@rytass/bpm-core-react 0.18.1 → 0.20.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.
- package/CHANGELOG.md +52 -0
- package/dist/chunks/{FormBuilderView-vQfVc08Z.js → FormBuilderView-CFRiw04B.js} +563 -475
- package/dist/chunks/FormBuilderView-CFRiw04B.js.map +1 -0
- package/dist/chunks/FormBuilderView-CpUgbSbt.cjs +3 -0
- package/dist/chunks/FormBuilderView-CpUgbSbt.cjs.map +1 -0
- package/dist/chunks/FormRendererView-GfbVWEGa.js +1321 -0
- package/dist/chunks/FormRendererView-GfbVWEGa.js.map +1 -0
- package/dist/chunks/FormRendererView-lYSaR8CQ.cjs +6 -0
- package/dist/chunks/FormRendererView-lYSaR8CQ.cjs.map +1 -0
- package/dist/chunks/{compose-DtfX8DQ9.cjs → compose-Bb5bUVFd.cjs} +2 -2
- package/dist/chunks/{compose-DtfX8DQ9.cjs.map → compose-Bb5bUVFd.cjs.map} +1 -1
- package/dist/chunks/{compose-D9ipJpF_.js → compose-egQlRjuZ.js} +5 -4
- package/dist/chunks/{compose-D9ipJpF_.js.map → compose-egQlRjuZ.js.map} +1 -1
- package/dist/chunks/{delegations-BfhCDz5e.js → delegations-9-yvWWws.js} +3 -2
- package/dist/chunks/delegations-9-yvWWws.js.map +1 -0
- package/dist/chunks/delegations-CVmtpkRn.cjs +2 -0
- package/dist/chunks/delegations-CVmtpkRn.cjs.map +1 -0
- package/dist/chunks/delegations-CrfjsH94.cjs +2 -0
- package/dist/chunks/delegations-CrfjsH94.cjs.map +1 -0
- package/dist/chunks/{delegations-DBh5TT6G.js → delegations-CxnNvTCc.js} +3 -2
- package/dist/chunks/delegations-CxnNvTCc.js.map +1 -0
- package/dist/chunks/designer-CX9bhYJS.cjs +69 -0
- package/dist/chunks/designer-CX9bhYJS.cjs.map +1 -0
- package/dist/chunks/{designer-ubnZbP-A.js → designer-CZDlQ9Nf.js} +2341 -1584
- package/dist/chunks/designer-CZDlQ9Nf.js.map +1 -0
- package/dist/chunks/{detail-C6XKZjlF.js → detail-ByZV1XaI.js} +853 -840
- package/dist/chunks/detail-ByZV1XaI.js.map +1 -0
- package/dist/chunks/detail-ChseSF55.cjs +5 -0
- package/dist/chunks/detail-ChseSF55.cjs.map +1 -0
- package/dist/chunks/{approver-filled-form-B4zPg9kz.cjs → instance-error-message-DTARGbGo.cjs} +2 -2
- package/dist/chunks/instance-error-message-DTARGbGo.cjs.map +1 -0
- package/dist/chunks/{approver-filled-form-Bgazhbvd.js → instance-error-message-q6gy5evy.js} +44 -36
- package/dist/chunks/instance-error-message-q6gy5evy.js.map +1 -0
- package/dist/chunks/workflow-chat-prompt-B4wCFKPB.js +25 -0
- package/dist/chunks/workflow-chat-prompt-B4wCFKPB.js.map +1 -0
- package/dist/chunks/workflow-chat-prompt-B803qVdt.cjs +27 -0
- package/dist/chunks/workflow-chat-prompt-B803qVdt.cjs.map +1 -0
- package/dist/next/workflow-chat-route.cjs +8 -19
- package/dist/next/workflow-chat-route.cjs.map +1 -1
- package/dist/next/workflow-chat-route.d.cts +92 -4
- package/dist/next/workflow-chat-route.d.ts +92 -4
- package/dist/next/workflow-chat-route.js +127 -19
- package/dist/next/workflow-chat-route.js.map +1 -1
- package/dist/pages/admin/delegations/index.cjs +1 -1
- package/dist/pages/admin/delegations/index.js +1 -1
- package/dist/pages/delegations/index.cjs +1 -1
- package/dist/pages/delegations/index.js +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/admin/delegations/index.cjs +1 -1
- package/dist/views/admin/delegations/index.js +1 -1
- package/dist/views/admin/index.cjs +1 -1
- package/dist/views/admin/index.js +1 -1
- package/dist/views/delegations/index.cjs +1 -1
- package/dist/views/delegations/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 +25 -2
- package/dist/views/forms/renderer/FormRendererView.d.ts +25 -2
- package/dist/views/forms/renderer/file-upload-field.d.cts +84 -0
- package/dist/views/forms/renderer/file-upload-field.d.ts +84 -0
- package/dist/views/forms/renderer/form-data-source-field.d.cts +9 -1
- package/dist/views/forms/renderer/form-data-source-field.d.ts +9 -1
- package/dist/views/forms/renderer/form-value-readers.d.cts +7 -0
- package/dist/views/forms/renderer/form-value-readers.d.ts +7 -0
- package/dist/views/forms/renderer/index.cjs +1 -1
- package/dist/views/forms/renderer/index.d.cts +1 -0
- package/dist/views/forms/renderer/index.d.ts +1 -0
- package/dist/views/forms/renderer/index.js +1 -1
- 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 +20 -3
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +20 -3
- package/dist/views/instances/detail/sections/shared.d.cts +1 -2
- package/dist/views/instances/detail/sections/shared.d.ts +1 -2
- package/dist/views/instances/instance-error-message.d.cts +5 -0
- package/dist/views/instances/instance-error-message.d.ts +5 -0
- 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 +79 -76
- package/dist/views/instances/new/index.js.map +1 -1
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/designer/designer-version-labels.d.cts +7 -0
- package/dist/views/templates/designer/designer-version-labels.d.ts +7 -0
- package/dist/views/templates/designer/expression/DialectUpgradeModal.d.cts +25 -0
- package/dist/views/templates/designer/expression/DialectUpgradeModal.d.ts +25 -0
- package/dist/views/templates/designer/expression/ExpressionField.d.cts +79 -0
- package/dist/views/templates/designer/expression/ExpressionField.d.ts +79 -0
- package/dist/views/templates/designer/expression/use-workflow-expression-references.d.cts +22 -0
- package/dist/views/templates/designer/expression/use-workflow-expression-references.d.ts +22 -0
- package/dist/views/templates/designer/expression/workflow-expression-edits.d.cts +58 -0
- package/dist/views/templates/designer/expression/workflow-expression-edits.d.ts +58 -0
- package/dist/views/templates/designer/expression/workflow-expression-tools.d.cts +14 -0
- package/dist/views/templates/designer/expression/workflow-expression-tools.d.ts +14 -0
- package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.cts +7 -1
- package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.ts +7 -1
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/dist/views/templates/designer/notify-webhook-designer.d.cts +8 -0
- package/dist/views/templates/designer/notify-webhook-designer.d.ts +8 -0
- package/dist/views/templates/designer/use-workflow-designer-controller.d.cts +8 -2
- package/dist/views/templates/designer/use-workflow-designer-controller.d.ts +8 -2
- package/dist/views/templates/designer/workflow-chat-prompt.d.cts +18 -0
- package/dist/views/templates/designer/workflow-chat-prompt.d.ts +18 -0
- package/package.json +3 -3
- package/dist/chunks/FormBuilderView-CHaAQL5v.cjs +0 -3
- package/dist/chunks/FormBuilderView-CHaAQL5v.cjs.map +0 -1
- package/dist/chunks/FormBuilderView-vQfVc08Z.js.map +0 -1
- package/dist/chunks/FormRendererView-CTLlG13b.js +0 -1106
- package/dist/chunks/FormRendererView-CTLlG13b.js.map +0 -1
- package/dist/chunks/FormRendererView-ChmM_4Yc.cjs +0 -4
- package/dist/chunks/FormRendererView-ChmM_4Yc.cjs.map +0 -1
- package/dist/chunks/approver-filled-form-B4zPg9kz.cjs.map +0 -1
- package/dist/chunks/approver-filled-form-Bgazhbvd.js.map +0 -1
- package/dist/chunks/delegations-BfhCDz5e.js.map +0 -1
- package/dist/chunks/delegations-BmFGcuhA.cjs +0 -2
- package/dist/chunks/delegations-BmFGcuhA.cjs.map +0 -1
- package/dist/chunks/delegations-CcS0SHbf.cjs +0 -2
- package/dist/chunks/delegations-CcS0SHbf.cjs.map +0 -1
- package/dist/chunks/delegations-DBh5TT6G.js.map +0 -1
- package/dist/chunks/designer-Df79YzUn.cjs +0 -65
- package/dist/chunks/designer-Df79YzUn.cjs.map +0 -1
- package/dist/chunks/designer-ubnZbP-A.js.map +0 -1
- package/dist/chunks/detail-BBC9kqXd.cjs +0 -5
- package/dist/chunks/detail-BBC9kqXd.cjs.map +0 -1
- package/dist/chunks/detail-C6XKZjlF.js.map +0 -1
|
@@ -1,1106 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { t as e } from "./bpm-form-field-9B-Det0u.js";
|
|
3
|
-
import { t } from "./format-member-label-C73FuP-d.js";
|
|
4
|
-
import { useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
5
|
-
import { AutoComplete as s, Button as c, CheckboxGroup as l, DatePicker as u, DateTimePicker as d, Input as f, RadioGroup as p, Select as m, Table as h, Textarea as g, Toggle as _, Typography as v, Upload as y } from "@mezzanine-ui/react";
|
|
6
|
-
import { resolveMembers as b, searchMembers as x } from "@rytass/bpm-core-client";
|
|
7
|
-
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
8
|
-
import { PlusIcon as w, TrashIcon as T } from "@mezzanine-ui/icons";
|
|
9
|
-
import { buildFormRendererValues as E, clampOptionalNumber as 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 P, readFieldOptionAsSelectOption as F, readFormDataSourceErrorCode as re, readFormDataSourceErrorMessage as ie, readFormDataSourceSelectedValues as ae, readFormDataSourceValueSignature as I, readFormFieldOptions as oe, readFormTableCellPath as L, readFormTableRowBounds as se, readFormTableRows as R, readMissingFormDataSourceDependencies as ce, readMissingFormDataSourceOptionValues as z, readSelectOption as B, readSelectedFormDataSourceOptions as le, readVisibleFormRendererFields as ue, resolveFormFieldOptions as de } from "@rytass/bpm-core-client/form";
|
|
10
|
-
import { isFormDataSourceFieldDefinition as fe, isFormStaticOptionFieldDefinition as pe, isFormTableCellValue as V, isTableFieldDefinition as me, readFormFieldSelectionMode as H, readFormMemberIds as U } from "@rytass/bpm-core-shared/form";
|
|
11
|
-
import { resolveOrgUnitOptions as W, searchOrgUnitOptions as G } from "@rytass/bpm-core-client/organization";
|
|
12
|
-
// src/views/forms/renderer/form-data-source-field.ts
|
|
13
|
-
var he = {
|
|
14
|
-
canRetry: !1,
|
|
15
|
-
error: null,
|
|
16
|
-
hasValue: !1,
|
|
17
|
-
hasNextPage: !1,
|
|
18
|
-
invalidValues: [],
|
|
19
|
-
onReachBottom: () => void 0,
|
|
20
|
-
onSearch: () => void 0,
|
|
21
|
-
options: [],
|
|
22
|
-
retry: () => void 0,
|
|
23
|
-
status: "IDLE"
|
|
24
|
-
}, K = [], ge = 10, _e = ["FORM_DATA_SOURCE_SEARCH_NOT_SUPPORTED", "FORM_DATA_SOURCE_SEARCH_TOO_SHORT"];
|
|
25
|
-
function q(e) {
|
|
26
|
-
let t = fe(e.field) ? e.field : null, s = e.fieldPath ?? t?.fieldKey ?? "", c = t ? e.optionSnapshots?.[e.snapshotKey ?? t.fieldKey] : void 0, l = t ? JSON.stringify({
|
|
27
|
-
dataSource: t.dataSource,
|
|
28
|
-
fieldKey: t.fieldKey,
|
|
29
|
-
type: t.type
|
|
30
|
-
}) : "", 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({
|
|
31
|
-
bindings: t.dataSource.bindings.map((t) => t.from.kind === "FIELD" ? {
|
|
32
|
-
fieldKey: t.from.fieldKey,
|
|
33
|
-
value: e.formData[t.from.fieldKey]
|
|
34
|
-
} : t.from.kind === "CONSTANT" ? { value: t.from.value } : {
|
|
35
|
-
columnKey: t.from.columnKey,
|
|
36
|
-
value: e.row?.values[t.from.columnKey]
|
|
37
|
-
}),
|
|
38
|
-
value: e.initialFormData !== void 0 || e.initialValue !== void 0 ? x : void 0
|
|
39
|
-
}) : "", E = i(() => {
|
|
40
|
-
if (g === "preview") return { kind: "preview" };
|
|
41
|
-
if (g === "runtime" && !e.readonly) return {
|
|
42
|
-
instanceId: _,
|
|
43
|
-
kind: "runtime",
|
|
44
|
-
templateId: v
|
|
45
|
-
};
|
|
46
|
-
}, [
|
|
47
|
-
_,
|
|
48
|
-
g,
|
|
49
|
-
v,
|
|
50
|
-
e.readonly
|
|
51
|
-
]), D = t ? (e.initialFormData !== void 0 || e.initialValue !== void 0) && I(e.initialValue) !== S : !1, ee = t ? e.initialFormData !== void 0 && t.dataSource.bindings.some((t) => t.from.kind === "FIELD" ? I(e.initialFormData?.[t.from.fieldKey]) !== I(e.formData[t.from.fieldKey]) : t.from.kind === "ROW_FIELD" && e.row?.initialValues ? I(e.row.initialValues[t.from.columnKey]) !== I(e.row.values[t.from.columnKey]) : !1) : !1, O = !(!c && !w || !D && !ee), k = !!(t && E && O && w), A = ye({
|
|
52
|
-
hasSnapshot: !!c,
|
|
53
|
-
hasValue: w,
|
|
54
|
-
isStale: O,
|
|
55
|
-
readonly: e.readonly
|
|
56
|
-
}), j = !!(t && E && t.type !== "autocomplete"), N = be(O, j && t !== null && ce(t, e.formData, e.row?.values).length > 0), [P, F] = o([]), [L, se] = o(""), [R, z] = o(null), [B, ue] = o(null), [pe, V] = o(() => t ? j ? N : A : "IDLE"), [me, H] = o(null), U = a(0), W = a(0), G = a(0), K = a(null), q = a(null), J = a({
|
|
57
|
-
cursor: null,
|
|
58
|
-
searchText: ""
|
|
59
|
-
}), Y = i(() => we(e.formData), [f]), X = i(() => e.row ? we(e.row.values) : void 0, [y]), Te = i(() => M(d, P), [P, d]), Ee = B && B.signature === T ? B : null, De = k && !Ee, Oe = ve({
|
|
60
|
-
options: Te,
|
|
61
|
-
resolution: Ee,
|
|
62
|
-
resolvePending: De,
|
|
63
|
-
value: x
|
|
64
|
-
}), Z = n((n, r) => {
|
|
65
|
-
if (!t || !E) return;
|
|
66
|
-
let i = W.current + 1;
|
|
67
|
-
W.current = i, J.current = {
|
|
68
|
-
cursor: r,
|
|
69
|
-
searchText: n
|
|
70
|
-
}, K.current?.abort();
|
|
71
|
-
let a = new AbortController();
|
|
72
|
-
K.current = a, V(N), H(null), (E.kind === "preview" ? te({
|
|
73
|
-
cursor: r,
|
|
74
|
-
fieldKey: s,
|
|
75
|
-
formData: Y,
|
|
76
|
-
rowValues: X,
|
|
77
|
-
schema: e.schema,
|
|
78
|
-
searchText: n,
|
|
79
|
-
signal: a.signal,
|
|
80
|
-
uiSchema: e.uiSchema
|
|
81
|
-
}) : oe({
|
|
82
|
-
cursor: r,
|
|
83
|
-
fieldKey: s,
|
|
84
|
-
formData: Y,
|
|
85
|
-
instanceId: E.instanceId ?? null,
|
|
86
|
-
rowValues: X,
|
|
87
|
-
searchText: n,
|
|
88
|
-
signal: a.signal,
|
|
89
|
-
templateId: E.templateId ?? null
|
|
90
|
-
})).then((e) => {
|
|
91
|
-
Ce(a, W, i) || (F((t) => {
|
|
92
|
-
let n = le(x, t);
|
|
93
|
-
return M(n, r ? t : [], e.options);
|
|
94
|
-
}), z(e.nextCursor), H(null), U.current = r ? U.current + e.options.length : e.options.length, e.nextCursor && e.options.length > 0 && U.current < ge && ke.current(n, e.nextCursor), V(e.waitingForFieldKeys.length ? "WAITING_FOR_DEPENDENCIES" : "VALID"));
|
|
95
|
-
}).catch((e) => {
|
|
96
|
-
if (Ce(a, W, i)) return;
|
|
97
|
-
let t = ie(e) ?? "選項來源暫時無法使用。", n = re(e);
|
|
98
|
-
H(t), V(xe(!!(n && _e.includes(n)), w));
|
|
99
|
-
});
|
|
100
|
-
}, [
|
|
101
|
-
S,
|
|
102
|
-
l,
|
|
103
|
-
E,
|
|
104
|
-
w,
|
|
105
|
-
N,
|
|
106
|
-
s,
|
|
107
|
-
Y,
|
|
108
|
-
X,
|
|
109
|
-
m,
|
|
110
|
-
h
|
|
111
|
-
]), ke = a(Z);
|
|
112
|
-
ke.current = Z;
|
|
113
|
-
let Ae = n(() => {
|
|
114
|
-
if (!t || !E || C.length === 0) return;
|
|
115
|
-
let n = T, r = G.current + 1;
|
|
116
|
-
G.current = r, q.current?.abort();
|
|
117
|
-
let i = new AbortController();
|
|
118
|
-
q.current = i, H(null), (E.kind === "preview" ? ne({
|
|
119
|
-
fieldKey: s,
|
|
120
|
-
formData: Y,
|
|
121
|
-
rowValues: X,
|
|
122
|
-
schema: e.schema,
|
|
123
|
-
signal: i.signal,
|
|
124
|
-
uiSchema: e.uiSchema,
|
|
125
|
-
values: C
|
|
126
|
-
}) : de({
|
|
127
|
-
fieldKey: s,
|
|
128
|
-
formData: Y,
|
|
129
|
-
instanceId: E.instanceId ?? null,
|
|
130
|
-
rowValues: X,
|
|
131
|
-
signal: i.signal,
|
|
132
|
-
templateId: E.templateId ?? null,
|
|
133
|
-
values: C
|
|
134
|
-
})).then((e) => {
|
|
135
|
-
Ce(i, G, r) || (e.waitingForFieldKeys.length ? V("WAITING_FOR_DEPENDENCIES") : (F((t) => M(t, e.options)), ue({
|
|
136
|
-
signature: n,
|
|
137
|
-
unresolvedValues: e.unresolvedValues
|
|
138
|
-
}), V("VALID")));
|
|
139
|
-
}).catch((e) => {
|
|
140
|
-
Ce(i, G, r) || (V("UNAVAILABLE"), H(ie(e) ?? "選項來源暫時無法使用。"));
|
|
141
|
-
});
|
|
142
|
-
}, [
|
|
143
|
-
T,
|
|
144
|
-
l,
|
|
145
|
-
E,
|
|
146
|
-
s,
|
|
147
|
-
Y,
|
|
148
|
-
X,
|
|
149
|
-
m,
|
|
150
|
-
C,
|
|
151
|
-
h
|
|
152
|
-
]), Q = a(Ae);
|
|
153
|
-
Q.current = Ae, r(() => {
|
|
154
|
-
W.current += 1, K.current?.abort(), F((e) => le(x, e)), z((e) => e === null ? e : null), se((e) => e && ""), H((e) => e && null), t ? j ? ke.current("", null) : V(A) : V("IDLE");
|
|
155
|
-
}, [
|
|
156
|
-
j,
|
|
157
|
-
l,
|
|
158
|
-
E,
|
|
159
|
-
T,
|
|
160
|
-
p,
|
|
161
|
-
b,
|
|
162
|
-
e.readonly,
|
|
163
|
-
N,
|
|
164
|
-
A,
|
|
165
|
-
u
|
|
166
|
-
]), r(() => {
|
|
167
|
-
k && Q.current();
|
|
168
|
-
}, [
|
|
169
|
-
T,
|
|
170
|
-
E,
|
|
171
|
-
k
|
|
172
|
-
]), r(() => () => {
|
|
173
|
-
K.current?.abort(), q.current?.abort();
|
|
174
|
-
}, []);
|
|
175
|
-
let je = n((e) => {
|
|
176
|
-
se(e), F((e) => le(x, e)), z(null), Z(e, null);
|
|
177
|
-
}, [Z]), Me = n(() => {
|
|
178
|
-
R && Z(L, R);
|
|
179
|
-
}, [
|
|
180
|
-
Z,
|
|
181
|
-
R,
|
|
182
|
-
L
|
|
183
|
-
]), Ne = n(() => {
|
|
184
|
-
E && (Z(J.current.searchText, J.current.cursor), k && Q.current());
|
|
185
|
-
}, [
|
|
186
|
-
E,
|
|
187
|
-
Z,
|
|
188
|
-
k
|
|
189
|
-
]);
|
|
190
|
-
return t ? {
|
|
191
|
-
canRetry: !!E,
|
|
192
|
-
error: me,
|
|
193
|
-
hasValue: w,
|
|
194
|
-
hasNextPage: !!R,
|
|
195
|
-
invalidValues: Oe,
|
|
196
|
-
onReachBottom: Me,
|
|
197
|
-
onSearch: je,
|
|
198
|
-
options: Te,
|
|
199
|
-
retry: Ne,
|
|
200
|
-
status: Se({
|
|
201
|
-
invalidValues: Oe,
|
|
202
|
-
resolvePending: De,
|
|
203
|
-
status: pe
|
|
204
|
-
})
|
|
205
|
-
} : he;
|
|
206
|
-
}
|
|
207
|
-
function J(e) {
|
|
208
|
-
switch (e.status) {
|
|
209
|
-
case "WAITING_FOR_DEPENDENCIES": return "請先填寫相依欄位。";
|
|
210
|
-
case "STALE": return "選項需要重新載入或驗證。";
|
|
211
|
-
case "INVALID": return e.invalidValues.length ? `無法辨識選項:${e.invalidValues.join("、")}` : "目前選項已失效,請重新選擇。";
|
|
212
|
-
case "UNAVAILABLE": return e.error ?? "選項來源暫時無法使用。";
|
|
213
|
-
case "VALID": return e.error ?? (e.options.length ? null : "目前沒有可用選項。");
|
|
214
|
-
default: return e.error;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
function Y(e) {
|
|
218
|
-
return e.hasValue && e.status !== "VALID";
|
|
219
|
-
}
|
|
220
|
-
function X(e) {
|
|
221
|
-
let t = e.filter(Y);
|
|
222
|
-
return t.length === 0 ? null : t.every((e) => e.status === "LOADING" || e.status === "STALE") ? "選項驗證中,請稍候再送出。" : "請先完成動態選項驗證。";
|
|
223
|
-
}
|
|
224
|
-
function ve(e) {
|
|
225
|
-
return e.resolution ? e.resolution.unresolvedValues : e.resolvePending ? K : z(e.value, e.options);
|
|
226
|
-
}
|
|
227
|
-
function ye(e) {
|
|
228
|
-
return e.isStale ? "STALE" : e.hasSnapshot ? "VALID" : e.readonly && e.hasValue ? "UNAVAILABLE" : "IDLE";
|
|
229
|
-
}
|
|
230
|
-
function be(e, t) {
|
|
231
|
-
return t ? "WAITING_FOR_DEPENDENCIES" : e ? "STALE" : "LOADING";
|
|
232
|
-
}
|
|
233
|
-
function xe(e, t) {
|
|
234
|
-
return e ? t ? "VALID" : "IDLE" : "UNAVAILABLE";
|
|
235
|
-
}
|
|
236
|
-
function Se(e) {
|
|
237
|
-
return e.status === "LOADING" || e.status === "UNAVAILABLE" || e.status === "WAITING_FOR_DEPENDENCIES" ? e.status : e.invalidValues.length ? "INVALID" : e.resolvePending ? "STALE" : e.status;
|
|
238
|
-
}
|
|
239
|
-
function Ce(e, t, n) {
|
|
240
|
-
return e.signal.aborted || t.current !== n;
|
|
241
|
-
}
|
|
242
|
-
function we(e) {
|
|
243
|
-
return Object.entries(e).reduce((e, [t, n]) => n === void 0 ? e : {
|
|
244
|
-
...e,
|
|
245
|
-
[t]: n
|
|
246
|
-
}, {});
|
|
247
|
-
}
|
|
248
|
-
// src/views/forms/renderer/form-field-link.ts
|
|
249
|
-
var Te = /\s/u;
|
|
250
|
-
function Ee(e) {
|
|
251
|
-
return [...e].some((e) => {
|
|
252
|
-
let t = e.codePointAt(0) ?? 0;
|
|
253
|
-
return t <= 32 || t >= 127 && t <= 160 || Te.test(e);
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
var De = /^https?:\/\//iu;
|
|
257
|
-
function Oe(e) {
|
|
258
|
-
return typeof e != "string" || !e || e.includes("\\") || Ee(e) ? null : e.startsWith("/") ? !e.startsWith("//") && ke(e) ? {
|
|
259
|
-
external: !1,
|
|
260
|
-
href: e
|
|
261
|
-
} : null : De.test(e) && Ae(e) ? {
|
|
262
|
-
external: !0,
|
|
263
|
-
href: e
|
|
264
|
-
} : null;
|
|
265
|
-
}
|
|
266
|
-
var Z = "http://placeholder.invalid";
|
|
267
|
-
function ke(e) {
|
|
268
|
-
try {
|
|
269
|
-
let t = new URL(e, Z);
|
|
270
|
-
return t.origin === Z && !t.pathname.startsWith("//");
|
|
271
|
-
} catch {
|
|
272
|
-
return !1;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
function Ae(e) {
|
|
276
|
-
try {
|
|
277
|
-
let t = new URL(e);
|
|
278
|
-
return (t.protocol === "http:" || t.protocol === "https:") && !!t.hostname && !t.username && !t.password;
|
|
279
|
-
} catch {
|
|
280
|
-
return !1;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
async function Q(e, t, n = {}) {
|
|
284
|
-
let r = n.maxPerIdRequests ?? 20, i = Math.max(1, n.concurrency ?? 4);
|
|
285
|
-
try {
|
|
286
|
-
return {
|
|
287
|
-
failedIds: [],
|
|
288
|
-
profiles: await t(e),
|
|
289
|
-
skippedIds: []
|
|
290
|
-
};
|
|
291
|
-
} catch {
|
|
292
|
-
if (e.length <= 1) return {
|
|
293
|
-
failedIds: e,
|
|
294
|
-
profiles: [],
|
|
295
|
-
skippedIds: []
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
let a = e.slice(0, r), o = await Me(a, i, (e) => t([e]));
|
|
299
|
-
return {
|
|
300
|
-
failedIds: a.filter((e, t) => o[t].status === "rejected"),
|
|
301
|
-
profiles: o.flatMap((e) => e.status === "fulfilled" ? e.value : []),
|
|
302
|
-
skippedIds: e.slice(r)
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
function je(e, t) {
|
|
306
|
-
return e.filter((e) => !t.has(e));
|
|
307
|
-
}
|
|
308
|
-
async function Me(e, t, n) {
|
|
309
|
-
let r = [], i = 0;
|
|
310
|
-
async function a() {
|
|
311
|
-
for (; i < e.length;) {
|
|
312
|
-
let t = i;
|
|
313
|
-
i += 1, r[t] = await n(e[t]).then((e) => ({
|
|
314
|
-
status: "fulfilled",
|
|
315
|
-
value: e
|
|
316
|
-
}), (e) => ({
|
|
317
|
-
reason: e,
|
|
318
|
-
status: "rejected"
|
|
319
|
-
}));
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
return await Promise.all(Array.from({ length: Math.min(t, e.length) }, a)), r;
|
|
323
|
-
}
|
|
324
|
-
// src/views/forms/renderer/member-field-options.ts
|
|
325
|
-
var Ne = "未知會員";
|
|
326
|
-
function Pe(e) {
|
|
327
|
-
return {
|
|
328
|
-
id: e.memberId,
|
|
329
|
-
name: t(e.name, e.email)
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
function Fe(e) {
|
|
333
|
-
return {
|
|
334
|
-
id: e,
|
|
335
|
-
name: Ne,
|
|
336
|
-
unresolved: !0
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
function Ie(e, t) {
|
|
340
|
-
let n = new Map(t.filter((e) => !e.unresolved).map((e) => [e.id, e])), r = new Set(e.map((e) => e.id)), i = t.filter((e, n) => !r.has(e.id) && t.findIndex((t) => t.id === e.id) === n), a = e.map((e) => (e.unresolved ? n.get(e.id) : void 0) ?? e);
|
|
341
|
-
return i.length > 0 || a.some((t, n) => t !== e[n]) ? [...a, ...i] : e;
|
|
342
|
-
}
|
|
343
|
-
function Le(e, t) {
|
|
344
|
-
let n = new Set(t.filter((e) => !e.unresolved).map((e) => e.id));
|
|
345
|
-
return U(e).filter((e) => !n.has(e));
|
|
346
|
-
}
|
|
347
|
-
function Re(e, t) {
|
|
348
|
-
return U(e).map((e) => t.find((t) => t.id === e) ?? Fe(e));
|
|
349
|
-
}
|
|
350
|
-
function ze(e, t) {
|
|
351
|
-
if (e.length !== 0) return t ? e.map((e) => e.id) : e[0]?.id;
|
|
352
|
-
}
|
|
353
|
-
// src/views/forms/renderer/member-field.tsx
|
|
354
|
-
function Be({ multiple: e, name: t, onChange: n, placeholder: i, readonly: c, size: l, value: u }) {
|
|
355
|
-
let [d, f] = o([]), [p, m] = o([]), [h, g] = o(!1), _ = a(0), v = a(/* @__PURE__ */ new Set()), y = Le(u, d).join("\n");
|
|
356
|
-
r(() => {
|
|
357
|
-
let e = je(y ? y.split("\n") : [], v.current), t = !1;
|
|
358
|
-
return e.length === 0 ? () => void 0 : (Q(e, b).then(({ profiles: n, skippedIds: r }) => {
|
|
359
|
-
if (t) return;
|
|
360
|
-
let i = n.map(Pe), a = e.filter((e) => !i.some((t) => t.id === e)).map(Fe);
|
|
361
|
-
a.filter((e) => !r.includes(e.id)).forEach((e) => v.current.add(e.id)), f((e) => Ie(e, [...i, ...a]));
|
|
362
|
-
}), () => {
|
|
363
|
-
t = !0;
|
|
364
|
-
});
|
|
365
|
-
}, [y]);
|
|
366
|
-
async function C(e) {
|
|
367
|
-
let t = _.current + 1;
|
|
368
|
-
_.current = t, g(!0);
|
|
369
|
-
try {
|
|
370
|
-
let n = (await x(e)).map(Pe);
|
|
371
|
-
_.current === t && (m(n), f((e) => Ie(e, n)));
|
|
372
|
-
} catch {
|
|
373
|
-
_.current === t && m([]);
|
|
374
|
-
} finally {
|
|
375
|
-
_.current === t && g(!1);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
let w = Re(u, d), T = [...Ie(w, p)], E = {
|
|
379
|
-
asyncData: !0,
|
|
380
|
-
clearSearchText: !0,
|
|
381
|
-
disabled: c,
|
|
382
|
-
disabledOptionsFilter: !0,
|
|
383
|
-
emptyText: "沒有符合的成員",
|
|
384
|
-
globalPortal: !0,
|
|
385
|
-
inputProps: {
|
|
386
|
-
autoCapitalize: "none",
|
|
387
|
-
autoCorrect: "off",
|
|
388
|
-
name: t,
|
|
389
|
-
spellCheck: !1
|
|
390
|
-
},
|
|
391
|
-
loading: h,
|
|
392
|
-
loadingText: "搜尋成員中...",
|
|
393
|
-
onSearch: C,
|
|
394
|
-
onVisibilityChange: (e) => {
|
|
395
|
-
e && (m([]), C(""));
|
|
396
|
-
},
|
|
397
|
-
options: T,
|
|
398
|
-
placeholder: i ?? "搜尋姓名或信箱",
|
|
399
|
-
readOnly: c,
|
|
400
|
-
searchDebounceTime: 300,
|
|
401
|
-
size: l
|
|
402
|
-
};
|
|
403
|
-
return e ? /* @__PURE__ */ S(s, {
|
|
404
|
-
...E,
|
|
405
|
-
mode: "multiple",
|
|
406
|
-
onChange: (e) => n(ze(e, !0)),
|
|
407
|
-
value: [...w]
|
|
408
|
-
}) : /* @__PURE__ */ S(s, {
|
|
409
|
-
...E,
|
|
410
|
-
mode: "single",
|
|
411
|
-
onChange: (e) => n(ze(e ? [e] : [], !1)),
|
|
412
|
-
value: w[0] ?? null
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
// src/views/forms/renderer/org-unit-field-options.ts
|
|
416
|
-
var Ve = "未知組織", He = "(已刪除)";
|
|
417
|
-
function Ue(e) {
|
|
418
|
-
return {
|
|
419
|
-
id: e.id,
|
|
420
|
-
name: e.deleted ? `${e.name}${He}` : e.name
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
function We(e) {
|
|
424
|
-
return {
|
|
425
|
-
id: e,
|
|
426
|
-
name: e,
|
|
427
|
-
unresolved: !0
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
function Ge(e) {
|
|
431
|
-
return {
|
|
432
|
-
id: e,
|
|
433
|
-
name: Ve,
|
|
434
|
-
unresolved: !0
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
function Ke(e) {
|
|
438
|
-
return typeof e == "string" && e.trim() ? e : null;
|
|
439
|
-
}
|
|
440
|
-
function $(e) {
|
|
441
|
-
return e.toLowerCase();
|
|
442
|
-
}
|
|
443
|
-
function qe(e, t) {
|
|
444
|
-
return $(e) === $(t);
|
|
445
|
-
}
|
|
446
|
-
function Je(e, t) {
|
|
447
|
-
let n = Ke(e);
|
|
448
|
-
return n === null ? null : t.find((e) => qe(e.id, n)) ?? We(n);
|
|
449
|
-
}
|
|
450
|
-
function Ye(e, t) {
|
|
451
|
-
let n = Ke(e);
|
|
452
|
-
return n !== null && !t.some((e) => qe(e.id, n)) ? n : null;
|
|
453
|
-
}
|
|
454
|
-
function Xe(e, t) {
|
|
455
|
-
let n = new Map(t.filter((e) => !e.unresolved).map((e) => [$(e.id), e])), r = new Set(e.map((e) => $(e.id))), i = t.filter((e, n) => !r.has($(e.id)) && t.findIndex((t) => qe(t.id, e.id)) === n), a = e.map((e) => (e.unresolved ? n.get($(e.id)) : void 0) ?? e);
|
|
456
|
-
return i.length > 0 || a.some((t, n) => t !== e[n]) ? [...a, ...i] : e;
|
|
457
|
-
}
|
|
458
|
-
function Ze(e) {
|
|
459
|
-
return e ? e.id : void 0;
|
|
460
|
-
}
|
|
461
|
-
// src/views/forms/renderer/org-unit-field.tsx
|
|
462
|
-
var Qe = "搜尋組織失敗,請稍後再試。";
|
|
463
|
-
function $e({ name: e, onChange: t, placeholder: n, readonly: i, size: c, value: l }) {
|
|
464
|
-
let [u, d] = o([]), [f, p] = o([]), [m, h] = o(!1), [g, _] = o(!1), y = a(0), b = Ye(l, u);
|
|
465
|
-
r(() => {
|
|
466
|
-
let e = !1;
|
|
467
|
-
return b === null ? () => void 0 : (W([b]).then((e) => {
|
|
468
|
-
let t = e.map(Ue);
|
|
469
|
-
return t.some((e) => e.id.toLowerCase() === b.toLowerCase()) ? t : [...t, Ge(b)];
|
|
470
|
-
}).catch(() => [Ge(b)]).then((t) => {
|
|
471
|
-
e || d((e) => Xe(e, t));
|
|
472
|
-
}), () => {
|
|
473
|
-
e = !0;
|
|
474
|
-
});
|
|
475
|
-
}, [b]);
|
|
476
|
-
async function x(e) {
|
|
477
|
-
let t = y.current + 1;
|
|
478
|
-
y.current = t, h(!0);
|
|
479
|
-
try {
|
|
480
|
-
let n = (await G(e)).map(Ue);
|
|
481
|
-
y.current === t && (p(n), _(!1), d((e) => Xe(e, n)));
|
|
482
|
-
} catch {
|
|
483
|
-
y.current === t && (p([]), _(!0));
|
|
484
|
-
} finally {
|
|
485
|
-
y.current === t && h(!1);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
let w = Je(l, u), T = [...Xe(w ? [w] : [], f)];
|
|
489
|
-
return /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(s, {
|
|
490
|
-
asyncData: !0,
|
|
491
|
-
clearSearchText: !0,
|
|
492
|
-
disabled: i,
|
|
493
|
-
disabledOptionsFilter: !0,
|
|
494
|
-
emptyText: "沒有符合的組織",
|
|
495
|
-
globalPortal: !0,
|
|
496
|
-
inputProps: {
|
|
497
|
-
autoCapitalize: "none",
|
|
498
|
-
autoCorrect: "off",
|
|
499
|
-
name: e,
|
|
500
|
-
spellCheck: !1
|
|
501
|
-
},
|
|
502
|
-
loading: m,
|
|
503
|
-
loadingText: "搜尋組織中...",
|
|
504
|
-
mode: "single",
|
|
505
|
-
onChange: (e) => t(Ze(e ?? null)),
|
|
506
|
-
onSearch: x,
|
|
507
|
-
onVisibilityChange: (e) => {
|
|
508
|
-
e && (p([]), x(""));
|
|
509
|
-
},
|
|
510
|
-
options: T,
|
|
511
|
-
placeholder: n ?? "搜尋組織名稱",
|
|
512
|
-
readOnly: i,
|
|
513
|
-
searchDebounceTime: 300,
|
|
514
|
-
size: c,
|
|
515
|
-
value: w
|
|
516
|
-
}), g ? /* @__PURE__ */ S(v, {
|
|
517
|
-
color: "text-error",
|
|
518
|
-
variant: "caption",
|
|
519
|
-
children: Qe
|
|
520
|
-
}) : null] });
|
|
521
|
-
}
|
|
522
|
-
// src/views/forms/renderer/FormRendererView.tsx
|
|
523
|
-
var et = {
|
|
524
|
-
alignItems: "start",
|
|
525
|
-
display: "grid",
|
|
526
|
-
gap: 12,
|
|
527
|
-
gridTemplateColumns: "repeat(12, minmax(0, 1fr))"
|
|
528
|
-
}, tt = { gridColumn: "1 / -1" }, nt = {
|
|
529
|
-
alignItems: "start",
|
|
530
|
-
display: "grid",
|
|
531
|
-
gap: 8,
|
|
532
|
-
minWidth: 0
|
|
533
|
-
}, rt = {
|
|
534
|
-
minWidth: "100%",
|
|
535
|
-
width: "100%"
|
|
536
|
-
};
|
|
537
|
-
function it(e) {
|
|
538
|
-
e && (e.style.width = "100%");
|
|
539
|
-
}
|
|
540
|
-
function at({ 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 }) {
|
|
541
|
-
let [x, C] = o(() => E(g.fields, b ?? {})), w = i(() => E(g.fields, b ?? x), [
|
|
542
|
-
x,
|
|
543
|
-
g.fields,
|
|
544
|
-
b
|
|
545
|
-
]), T = a(w), D = i(() => ue(g, y, w).filter((e) => ot(c, e.fieldKey)?.visible !== !1), [
|
|
546
|
-
c,
|
|
547
|
-
g,
|
|
548
|
-
y,
|
|
549
|
-
w
|
|
550
|
-
]);
|
|
551
|
-
r(() => {
|
|
552
|
-
T.current = w;
|
|
553
|
-
}, [w]), r(() => {
|
|
554
|
-
C((e) => E(g.fields, b ?? e));
|
|
555
|
-
}, [g.fields, b]);
|
|
556
|
-
function ee(e, t) {
|
|
557
|
-
let n = {
|
|
558
|
-
...T.current,
|
|
559
|
-
[e]: t
|
|
560
|
-
};
|
|
561
|
-
T.current = n, b || C(n), d?.(n);
|
|
562
|
-
}
|
|
563
|
-
return D.length ? /* @__PURE__ */ S("div", {
|
|
564
|
-
style: {
|
|
565
|
-
...et,
|
|
566
|
-
..._ ? { width: "100%" } : {}
|
|
567
|
-
},
|
|
568
|
-
children: D.map((n) => /* @__PURE__ */ S(ct, {
|
|
569
|
-
dataSourceContext: e,
|
|
570
|
-
dataSourceInitialValues: t,
|
|
571
|
-
field: n,
|
|
572
|
-
error: s[n.fieldKey] ?? null,
|
|
573
|
-
errors: s,
|
|
574
|
-
fields: g.fields,
|
|
575
|
-
labelMarker: l !== void 0 && Object.prototype.hasOwnProperty.call(l, n.fieldKey) ? l[n.fieldKey] : void 0,
|
|
576
|
-
onChange: ee,
|
|
577
|
-
onDataSourceStateChange: f,
|
|
578
|
-
onUploadAttachment: p,
|
|
579
|
-
optionSnapshots: m,
|
|
580
|
-
readonly: st(ot(c, n.fieldKey), h),
|
|
581
|
-
schema: g,
|
|
582
|
-
style: {
|
|
583
|
-
...nt,
|
|
584
|
-
gridColumn: `span ${_ ? 12 : Ot(n, y)}`,
|
|
585
|
-
..._ && !me(n) ? { maxWidth: u } : {}
|
|
586
|
-
},
|
|
587
|
-
value: w[n.fieldKey],
|
|
588
|
-
values: w,
|
|
589
|
-
uiSchema: y
|
|
590
|
-
}, n.fieldKey))
|
|
591
|
-
}) : /* @__PURE__ */ S("div", {
|
|
592
|
-
style: et,
|
|
593
|
-
children: /* @__PURE__ */ S(v, {
|
|
594
|
-
color: "text-neutral",
|
|
595
|
-
style: tt,
|
|
596
|
-
variant: "body",
|
|
597
|
-
children: g.fields.length > 0 ? "目前條件下沒有可填寫欄位。" : n
|
|
598
|
-
})
|
|
599
|
-
});
|
|
600
|
-
}
|
|
601
|
-
function ot(e, t) {
|
|
602
|
-
return e !== void 0 && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
603
|
-
}
|
|
604
|
-
function st(e, t) {
|
|
605
|
-
return e === void 0 ? t : !e.editable;
|
|
606
|
-
}
|
|
607
|
-
function ct({ 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 }) {
|
|
608
|
-
let x = j(o, s, y), w = m || A(o, s, y), T = q({
|
|
609
|
-
context: t,
|
|
610
|
-
field: o,
|
|
611
|
-
formData: y,
|
|
612
|
-
initialFormData: n,
|
|
613
|
-
initialValue: n?.[o.fieldKey],
|
|
614
|
-
optionSnapshots: p,
|
|
615
|
-
readonly: w,
|
|
616
|
-
schema: h,
|
|
617
|
-
uiSchema: b
|
|
618
|
-
}), E = J(T), D = JSON.stringify({
|
|
619
|
-
hasValue: T.hasValue,
|
|
620
|
-
invalidValues: T.invalidValues,
|
|
621
|
-
status: T.status
|
|
622
|
-
});
|
|
623
|
-
return r(() => {
|
|
624
|
-
fe(o) && d?.(o.fieldKey, {
|
|
625
|
-
hasValue: T.hasValue,
|
|
626
|
-
invalidValues: T.invalidValues,
|
|
627
|
-
status: T.status
|
|
628
|
-
});
|
|
629
|
-
}, [
|
|
630
|
-
D,
|
|
631
|
-
o.fieldKey,
|
|
632
|
-
d
|
|
633
|
-
]), /* @__PURE__ */ C("div", {
|
|
634
|
-
"data-form-field-key": o.fieldKey,
|
|
635
|
-
style: g,
|
|
636
|
-
children: [
|
|
637
|
-
/* @__PURE__ */ S(e, {
|
|
638
|
-
label: o.label,
|
|
639
|
-
...l ? { labelOptionalMarker: l } : {},
|
|
640
|
-
name: o.fieldKey,
|
|
641
|
-
required: x,
|
|
642
|
-
children: me(o) ? /* @__PURE__ */ S(yt, {
|
|
643
|
-
dataSourceContext: t,
|
|
644
|
-
dataSourceInitialValues: n,
|
|
645
|
-
errors: a,
|
|
646
|
-
field: o,
|
|
647
|
-
onChange: u,
|
|
648
|
-
onDataSourceStateChange: d,
|
|
649
|
-
optionSnapshots: p,
|
|
650
|
-
readonly: w,
|
|
651
|
-
schema: h,
|
|
652
|
-
uiSchema: b,
|
|
653
|
-
value: _,
|
|
654
|
-
values: y
|
|
655
|
-
}) : Tt(o, _, w, u, f, t, T)
|
|
656
|
-
}),
|
|
657
|
-
i ? /* @__PURE__ */ S(v, {
|
|
658
|
-
color: "text-error",
|
|
659
|
-
variant: "caption",
|
|
660
|
-
children: i
|
|
661
|
-
}) : null,
|
|
662
|
-
E ? /* @__PURE__ */ C("div", {
|
|
663
|
-
style: ft,
|
|
664
|
-
children: [/* @__PURE__ */ S(v, {
|
|
665
|
-
color: T.status === "INVALID" || T.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
|
|
666
|
-
variant: "caption",
|
|
667
|
-
children: E
|
|
668
|
-
}), T.status === "UNAVAILABLE" && T.canRetry ? /* @__PURE__ */ S(c, {
|
|
669
|
-
onClick: T.retry,
|
|
670
|
-
size: "sub",
|
|
671
|
-
type: "button",
|
|
672
|
-
variant: "base-ghost",
|
|
673
|
-
children: "重試"
|
|
674
|
-
}) : null]
|
|
675
|
-
}) : null
|
|
676
|
-
]
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
var lt = "(另開新分頁)", ut = "另開新分頁", dt = {
|
|
680
|
-
color: "inherit",
|
|
681
|
-
textDecoration: "underline",
|
|
682
|
-
wordBreak: "break-all"
|
|
683
|
-
}, ft = {
|
|
684
|
-
alignItems: "center",
|
|
685
|
-
display: "flex",
|
|
686
|
-
gap: 8
|
|
687
|
-
}, pt = {
|
|
688
|
-
display: "grid",
|
|
689
|
-
gap: 8,
|
|
690
|
-
minWidth: 0,
|
|
691
|
-
width: "100%"
|
|
692
|
-
}, mt = {
|
|
693
|
-
display: "flex",
|
|
694
|
-
justifyContent: "flex-start"
|
|
695
|
-
}, ht = {
|
|
696
|
-
maxWidth: "100%",
|
|
697
|
-
overflowX: "auto"
|
|
698
|
-
}, gt = 160, _t = 56, vt = {
|
|
699
|
-
display: "grid",
|
|
700
|
-
gap: 4,
|
|
701
|
-
minWidth: 0
|
|
702
|
-
};
|
|
703
|
-
function yt({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field: i, onChange: s, onDataSourceStateChange: l, optionSnapshots: u, readonly: d, schema: f, uiSchema: p, value: m, values: g }) {
|
|
704
|
-
let _ = R(m), v = se(i), y = a(0), [b, x] = o(() => _.map(() => St(y)));
|
|
705
|
-
r(() => {
|
|
706
|
-
b.length !== _.length && x(_.map(() => St(y)));
|
|
707
|
-
}, [b.length, _.length]);
|
|
708
|
-
function E(e) {
|
|
709
|
-
s(i.fieldKey, e);
|
|
710
|
-
}
|
|
711
|
-
function D() {
|
|
712
|
-
x([...b, St(y)]), E([..._, ee(i.columns)]);
|
|
713
|
-
}
|
|
714
|
-
function O(e) {
|
|
715
|
-
x(b.filter((t, n) => n !== e)), E(_.filter((t, n) => n !== e));
|
|
716
|
-
}
|
|
717
|
-
function k(e, t, n) {
|
|
718
|
-
E(_.map((r, i) => i === e ? Ct(r, t, n) : r));
|
|
719
|
-
}
|
|
720
|
-
let A = _.map((e, t) => ({
|
|
721
|
-
...e,
|
|
722
|
-
index: t,
|
|
723
|
-
key: b[t] ?? `row-${t}`
|
|
724
|
-
})), j = i.columns.map((r) => ({
|
|
725
|
-
key: r.fieldKey,
|
|
726
|
-
render: (a) => /* @__PURE__ */ S(bt, {
|
|
727
|
-
column: r,
|
|
728
|
-
dataSourceContext: e,
|
|
729
|
-
error: n[L(i.fieldKey, a.index, r.fieldKey)] ?? null,
|
|
730
|
-
fieldPath: `${i.fieldKey}.${r.fieldKey}`,
|
|
731
|
-
formData: g,
|
|
732
|
-
initialFormData: t,
|
|
733
|
-
initialRowValues: xt(t?.[i.fieldKey], a.index),
|
|
734
|
-
onChange: (e) => k(a.index, r.fieldKey, e),
|
|
735
|
-
onDataSourceStateChange: l,
|
|
736
|
-
optionSnapshots: u,
|
|
737
|
-
path: L(i.fieldKey, a.index, r.fieldKey),
|
|
738
|
-
readonly: d,
|
|
739
|
-
rowValues: _[a.index] ?? {},
|
|
740
|
-
schema: f,
|
|
741
|
-
uiSchema: p
|
|
742
|
-
}, `${b[a.index] ?? a.index}-${r.fieldKey}`),
|
|
743
|
-
title: r.label || r.fieldKey
|
|
744
|
-
})), M = d ? void 0 : {
|
|
745
|
-
render: (e) => [{
|
|
746
|
-
disabled: () => _.length <= v.minRows,
|
|
747
|
-
icon: T,
|
|
748
|
-
iconType: "icon-only",
|
|
749
|
-
name: "刪除此列",
|
|
750
|
-
onClick: () => O(e.index),
|
|
751
|
-
variant: "destructive-ghost"
|
|
752
|
-
}],
|
|
753
|
-
width: 56
|
|
754
|
-
};
|
|
755
|
-
return /* @__PURE__ */ C("div", {
|
|
756
|
-
style: pt,
|
|
757
|
-
children: [/* @__PURE__ */ S("div", {
|
|
758
|
-
style: ht,
|
|
759
|
-
children: /* @__PURE__ */ S("div", {
|
|
760
|
-
style: { minWidth: i.columns.length * gt + (M ? _t : 0) },
|
|
761
|
-
children: /* @__PURE__ */ S(h, {
|
|
762
|
-
...M ? { actions: M } : {},
|
|
763
|
-
columns: j,
|
|
764
|
-
dataSource: [...A],
|
|
765
|
-
rowHeightPreset: "roomy",
|
|
766
|
-
showHeader: !0,
|
|
767
|
-
size: "sub"
|
|
768
|
-
})
|
|
769
|
-
})
|
|
770
|
-
}), d ? null : /* @__PURE__ */ S("div", {
|
|
771
|
-
style: mt,
|
|
772
|
-
children: /* @__PURE__ */ S(c, {
|
|
773
|
-
disabled: _.length >= v.maxRows,
|
|
774
|
-
icon: w,
|
|
775
|
-
iconType: "leading",
|
|
776
|
-
onClick: D,
|
|
777
|
-
size: "sub",
|
|
778
|
-
type: "button",
|
|
779
|
-
variant: "base-secondary",
|
|
780
|
-
children: i.addRowLabel || "新增一列"
|
|
781
|
-
})
|
|
782
|
-
})]
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
function bt({ 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 }) {
|
|
786
|
-
let _ = wt(m, e.fieldKey), y = q({
|
|
787
|
-
context: t,
|
|
788
|
-
field: e,
|
|
789
|
-
fieldPath: i,
|
|
790
|
-
formData: a,
|
|
791
|
-
initialFormData: o,
|
|
792
|
-
initialValue: s ? wt(s, e.fieldKey) : void 0,
|
|
793
|
-
optionSnapshots: d,
|
|
794
|
-
readonly: p,
|
|
795
|
-
row: {
|
|
796
|
-
initialValues: s,
|
|
797
|
-
values: m
|
|
798
|
-
},
|
|
799
|
-
schema: h,
|
|
800
|
-
snapshotKey: f,
|
|
801
|
-
uiSchema: g
|
|
802
|
-
}), b = J(y), x = JSON.stringify({
|
|
803
|
-
hasValue: y.hasValue,
|
|
804
|
-
invalidValues: y.invalidValues,
|
|
805
|
-
status: y.status
|
|
806
|
-
});
|
|
807
|
-
return r(() => {
|
|
808
|
-
if (fe(e)) return u?.(f, {
|
|
809
|
-
hasValue: y.hasValue,
|
|
810
|
-
invalidValues: y.invalidValues,
|
|
811
|
-
status: y.status
|
|
812
|
-
}), () => {
|
|
813
|
-
u?.(f, {
|
|
814
|
-
hasValue: !1,
|
|
815
|
-
invalidValues: [],
|
|
816
|
-
status: "IDLE"
|
|
817
|
-
});
|
|
818
|
-
};
|
|
819
|
-
}, [
|
|
820
|
-
u,
|
|
821
|
-
f,
|
|
822
|
-
x
|
|
823
|
-
]), /* @__PURE__ */ C("div", {
|
|
824
|
-
"data-form-field-key": f,
|
|
825
|
-
style: vt,
|
|
826
|
-
children: [
|
|
827
|
-
Tt(e, _, p, (e, t) => l(t), void 0, t, y, "sub"),
|
|
828
|
-
n ? /* @__PURE__ */ S(v, {
|
|
829
|
-
color: "text-error",
|
|
830
|
-
variant: "caption",
|
|
831
|
-
children: n
|
|
832
|
-
}) : null,
|
|
833
|
-
b ? /* @__PURE__ */ C("div", {
|
|
834
|
-
style: ft,
|
|
835
|
-
children: [/* @__PURE__ */ S(v, {
|
|
836
|
-
color: y.status === "INVALID" || y.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
|
|
837
|
-
variant: "caption",
|
|
838
|
-
children: b
|
|
839
|
-
}), y.status === "UNAVAILABLE" && y.canRetry ? /* @__PURE__ */ S(c, {
|
|
840
|
-
onClick: y.retry,
|
|
841
|
-
size: "sub",
|
|
842
|
-
type: "button",
|
|
843
|
-
variant: "base-ghost",
|
|
844
|
-
children: "重試"
|
|
845
|
-
}) : null]
|
|
846
|
-
}) : null
|
|
847
|
-
]
|
|
848
|
-
});
|
|
849
|
-
}
|
|
850
|
-
function xt(e, t) {
|
|
851
|
-
return R(e)[t];
|
|
852
|
-
}
|
|
853
|
-
function St(e) {
|
|
854
|
-
return e.current += 1, `table-row-${e.current}`;
|
|
855
|
-
}
|
|
856
|
-
function Ct(e, t, n) {
|
|
857
|
-
return n === void 0 || !V(n) ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)) : {
|
|
858
|
-
...e,
|
|
859
|
-
[t]: n
|
|
860
|
-
};
|
|
861
|
-
}
|
|
862
|
-
function wt(e, t) {
|
|
863
|
-
if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
864
|
-
}
|
|
865
|
-
function Tt(e, t, n, r, i, a, o, s = "main") {
|
|
866
|
-
return fe(e) ? Dt(e, t, n, r, a, o, s) : Et(e, t, n, r, i, s);
|
|
867
|
-
}
|
|
868
|
-
function Et(e, t, n, r, i, a = "main") {
|
|
869
|
-
let o = n && (e.type === "text" || e.type === "textarea") && e.displayAs === "link" ? Oe(t) : null;
|
|
870
|
-
if (o) return /* @__PURE__ */ S(v, {
|
|
871
|
-
color: "text-brand",
|
|
872
|
-
component: "span",
|
|
873
|
-
variant: "body",
|
|
874
|
-
children: /* @__PURE__ */ S("a", {
|
|
875
|
-
href: o.href,
|
|
876
|
-
style: dt,
|
|
877
|
-
...o.external ? {
|
|
878
|
-
"aria-label": `${o.href}${lt}`,
|
|
879
|
-
rel: "noopener noreferrer",
|
|
880
|
-
target: "_blank",
|
|
881
|
-
title: ut
|
|
882
|
-
} : {},
|
|
883
|
-
children: o.href
|
|
884
|
-
})
|
|
885
|
-
});
|
|
886
|
-
if (e.type === "textarea") return /* @__PURE__ */ S(g, {
|
|
887
|
-
onChange: (t) => r(e.fieldKey, t.target.value),
|
|
888
|
-
placeholder: e.placeholder ?? "請輸入多行文字",
|
|
889
|
-
readOnly: n,
|
|
890
|
-
ref: it,
|
|
891
|
-
rows: 3,
|
|
892
|
-
style: rt,
|
|
893
|
-
value: kt(t)
|
|
894
|
-
});
|
|
895
|
-
if (e.type === "boolean") return /* @__PURE__ */ S(_, {
|
|
896
|
-
checked: t === !0,
|
|
897
|
-
disabled: n,
|
|
898
|
-
label: "啟用",
|
|
899
|
-
onChange: (t) => r(e.fieldKey, t.target.checked),
|
|
900
|
-
size: a
|
|
901
|
-
});
|
|
902
|
-
if (pe(e) && e.type === "checkbox") {
|
|
903
|
-
let i = e.options.map(F);
|
|
904
|
-
return /* @__PURE__ */ S(m, {
|
|
905
|
-
mode: "multiple",
|
|
906
|
-
onChange: (t) => r(e.fieldKey, t?.length ? t.map((e) => e.id) : void 0),
|
|
907
|
-
options: i,
|
|
908
|
-
placeholder: e.placeholder ?? "請選擇一或多個選項",
|
|
909
|
-
readOnly: n,
|
|
910
|
-
size: a,
|
|
911
|
-
value: i.filter((e) => At(t).includes(e.id))
|
|
912
|
-
});
|
|
913
|
-
}
|
|
914
|
-
if (pe(e)) {
|
|
915
|
-
let i = e.options.map(F);
|
|
916
|
-
return /* @__PURE__ */ S(m, {
|
|
917
|
-
onChange: (t) => r(e.fieldKey, t?.id ?? void 0),
|
|
918
|
-
options: i,
|
|
919
|
-
placeholder: e.placeholder ?? "請選擇",
|
|
920
|
-
readOnly: n,
|
|
921
|
-
size: a,
|
|
922
|
-
value: B(i, kt(t))
|
|
923
|
-
});
|
|
924
|
-
}
|
|
925
|
-
return e.type === "member" ? /* @__PURE__ */ S(Be, {
|
|
926
|
-
multiple: e.multiple === !0,
|
|
927
|
-
name: e.fieldKey,
|
|
928
|
-
onChange: (t) => r(e.fieldKey, t),
|
|
929
|
-
placeholder: e.placeholder,
|
|
930
|
-
readonly: n,
|
|
931
|
-
size: a,
|
|
932
|
-
value: t
|
|
933
|
-
}) : e.type === "org_unit" ? /* @__PURE__ */ S($e, {
|
|
934
|
-
name: e.fieldKey,
|
|
935
|
-
onChange: (t) => r(e.fieldKey, t),
|
|
936
|
-
placeholder: e.placeholder ?? Mt(e.type),
|
|
937
|
-
readonly: n,
|
|
938
|
-
size: a,
|
|
939
|
-
value: t
|
|
940
|
-
}) : e.type === "file_upload" ? /* @__PURE__ */ S(y, {
|
|
941
|
-
accept: e.acceptedMimeTypes?.join(","),
|
|
942
|
-
disabled: n,
|
|
943
|
-
maxFiles: e.maxFiles,
|
|
944
|
-
mode: "button-list",
|
|
945
|
-
...(e.maxFiles ?? 1) > 1 ? { multiple: !0 } : {},
|
|
946
|
-
onChange: (t) => r(e.fieldKey, t.length ? t.map((e) => e.id) : void 0),
|
|
947
|
-
onUpload: async (t) => Promise.all(t.map(async (t) => ({
|
|
948
|
-
file: t,
|
|
949
|
-
id: (i ? await i(e, t) : { id: `${t.name}-${t.lastModified}` }).id,
|
|
950
|
-
progress: 100,
|
|
951
|
-
status: "done"
|
|
952
|
-
}))),
|
|
953
|
-
size: "sub"
|
|
954
|
-
}) : e.type === "date" ? /* @__PURE__ */ S(u, {
|
|
955
|
-
format: "YYYY-MM-DD",
|
|
956
|
-
fullWidth: !0,
|
|
957
|
-
onChange: (t) => r(e.fieldKey, O(t)),
|
|
958
|
-
placeholder: e.placeholder ?? Mt(e.type),
|
|
959
|
-
readOnly: n,
|
|
960
|
-
value: P(t)
|
|
961
|
-
}) : e.type === "datetime" ? /* @__PURE__ */ S(d, {
|
|
962
|
-
formatDate: "YYYY-MM-DD",
|
|
963
|
-
formatTime: "HH:mm",
|
|
964
|
-
fullWidth: !0,
|
|
965
|
-
hideSecond: !0,
|
|
966
|
-
onChange: (t) => r(e.fieldKey, k(t)),
|
|
967
|
-
placeholderLeft: "選擇日期",
|
|
968
|
-
placeholderRight: "選擇時間",
|
|
969
|
-
readOnly: n,
|
|
970
|
-
value: P(t)
|
|
971
|
-
}) : e.type === "number" || e.type === "money" ? /* @__PURE__ */ S(f, {
|
|
972
|
-
fullWidth: !0,
|
|
973
|
-
max: e.maximum,
|
|
974
|
-
min: e.minimum,
|
|
975
|
-
size: a,
|
|
976
|
-
onChange: (t) => r(e.fieldKey, D(N(t.target.value), {
|
|
977
|
-
max: e.maximum,
|
|
978
|
-
min: e.minimum
|
|
979
|
-
})),
|
|
980
|
-
placeholder: e.placeholder ?? Mt(e.type),
|
|
981
|
-
...n ? { readonly: !0 } : {},
|
|
982
|
-
showSpinner: !0,
|
|
983
|
-
value: jt(t),
|
|
984
|
-
variant: "measure"
|
|
985
|
-
}) : /* @__PURE__ */ S(f, {
|
|
986
|
-
fullWidth: !0,
|
|
987
|
-
onChange: (t) => r(e.fieldKey, t.target.value),
|
|
988
|
-
placeholder: e.placeholder ?? Mt(e.type),
|
|
989
|
-
...n ? { readonly: !0 } : {},
|
|
990
|
-
size: a,
|
|
991
|
-
value: kt(t),
|
|
992
|
-
variant: "base"
|
|
993
|
-
});
|
|
994
|
-
}
|
|
995
|
-
function Dt(e, t, n, r, i, a, o = "main") {
|
|
996
|
-
let c = a.options.map(F), u = le(t, a.options).map(F), d = a.status === "LOADING", f = a.status === "WAITING_FOR_DEPENDENCIES", h = !!i && !n, g = n || f, _ = n;
|
|
997
|
-
return e.type === "autocomplete" ? H(e) === "multiple" ? /* @__PURE__ */ S(s, {
|
|
998
|
-
asyncData: h,
|
|
999
|
-
clearSearchText: !0,
|
|
1000
|
-
disabled: _,
|
|
1001
|
-
disabledOptionsFilter: h,
|
|
1002
|
-
globalPortal: !0,
|
|
1003
|
-
loading: d,
|
|
1004
|
-
mode: "multiple",
|
|
1005
|
-
onChange: (t) => r(e.fieldKey, t.length ? t.map((e) => e.id) : void 0),
|
|
1006
|
-
onReachBottom: a.hasNextPage ? a.onReachBottom : void 0,
|
|
1007
|
-
onSearch: h ? a.onSearch : void 0,
|
|
1008
|
-
options: c,
|
|
1009
|
-
placeholder: e.placeholder ?? "請輸入或選擇",
|
|
1010
|
-
readOnly: n,
|
|
1011
|
-
searchDebounceTime: 300,
|
|
1012
|
-
size: o,
|
|
1013
|
-
value: u
|
|
1014
|
-
}) : /* @__PURE__ */ S(s, {
|
|
1015
|
-
asyncData: h,
|
|
1016
|
-
clearSearchText: !0,
|
|
1017
|
-
disabled: _,
|
|
1018
|
-
disabledOptionsFilter: h,
|
|
1019
|
-
globalPortal: !0,
|
|
1020
|
-
loading: d,
|
|
1021
|
-
mode: "single",
|
|
1022
|
-
onChange: (t) => r(e.fieldKey, t?.id ?? void 0),
|
|
1023
|
-
onReachBottom: a.hasNextPage ? a.onReachBottom : void 0,
|
|
1024
|
-
onSearch: h ? a.onSearch : void 0,
|
|
1025
|
-
options: c,
|
|
1026
|
-
placeholder: e.placeholder ?? "請輸入或選擇",
|
|
1027
|
-
readOnly: n,
|
|
1028
|
-
searchDebounceTime: 300,
|
|
1029
|
-
size: o,
|
|
1030
|
-
value: u[0] ?? null
|
|
1031
|
-
}) : e.type === "radio" ? /* @__PURE__ */ S(p, {
|
|
1032
|
-
disabled: g,
|
|
1033
|
-
name: e.fieldKey,
|
|
1034
|
-
onChange: (t) => r(e.fieldKey, t.target.value || void 0),
|
|
1035
|
-
options: c,
|
|
1036
|
-
value: kt(t)
|
|
1037
|
-
}) : e.type === "checkbox" ? /* @__PURE__ */ S(l, {
|
|
1038
|
-
disabled: g,
|
|
1039
|
-
name: e.fieldKey,
|
|
1040
|
-
onChange: (t) => r(e.fieldKey, t.target.values.length ? t.target.values : void 0),
|
|
1041
|
-
options: c.map((e) => ({
|
|
1042
|
-
label: e.name,
|
|
1043
|
-
value: e.id
|
|
1044
|
-
})),
|
|
1045
|
-
value: [...At(t)]
|
|
1046
|
-
}) : H(e) === "multiple" ? /* @__PURE__ */ S(m, {
|
|
1047
|
-
disabled: g,
|
|
1048
|
-
loading: d,
|
|
1049
|
-
mode: "multiple",
|
|
1050
|
-
onChange: (t) => r(e.fieldKey, t.length ? t.map((e) => e.id) : void 0),
|
|
1051
|
-
onReachBottom: a.hasNextPage ? a.onReachBottom : void 0,
|
|
1052
|
-
options: c,
|
|
1053
|
-
placeholder: e.placeholder ?? "請選擇一或多個選項",
|
|
1054
|
-
readOnly: n,
|
|
1055
|
-
size: o,
|
|
1056
|
-
value: u
|
|
1057
|
-
}) : /* @__PURE__ */ S(m, {
|
|
1058
|
-
disabled: g,
|
|
1059
|
-
loading: d,
|
|
1060
|
-
onChange: (t) => r(e.fieldKey, t?.id ?? void 0),
|
|
1061
|
-
onReachBottom: a.hasNextPage ? a.onReachBottom : void 0,
|
|
1062
|
-
options: c,
|
|
1063
|
-
placeholder: e.placeholder ?? "請選擇",
|
|
1064
|
-
readOnly: n,
|
|
1065
|
-
size: o,
|
|
1066
|
-
value: u[0] ?? null
|
|
1067
|
-
});
|
|
1068
|
-
}
|
|
1069
|
-
function Ot(e, t) {
|
|
1070
|
-
return {
|
|
1071
|
-
FULL: 12,
|
|
1072
|
-
HALF: 6,
|
|
1073
|
-
THIRD: 4
|
|
1074
|
-
}[t.layout.find((t) => t.fieldKey === e.fieldKey)?.width ?? "FULL"];
|
|
1075
|
-
}
|
|
1076
|
-
function kt(e) {
|
|
1077
|
-
return typeof e == "string" ? e : "";
|
|
1078
|
-
}
|
|
1079
|
-
function At(e) {
|
|
1080
|
-
return Array.isArray(e) && e.every((e) => typeof e == "string") ? e : [];
|
|
1081
|
-
}
|
|
1082
|
-
function jt(e) {
|
|
1083
|
-
return typeof e == "number" ? String(e) : "";
|
|
1084
|
-
}
|
|
1085
|
-
function Mt(e) {
|
|
1086
|
-
return {
|
|
1087
|
-
boolean: "",
|
|
1088
|
-
autocomplete: "請輸入或選擇",
|
|
1089
|
-
checkbox: "請選擇一或多個選項",
|
|
1090
|
-
date: "請選擇日期",
|
|
1091
|
-
datetime: "請選擇日期與時間",
|
|
1092
|
-
file_upload: "請上傳附件",
|
|
1093
|
-
member: "搜尋姓名或信箱",
|
|
1094
|
-
money: "請輸入金額",
|
|
1095
|
-
number: "請輸入數字",
|
|
1096
|
-
org_unit: "搜尋組織名稱",
|
|
1097
|
-
radio: "請選擇一個選項",
|
|
1098
|
-
select: "請選擇一個選項",
|
|
1099
|
-
table: "",
|
|
1100
|
-
text: "請輸入文字",
|
|
1101
|
-
textarea: "請輸入多行文字"
|
|
1102
|
-
}[e];
|
|
1103
|
-
}
|
|
1104
|
-
export { Y as a, q as c, Q as i, Ue as n, J as o, je as r, X as s, at as t };
|
|
1105
|
-
|
|
1106
|
-
//# sourceMappingURL=FormRendererView-CTLlG13b.js.map
|