@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.
- package/CHANGELOG.md +37 -0
- package/README.md +1 -1
- package/dist/chunks/{FormBuilderView-aBcA-_tt.cjs → FormBuilderView-CUOyS07f.cjs} +2 -2
- package/dist/chunks/{FormBuilderView-aBcA-_tt.cjs.map → FormBuilderView-CUOyS07f.cjs.map} +1 -1
- package/dist/chunks/{FormBuilderView-BYL42M0d.js → FormBuilderView-ClLnQ1e_.js} +2 -2
- package/dist/chunks/{FormBuilderView-BYL42M0d.js.map → FormBuilderView-ClLnQ1e_.js.map} +1 -1
- package/dist/chunks/{FormRendererView-cZGOOjU5.js → FormRendererView-BsTwZkqU.js} +207 -198
- package/dist/chunks/FormRendererView-BsTwZkqU.js.map +1 -0
- package/dist/chunks/FormRendererView-GpsE03np.cjs +4 -0
- package/dist/chunks/FormRendererView-GpsE03np.cjs.map +1 -0
- package/dist/chunks/approver-filled-form-D1DmqDVP.cjs +2 -0
- package/dist/chunks/approver-filled-form-D1DmqDVP.cjs.map +1 -0
- package/dist/chunks/approver-filled-form-DuQGPtNB.js +95 -0
- package/dist/chunks/approver-filled-form-DuQGPtNB.js.map +1 -0
- package/dist/chunks/{compose-DOEaPfEC.cjs → compose-DjEJi5Dv.cjs} +2 -2
- package/dist/chunks/{compose-DOEaPfEC.cjs.map → compose-DjEJi5Dv.cjs.map} +1 -1
- package/dist/chunks/{compose-v1Vcw9hE.js → compose-WekGZj74.js} +4 -4
- package/dist/chunks/{compose-v1Vcw9hE.js.map → compose-WekGZj74.js.map} +1 -1
- package/dist/chunks/{designer-DBBrktom.js → designer-D87ILhjz.js} +1664 -1182
- package/dist/chunks/designer-D87ILhjz.js.map +1 -0
- package/dist/chunks/designer-DESS0CMl.cjs +65 -0
- package/dist/chunks/designer-DESS0CMl.cjs.map +1 -0
- package/dist/chunks/detail-D49NuNCn.cjs +2 -0
- package/dist/chunks/detail-D49NuNCn.cjs.map +1 -0
- package/dist/chunks/{detail-B_bSg31B.js → detail-URwxkcro.js} +1036 -847
- package/dist/chunks/detail-URwxkcro.js.map +1 -0
- package/dist/chunks/{providers-H_vPRsSN.js → providers-B_d5tbCL.js} +178 -167
- package/dist/chunks/providers-B_d5tbCL.js.map +1 -0
- package/dist/chunks/providers-chuJvMgv.cjs +2 -0
- package/dist/chunks/providers-chuJvMgv.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.js +1 -1
- package/dist/next/workflow-chat-route.cjs +1 -0
- package/dist/next/workflow-chat-route.cjs.map +1 -1
- package/dist/next/workflow-chat-route.d.cts +1 -1
- package/dist/next/workflow-chat-route.d.ts +1 -1
- package/dist/next/workflow-chat-route.js +1 -1
- package/dist/next/workflow-chat-route.js.map +1 -1
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.js +1 -1
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.js +1 -1
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/renderer/FormRendererView.d.cts +16 -1
- package/dist/views/forms/renderer/FormRendererView.d.ts +16 -1
- package/dist/views/forms/renderer/index.cjs +1 -1
- package/dist/views/forms/renderer/index.js +1 -1
- package/dist/views/inbox/index.cjs +1 -1
- package/dist/views/inbox/index.cjs.map +1 -1
- package/dist/views/inbox/index.js +109 -99
- package/dist/views/inbox/index.js.map +1 -1
- package/dist/views/instances/approver-filled-form.d.cts +76 -0
- package/dist/views/instances/approver-filled-form.d.ts +76 -0
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +30 -2
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +30 -2
- package/dist/views/instances/detail/sections/InstanceHistorySection.d.cts +4 -1
- package/dist/views/instances/detail/sections/InstanceHistorySection.d.ts +4 -1
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +21 -0
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +21 -0
- package/dist/views/instances/detail/sections/container-helpers.d.cts +1 -1
- package/dist/views/instances/detail/sections/container-helpers.d.ts +1 -1
- package/dist/views/instances/detail/sections/shared.d.cts +11 -2
- package/dist/views/instances/detail/sections/shared.d.ts +11 -2
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.cjs.map +1 -1
- package/dist/views/instances/new/index.js +88 -87
- package/dist/views/instances/new/index.js.map +1 -1
- package/dist/views/instances/viewer-field-access.d.cts +22 -0
- package/dist/views/instances/viewer-field-access.d.ts +22 -0
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.cts +33 -0
- package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.ts +33 -0
- package/dist/views/templates/designer/field-access-matrix/FieldAccessNodeSection.d.cts +20 -0
- package/dist/views/templates/designer/field-access-matrix/FieldAccessNodeSection.d.ts +20 -0
- package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.cts +22 -0
- package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.ts +22 -0
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunks/FormRendererView-DRFi_IH7.cjs +0 -4
- package/dist/chunks/FormRendererView-DRFi_IH7.cjs.map +0 -1
- package/dist/chunks/FormRendererView-cZGOOjU5.js.map +0 -1
- package/dist/chunks/designer-CTXMqCD2.cjs +0 -65
- package/dist/chunks/designer-CTXMqCD2.cjs.map +0 -1
- package/dist/chunks/designer-DBBrktom.js.map +0 -1
- package/dist/chunks/detail-BQSVgVlO.cjs +0 -2
- package/dist/chunks/detail-BQSVgVlO.cjs.map +0 -1
- package/dist/chunks/detail-B_bSg31B.js.map +0 -1
- package/dist/chunks/providers-DP7b0TMN.cjs +0 -2
- package/dist/chunks/providers-DP7b0TMN.cjs.map +0 -1
- 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
|
|
10
|
-
import { isFormDataSourceFieldDefinition as
|
|
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
|
|
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
|
-
},
|
|
24
|
-
function
|
|
25
|
-
let t =
|
|
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 =
|
|
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
|
-
]),
|
|
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:
|
|
53
|
+
isStale: O,
|
|
54
54
|
readonly: e.readonly
|
|
55
|
-
}),
|
|
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(() =>
|
|
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 =
|
|
66
|
-
|
|
65
|
+
let i = G.current + 1;
|
|
66
|
+
G.current = i, _e.current = {
|
|
67
67
|
cursor: r,
|
|
68
68
|
searchText: n
|
|
69
|
-
},
|
|
69
|
+
}, q.current?.abort();
|
|
70
70
|
let a = new AbortController();
|
|
71
|
-
|
|
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
|
-
}) :
|
|
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,
|
|
91
|
-
let n =
|
|
92
|
-
return
|
|
93
|
-
}),
|
|
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,
|
|
96
|
-
let t =
|
|
97
|
-
|
|
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
|
-
|
|
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 =
|
|
115
|
-
|
|
114
|
+
let n = T, r = K.current + 1;
|
|
115
|
+
K.current = r, J.current?.abort();
|
|
116
116
|
let i = new AbortController();
|
|
117
|
-
|
|
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
|
-
}) :
|
|
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,
|
|
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
|
-
}),
|
|
137
|
+
}), H("VALID")));
|
|
138
138
|
}).catch((e) => {
|
|
139
|
-
Ce(i,
|
|
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
|
-
|
|
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
|
-
|
|
155
|
+
j,
|
|
156
156
|
l,
|
|
157
157
|
E,
|
|
158
158
|
T,
|
|
159
159
|
p,
|
|
160
160
|
b,
|
|
161
161
|
e.readonly,
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
N,
|
|
163
|
+
A,
|
|
164
164
|
u
|
|
165
165
|
]), r(() => {
|
|
166
|
-
|
|
166
|
+
k && Ae.current();
|
|
167
167
|
}, [
|
|
168
168
|
T,
|
|
169
169
|
E,
|
|
170
|
-
|
|
170
|
+
k
|
|
171
171
|
]), r(() => () => {
|
|
172
|
-
|
|
172
|
+
q.current?.abort(), J.current?.abort();
|
|
173
173
|
}, []);
|
|
174
174
|
let je = n((e) => {
|
|
175
|
-
|
|
175
|
+
ce(e), P((e) => B(x, e)), R(null), Z(e, null);
|
|
176
176
|
}, [Z]), Me = n(() => {
|
|
177
|
-
|
|
177
|
+
L && Z(I, L);
|
|
178
178
|
}, [
|
|
179
179
|
Z,
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
L,
|
|
181
|
+
I
|
|
182
182
|
]), Ne = n(() => {
|
|
183
|
-
E && (Z(
|
|
183
|
+
E && (Z(_e.current.searchText, _e.current.cursor), k && Ae.current());
|
|
184
184
|
}, [
|
|
185
185
|
E,
|
|
186
186
|
Z,
|
|
187
|
-
|
|
187
|
+
k
|
|
188
188
|
]);
|
|
189
189
|
return t ? {
|
|
190
190
|
canRetry: !!E,
|
|
191
|
-
error:
|
|
191
|
+
error: pe,
|
|
192
192
|
hasValue: w,
|
|
193
|
-
hasNextPage: !!
|
|
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:
|
|
202
|
+
status: fe
|
|
203
203
|
})
|
|
204
|
-
} :
|
|
204
|
+
} : me;
|
|
205
205
|
}
|
|
206
|
-
function
|
|
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
|
|
216
|
+
function J(e) {
|
|
217
217
|
return e.hasValue && e.status !== "VALID";
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
let t = e.filter(
|
|
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 ?
|
|
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
|
|
346
|
+
return W(e).filter((e) => !n.has(e));
|
|
347
347
|
}
|
|
348
348
|
function Ie(e, t) {
|
|
349
|
-
return
|
|
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 = {},
|
|
437
|
-
let [
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
]),
|
|
442
|
-
|
|
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
|
-
|
|
444
|
+
y,
|
|
445
|
+
w
|
|
445
446
|
]);
|
|
446
447
|
r(() => {
|
|
447
|
-
|
|
448
|
-
}, [
|
|
449
|
-
|
|
450
|
-
}, [
|
|
451
|
-
function
|
|
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
|
-
...
|
|
454
|
+
...T.current,
|
|
454
455
|
[e]: t
|
|
455
456
|
};
|
|
456
|
-
|
|
457
|
+
T.current = n, b || C(n), d?.(n);
|
|
457
458
|
}
|
|
458
|
-
return
|
|
459
|
+
return D.length ? /* @__PURE__ */ S("div", {
|
|
459
460
|
style: {
|
|
460
461
|
...ze,
|
|
461
|
-
...
|
|
462
|
+
..._ ? { width: "100%" } : {}
|
|
462
463
|
},
|
|
463
|
-
children:
|
|
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:
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
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 ${
|
|
479
|
-
...
|
|
480
|
+
gridColumn: `span ${_ ? 12 : pt(n, y)}`,
|
|
481
|
+
..._ && !pe(n) ? { maxWidth: u } : {}
|
|
480
482
|
},
|
|
481
|
-
value:
|
|
482
|
-
values:
|
|
483
|
-
uiSchema:
|
|
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:
|
|
493
|
+
children: g.fields.length > 0 ? "目前條件下沒有可填寫欄位。" : n
|
|
492
494
|
})
|
|
493
495
|
});
|
|
494
496
|
}
|
|
495
|
-
function Ge(
|
|
496
|
-
|
|
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:
|
|
503
|
-
readonly:
|
|
504
|
-
schema:
|
|
505
|
-
uiSchema:
|
|
506
|
-
}),
|
|
507
|
-
hasValue:
|
|
508
|
-
invalidValues:
|
|
509
|
-
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
|
-
|
|
513
|
-
hasValue:
|
|
514
|
-
invalidValues:
|
|
515
|
-
status:
|
|
520
|
+
V(o) && d?.(o.fieldKey, {
|
|
521
|
+
hasValue: T.hasValue,
|
|
522
|
+
invalidValues: T.invalidValues,
|
|
523
|
+
status: T.status
|
|
516
524
|
});
|
|
517
525
|
}, [
|
|
518
|
-
|
|
526
|
+
D,
|
|
519
527
|
o.fieldKey,
|
|
520
|
-
|
|
528
|
+
d
|
|
521
529
|
]), /* @__PURE__ */ C("div", {
|
|
522
530
|
"data-form-field-key": o.fieldKey,
|
|
523
|
-
style:
|
|
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:
|
|
529
|
-
children:
|
|
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:
|
|
535
|
-
onDataSourceStateChange:
|
|
536
|
-
optionSnapshots:
|
|
537
|
-
readonly:
|
|
538
|
-
schema:
|
|
539
|
-
uiSchema:
|
|
540
|
-
value:
|
|
541
|
-
values:
|
|
542
|
-
}) :
|
|
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
|
-
|
|
550
|
-
style:
|
|
558
|
+
E ? /* @__PURE__ */ C("div", {
|
|
559
|
+
style: Ze,
|
|
551
560
|
children: [/* @__PURE__ */ S(v, {
|
|
552
|
-
color:
|
|
561
|
+
color: T.status === "INVALID" || T.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
|
|
553
562
|
variant: "caption",
|
|
554
|
-
children:
|
|
555
|
-
}),
|
|
556
|
-
onClick:
|
|
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
|
|
575
|
+
var Je = "(另開新分頁)", Ye = "另開新分頁", Xe = {
|
|
567
576
|
color: "inherit",
|
|
568
577
|
textDecoration: "underline",
|
|
569
578
|
wordBreak: "break-all"
|
|
570
|
-
},
|
|
579
|
+
}, Ze = {
|
|
571
580
|
alignItems: "center",
|
|
572
581
|
display: "flex",
|
|
573
582
|
gap: 8
|
|
574
|
-
},
|
|
583
|
+
}, Qe = {
|
|
575
584
|
display: "grid",
|
|
576
585
|
gap: 8,
|
|
577
586
|
minWidth: 0,
|
|
578
587
|
width: "100%"
|
|
579
|
-
},
|
|
588
|
+
}, $e = {
|
|
580
589
|
display: "flex",
|
|
581
590
|
justifyContent: "flex-start"
|
|
582
|
-
},
|
|
591
|
+
}, et = {
|
|
583
592
|
maxWidth: "100%",
|
|
584
593
|
overflowX: "auto"
|
|
585
|
-
},
|
|
594
|
+
}, tt = 160, nt = 56, rt = {
|
|
586
595
|
display: "grid",
|
|
587
596
|
gap: 4,
|
|
588
597
|
minWidth: 0
|
|
589
598
|
};
|
|
590
|
-
function
|
|
591
|
-
let _ =
|
|
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(() =>
|
|
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
|
|
599
|
-
x([...b,
|
|
607
|
+
function D() {
|
|
608
|
+
x([...b, st(y)]), E([..._, ee(i.columns)]);
|
|
600
609
|
}
|
|
601
|
-
function
|
|
610
|
+
function O(e) {
|
|
602
611
|
x(b.filter((t, n) => n !== e)), E(_.filter((t, n) => n !== e));
|
|
603
612
|
}
|
|
604
|
-
function
|
|
605
|
-
E(_.map((r, i) => i === e ?
|
|
613
|
+
function k(e, t, n) {
|
|
614
|
+
E(_.map((r, i) => i === e ? ct(r, t, n) : r));
|
|
606
615
|
}
|
|
607
|
-
let
|
|
616
|
+
let A = _.map((e, t) => ({
|
|
608
617
|
...e,
|
|
609
618
|
index: t,
|
|
610
619
|
key: b[t] ?? `row-${t}`
|
|
611
|
-
})),
|
|
620
|
+
})), j = i.columns.map((r) => ({
|
|
612
621
|
key: r.fieldKey,
|
|
613
|
-
render: (a) => /* @__PURE__ */ S(
|
|
622
|
+
render: (a) => /* @__PURE__ */ S(at, {
|
|
614
623
|
column: r,
|
|
615
624
|
dataSourceContext: e,
|
|
616
|
-
error: n[
|
|
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:
|
|
621
|
-
onChange: (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:
|
|
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
|
-
})),
|
|
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: () =>
|
|
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:
|
|
652
|
+
style: Qe,
|
|
644
653
|
children: [/* @__PURE__ */ S("div", {
|
|
645
|
-
style:
|
|
654
|
+
style: et,
|
|
646
655
|
children: /* @__PURE__ */ S("div", {
|
|
647
|
-
style: { minWidth: i.columns.length *
|
|
656
|
+
style: { minWidth: i.columns.length * tt + (M ? nt : 0) },
|
|
648
657
|
children: /* @__PURE__ */ S(h, {
|
|
649
|
-
...
|
|
650
|
-
columns:
|
|
651
|
-
dataSource: [...
|
|
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:
|
|
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:
|
|
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
|
|
673
|
-
let _ =
|
|
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 ?
|
|
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 =
|
|
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 (
|
|
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:
|
|
721
|
+
style: rt,
|
|
713
722
|
children: [
|
|
714
|
-
|
|
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:
|
|
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
|
|
738
|
-
return
|
|
746
|
+
function ot(e, t) {
|
|
747
|
+
return L(e)[t];
|
|
739
748
|
}
|
|
740
|
-
function
|
|
749
|
+
function st(e) {
|
|
741
750
|
return e.current += 1, `table-row-${e.current}`;
|
|
742
751
|
}
|
|
743
|
-
function
|
|
744
|
-
return n === void 0 || !
|
|
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
|
|
758
|
+
function lt(e, t) {
|
|
750
759
|
if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
751
760
|
}
|
|
752
|
-
function
|
|
753
|
-
return
|
|
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
|
|
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:
|
|
772
|
+
style: Xe,
|
|
764
773
|
...o.external ? {
|
|
765
|
-
"aria-label": `${o.href}${
|
|
774
|
+
"aria-label": `${o.href}${Je}`,
|
|
766
775
|
rel: "noopener noreferrer",
|
|
767
776
|
target: "_blank",
|
|
768
|
-
title:
|
|
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 (
|
|
790
|
-
let i = e.options.map(
|
|
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) =>
|
|
807
|
+
value: i.filter((e) => mt(t).includes(e.id))
|
|
799
808
|
});
|
|
800
809
|
}
|
|
801
|
-
if (
|
|
802
|
-
let i = e.options.map(
|
|
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:
|
|
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,
|
|
838
|
-
placeholder: e.placeholder ??
|
|
846
|
+
onChange: (t) => r(e.fieldKey, O(t)),
|
|
847
|
+
placeholder: e.placeholder ?? gt(e.type),
|
|
839
848
|
readOnly: n,
|
|
840
|
-
value:
|
|
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,
|
|
855
|
+
onChange: (t) => r(e.fieldKey, k(t)),
|
|
847
856
|
placeholderLeft: "選擇日期",
|
|
848
857
|
placeholderRight: "選擇時間",
|
|
849
858
|
readOnly: n,
|
|
850
|
-
value:
|
|
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,
|
|
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 ??
|
|
869
|
+
placeholder: e.placeholder ?? gt(e.type),
|
|
861
870
|
...n ? { readonly: !0 } : {},
|
|
862
871
|
showSpinner: !0,
|
|
863
|
-
value:
|
|
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 ??
|
|
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
|
|
876
|
-
let c = a.options.map(
|
|
877
|
-
return e.type === "autocomplete" ?
|
|
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: [...
|
|
926
|
-
}) :
|
|
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
|
|
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
|
|
968
|
+
function mt(e) {
|
|
960
969
|
return Array.isArray(e) && e.every((e) => typeof e == "string") ? e : [];
|
|
961
970
|
}
|
|
962
|
-
function
|
|
971
|
+
function ht(e) {
|
|
963
972
|
return typeof e == "number" ? String(e) : "";
|
|
964
973
|
}
|
|
965
|
-
function
|
|
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 {
|
|
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-
|
|
995
|
+
//# sourceMappingURL=FormRendererView-BsTwZkqU.js.map
|