@rytass/bpm-core-react 0.17.5 → 0.17.7

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 (99) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +1 -1
  3. package/dist/chunks/{FormBuilderView-aBcA-_tt.cjs → FormBuilderView-CUOyS07f.cjs} +2 -2
  4. package/dist/chunks/{FormBuilderView-aBcA-_tt.cjs.map → FormBuilderView-CUOyS07f.cjs.map} +1 -1
  5. package/dist/chunks/{FormBuilderView-BYL42M0d.js → FormBuilderView-ClLnQ1e_.js} +2 -2
  6. package/dist/chunks/{FormBuilderView-BYL42M0d.js.map → FormBuilderView-ClLnQ1e_.js.map} +1 -1
  7. package/dist/chunks/{FormRendererView-cZGOOjU5.js → FormRendererView-BsTwZkqU.js} +207 -198
  8. package/dist/chunks/FormRendererView-BsTwZkqU.js.map +1 -0
  9. package/dist/chunks/FormRendererView-GpsE03np.cjs +4 -0
  10. package/dist/chunks/FormRendererView-GpsE03np.cjs.map +1 -0
  11. package/dist/chunks/approver-filled-form-D1DmqDVP.cjs +2 -0
  12. package/dist/chunks/approver-filled-form-D1DmqDVP.cjs.map +1 -0
  13. package/dist/chunks/approver-filled-form-DuQGPtNB.js +95 -0
  14. package/dist/chunks/approver-filled-form-DuQGPtNB.js.map +1 -0
  15. package/dist/chunks/{compose-DOEaPfEC.cjs → compose-DjEJi5Dv.cjs} +2 -2
  16. package/dist/chunks/{compose-DOEaPfEC.cjs.map → compose-DjEJi5Dv.cjs.map} +1 -1
  17. package/dist/chunks/{compose-v1Vcw9hE.js → compose-WekGZj74.js} +4 -4
  18. package/dist/chunks/{compose-v1Vcw9hE.js.map → compose-WekGZj74.js.map} +1 -1
  19. package/dist/chunks/{designer-DBBrktom.js → designer-D87ILhjz.js} +1664 -1182
  20. package/dist/chunks/designer-D87ILhjz.js.map +1 -0
  21. package/dist/chunks/designer-DESS0CMl.cjs +65 -0
  22. package/dist/chunks/designer-DESS0CMl.cjs.map +1 -0
  23. package/dist/chunks/detail-D49NuNCn.cjs +2 -0
  24. package/dist/chunks/detail-D49NuNCn.cjs.map +1 -0
  25. package/dist/chunks/{detail-B_bSg31B.js → detail-URwxkcro.js} +1036 -847
  26. package/dist/chunks/detail-URwxkcro.js.map +1 -0
  27. package/dist/chunks/{providers-H_vPRsSN.js → providers-B_d5tbCL.js} +178 -167
  28. package/dist/chunks/providers-B_d5tbCL.js.map +1 -0
  29. package/dist/chunks/providers-chuJvMgv.cjs +2 -0
  30. package/dist/chunks/providers-chuJvMgv.cjs.map +1 -0
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.js +1 -1
  33. package/dist/next/index.cjs +1 -1
  34. package/dist/next/index.js +1 -1
  35. package/dist/next/workflow-chat-route.cjs +1 -0
  36. package/dist/next/workflow-chat-route.cjs.map +1 -1
  37. package/dist/next/workflow-chat-route.d.cts +1 -1
  38. package/dist/next/workflow-chat-route.d.ts +1 -1
  39. package/dist/next/workflow-chat-route.js +1 -1
  40. package/dist/next/workflow-chat-route.js.map +1 -1
  41. package/dist/pages/instances/detail/index.cjs +1 -1
  42. package/dist/pages/instances/detail/index.js +1 -1
  43. package/dist/pages/templates/compose/index.cjs +1 -1
  44. package/dist/pages/templates/compose/index.js +1 -1
  45. package/dist/pages/templates/designer/index.cjs +1 -1
  46. package/dist/pages/templates/designer/index.js +1 -1
  47. package/dist/views/forms/builder/index.cjs +1 -1
  48. package/dist/views/forms/builder/index.js +1 -1
  49. package/dist/views/forms/renderer/FormRendererView.d.cts +16 -1
  50. package/dist/views/forms/renderer/FormRendererView.d.ts +16 -1
  51. package/dist/views/forms/renderer/index.cjs +1 -1
  52. package/dist/views/forms/renderer/index.js +1 -1
  53. package/dist/views/inbox/index.cjs +1 -1
  54. package/dist/views/inbox/index.cjs.map +1 -1
  55. package/dist/views/inbox/index.js +109 -99
  56. package/dist/views/inbox/index.js.map +1 -1
  57. package/dist/views/instances/approver-filled-form.d.cts +76 -0
  58. package/dist/views/instances/approver-filled-form.d.ts +76 -0
  59. package/dist/views/instances/detail/index.cjs +1 -1
  60. package/dist/views/instances/detail/index.js +1 -1
  61. package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +30 -2
  62. package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +30 -2
  63. package/dist/views/instances/detail/sections/InstanceHistorySection.d.cts +4 -1
  64. package/dist/views/instances/detail/sections/InstanceHistorySection.d.ts +4 -1
  65. package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +21 -0
  66. package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +21 -0
  67. package/dist/views/instances/detail/sections/container-helpers.d.cts +1 -1
  68. package/dist/views/instances/detail/sections/container-helpers.d.ts +1 -1
  69. package/dist/views/instances/detail/sections/shared.d.cts +11 -2
  70. package/dist/views/instances/detail/sections/shared.d.ts +11 -2
  71. package/dist/views/instances/new/index.cjs +1 -1
  72. package/dist/views/instances/new/index.cjs.map +1 -1
  73. package/dist/views/instances/new/index.js +88 -87
  74. package/dist/views/instances/new/index.js.map +1 -1
  75. package/dist/views/instances/viewer-field-access.d.cts +22 -0
  76. package/dist/views/instances/viewer-field-access.d.ts +22 -0
  77. package/dist/views/templates/compose/index.cjs +1 -1
  78. package/dist/views/templates/compose/index.js +1 -1
  79. package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.cts +33 -0
  80. package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.ts +33 -0
  81. package/dist/views/templates/designer/field-access-matrix/FieldAccessNodeSection.d.cts +20 -0
  82. package/dist/views/templates/designer/field-access-matrix/FieldAccessNodeSection.d.ts +20 -0
  83. package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.cts +22 -0
  84. package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.ts +22 -0
  85. package/dist/views/templates/designer/index.cjs +1 -1
  86. package/dist/views/templates/designer/index.js +1 -1
  87. package/package.json +3 -3
  88. package/dist/chunks/FormRendererView-DRFi_IH7.cjs +0 -4
  89. package/dist/chunks/FormRendererView-DRFi_IH7.cjs.map +0 -1
  90. package/dist/chunks/FormRendererView-cZGOOjU5.js.map +0 -1
  91. package/dist/chunks/designer-CTXMqCD2.cjs +0 -65
  92. package/dist/chunks/designer-CTXMqCD2.cjs.map +0 -1
  93. package/dist/chunks/designer-DBBrktom.js.map +0 -1
  94. package/dist/chunks/detail-BQSVgVlO.cjs +0 -2
  95. package/dist/chunks/detail-BQSVgVlO.cjs.map +0 -1
  96. package/dist/chunks/detail-B_bSg31B.js.map +0 -1
  97. package/dist/chunks/providers-DP7b0TMN.cjs +0 -2
  98. package/dist/chunks/providers-DP7b0TMN.cjs.map +0 -1
  99. package/dist/chunks/providers-H_vPRsSN.js.map +0 -1
@@ -6,10 +6,10 @@ 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 { 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";
9
+ import { buildFormRendererValues as E, clampOptionalNumber as D, createFormTableRow as ee, formatDatePickerValue as O, formatDateTimePickerValue as k, isFormRendererFieldReadonly as A, isFormRendererFieldRequired as j, mergeFormDataSourceOptions as M, parseOptionalNumberInput as N, previewFormFieldOptions as te, previewResolveFormFieldOptions as ne, readDatePickerValue as re, readFieldOptionAsSelectOption as P, readFormDataSourceErrorCode as ie, readFormDataSourceErrorMessage as ae, readFormDataSourceSelectedValues as oe, readFormDataSourceValueSignature as F, readFormFieldOptions as se, readFormTableCellPath as I, readFormTableRowBounds as ce, readFormTableRows as L, readMissingFormDataSourceDependencies as le, readMissingFormDataSourceOptionValues as R, readSelectOption as z, readSelectedFormDataSourceOptions as B, readVisibleFormRendererFields as ue, resolveFormFieldOptions as de } from "@rytass/bpm-core-client/form";
10
+ import { isFormDataSourceFieldDefinition as V, isFormStaticOptionFieldDefinition as fe, isFormTableCellValue as H, isTableFieldDefinition as pe, readFormFieldSelectionMode as U, readFormMemberIds as W } from "@rytass/bpm-core-shared/form";
11
11
  //#region src/views/forms/renderer/form-data-source-field.ts
12
- var he = {
12
+ var me = {
13
13
  canRetry: !1,
14
14
  error: null,
15
15
  hasValue: !1,
@@ -20,13 +20,13 @@ var he = {
20
20
  options: [],
21
21
  retry: () => void 0,
22
22
  status: "IDLE"
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({
23
+ }, G = [], he = 10, ge = ["FORM_DATA_SOURCE_SEARCH_NOT_SUPPORTED", "FORM_DATA_SOURCE_SEARCH_TOO_SHORT"];
24
+ function K(e) {
25
+ let t = V(e.field) ? e.field : null, s = e.fieldPath ?? t?.fieldKey ?? "", c = t ? e.optionSnapshots?.[e.snapshotKey ?? t.fieldKey] : void 0, l = t ? JSON.stringify({
26
26
  dataSource: t.dataSource,
27
27
  fieldKey: t.fieldKey,
28
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({
29
+ }) : "", u = JSON.stringify(c ?? null), d = i(() => c?.options ?? [], [u]), f = JSON.stringify(e.formData), p = JSON.stringify(e.initialFormData ?? {}), m = JSON.stringify(e.schema), h = JSON.stringify(e.uiSchema), g = e.context?.kind, _ = e.context?.kind === "runtime" ? e.context.instanceId : void 0, v = e.context?.kind === "runtime" ? e.context.templateId : void 0, y = JSON.stringify(e.row?.values ?? null), b = JSON.stringify(e.row?.initialValues ?? null), x = t ? e.row ? e.row.values[t.fieldKey] : e.formData[t.fieldKey] : void 0, S = F(x), C = i(() => oe(x), [S]), w = C.length > 0, T = t ? JSON.stringify({
30
30
  bindings: t.dataSource.bindings.map((t) => t.from.kind === "FIELD" ? {
31
31
  fieldKey: t.from.fieldKey,
32
32
  value: e.formData[t.from.fieldKey]
@@ -47,28 +47,28 @@ function G(e) {
47
47
  g,
48
48
  v,
49
49
  e.readonly
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
+ ]), D = t ? (e.initialFormData !== void 0 || e.initialValue !== void 0) && F(e.initialValue) !== S : !1, ee = t ? e.initialFormData !== void 0 && t.dataSource.bindings.some((t) => t.from.kind === "FIELD" ? F(e.initialFormData?.[t.from.fieldKey]) !== F(e.formData[t.from.fieldKey]) : t.from.kind === "ROW_FIELD" && e.row?.initialValues ? F(e.row.initialValues[t.from.columnKey]) !== F(e.row.values[t.from.columnKey]) : !1) : !1, O = !(!c && !w || !D && !ee), k = !!(t && E && O && w), A = ye({
51
51
  hasSnapshot: !!c,
52
52
  hasValue: w,
53
- isStale: D,
53
+ isStale: O,
54
54
  readonly: e.readonly
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
+ }), j = !!(t && E && t.type !== "autocomplete"), N = be(O, j && t !== null && le(t, e.formData, e.row?.values).length > 0), [re, P] = o([]), [I, ce] = o(""), [L, R] = o(null), [z, ue] = o(null), [fe, H] = o(() => t ? j ? N : A : "IDLE"), [pe, U] = o(null), W = a(0), G = a(0), K = a(0), q = a(null), J = a(null), _e = a({
56
56
  cursor: null,
57
57
  searchText: ""
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
+ }), Y = i(() => we(e.formData), [f]), X = i(() => e.row ? we(e.row.values) : void 0, [y]), Te = i(() => M(d, re), [re, d]), Ee = z && z.signature === T ? z : null, De = k && !Ee, Oe = ve({
59
59
  options: Te,
60
60
  resolution: Ee,
61
61
  resolvePending: De,
62
62
  value: x
63
63
  }), Z = n((n, r) => {
64
64
  if (!t || !E) return;
65
- let i = W.current + 1;
66
- W.current = i, J.current = {
65
+ let i = G.current + 1;
66
+ G.current = i, _e.current = {
67
67
  cursor: r,
68
68
  searchText: n
69
- }, K.current?.abort();
69
+ }, q.current?.abort();
70
70
  let a = new AbortController();
71
- K.current = a, V(M), H(null), (E.kind === "preview" ? ne({
71
+ q.current = a, H(N), U(null), (E.kind === "preview" ? te({
72
72
  cursor: r,
73
73
  fieldKey: s,
74
74
  formData: Y,
@@ -77,7 +77,7 @@ function G(e) {
77
77
  searchText: n,
78
78
  signal: a.signal,
79
79
  uiSchema: e.uiSchema
80
- }) : ce({
80
+ }) : se({
81
81
  cursor: r,
82
82
  fieldKey: s,
83
83
  formData: Y,
@@ -87,21 +87,21 @@ function G(e) {
87
87
  signal: a.signal,
88
88
  templateId: E.templateId ?? null
89
89
  })).then((e) => {
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"));
90
+ Ce(a, G, i) || (P((t) => {
91
+ let n = B(x, t);
92
+ return M(n, r ? t : [], e.options);
93
+ }), R(e.nextCursor), U(null), W.current = r ? W.current + e.options.length : e.options.length, e.nextCursor && e.options.length > 0 && W.current < he && Q.current(n, e.nextCursor), H(e.waitingForFieldKeys.length ? "WAITING_FOR_DEPENDENCIES" : "VALID"));
94
94
  }).catch((e) => {
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));
95
+ if (Ce(a, G, i)) return;
96
+ let t = ae(e) ?? "選項來源暫時無法使用。", n = ie(e);
97
+ U(t), H(xe(!!(n && ge.includes(n)), w));
98
98
  });
99
99
  }, [
100
100
  S,
101
101
  l,
102
102
  E,
103
103
  w,
104
- M,
104
+ N,
105
105
  s,
106
106
  Y,
107
107
  X,
@@ -111,10 +111,10 @@ function G(e) {
111
111
  Q.current = Z;
112
112
  let ke = n(() => {
113
113
  if (!t || !E || C.length === 0) return;
114
- let n = T, r = G.current + 1;
115
- G.current = r, q.current?.abort();
114
+ let n = T, r = K.current + 1;
115
+ K.current = r, J.current?.abort();
116
116
  let i = new AbortController();
117
- q.current = i, H(null), (E.kind === "preview" ? re({
117
+ J.current = i, U(null), (E.kind === "preview" ? ne({
118
118
  fieldKey: s,
119
119
  formData: Y,
120
120
  rowValues: X,
@@ -122,7 +122,7 @@ function G(e) {
122
122
  signal: i.signal,
123
123
  uiSchema: e.uiSchema,
124
124
  values: C
125
- }) : fe({
125
+ }) : de({
126
126
  fieldKey: s,
127
127
  formData: Y,
128
128
  instanceId: E.instanceId ?? null,
@@ -131,12 +131,12 @@ function G(e) {
131
131
  templateId: E.templateId ?? null,
132
132
  values: C
133
133
  })).then((e) => {
134
- Ce(i, G, r) || (e.waitingForFieldKeys.length ? V("WAITING_FOR_DEPENDENCIES") : (N((t) => j(t, e.options)), de({
134
+ Ce(i, K, r) || (e.waitingForFieldKeys.length ? H("WAITING_FOR_DEPENDENCIES") : (P((t) => M(t, e.options)), ue({
135
135
  signature: n,
136
136
  unresolvedValues: e.unresolvedValues
137
- }), V("VALID")));
137
+ }), H("VALID")));
138
138
  }).catch((e) => {
139
- Ce(i, G, r) || (V("UNAVAILABLE"), H(oe(e) ?? "選項來源暫時無法使用。"));
139
+ Ce(i, K, r) || (H("UNAVAILABLE"), U(ae(e) ?? "選項來源暫時無法使用。"));
140
140
  });
141
141
  }, [
142
142
  T,
@@ -150,47 +150,47 @@ function G(e) {
150
150
  h
151
151
  ]), Ae = a(ke);
152
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");
153
+ G.current += 1, q.current?.abort(), P((e) => B(x, e)), R((e) => e === null ? e : null), ce((e) => e && ""), U((e) => e && null), t ? j ? Q.current("", null) : H(A) : H("IDLE");
154
154
  }, [
155
- A,
155
+ j,
156
156
  l,
157
157
  E,
158
158
  T,
159
159
  p,
160
160
  b,
161
161
  e.readonly,
162
- M,
163
- k,
162
+ N,
163
+ A,
164
164
  u
165
165
  ]), r(() => {
166
- O && Ae.current();
166
+ k && Ae.current();
167
167
  }, [
168
168
  T,
169
169
  E,
170
- O
170
+ k
171
171
  ]), r(() => () => {
172
- K.current?.abort(), q.current?.abort();
172
+ q.current?.abort(), J.current?.abort();
173
173
  }, []);
174
174
  let je = n((e) => {
175
- le(e), N((e) => z(x, e)), L(null), Z(e, null);
175
+ ce(e), P((e) => B(x, e)), R(null), Z(e, null);
176
176
  }, [Z]), Me = n(() => {
177
- I && Z(F, I);
177
+ L && Z(I, L);
178
178
  }, [
179
179
  Z,
180
- I,
181
- F
180
+ L,
181
+ I
182
182
  ]), Ne = n(() => {
183
- E && (Z(J.current.searchText, J.current.cursor), O && Ae.current());
183
+ E && (Z(_e.current.searchText, _e.current.cursor), k && Ae.current());
184
184
  }, [
185
185
  E,
186
186
  Z,
187
- O
187
+ k
188
188
  ]);
189
189
  return t ? {
190
190
  canRetry: !!E,
191
- error: me,
191
+ error: pe,
192
192
  hasValue: w,
193
- hasNextPage: !!I,
193
+ hasNextPage: !!L,
194
194
  invalidValues: Oe,
195
195
  onReachBottom: Me,
196
196
  onSearch: je,
@@ -199,11 +199,11 @@ function G(e) {
199
199
  status: Se({
200
200
  invalidValues: Oe,
201
201
  resolvePending: De,
202
- status: pe
202
+ status: fe
203
203
  })
204
- } : he;
204
+ } : me;
205
205
  }
206
- function K(e) {
206
+ function q(e) {
207
207
  switch (e.status) {
208
208
  case "WAITING_FOR_DEPENDENCIES": return "請先填寫相依欄位。";
209
209
  case "STALE": return "選項需要重新載入或驗證。";
@@ -213,15 +213,15 @@ function K(e) {
213
213
  default: return e.error;
214
214
  }
215
215
  }
216
- function q(e) {
216
+ function J(e) {
217
217
  return e.hasValue && e.status !== "VALID";
218
218
  }
219
- function J(e) {
220
- let t = e.filter(q);
219
+ function _e(e) {
220
+ let t = e.filter(J);
221
221
  return t.length === 0 ? null : t.every((e) => e.status === "LOADING" || e.status === "STALE") ? "選項驗證中,請稍候再送出。" : "請先完成動態選項驗證。";
222
222
  }
223
223
  function ve(e) {
224
- return e.resolution ? e.resolution.unresolvedValues : e.resolvePending ? W : L(e.value, e.options);
224
+ return e.resolution ? e.resolution.unresolvedValues : e.resolvePending ? G : R(e.value, e.options);
225
225
  }
226
226
  function ye(e) {
227
227
  return e.isStale ? "STALE" : e.hasSnapshot ? "VALID" : e.readonly && e.hasValue ? "UNAVAILABLE" : "IDLE";
@@ -343,10 +343,10 @@ function Pe(e, t) {
343
343
  }
344
344
  function Fe(e, t) {
345
345
  let n = new Set(t.filter((e) => !e.unresolved).map((e) => e.id));
346
- return U(e).filter((e) => !n.has(e));
346
+ return W(e).filter((e) => !n.has(e));
347
347
  }
348
348
  function Ie(e, t) {
349
- return U(e).map((e) => t.find((t) => t.id === e) ?? Ne(e));
349
+ return W(e).map((e) => t.find((t) => t.id === e) ?? Ne(e));
350
350
  }
351
351
  function Le(e, t) {
352
352
  if (e.length !== 0) return t ? e.map((e) => e.id) : e[0]?.id;
@@ -433,54 +433,56 @@ var ze = {
433
433
  function Ue(e) {
434
434
  e && (e.style.width = "100%");
435
435
  }
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), [
438
- y,
439
- m.fields,
440
- _
441
- ]), C = a(x), w = i(() => de(m, g, x), [
442
- m,
436
+ function We({ dataSourceContext: e, dataSourceInitialValues: t, emptyText: n = "尚未建立欄位。", errors: s = {}, fieldAccess: c, fieldLabelMarkers: l, maxWidth: u, onChange: d, onDataSourceStateChange: f, onUploadAttachment: p, optionSnapshots: m, readonly: h = !1, schema: g, singleColumn: _ = !1, uiSchema: y, value: b }) {
437
+ let [x, C] = o(() => E(g.fields, b ?? {})), w = i(() => E(g.fields, b ?? x), [
438
+ x,
439
+ g.fields,
440
+ b
441
+ ]), T = a(w), D = i(() => ue(g, y, w).filter((e) => Ge(c, e.fieldKey)?.visible !== !1), [
442
+ c,
443
443
  g,
444
- x
444
+ y,
445
+ w
445
446
  ]);
446
447
  r(() => {
447
- C.current = x;
448
- }, [x]), r(() => {
449
- b((e) => E(m.fields, _ ?? e));
450
- }, [m.fields, _]);
451
- function T(e, t) {
448
+ T.current = w;
449
+ }, [w]), r(() => {
450
+ C((e) => E(g.fields, b ?? e));
451
+ }, [g.fields, b]);
452
+ function ee(e, t) {
452
453
  let n = {
453
- ...C.current,
454
+ ...T.current,
454
455
  [e]: t
455
456
  };
456
- C.current = n, _ || b(n), l?.(n);
457
+ T.current = n, b || C(n), d?.(n);
457
458
  }
458
- return w.length ? /* @__PURE__ */ S("div", {
459
+ return D.length ? /* @__PURE__ */ S("div", {
459
460
  style: {
460
461
  ...ze,
461
- ...h ? { width: "100%" } : {}
462
+ ..._ ? { width: "100%" } : {}
462
463
  },
463
- children: w.map((n) => /* @__PURE__ */ S(Ge, {
464
+ children: D.map((n) => /* @__PURE__ */ S(qe, {
464
465
  dataSourceContext: e,
465
466
  dataSourceInitialValues: t,
466
467
  field: n,
467
468
  error: s[n.fieldKey] ?? null,
468
469
  errors: s,
469
- fields: m.fields,
470
- onChange: T,
471
- onDataSourceStateChange: u,
472
- onUploadAttachment: d,
473
- optionSnapshots: f,
474
- readonly: p,
475
- schema: m,
470
+ fields: g.fields,
471
+ labelMarker: l !== void 0 && Object.prototype.hasOwnProperty.call(l, n.fieldKey) ? l[n.fieldKey] : void 0,
472
+ onChange: ee,
473
+ onDataSourceStateChange: f,
474
+ onUploadAttachment: p,
475
+ optionSnapshots: m,
476
+ readonly: Ke(Ge(c, n.fieldKey), h),
477
+ schema: g,
476
478
  style: {
477
479
  ...Ve,
478
- gridColumn: `span ${h ? 12 : dt(n, g)}`,
479
- ...h && !me(n) ? { maxWidth: c } : {}
480
+ gridColumn: `span ${_ ? 12 : pt(n, y)}`,
481
+ ..._ && !pe(n) ? { maxWidth: u } : {}
480
482
  },
481
- value: x[n.fieldKey],
482
- values: x,
483
- uiSchema: g
483
+ value: w[n.fieldKey],
484
+ values: w,
485
+ uiSchema: y
484
486
  }, n.fieldKey))
485
487
  }) : /* @__PURE__ */ S("div", {
486
488
  style: ze,
@@ -488,72 +490,79 @@ function We({ dataSourceContext: e, dataSourceInitialValues: t, emptyText: n = "
488
490
  color: "text-neutral",
489
491
  style: Be,
490
492
  variant: "body",
491
- children: m.fields.length > 0 ? "目前條件下沒有可填寫欄位。" : n
493
+ children: g.fields.length > 0 ? "目前條件下沒有可填寫欄位。" : n
492
494
  })
493
495
  });
494
496
  }
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({
497
+ function Ge(e, t) {
498
+ return e !== void 0 && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
499
+ }
500
+ function Ke(e, t) {
501
+ return e === void 0 ? t : !e.editable;
502
+ }
503
+ function qe({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors: a, field: o, fields: s, labelMarker: l, onChange: u, onDataSourceStateChange: d, onUploadAttachment: f, optionSnapshots: p, readonly: m, schema: h, style: g, value: _, values: y, uiSchema: b }) {
504
+ let x = j(o, s, y), w = m || A(o, s, y), T = K({
497
505
  context: t,
498
506
  field: o,
499
- formData: _,
507
+ formData: y,
500
508
  initialFormData: n,
501
509
  initialValue: n?.[o.fieldKey],
502
- optionSnapshots: f,
503
- readonly: x,
504
- schema: m,
505
- uiSchema: y
506
- }), T = K(w), E = JSON.stringify({
507
- hasValue: w.hasValue,
508
- invalidValues: w.invalidValues,
509
- status: w.status
510
+ optionSnapshots: p,
511
+ readonly: w,
512
+ schema: h,
513
+ uiSchema: b
514
+ }), E = q(T), D = JSON.stringify({
515
+ hasValue: T.hasValue,
516
+ invalidValues: T.invalidValues,
517
+ status: T.status
510
518
  });
511
519
  return r(() => {
512
- B(o) && u?.(o.fieldKey, {
513
- hasValue: w.hasValue,
514
- invalidValues: w.invalidValues,
515
- status: w.status
520
+ V(o) && d?.(o.fieldKey, {
521
+ hasValue: T.hasValue,
522
+ invalidValues: T.invalidValues,
523
+ status: T.status
516
524
  });
517
525
  }, [
518
- E,
526
+ D,
519
527
  o.fieldKey,
520
- u
528
+ d
521
529
  ]), /* @__PURE__ */ C("div", {
522
530
  "data-form-field-key": o.fieldKey,
523
- style: h,
531
+ style: g,
524
532
  children: [
525
533
  /* @__PURE__ */ S(e, {
526
534
  label: o.label,
535
+ ...l ? { labelOptionalMarker: l } : {},
527
536
  name: o.fieldKey,
528
- required: b,
529
- children: me(o) ? /* @__PURE__ */ S(nt, {
537
+ required: x,
538
+ children: pe(o) ? /* @__PURE__ */ S(it, {
530
539
  dataSourceContext: t,
531
540
  dataSourceInitialValues: n,
532
541
  errors: a,
533
542
  field: o,
534
- onChange: l,
535
- onDataSourceStateChange: u,
536
- optionSnapshots: f,
537
- readonly: x,
538
- schema: m,
539
- uiSchema: y,
540
- value: g,
541
- values: _
542
- }) : ct(o, g, x, l, d, t, w)
543
+ onChange: u,
544
+ onDataSourceStateChange: d,
545
+ optionSnapshots: p,
546
+ readonly: w,
547
+ schema: h,
548
+ uiSchema: b,
549
+ value: _,
550
+ values: y
551
+ }) : ut(o, _, w, u, f, t, T)
543
552
  }),
544
553
  i ? /* @__PURE__ */ S(v, {
545
554
  color: "text-error",
546
555
  variant: "caption",
547
556
  children: i
548
557
  }) : null,
549
- T ? /* @__PURE__ */ C("div", {
550
- style: Ye,
558
+ E ? /* @__PURE__ */ C("div", {
559
+ style: Ze,
551
560
  children: [/* @__PURE__ */ S(v, {
552
- color: w.status === "INVALID" || w.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
561
+ color: T.status === "INVALID" || T.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
553
562
  variant: "caption",
554
- children: T
555
- }), w.status === "UNAVAILABLE" && w.canRetry ? /* @__PURE__ */ S(c, {
556
- onClick: w.retry,
563
+ children: E
564
+ }), T.status === "UNAVAILABLE" && T.canRetry ? /* @__PURE__ */ S(c, {
565
+ onClick: T.retry,
557
566
  size: "sub",
558
567
  type: "button",
559
568
  variant: "base-ghost",
@@ -563,104 +572,104 @@ function Ge({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
563
572
  ]
564
573
  });
565
574
  }
566
- var Ke = "(另開新分頁)", qe = "另開新分頁", Je = {
575
+ var Je = "(另開新分頁)", Ye = "另開新分頁", Xe = {
567
576
  color: "inherit",
568
577
  textDecoration: "underline",
569
578
  wordBreak: "break-all"
570
- }, Ye = {
579
+ }, Ze = {
571
580
  alignItems: "center",
572
581
  display: "flex",
573
582
  gap: 8
574
- }, Xe = {
583
+ }, Qe = {
575
584
  display: "grid",
576
585
  gap: 8,
577
586
  minWidth: 0,
578
587
  width: "100%"
579
- }, Ze = {
588
+ }, $e = {
580
589
  display: "flex",
581
590
  justifyContent: "flex-start"
582
- }, Qe = {
591
+ }, et = {
583
592
  maxWidth: "100%",
584
593
  overflowX: "auto"
585
- }, $e = 160, et = 56, tt = {
594
+ }, tt = 160, nt = 56, rt = {
586
595
  display: "grid",
587
596
  gap: 4,
588
597
  minWidth: 0
589
598
  };
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)));
599
+ function it({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field: i, onChange: s, onDataSourceStateChange: l, optionSnapshots: u, readonly: d, schema: f, uiSchema: p, value: m, values: g }) {
600
+ let _ = L(m), v = ce(i), y = a(0), [b, x] = o(() => _.map(() => st(y)));
592
601
  r(() => {
593
- b.length !== _.length && x(_.map(() => at(y)));
602
+ b.length !== _.length && x(_.map(() => st(y)));
594
603
  }, [b.length, _.length]);
595
604
  function E(e) {
596
605
  s(i.fieldKey, e);
597
606
  }
598
- function ee() {
599
- x([...b, at(y)]), E([..._, te(i.columns)]);
607
+ function D() {
608
+ x([...b, st(y)]), E([..._, ee(i.columns)]);
600
609
  }
601
- function D(e) {
610
+ function O(e) {
602
611
  x(b.filter((t, n) => n !== e)), E(_.filter((t, n) => n !== e));
603
612
  }
604
- function O(e, t, n) {
605
- E(_.map((r, i) => i === e ? ot(r, t, n) : r));
613
+ function k(e, t, n) {
614
+ E(_.map((r, i) => i === e ? ct(r, t, n) : r));
606
615
  }
607
- let k = _.map((e, t) => ({
616
+ let A = _.map((e, t) => ({
608
617
  ...e,
609
618
  index: t,
610
619
  key: b[t] ?? `row-${t}`
611
- })), A = i.columns.map((r) => ({
620
+ })), j = i.columns.map((r) => ({
612
621
  key: r.fieldKey,
613
- render: (a) => /* @__PURE__ */ S(rt, {
622
+ render: (a) => /* @__PURE__ */ S(at, {
614
623
  column: r,
615
624
  dataSourceContext: e,
616
- error: n[F(i.fieldKey, a.index, r.fieldKey)] ?? null,
625
+ error: n[I(i.fieldKey, a.index, r.fieldKey)] ?? null,
617
626
  fieldPath: `${i.fieldKey}.${r.fieldKey}`,
618
627
  formData: g,
619
628
  initialFormData: t,
620
- initialRowValues: it(t?.[i.fieldKey], a.index),
621
- onChange: (e) => O(a.index, r.fieldKey, e),
629
+ initialRowValues: ot(t?.[i.fieldKey], a.index),
630
+ onChange: (e) => k(a.index, r.fieldKey, e),
622
631
  onDataSourceStateChange: l,
623
632
  optionSnapshots: u,
624
- path: F(i.fieldKey, a.index, r.fieldKey),
633
+ path: I(i.fieldKey, a.index, r.fieldKey),
625
634
  readonly: d,
626
635
  rowValues: _[a.index] ?? {},
627
636
  schema: f,
628
637
  uiSchema: p
629
638
  }, `${b[a.index] ?? a.index}-${r.fieldKey}`),
630
639
  title: r.label || r.fieldKey
631
- })), j = d ? void 0 : {
640
+ })), M = d ? void 0 : {
632
641
  render: (e) => [{
633
642
  disabled: () => _.length <= v.minRows,
634
643
  icon: T,
635
644
  iconType: "icon-only",
636
645
  name: "刪除此列",
637
- onClick: () => D(e.index),
646
+ onClick: () => O(e.index),
638
647
  variant: "destructive-ghost"
639
648
  }],
640
649
  width: 56
641
650
  };
642
651
  return /* @__PURE__ */ C("div", {
643
- style: Xe,
652
+ style: Qe,
644
653
  children: [/* @__PURE__ */ S("div", {
645
- style: Qe,
654
+ style: et,
646
655
  children: /* @__PURE__ */ S("div", {
647
- style: { minWidth: i.columns.length * $e + (j ? et : 0) },
656
+ style: { minWidth: i.columns.length * tt + (M ? nt : 0) },
648
657
  children: /* @__PURE__ */ S(h, {
649
- ...j ? { actions: j } : {},
650
- columns: A,
651
- dataSource: [...k],
658
+ ...M ? { actions: M } : {},
659
+ columns: j,
660
+ dataSource: [...A],
652
661
  rowHeightPreset: "roomy",
653
662
  showHeader: !0,
654
663
  size: "sub"
655
664
  })
656
665
  })
657
666
  }), d ? null : /* @__PURE__ */ S("div", {
658
- style: Ze,
667
+ style: $e,
659
668
  children: /* @__PURE__ */ S(c, {
660
669
  disabled: _.length >= v.maxRows,
661
670
  icon: w,
662
671
  iconType: "leading",
663
- onClick: ee,
672
+ onClick: D,
664
673
  size: "sub",
665
674
  type: "button",
666
675
  variant: "base-secondary",
@@ -669,14 +678,14 @@ function nt({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field
669
678
  })]
670
679
  });
671
680
  }
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({
681
+ function at({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData: a, initialFormData: o, initialRowValues: s, onChange: l, onDataSourceStateChange: u, optionSnapshots: d, path: f, readonly: p, rowValues: m, schema: h, uiSchema: g }) {
682
+ let _ = lt(m, e.fieldKey), y = K({
674
683
  context: t,
675
684
  field: e,
676
685
  fieldPath: i,
677
686
  formData: a,
678
687
  initialFormData: o,
679
- initialValue: s ? st(s, e.fieldKey) : void 0,
688
+ initialValue: s ? lt(s, e.fieldKey) : void 0,
680
689
  optionSnapshots: d,
681
690
  readonly: p,
682
691
  row: {
@@ -686,13 +695,13 @@ function rt({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData:
686
695
  schema: h,
687
696
  snapshotKey: f,
688
697
  uiSchema: g
689
- }), b = K(y), x = JSON.stringify({
698
+ }), b = q(y), x = JSON.stringify({
690
699
  hasValue: y.hasValue,
691
700
  invalidValues: y.invalidValues,
692
701
  status: y.status
693
702
  });
694
703
  return r(() => {
695
- if (B(e)) return u?.(f, {
704
+ if (V(e)) return u?.(f, {
696
705
  hasValue: y.hasValue,
697
706
  invalidValues: y.invalidValues,
698
707
  status: y.status
@@ -709,16 +718,16 @@ function rt({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData:
709
718
  x
710
719
  ]), /* @__PURE__ */ C("div", {
711
720
  "data-form-field-key": f,
712
- style: tt,
721
+ style: rt,
713
722
  children: [
714
- ct(e, _, p, (e, t) => l(t), void 0, t, y, "sub"),
723
+ ut(e, _, p, (e, t) => l(t), void 0, t, y, "sub"),
715
724
  n ? /* @__PURE__ */ S(v, {
716
725
  color: "text-error",
717
726
  variant: "caption",
718
727
  children: n
719
728
  }) : null,
720
729
  b ? /* @__PURE__ */ C("div", {
721
- style: Ye,
730
+ style: Ze,
722
731
  children: [/* @__PURE__ */ S(v, {
723
732
  color: y.status === "INVALID" || y.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
724
733
  variant: "caption",
@@ -734,25 +743,25 @@ function rt({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData:
734
743
  ]
735
744
  });
736
745
  }
737
- function it(e, t) {
738
- return I(e)[t];
746
+ function ot(e, t) {
747
+ return L(e)[t];
739
748
  }
740
- function at(e) {
749
+ function st(e) {
741
750
  return e.current += 1, `table-row-${e.current}`;
742
751
  }
743
- function ot(e, t, n) {
744
- return n === void 0 || !V(n) ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)) : {
752
+ function ct(e, t, n) {
753
+ return n === void 0 || !H(n) ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)) : {
745
754
  ...e,
746
755
  [t]: n
747
756
  };
748
757
  }
749
- function st(e, t) {
758
+ function lt(e, t) {
750
759
  if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
751
760
  }
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);
761
+ function ut(e, t, n, r, i, a, o, s = "main") {
762
+ return V(e) ? ft(e, t, n, r, a, o, s) : dt(e, t, n, r, i, s);
754
763
  }
755
- function lt(e, t, n, r, i, a = "main") {
764
+ function dt(e, t, n, r, i, a = "main") {
756
765
  let o = n && (e.type === "text" || e.type === "textarea") && e.displayAs === "link" ? Ee(t) : null;
757
766
  if (o) return /* @__PURE__ */ S(v, {
758
767
  color: "text-brand",
@@ -760,12 +769,12 @@ function lt(e, t, n, r, i, a = "main") {
760
769
  variant: "body",
761
770
  children: /* @__PURE__ */ S("a", {
762
771
  href: o.href,
763
- style: Je,
772
+ style: Xe,
764
773
  ...o.external ? {
765
- "aria-label": `${o.href}${Ke}`,
774
+ "aria-label": `${o.href}${Je}`,
766
775
  rel: "noopener noreferrer",
767
776
  target: "_blank",
768
- title: qe
777
+ title: Ye
769
778
  } : {},
770
779
  children: o.href
771
780
  })
@@ -786,8 +795,8 @@ function lt(e, t, n, r, i, a = "main") {
786
795
  onChange: (t) => r(e.fieldKey, t.target.checked),
787
796
  size: a
788
797
  });
789
- if (pe(e) && e.type === "checkbox") {
790
- let i = e.options.map(N);
798
+ if (fe(e) && e.type === "checkbox") {
799
+ let i = e.options.map(P);
791
800
  return /* @__PURE__ */ S(m, {
792
801
  mode: "multiple",
793
802
  onChange: (t) => r(e.fieldKey, t?.length ? t.map((e) => e.id) : void 0),
@@ -795,18 +804,18 @@ function lt(e, t, n, r, i, a = "main") {
795
804
  placeholder: e.placeholder ?? "請選擇一或多個選項",
796
805
  readOnly: n,
797
806
  size: a,
798
- value: i.filter((e) => ft(t).includes(e.id))
807
+ value: i.filter((e) => mt(t).includes(e.id))
799
808
  });
800
809
  }
801
- if (pe(e)) {
802
- let i = e.options.map(N);
810
+ if (fe(e)) {
811
+ let i = e.options.map(P);
803
812
  return /* @__PURE__ */ S(m, {
804
813
  onChange: (t) => r(e.fieldKey, t?.id ?? void 0),
805
814
  options: i,
806
815
  placeholder: e.placeholder ?? "請選擇",
807
816
  readOnly: n,
808
817
  size: a,
809
- value: R(i, $(t))
818
+ value: z(i, $(t))
810
819
  });
811
820
  }
812
821
  return e.type === "member" ? /* @__PURE__ */ S(Re, {
@@ -834,47 +843,47 @@ function lt(e, t, n, r, i, a = "main") {
834
843
  }) : e.type === "date" ? /* @__PURE__ */ S(u, {
835
844
  format: "YYYY-MM-DD",
836
845
  fullWidth: !0,
837
- onChange: (t) => r(e.fieldKey, D(t)),
838
- placeholder: e.placeholder ?? mt(e.type),
846
+ onChange: (t) => r(e.fieldKey, O(t)),
847
+ placeholder: e.placeholder ?? gt(e.type),
839
848
  readOnly: n,
840
- value: ie(t)
849
+ value: re(t)
841
850
  }) : e.type === "datetime" ? /* @__PURE__ */ S(d, {
842
851
  formatDate: "YYYY-MM-DD",
843
852
  formatTime: "HH:mm",
844
853
  fullWidth: !0,
845
854
  hideSecond: !0,
846
- onChange: (t) => r(e.fieldKey, O(t)),
855
+ onChange: (t) => r(e.fieldKey, k(t)),
847
856
  placeholderLeft: "選擇日期",
848
857
  placeholderRight: "選擇時間",
849
858
  readOnly: n,
850
- value: ie(t)
859
+ value: re(t)
851
860
  }) : e.type === "number" || e.type === "money" ? /* @__PURE__ */ S(f, {
852
861
  fullWidth: !0,
853
862
  max: e.maximum,
854
863
  min: e.minimum,
855
864
  size: a,
856
- onChange: (t) => r(e.fieldKey, ee(M(t.target.value), {
865
+ onChange: (t) => r(e.fieldKey, D(N(t.target.value), {
857
866
  max: e.maximum,
858
867
  min: e.minimum
859
868
  })),
860
- placeholder: e.placeholder ?? mt(e.type),
869
+ placeholder: e.placeholder ?? gt(e.type),
861
870
  ...n ? { readonly: !0 } : {},
862
871
  showSpinner: !0,
863
- value: pt(t),
872
+ value: ht(t),
864
873
  variant: "measure"
865
874
  }) : /* @__PURE__ */ S(f, {
866
875
  fullWidth: !0,
867
876
  onChange: (t) => r(e.fieldKey, t.target.value),
868
- placeholder: e.placeholder ?? mt(e.type),
877
+ placeholder: e.placeholder ?? gt(e.type),
869
878
  ...n ? { readonly: !0 } : {},
870
879
  size: a,
871
880
  value: $(t),
872
881
  variant: "base"
873
882
  });
874
883
  }
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, {
884
+ function ft(e, t, n, r, i, a, o = "main") {
885
+ let c = a.options.map(P), u = B(t, a.options).map(P), d = a.status === "LOADING", f = a.status === "WAITING_FOR_DEPENDENCIES", h = !!i && !n, g = n || f, _ = n;
886
+ return e.type === "autocomplete" ? U(e) === "multiple" ? /* @__PURE__ */ S(s, {
878
887
  asyncData: h,
879
888
  clearSearchText: !0,
880
889
  disabled: _,
@@ -922,8 +931,8 @@ function ut(e, t, n, r, i, a, o = "main") {
922
931
  label: e.name,
923
932
  value: e.id
924
933
  })),
925
- value: [...ft(t)]
926
- }) : H(e) === "multiple" ? /* @__PURE__ */ S(m, {
934
+ value: [...mt(t)]
935
+ }) : U(e) === "multiple" ? /* @__PURE__ */ S(m, {
927
936
  disabled: g,
928
937
  loading: d,
929
938
  mode: "multiple",
@@ -946,7 +955,7 @@ function ut(e, t, n, r, i, a, o = "main") {
946
955
  value: u[0] ?? null
947
956
  });
948
957
  }
949
- function dt(e, t) {
958
+ function pt(e, t) {
950
959
  return {
951
960
  FULL: 12,
952
961
  HALF: 6,
@@ -956,13 +965,13 @@ function dt(e, t) {
956
965
  function $(e) {
957
966
  return typeof e == "string" ? e : "";
958
967
  }
959
- function ft(e) {
968
+ function mt(e) {
960
969
  return Array.isArray(e) && e.every((e) => typeof e == "string") ? e : [];
961
970
  }
962
- function pt(e) {
971
+ function ht(e) {
963
972
  return typeof e == "number" ? String(e) : "";
964
973
  }
965
- function mt(e) {
974
+ function gt(e) {
966
975
  return {
967
976
  boolean: "",
968
977
  autocomplete: "請輸入或選擇",
@@ -981,6 +990,6 @@ function mt(e) {
981
990
  }[e];
982
991
  }
983
992
  //#endregion
984
- export { K as a, q as i, ke as n, J as o, Q as r, G as s, We as t };
993
+ export { q as a, J as i, ke as n, _e as o, Q as r, K as s, We as t };
985
994
 
986
- //# sourceMappingURL=FormRendererView-cZGOOjU5.js.map
995
+ //# sourceMappingURL=FormRendererView-BsTwZkqU.js.map