@rytass/bpm-core-react 0.20.1 → 0.21.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 +34 -0
- package/README.md +1 -1
- package/dist/approval-instance-list-page.css +1 -1
- package/dist/chunks/FormBuilderView-DjPGrOJ2.cjs +4 -0
- package/dist/chunks/FormBuilderView-DjPGrOJ2.cjs.map +1 -0
- package/dist/chunks/{FormBuilderView-CFRiw04B.js → FormBuilderView-WtC2iW5f.js} +667 -584
- package/dist/chunks/FormBuilderView-WtC2iW5f.js.map +1 -0
- package/dist/chunks/{FormRendererView-lYSaR8CQ.cjs → FormRendererView-B-xycC9S.cjs} +3 -3
- package/dist/chunks/{FormRendererView-lYSaR8CQ.cjs.map → FormRendererView-B-xycC9S.cjs.map} +1 -1
- package/dist/chunks/{FormRendererView-GfbVWEGa.js → FormRendererView-BcQKUi1A.js} +238 -238
- package/dist/chunks/{FormRendererView-GfbVWEGa.js.map → FormRendererView-BcQKUi1A.js.map} +1 -1
- package/dist/chunks/approval-instance-list-page-Bth7Raya.js +724 -0
- package/dist/chunks/approval-instance-list-page-Bth7Raya.js.map +1 -0
- package/dist/chunks/approval-instance-list-page-Dcvo6TrT.cjs +2 -0
- package/dist/chunks/approval-instance-list-page-Dcvo6TrT.cjs.map +1 -0
- package/dist/chunks/{categories-DQUtVEiV.cjs → categories-CyyqG6wG.cjs} +2 -2
- package/dist/chunks/{categories-DQUtVEiV.cjs.map → categories-CyyqG6wG.cjs.map} +1 -1
- package/dist/chunks/{categories-BAdxjNSA.js → categories-f7E-RJEc.js} +9 -9
- package/dist/chunks/{categories-BAdxjNSA.js.map → categories-f7E-RJEc.js.map} +1 -1
- package/dist/chunks/{compose-Bb5bUVFd.cjs → compose-BKUTsB2W.cjs} +2 -2
- package/dist/chunks/{compose-Bb5bUVFd.cjs.map → compose-BKUTsB2W.cjs.map} +1 -1
- package/dist/chunks/{compose-egQlRjuZ.js → compose-DZvIspW3.js} +4 -4
- package/dist/chunks/{compose-egQlRjuZ.js.map → compose-DZvIspW3.js.map} +1 -1
- package/dist/chunks/{delegations-CVmtpkRn.cjs → delegations-ClRCwD1I.cjs} +2 -2
- package/dist/chunks/{delegations-CVmtpkRn.cjs.map → delegations-ClRCwD1I.cjs.map} +1 -1
- package/dist/chunks/{delegations-9-yvWWws.js → delegations-CqND-Qtz.js} +5 -5
- package/dist/chunks/{delegations-9-yvWWws.js.map → delegations-CqND-Qtz.js.map} +1 -1
- package/dist/chunks/{delegations-CrfjsH94.cjs → delegations-D43VDSz1.cjs} +2 -2
- package/dist/chunks/{delegations-CrfjsH94.cjs.map → delegations-D43VDSz1.cjs.map} +1 -1
- package/dist/chunks/{delegations-CxnNvTCc.js → delegations-zisffLwk.js} +5 -5
- package/dist/chunks/{delegations-CxnNvTCc.js.map → delegations-zisffLwk.js.map} +1 -1
- package/dist/chunks/{designer-CZDlQ9Nf.js → designer-CWubIE69.js} +1425 -1412
- package/dist/chunks/designer-CWubIE69.js.map +1 -0
- package/dist/chunks/designer-C_m8DmMl.cjs +69 -0
- package/dist/chunks/designer-C_m8DmMl.cjs.map +1 -0
- package/dist/chunks/{detail-ByZV1XaI.js → detail-Bv90gvy0.js} +578 -577
- package/dist/chunks/detail-Bv90gvy0.js.map +1 -0
- package/dist/chunks/detail-DNzqesdI.cjs +5 -0
- package/dist/chunks/detail-DNzqesdI.cjs.map +1 -0
- package/dist/chunks/instance-error-message-BW464LRQ.cjs +2 -0
- package/dist/chunks/instance-error-message-BW464LRQ.cjs.map +1 -0
- package/dist/chunks/instance-error-message-CAP1vJhX.js +204 -0
- package/dist/chunks/instance-error-message-CAP1vJhX.js.map +1 -0
- package/dist/components/approval-instance-field-filter-controls.d.cts +12 -0
- package/dist/components/approval-instance-field-filter-controls.d.ts +12 -0
- package/dist/components/approval-instance-field-filters.d.cts +86 -0
- package/dist/components/approval-instance-field-filters.d.ts +86 -0
- package/dist/components/approval-instance-list-page.d.cts +4 -0
- package/dist/components/approval-instance-list-page.d.ts +4 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/next/workflow-chat-route.cjs +2 -2
- package/dist/next/workflow-chat-route.cjs.map +1 -1
- package/dist/next/workflow-chat-route.js +13 -13
- 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/categories/index.cjs +1 -1
- package/dist/pages/templates/categories/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/admin/webhook-endpoints/index.cjs +1 -1
- package/dist/views/admin/webhook-endpoints/index.cjs.map +1 -1
- package/dist/views/admin/webhook-endpoints/index.js +60 -60
- package/dist/views/admin/webhook-endpoints/index.js.map +1 -1
- package/dist/views/cc/index.cjs +1 -1
- package/dist/views/cc/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/FormBuilderView.d.cts +8 -1
- package/dist/views/forms/builder/FormBuilderView.d.ts +8 -1
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/renderer/index.cjs +1 -1
- package/dist/views/forms/renderer/index.js +1 -1
- package/dist/views/instances/approver-filled-form.d.cts +8 -5
- package/dist/views/instances/approver-filled-form.d.ts +8 -5
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +2 -1
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +2 -1
- 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 +8 -8
- package/dist/views/instances/new/index.js.map +1 -1
- package/dist/views/search/index.cjs +1 -1
- package/dist/views/search/index.js +1 -1
- package/dist/views/sent/index.cjs +1 -1
- package/dist/views/sent/index.js +1 -1
- package/dist/views/templates/categories/index.cjs +1 -1
- package/dist/views/templates/categories/index.js +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/NotifyWebhookTargetsEditor.d.cts +2 -0
- package/dist/views/templates/designer/NotifyWebhookTargetsEditor.d.ts +2 -0
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/dist/views/templates/index.cjs +1 -1
- package/dist/views/templates/index.cjs.map +1 -1
- package/dist/views/templates/index.js +7 -7
- package/package.json +3 -3
- package/dist/chunks/FormBuilderView-CFRiw04B.js.map +0 -1
- package/dist/chunks/FormBuilderView-CpUgbSbt.cjs +0 -3
- package/dist/chunks/FormBuilderView-CpUgbSbt.cjs.map +0 -1
- package/dist/chunks/approval-instance-list-page-BnI4t5mD.js +0 -279
- package/dist/chunks/approval-instance-list-page-BnI4t5mD.js.map +0 -1
- package/dist/chunks/approval-instance-list-page-fqvmkBlg.cjs +0 -2
- package/dist/chunks/approval-instance-list-page-fqvmkBlg.cjs.map +0 -1
- package/dist/chunks/designer-CX9bhYJS.cjs +0 -69
- package/dist/chunks/designer-CX9bhYJS.cjs.map +0 -1
- package/dist/chunks/designer-CZDlQ9Nf.js.map +0 -1
- package/dist/chunks/detail-ByZV1XaI.js.map +0 -1
- package/dist/chunks/detail-ChseSF55.cjs +0 -5
- package/dist/chunks/detail-ChseSF55.cjs.map +0 -1
- package/dist/chunks/instance-error-message-DTARGbGo.cjs +0 -2
- package/dist/chunks/instance-error-message-DTARGbGo.cjs.map +0 -1
- package/dist/chunks/instance-error-message-q6gy5evy.js +0 -120
- package/dist/chunks/instance-error-message-q6gy5evy.js.map +0 -1
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "./bpm-form-field-9B-Det0u.js";
|
|
3
|
-
import { t } from "./FormRendererView-
|
|
3
|
+
import { t } from "./FormRendererView-BcQKUi1A.js";
|
|
4
4
|
import { useEffect as n, useMemo as r, useState as i } from "react";
|
|
5
|
-
import { Accordion as a, Badge as o, BaseCard as s, Button as c, DatePicker as l, DateTimePicker as u, Icon as d, Input as f, Modal as
|
|
5
|
+
import { Accordion as a, Badge as o, BaseCard as s, Button as c, DatePicker as l, DateTimePicker as u, Icon as d, InlineMessage as ee, Input as f, Modal as te, Section as ne, SectionGroup as re, Select as p, Tab as ie, TabItem as ae, Table as oe, Tag as se, Textarea as ce, Toggle as m, Typography as h } from "@mezzanine-ui/react";
|
|
6
6
|
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
7
|
+
import { listFilterableFieldIssues as le } from "@rytass/bpm-core-client/workflow";
|
|
8
|
+
import { FormFieldLayout as ue } from "@mezzanine-ui/core/form";
|
|
9
|
+
import { parseFormBindingExpressionLintLine as de, readFormBindingExpressionLintMessage as fe } from "@rytass/bpm-core-client/template";
|
|
10
|
+
import { readFilterableFieldPaths as pe } from "@rytass/bpm-core-shared";
|
|
11
|
+
import { buildConditionExpression as me, buildFormRendererValues as he, clampOptionalNumber as ge, createFieldDefinition as _e, createTableColumnDefinition as ve, formatDatePickerValue as ye, formatDateTimePickerValue as be, isDateFieldDefinition as xe, isFormDataSourceDescriptorCompatible as Se, isNumberFieldDefinition as Ce, isSelectFieldDefinition as we, lintFormSchema as Te, listFormDataSources as Ee, parseConditionRule as De, parseOptionalNumberInput as Oe, readCompatibleFormDataSourceBindingFields as ke, readCompatibleFormDataSourceDescriptors as Ae, readCompatibleFormTableColumnBindingFields as je, readConditionOperatorOption as Me, readConditionOperatorOptions as Ne, readDatePickerValue as Pe, readDefaultConditionOperator as Fe, readDefaultConditionValue as Ie, readFieldOptionAsSelectOption as Le, readFormDataSourceBinding as y, readFormDataSourceBindingExpression as Re, readFormDataSourceBindingValue as ze, readFormDataSourceBindingValueKind as Be, readFormDataSourceFieldDependencyKeys as Ve, readFormSchemaLintMessage as He, readFormTableRowBounds as Ue, readSelectOption as b, renameFormDataSourceFieldBindings as We, renameFormTableColumnBindings as Ge, upsertFormDataSourceFieldBinding as Ke } from "@rytass/bpm-core-client/form";
|
|
12
|
+
import { AlignLeftIcon as qe, CalendarIcon as Je, CheckedIcon as Ye, CheckedOutlineIcon as Xe, CurrencyDollarIcon as Ze, DotDragVerticalIcon as Qe, DotGridIcon as $e, FileAttachmentIcon as x, FileIcon as S, FolderIcon as C, ListIcon as w, PlusIcon as et, TrashIcon as tt, UserIcon as nt } from "@mezzanine-ui/icons";
|
|
13
|
+
import { FORM_TABLE_MAX_ROWS as rt, TEXT_FIELD_PATTERN_ERROR_MESSAGE_MAX_LENGTH as T, TEXT_FIELD_PATTERN_MAX_LENGTH as it, compileTextFieldPattern as E, hasRepeatedTextFieldPatternGroup as at, isFormDataSourceFieldDefinition as D, isFormOptionFieldDefinition as ot, isFormStaticOptionFieldDefinition as st, isMemberFieldDefinition as ct, isOrgUnitFieldDefinition as lt, isTableColumnFieldType as ut, isTableFieldDefinition as O, readFormFieldSelectionMode as dt } from "@rytass/bpm-core-shared/form";
|
|
14
|
+
import { DragDropContext as ft, Draggable as pt, Droppable as mt } from "@hello-pangea/dnd";
|
|
15
|
+
import ht from "next/dynamic";
|
|
16
|
+
import { json as k } from "@codemirror/lang-json";
|
|
17
|
+
import { EditorView as A } from "@codemirror/view";
|
|
16
18
|
// src/views/forms/builder/json-code-editor.tsx
|
|
17
|
-
var
|
|
19
|
+
var j = {
|
|
18
20
|
alignItems: "center",
|
|
19
21
|
border: "1px solid var(--mzn-color-border-neutral)",
|
|
20
22
|
borderRadius: 4,
|
|
@@ -23,10 +25,10 @@ var P = {
|
|
|
23
25
|
minHeight: 160,
|
|
24
26
|
padding: 12,
|
|
25
27
|
width: "100%"
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
}, gt = [
|
|
29
|
+
k(),
|
|
30
|
+
A.lineWrapping,
|
|
31
|
+
A.theme({
|
|
30
32
|
"&": {
|
|
31
33
|
border: "1px solid var(--mzn-color-border-neutral)",
|
|
32
34
|
borderRadius: "4px",
|
|
@@ -42,15 +44,15 @@ var P = {
|
|
|
42
44
|
".cm-gutters": { borderRight: "1px solid var(--mzn-color-border-neutral)" },
|
|
43
45
|
".cm-scroller": { fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", monospace" }
|
|
44
46
|
})
|
|
45
|
-
],
|
|
47
|
+
], M = ht(() => import("@uiw/react-codemirror"), {
|
|
46
48
|
loading: () => /* @__PURE__ */ _("div", {
|
|
47
|
-
style:
|
|
49
|
+
style: j,
|
|
48
50
|
children: "載入 JSON 編輯器"
|
|
49
51
|
}),
|
|
50
52
|
ssr: !1
|
|
51
53
|
});
|
|
52
|
-
function
|
|
53
|
-
return /* @__PURE__ */ _(
|
|
54
|
+
function _t({ disabled: e = !1, height: t, name: n, onChange: r, placeholder: i, value: a }) {
|
|
55
|
+
return /* @__PURE__ */ _(M, {
|
|
54
56
|
"aria-label": n,
|
|
55
57
|
basicSetup: {
|
|
56
58
|
autocompletion: !0,
|
|
@@ -64,7 +66,7 @@ function dt({ disabled: e = !1, height: t, name: n, onChange: r, placeholder: i,
|
|
|
64
66
|
syntaxHighlighting: !0
|
|
65
67
|
},
|
|
66
68
|
editable: !e,
|
|
67
|
-
extensions: [...
|
|
69
|
+
extensions: [...gt],
|
|
68
70
|
height: t,
|
|
69
71
|
indentWithTab: !1,
|
|
70
72
|
onChange: r,
|
|
@@ -76,46 +78,46 @@ function dt({ disabled: e = !1, height: t, name: n, onChange: r, placeholder: i,
|
|
|
76
78
|
});
|
|
77
79
|
}
|
|
78
80
|
// src/views/forms/builder/FormBuilderView.tsx
|
|
79
|
-
var
|
|
81
|
+
var vt = [
|
|
80
82
|
{
|
|
81
83
|
description: "單行文字、姓名、編號",
|
|
82
|
-
icon:
|
|
84
|
+
icon: qe,
|
|
83
85
|
label: "文字",
|
|
84
86
|
type: "text"
|
|
85
87
|
},
|
|
86
88
|
{
|
|
87
89
|
description: "多行補充內容",
|
|
88
|
-
icon:
|
|
90
|
+
icon: S,
|
|
89
91
|
label: "長文字",
|
|
90
92
|
type: "textarea"
|
|
91
93
|
},
|
|
92
94
|
{
|
|
93
95
|
description: "金額、數量、分數",
|
|
94
|
-
icon:
|
|
96
|
+
icon: Ze,
|
|
95
97
|
label: "數字",
|
|
96
98
|
type: "number"
|
|
97
99
|
},
|
|
98
100
|
{
|
|
99
101
|
description: "金額與費用",
|
|
100
|
-
icon:
|
|
102
|
+
icon: Ze,
|
|
101
103
|
label: "金額",
|
|
102
104
|
type: "money"
|
|
103
105
|
},
|
|
104
106
|
{
|
|
105
107
|
description: "日期或到期日",
|
|
106
|
-
icon:
|
|
108
|
+
icon: Je,
|
|
107
109
|
label: "日期",
|
|
108
110
|
type: "date"
|
|
109
111
|
},
|
|
110
112
|
{
|
|
111
113
|
description: "日期與時間",
|
|
112
|
-
icon:
|
|
114
|
+
icon: Je,
|
|
113
115
|
label: "日期時間",
|
|
114
116
|
type: "datetime"
|
|
115
117
|
},
|
|
116
118
|
{
|
|
117
119
|
description: "是 / 否狀態",
|
|
118
|
-
icon:
|
|
120
|
+
icon: Ye,
|
|
119
121
|
label: "開關",
|
|
120
122
|
type: "boolean"
|
|
121
123
|
},
|
|
@@ -133,100 +135,100 @@ var ft = [
|
|
|
133
135
|
},
|
|
134
136
|
{
|
|
135
137
|
description: "固定選項單選",
|
|
136
|
-
icon:
|
|
138
|
+
icon: $e,
|
|
137
139
|
label: "單選",
|
|
138
140
|
type: "radio"
|
|
139
141
|
},
|
|
140
142
|
{
|
|
141
143
|
description: "固定選項複選",
|
|
142
|
-
icon:
|
|
144
|
+
icon: Xe,
|
|
143
145
|
label: "複選",
|
|
144
146
|
type: "checkbox"
|
|
145
147
|
},
|
|
146
148
|
{
|
|
147
149
|
description: "附件或佐證資料",
|
|
148
|
-
icon:
|
|
150
|
+
icon: x,
|
|
149
151
|
label: "附件",
|
|
150
152
|
type: "file_upload"
|
|
151
153
|
},
|
|
152
154
|
{
|
|
153
155
|
description: "從成員名單挑選一或多位人員",
|
|
154
|
-
icon:
|
|
156
|
+
icon: nt,
|
|
155
157
|
label: "人員選擇",
|
|
156
158
|
type: "member"
|
|
157
159
|
},
|
|
158
160
|
{
|
|
159
161
|
description: "從組織圖挑選一個組織",
|
|
160
|
-
icon:
|
|
162
|
+
icon: C,
|
|
161
163
|
label: "組織選擇",
|
|
162
164
|
type: "org_unit"
|
|
163
165
|
},
|
|
164
166
|
{
|
|
165
167
|
description: "多列多欄明細",
|
|
166
|
-
icon:
|
|
168
|
+
icon: $e,
|
|
167
169
|
label: "表格",
|
|
168
170
|
type: "table"
|
|
169
171
|
}
|
|
170
|
-
],
|
|
172
|
+
], N = vt.filter((e) => ut(e.type)).map((e) => ({
|
|
171
173
|
id: e.type,
|
|
172
174
|
name: e.label
|
|
173
|
-
})),
|
|
175
|
+
})), yt = {
|
|
174
176
|
alignItems: "start",
|
|
175
177
|
display: "flex",
|
|
176
178
|
flexWrap: "wrap",
|
|
177
179
|
gap: 16
|
|
178
|
-
},
|
|
180
|
+
}, bt = {
|
|
179
181
|
flex: "0.55 1 300px",
|
|
180
182
|
minWidth: 0
|
|
181
|
-
},
|
|
183
|
+
}, xt = {
|
|
182
184
|
flex: "1.45 1 720px",
|
|
183
185
|
minWidth: 620,
|
|
184
186
|
paddingBottom: 260
|
|
185
|
-
},
|
|
187
|
+
}, St = 240, Ct = {
|
|
186
188
|
BOOLEAN: "開關",
|
|
187
189
|
NUMBER: "數字",
|
|
188
190
|
STRING: "文字或選單",
|
|
189
191
|
STRING_ARRAY: "多選"
|
|
190
|
-
},
|
|
192
|
+
}, wt = /^schema\.fields\[(\d+)\](?:\.columns\[(\d+)\])?\.dataSource\.bindings missing required parameter: (.+)$/u, Tt = /^schema\.fields\[(\d+)\](?:\.columns\[(\d+)\])?\.dataSource\.bindings unknown parameter: (.+)$/u, P = {
|
|
191
193
|
display: "grid",
|
|
192
194
|
gap: 12
|
|
193
|
-
},
|
|
195
|
+
}, Et = {
|
|
194
196
|
display: "flex",
|
|
195
197
|
flexWrap: "wrap",
|
|
196
198
|
gap: 6
|
|
197
|
-
},
|
|
199
|
+
}, Dt = {
|
|
198
200
|
flex: "0 0 auto",
|
|
199
201
|
whiteSpace: "nowrap"
|
|
200
|
-
},
|
|
202
|
+
}, Ot = {
|
|
201
203
|
display: "grid",
|
|
202
204
|
gap: 8
|
|
203
|
-
},
|
|
205
|
+
}, kt = {
|
|
204
206
|
alignItems: "center",
|
|
205
207
|
cursor: "grab",
|
|
206
208
|
display: "flex",
|
|
207
209
|
gap: 12,
|
|
208
210
|
touchAction: "none"
|
|
209
|
-
},
|
|
211
|
+
}, At = {
|
|
210
212
|
display: "grid",
|
|
211
213
|
flex: "1 1 auto",
|
|
212
214
|
gap: 2,
|
|
213
215
|
minWidth: 0
|
|
214
|
-
},
|
|
216
|
+
}, jt = {
|
|
215
217
|
alignItems: "center",
|
|
216
218
|
display: "flex",
|
|
217
219
|
flex: "0 0 auto",
|
|
218
220
|
gap: 4
|
|
219
|
-
},
|
|
221
|
+
}, Mt = {
|
|
220
222
|
alignItems: "center",
|
|
221
223
|
display: "flex",
|
|
222
224
|
gap: 6
|
|
223
|
-
},
|
|
225
|
+
}, Nt = {
|
|
224
226
|
cursor: "pointer",
|
|
225
227
|
userSelect: "none"
|
|
226
|
-
},
|
|
228
|
+
}, Pt = { filter: "drop-shadow(0 8px 18px rgba(0, 0, 0, 0.12))" }, Ft = {
|
|
227
229
|
backgroundColor: "color-mix(in srgb, var(--mzn-color-primary) 8%, var(--mzn-color-bg-surface))",
|
|
228
230
|
boxShadow: "inset 0 0 0 1px var(--mzn-color-border-primary)"
|
|
229
|
-
},
|
|
231
|
+
}, It = {
|
|
230
232
|
alignItems: "center",
|
|
231
233
|
border: "1px dashed var(--mzn-color-border-neutral)",
|
|
232
234
|
borderRadius: 6,
|
|
@@ -235,135 +237,135 @@ var ft = [
|
|
|
235
237
|
minHeight: 240,
|
|
236
238
|
padding: 32,
|
|
237
239
|
textAlign: "center"
|
|
238
|
-
},
|
|
240
|
+
}, Lt = {
|
|
239
241
|
display: "flex",
|
|
240
242
|
gap: 8,
|
|
241
243
|
justifyContent: "center"
|
|
242
|
-
},
|
|
244
|
+
}, Rt = {
|
|
243
245
|
display: "grid",
|
|
244
246
|
gap: 14
|
|
245
|
-
},
|
|
247
|
+
}, zt = {
|
|
246
248
|
display: "grid",
|
|
247
249
|
columnGap: 16,
|
|
248
250
|
gridTemplateColumns: "repeat(auto-fit, minmax(280px, 360px))",
|
|
249
251
|
justifyContent: "start",
|
|
250
252
|
maxWidth: 736,
|
|
251
253
|
rowGap: 8
|
|
252
|
-
},
|
|
254
|
+
}, Bt = { gridColumn: "1 / -1" }, Vt = {
|
|
253
255
|
alignItems: "center",
|
|
254
256
|
display: "flex",
|
|
255
257
|
gap: 8,
|
|
256
258
|
gridColumn: "1 / -1",
|
|
257
259
|
justifyContent: "flex-end"
|
|
258
|
-
},
|
|
260
|
+
}, F = { gridColumn: "1 / -1" }, Ht = {
|
|
259
261
|
alignItems: "start",
|
|
260
262
|
display: "block",
|
|
261
263
|
width: "100%"
|
|
262
|
-
},
|
|
263
|
-
...
|
|
264
|
+
}, Ut = {
|
|
265
|
+
...Ht,
|
|
264
266
|
gridColumn: "1 / -1"
|
|
265
|
-
},
|
|
267
|
+
}, Wt = {
|
|
266
268
|
minWidth: 0,
|
|
267
269
|
width: "100%"
|
|
268
|
-
},
|
|
270
|
+
}, Gt = {
|
|
269
271
|
minWidth: "100%",
|
|
270
272
|
width: "100%"
|
|
271
|
-
},
|
|
273
|
+
}, Kt = {
|
|
272
274
|
display: "grid",
|
|
273
275
|
gap: 14
|
|
274
|
-
},
|
|
276
|
+
}, qt = {
|
|
275
277
|
alignItems: "start",
|
|
276
278
|
display: "block",
|
|
277
279
|
width: "100%"
|
|
278
|
-
},
|
|
280
|
+
}, Jt = {
|
|
279
281
|
minWidth: 0,
|
|
280
282
|
width: "100%"
|
|
281
|
-
},
|
|
283
|
+
}, Yt = { gridColumn: "2 / -1" }, Xt = {
|
|
282
284
|
display: "grid",
|
|
283
285
|
gap: 10,
|
|
284
286
|
width: "100%"
|
|
285
|
-
},
|
|
287
|
+
}, Zt = {
|
|
286
288
|
display: "grid",
|
|
287
289
|
gap: 8,
|
|
288
290
|
gridTemplateColumns: "repeat(auto-fit, minmax(160px, 1fr))"
|
|
289
|
-
},
|
|
291
|
+
}, Qt = { display: "inline-flex" }, $t = {
|
|
290
292
|
display: "grid",
|
|
291
293
|
gap: 16
|
|
292
|
-
},
|
|
294
|
+
}, en = {
|
|
293
295
|
display: "grid",
|
|
294
296
|
gap: 8
|
|
295
|
-
},
|
|
297
|
+
}, tn = {
|
|
296
298
|
display: "flex",
|
|
297
299
|
justifyContent: "flex-end"
|
|
298
|
-
},
|
|
300
|
+
}, nn = {
|
|
299
301
|
color: "var(--mzn-color-text-error)",
|
|
300
302
|
fontSize: "0.72em",
|
|
301
303
|
lineHeight: 0,
|
|
302
304
|
marginLeft: 2,
|
|
303
305
|
verticalAlign: "super"
|
|
304
|
-
},
|
|
306
|
+
}, rn = {
|
|
305
307
|
display: "grid",
|
|
306
308
|
gap: 10,
|
|
307
309
|
gridColumn: "1 / -1"
|
|
308
|
-
},
|
|
310
|
+
}, an = {
|
|
309
311
|
display: "grid",
|
|
310
312
|
gap: 2
|
|
311
|
-
},
|
|
313
|
+
}, on = {
|
|
312
314
|
display: "grid",
|
|
313
315
|
gap: 8
|
|
314
|
-
},
|
|
316
|
+
}, sn = {
|
|
315
317
|
display: "flex",
|
|
316
318
|
justifyContent: "flex-start"
|
|
317
|
-
},
|
|
319
|
+
}, cn = {
|
|
318
320
|
display: "flex",
|
|
319
321
|
flexWrap: "wrap",
|
|
320
322
|
gap: 4
|
|
321
|
-
},
|
|
323
|
+
}, ln = {
|
|
322
324
|
backgroundColor: "var(--mzn-color-bg-surface-secondary)",
|
|
323
325
|
borderRadius: 6,
|
|
324
326
|
display: "grid",
|
|
325
327
|
gap: 4,
|
|
326
328
|
padding: 10
|
|
327
|
-
},
|
|
328
|
-
...
|
|
329
|
+
}, un = {
|
|
330
|
+
...zt,
|
|
329
331
|
gridTemplateColumns: "minmax(280px, 520px)",
|
|
330
332
|
padding: "4px 0 8px"
|
|
331
|
-
},
|
|
333
|
+
}, dn = {
|
|
332
334
|
display: "grid",
|
|
333
335
|
gap: 8,
|
|
334
336
|
gridColumn: "1 / -1"
|
|
335
|
-
},
|
|
337
|
+
}, fn = {
|
|
336
338
|
alignItems: "center",
|
|
337
339
|
display: "flex",
|
|
338
340
|
gap: 12,
|
|
339
341
|
justifyContent: "space-between"
|
|
340
|
-
},
|
|
342
|
+
}, pn = {
|
|
341
343
|
alignItems: "baseline",
|
|
342
344
|
display: "flex",
|
|
343
345
|
gap: 2
|
|
344
|
-
},
|
|
346
|
+
}, mn = {
|
|
345
347
|
display: "grid",
|
|
346
348
|
gap: 4
|
|
347
349
|
};
|
|
348
|
-
function
|
|
350
|
+
function hn(e) {
|
|
349
351
|
e && (e.style.width = "100%");
|
|
350
352
|
}
|
|
351
|
-
var
|
|
353
|
+
var gn = {
|
|
352
354
|
fields: [],
|
|
353
355
|
schemaVersion: 1
|
|
354
|
-
},
|
|
356
|
+
}, _n = {
|
|
355
357
|
layout: [],
|
|
356
358
|
schemaVersion: 1
|
|
357
|
-
},
|
|
358
|
-
id:
|
|
359
|
+
}, vn = "__STATIC_OPTIONS__", yn = "__CONSTANT__", bn = "__EXPRESSION__", I = "__UNSUPPORTED__", xn = "__ROW_FIELD__:", Sn = "__UNBOUND__", Cn = [{
|
|
360
|
+
id: vn,
|
|
359
361
|
name: "靜態選項"
|
|
360
|
-
}],
|
|
362
|
+
}], wn = [{
|
|
361
363
|
id: "single",
|
|
362
364
|
name: "單選"
|
|
363
365
|
}, {
|
|
364
366
|
id: "multiple",
|
|
365
367
|
name: "複選"
|
|
366
|
-
}],
|
|
368
|
+
}], Tn = [
|
|
367
369
|
{
|
|
368
370
|
id: "unset",
|
|
369
371
|
name: "不預設"
|
|
@@ -376,13 +378,13 @@ var dn = {
|
|
|
376
378
|
id: "false",
|
|
377
379
|
name: "否"
|
|
378
380
|
}
|
|
379
|
-
],
|
|
381
|
+
], En = [{
|
|
380
382
|
id: "true",
|
|
381
383
|
name: "是"
|
|
382
384
|
}, {
|
|
383
385
|
id: "false",
|
|
384
386
|
name: "否"
|
|
385
|
-
}],
|
|
387
|
+
}], Dn = [
|
|
386
388
|
{
|
|
387
389
|
label: "顯示",
|
|
388
390
|
name: "fieldVisibleWhen",
|
|
@@ -401,141 +403,163 @@ var dn = {
|
|
|
401
403
|
supportingText: "符合條件時不允許修改這個欄位。",
|
|
402
404
|
target: "readonlyWhen"
|
|
403
405
|
}
|
|
404
|
-
];
|
|
405
|
-
function
|
|
406
|
-
let
|
|
406
|
+
], On = { whiteSpace: "pre-line" }, kn = "勾選後,此欄位的 key 與型別在之後的版本不能再改。HIDE/hidden 不是保密手段。";
|
|
407
|
+
function L({ formDefinitionId: qe, onChange: Je, templateId: Ye, value: Xe }) {
|
|
408
|
+
let Ze = Xe?.schema ?? gn, $e = Xe?.uiSchema ?? _n, [x, S] = i(Ze), [C, w] = i($e), [nt, T] = i(V(Ze)), [it, E] = i(V($e)), [at, st] = i({}), [ht, k] = i(null), [A, j] = i([]), [gt, M] = i(null);
|
|
409
|
+
n(() => {
|
|
410
|
+
if (!Ye && !qe || pe(x).length === 0) return j([]), M(null), () => void 0;
|
|
411
|
+
let e = !1, t = setTimeout(() => {
|
|
412
|
+
le({
|
|
413
|
+
formDefinitionId: qe,
|
|
414
|
+
schemaJson: V(x),
|
|
415
|
+
templateId: Ye
|
|
416
|
+
}).then((t) => {
|
|
417
|
+
e || (j(t), M(null));
|
|
418
|
+
}).catch((t) => {
|
|
419
|
+
e || (j([]), M(t instanceof Error ? t.message : "無法檢查可篩選欄位。"));
|
|
420
|
+
});
|
|
421
|
+
}, 400);
|
|
422
|
+
return () => {
|
|
423
|
+
e = !0, clearTimeout(t);
|
|
424
|
+
};
|
|
425
|
+
}, [
|
|
426
|
+
qe,
|
|
427
|
+
x,
|
|
428
|
+
Ye
|
|
429
|
+
]);
|
|
430
|
+
let L = r(() => new Map(A.map((e) => [e.path, e.message])), [A]), [R, Fn] = i("design"), [z, B] = i(null), [H, tr] = i([]), [nr, rr] = i(null), [ir, ar] = i("loading"), [or, U] = i(null), [sr, cr] = i(!1), [W, G] = i(null), [lr, K] = i(null);
|
|
407
431
|
n(() => {
|
|
408
432
|
let e = !0;
|
|
409
|
-
return
|
|
410
|
-
e && (
|
|
433
|
+
return Ee().then((t) => {
|
|
434
|
+
e && (tr(t), rr(null), ar("ready"));
|
|
411
435
|
}).catch((t) => {
|
|
412
|
-
e && (
|
|
436
|
+
e && (tr([]), rr("目前無法載入 DataSource Catalog,請稍後重試。"), ar("unavailable"));
|
|
413
437
|
}), () => {
|
|
414
438
|
e = !1;
|
|
415
439
|
};
|
|
416
440
|
}, []), n(() => {
|
|
417
|
-
|
|
418
|
-
}, [
|
|
419
|
-
|
|
420
|
-
}, [
|
|
421
|
-
|
|
441
|
+
x.fields.some((e) => e.fieldKey === z) || B(x.fields[0]?.fieldKey ?? null);
|
|
442
|
+
}, [x.fields, z]), n(() => {
|
|
443
|
+
st((e) => he(x.fields, e));
|
|
444
|
+
}, [x.fields]), n(() => {
|
|
445
|
+
R !== "advanced" && (T(V(x)), E(V(C)));
|
|
422
446
|
}, [
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
447
|
+
R,
|
|
448
|
+
x,
|
|
449
|
+
C
|
|
426
450
|
]);
|
|
427
|
-
let q = r(() =>
|
|
451
|
+
let q = r(() => x.fields.find((e) => e.fieldKey === z) ?? x.fields[0] ?? null, [x.fields, z]);
|
|
428
452
|
n(() => {
|
|
429
|
-
|
|
430
|
-
schema:
|
|
431
|
-
uiSchema:
|
|
453
|
+
Je?.({
|
|
454
|
+
schema: x,
|
|
455
|
+
uiSchema: C
|
|
432
456
|
});
|
|
433
|
-
}, [
|
|
434
|
-
function
|
|
435
|
-
let t =
|
|
436
|
-
|
|
437
|
-
...
|
|
438
|
-
fields: [...
|
|
439
|
-
}),
|
|
440
|
-
...
|
|
441
|
-
layout: [...
|
|
457
|
+
}, [x, C]);
|
|
458
|
+
function ur(e) {
|
|
459
|
+
let t = x.fields.length + 1, n = _e(e, t);
|
|
460
|
+
S({
|
|
461
|
+
...x,
|
|
462
|
+
fields: [...x.fields, n]
|
|
463
|
+
}), w({
|
|
464
|
+
...C,
|
|
465
|
+
layout: [...C.layout, {
|
|
442
466
|
fieldKey: n.fieldKey,
|
|
443
467
|
width: e === "textarea" || e === "file_upload" || e === "table" ? "FULL" : "HALF"
|
|
444
468
|
}]
|
|
445
|
-
}),
|
|
469
|
+
}), B(n.fieldKey), Fn("design"), k(null);
|
|
446
470
|
}
|
|
447
|
-
function
|
|
471
|
+
function dr(e) {
|
|
448
472
|
let t = e;
|
|
449
|
-
t === "advanced" &&
|
|
473
|
+
t === "advanced" && R !== "advanced" && (T(V(x)), E(V(C))), Fn(t);
|
|
450
474
|
}
|
|
451
|
-
function
|
|
452
|
-
let t =
|
|
475
|
+
function fr(e) {
|
|
476
|
+
let t = x.fields.flatMap((t) => O(t) ? t.columns.flatMap((n) => D(n) && Ve(n).includes(e) ? [`${t.fieldKey}.${n.fieldKey}`] : []) : D(t) && Ve(t).includes(e) ? [t.fieldKey] : []);
|
|
453
477
|
t.length > 0 ? G({
|
|
454
478
|
affectedFieldKeys: t,
|
|
455
479
|
fieldKey: e,
|
|
456
480
|
kind: "remove-field"
|
|
457
|
-
}) :
|
|
481
|
+
}) : pr(e);
|
|
458
482
|
}
|
|
459
|
-
function
|
|
460
|
-
let t =
|
|
461
|
-
|
|
462
|
-
...
|
|
483
|
+
function pr(e) {
|
|
484
|
+
let t = x.fields.filter((t) => t.fieldKey !== e);
|
|
485
|
+
S({
|
|
486
|
+
...x,
|
|
463
487
|
fields: t
|
|
464
|
-
}),
|
|
465
|
-
...
|
|
466
|
-
layout:
|
|
467
|
-
}),
|
|
488
|
+
}), w({
|
|
489
|
+
...C,
|
|
490
|
+
layout: C.layout.filter((t) => t.fieldKey !== e)
|
|
491
|
+
}), B(z === e ? t[0]?.fieldKey ?? null : z), k(null), U(null);
|
|
468
492
|
}
|
|
469
|
-
function
|
|
493
|
+
function mr(e) {
|
|
470
494
|
let t = e.destination;
|
|
471
|
-
t && e.source.index !== t.index && (
|
|
495
|
+
t && e.source.index !== t.index && (S((n) => ({
|
|
472
496
|
...n,
|
|
473
|
-
fields:
|
|
474
|
-
})),
|
|
497
|
+
fields: er(n.fields, e.source.index, t.index)
|
|
498
|
+
})), w((n) => ({
|
|
475
499
|
...n,
|
|
476
|
-
layout:
|
|
477
|
-
})),
|
|
500
|
+
layout: er(n.layout, e.source.index, t.index)
|
|
501
|
+
})), k(null));
|
|
478
502
|
}
|
|
479
|
-
function
|
|
480
|
-
|
|
503
|
+
function hr(e) {
|
|
504
|
+
J((t) => ({
|
|
481
505
|
...t,
|
|
482
506
|
...e
|
|
483
507
|
}));
|
|
484
508
|
}
|
|
485
|
-
function
|
|
509
|
+
function J(e) {
|
|
486
510
|
if (!q) return;
|
|
487
511
|
let t = q.fieldKey, n = e(q), r = n.fieldKey, i = {
|
|
488
|
-
...
|
|
489
|
-
fields:
|
|
490
|
-
}, a = t === r ? i :
|
|
491
|
-
|
|
492
|
-
...
|
|
493
|
-
layout:
|
|
512
|
+
...x,
|
|
513
|
+
fields: x.fields.map((e) => e.fieldKey === t ? n : e)
|
|
514
|
+
}, a = t === r ? i : We(i, t, r);
|
|
515
|
+
S(a), w({
|
|
516
|
+
...C,
|
|
517
|
+
layout: C.layout.map((e) => e.fieldKey === t ? {
|
|
494
518
|
...e,
|
|
495
519
|
fieldKey: r
|
|
496
520
|
} : e)
|
|
497
|
-
}),
|
|
521
|
+
}), B(r), k(null), U(null);
|
|
498
522
|
}
|
|
499
|
-
function
|
|
500
|
-
|
|
523
|
+
function gr(e) {
|
|
524
|
+
J(() => e);
|
|
501
525
|
}
|
|
502
|
-
function
|
|
503
|
-
|
|
526
|
+
function Y(e, t) {
|
|
527
|
+
S((n) => ({
|
|
504
528
|
...n,
|
|
505
|
-
fields: n.fields.map((n) => n.fieldKey === e &&
|
|
506
|
-
})),
|
|
529
|
+
fields: n.fields.map((n) => n.fieldKey === e && O(n) ? t(n) : n)
|
|
530
|
+
})), k(null), U(null);
|
|
507
531
|
}
|
|
508
|
-
function
|
|
532
|
+
function X(e, t, n) {
|
|
509
533
|
let r = e.columns[t]?.fieldKey;
|
|
510
|
-
|
|
534
|
+
Y(e.fieldKey, (e) => {
|
|
511
535
|
let i = {
|
|
512
536
|
...e,
|
|
513
537
|
columns: e.columns.map((e, r) => r === t ? n : e)
|
|
514
538
|
};
|
|
515
|
-
return typeof r == "string" && r !== n.fieldKey ?
|
|
539
|
+
return typeof r == "string" && r !== n.fieldKey ? Ge(i, r, n.fieldKey) : i;
|
|
516
540
|
});
|
|
517
541
|
}
|
|
518
|
-
function
|
|
519
|
-
let t =
|
|
520
|
-
|
|
542
|
+
function _r(e) {
|
|
543
|
+
let t = ve(e.columns, "text");
|
|
544
|
+
Y(e.fieldKey, (e) => ({
|
|
521
545
|
...e,
|
|
522
546
|
columns: [...e.columns, t]
|
|
523
547
|
})), K(e.columns.length);
|
|
524
548
|
}
|
|
525
|
-
function
|
|
526
|
-
|
|
549
|
+
function vr(e, t) {
|
|
550
|
+
Y(e, (e) => ({
|
|
527
551
|
...e,
|
|
528
552
|
columns: e.columns.filter((e, n) => n !== t)
|
|
529
553
|
})), K((e) => e === null || e < t ? e : e === t ? null : e - 1);
|
|
530
554
|
}
|
|
531
|
-
function
|
|
532
|
-
|
|
555
|
+
function yr(e, t, n) {
|
|
556
|
+
Y(e.fieldKey, (e) => ({
|
|
533
557
|
...e,
|
|
534
|
-
columns:
|
|
558
|
+
columns: er(e.columns, t, n)
|
|
535
559
|
})), K((e) => e === null ? e : e === t ? n : e > t && e <= n ? e - 1 : e < t && e >= n ? e + 1 : e);
|
|
536
560
|
}
|
|
537
|
-
function
|
|
538
|
-
if (e.type !== "select" && e.type !== "autocomplete" ||
|
|
561
|
+
function br(e, t, n) {
|
|
562
|
+
if (e.type !== "select" && e.type !== "autocomplete" || dt(e) === t) return;
|
|
539
563
|
let r = e.defaultValue, i = t === "multiple" ? typeof r == "string" ? [r] : r : Array.isArray(r) ? r[0] : r;
|
|
540
564
|
n(e, {
|
|
541
565
|
...e,
|
|
@@ -543,7 +567,7 @@ function z({ onChange: le, value: y }) {
|
|
|
543
567
|
mode: t
|
|
544
568
|
}, "選擇模式變更可能轉換或捨棄既有預設值。");
|
|
545
569
|
}
|
|
546
|
-
function
|
|
570
|
+
function xr(e, t, n = "此變更會替換目前選項來源;既有 options、dynamic reference 或 bindings 可能失效。") {
|
|
547
571
|
JSON.stringify(e) !== JSON.stringify(t) && G({
|
|
548
572
|
fieldKey: e.fieldKey,
|
|
549
573
|
impact: n,
|
|
@@ -551,10 +575,10 @@ function z({ onChange: le, value: y }) {
|
|
|
551
575
|
nextField: t
|
|
552
576
|
});
|
|
553
577
|
}
|
|
554
|
-
function
|
|
578
|
+
function Sr(e, t, n) {
|
|
555
579
|
if (!t) return;
|
|
556
|
-
if (t ===
|
|
557
|
-
if (!
|
|
580
|
+
if (t === vn) {
|
|
581
|
+
if (!D(e)) return;
|
|
558
582
|
let { dataSource: t, defaultValue: r, ...i } = e;
|
|
559
583
|
n({
|
|
560
584
|
...i,
|
|
@@ -562,9 +586,9 @@ function z({ onChange: le, value: y }) {
|
|
|
562
586
|
});
|
|
563
587
|
return;
|
|
564
588
|
}
|
|
565
|
-
let r =
|
|
589
|
+
let r = H.find((e) => jn(e) === t);
|
|
566
590
|
if (!r) return;
|
|
567
|
-
if (
|
|
591
|
+
if (D(e)) {
|
|
568
592
|
let t = new Set(r.parameters.map((e) => e.key)), i = e.dataSource.bindings.filter((e) => t.has(e.parameter));
|
|
569
593
|
n({
|
|
570
594
|
...e,
|
|
@@ -586,123 +610,135 @@ function z({ onChange: le, value: y }) {
|
|
|
586
610
|
}
|
|
587
611
|
});
|
|
588
612
|
}
|
|
589
|
-
function
|
|
590
|
-
W && (
|
|
613
|
+
function Cr() {
|
|
614
|
+
W && (wr(W), G(null));
|
|
591
615
|
}
|
|
592
|
-
function
|
|
593
|
-
e.kind === "remove-field" ?
|
|
616
|
+
function wr(e) {
|
|
617
|
+
e.kind === "remove-field" ? pr(e.fieldKey) : e.kind === "remove-column" ? vr(e.fieldKey, e.columnIndex) : e.kind === "replace-column" ? (Y(e.fieldKey, (t) => ({
|
|
594
618
|
...t,
|
|
595
619
|
columns: t.columns.map((t) => t.fieldKey === e.columnKey ? e.nextColumn : t)
|
|
596
|
-
})), K(e.columnIndex)) : (
|
|
597
|
-
...
|
|
598
|
-
fields:
|
|
599
|
-
}),
|
|
620
|
+
})), K(e.columnIndex)) : (S({
|
|
621
|
+
...x,
|
|
622
|
+
fields: x.fields.map((t) => t.fieldKey === e.fieldKey ? e.nextField : t)
|
|
623
|
+
}), k(null), U(null));
|
|
600
624
|
}
|
|
601
|
-
async function
|
|
602
|
-
|
|
625
|
+
async function Tr() {
|
|
626
|
+
cr(!0);
|
|
603
627
|
try {
|
|
604
|
-
let e = await
|
|
605
|
-
U(e.errors.map(
|
|
628
|
+
let e = await Te(x, C);
|
|
629
|
+
U(e.errors.map(Er));
|
|
606
630
|
} catch {
|
|
607
631
|
U(["目前無法完成 DataSource schema 驗證。"]);
|
|
608
632
|
} finally {
|
|
609
|
-
|
|
633
|
+
cr(!1);
|
|
610
634
|
}
|
|
611
635
|
}
|
|
612
|
-
function
|
|
613
|
-
let t =
|
|
614
|
-
if (t?.[1] && t[3]) return `${
|
|
615
|
-
let n =
|
|
636
|
+
function Er(e) {
|
|
637
|
+
let t = wt.exec(e);
|
|
638
|
+
if (t?.[1] && t[3]) return `${Dr(t[1], t[2])}尚未指定必要參數「${Or(t[1], t[2], t[3])}」的來源`;
|
|
639
|
+
let n = de(e);
|
|
616
640
|
if (n) {
|
|
617
|
-
let e = String(n.fieldIndex), t = n.columnIndex === null ? void 0 : String(n.columnIndex), r =
|
|
618
|
-
return
|
|
641
|
+
let e = String(n.fieldIndex), t = n.columnIndex === null ? void 0 : String(n.columnIndex), r = x.fields[n.fieldIndex], i = r ? Ar(r, t) : void 0, a = kr(e, t, String(n.bindingIndex)) ?? "";
|
|
642
|
+
return fe({
|
|
619
643
|
code: n.code,
|
|
620
644
|
columnLabel: i ? i.label || i.fieldKey : null,
|
|
621
645
|
fieldLabel: r ? r.label || r.fieldKey : "",
|
|
622
|
-
parameterLabel:
|
|
646
|
+
parameterLabel: Or(e, t, a),
|
|
623
647
|
subject: n.subject
|
|
624
648
|
});
|
|
625
649
|
}
|
|
626
|
-
let r =
|
|
627
|
-
return r?.[1] && r[3] ? `${
|
|
650
|
+
let r = Tt.exec(e);
|
|
651
|
+
return r?.[1] && r[3] ? `${Dr(r[1], r[2])}綁定了來源沒有的參數「${r[3]}」` : He(e);
|
|
628
652
|
}
|
|
629
|
-
function
|
|
630
|
-
let n =
|
|
653
|
+
function Dr(e, t) {
|
|
654
|
+
let n = x.fields[Number(e)];
|
|
631
655
|
if (!n) return "";
|
|
632
|
-
let r = n.label || n.fieldKey, i =
|
|
656
|
+
let r = n.label || n.fieldKey, i = Ar(n, t);
|
|
633
657
|
return i ? `「${r}」表格的「${i.label || i.fieldKey}」欄` : `「${r}」欄位`;
|
|
634
658
|
}
|
|
635
|
-
function
|
|
636
|
-
let r =
|
|
659
|
+
function Or(e, t, n) {
|
|
660
|
+
let r = x.fields[Number(e)];
|
|
637
661
|
if (!r) return n;
|
|
638
|
-
let i =
|
|
639
|
-
return (a ?
|
|
662
|
+
let i = Ar(r, t) ?? r, a = D(i) ? i.dataSource : null;
|
|
663
|
+
return (a ? H.find((e) => e.key === a.key && e.version === a.version) : void 0)?.parameters.find((e) => e.key === n)?.label || n;
|
|
640
664
|
}
|
|
641
|
-
function
|
|
642
|
-
let r =
|
|
643
|
-
return i &&
|
|
665
|
+
function kr(e, t, n) {
|
|
666
|
+
let r = x.fields[Number(e)], i = r ? Ar(r, t) ?? r : null;
|
|
667
|
+
return i && D(i) ? i.dataSource.bindings[Number(n)]?.parameter ?? null : null;
|
|
644
668
|
}
|
|
645
|
-
function
|
|
646
|
-
return typeof t == "string" &&
|
|
669
|
+
function Ar(e, t) {
|
|
670
|
+
return typeof t == "string" && O(e) ? e.columns[Number(t)] : void 0;
|
|
647
671
|
}
|
|
648
|
-
function
|
|
649
|
-
|
|
672
|
+
function jr(e) {
|
|
673
|
+
st(e);
|
|
650
674
|
}
|
|
651
|
-
function
|
|
652
|
-
|
|
675
|
+
function Mr(e, t) {
|
|
676
|
+
S((n) => ({
|
|
653
677
|
...n,
|
|
654
678
|
fields: n.fields.map((n) => n.fieldKey === e ? {
|
|
655
679
|
...n,
|
|
656
680
|
required: t
|
|
657
681
|
} : n)
|
|
658
|
-
})),
|
|
682
|
+
})), k(null);
|
|
659
683
|
}
|
|
660
|
-
function
|
|
661
|
-
|
|
684
|
+
function Nr(e) {
|
|
685
|
+
T(e);
|
|
662
686
|
try {
|
|
663
|
-
|
|
687
|
+
S(JSON.parse(e)), k(null);
|
|
664
688
|
} catch {
|
|
665
|
-
|
|
689
|
+
k("Form Schema JSON 格式不正確");
|
|
666
690
|
}
|
|
667
691
|
}
|
|
668
|
-
function
|
|
669
|
-
|
|
692
|
+
function Pr(e) {
|
|
693
|
+
E(e);
|
|
670
694
|
try {
|
|
671
|
-
|
|
695
|
+
w(JSON.parse(e)), k(null);
|
|
672
696
|
} catch {
|
|
673
|
-
|
|
697
|
+
k("UI Schema JSON 格式不正確");
|
|
674
698
|
}
|
|
675
699
|
}
|
|
676
|
-
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
700
|
+
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v(g, { children: [
|
|
701
|
+
gt ? /* @__PURE__ */ _(ee, {
|
|
702
|
+
content: gt,
|
|
703
|
+
severity: "warning"
|
|
704
|
+
}) : null,
|
|
705
|
+
A.length > 0 ? /* @__PURE__ */ _(h, {
|
|
706
|
+
color: "text-error",
|
|
707
|
+
style: On,
|
|
708
|
+
variant: "body",
|
|
709
|
+
children: A.map((e) => e.message).join("\n")
|
|
710
|
+
}) : null,
|
|
711
|
+
/* @__PURE__ */ _(re, { children: /* @__PURE__ */ _(ne, { children: /* @__PURE__ */ v("div", {
|
|
712
|
+
style: $t,
|
|
713
|
+
children: [
|
|
714
|
+
/* @__PURE__ */ v(ie, {
|
|
715
|
+
activeKey: R,
|
|
716
|
+
onChange: dr,
|
|
717
|
+
size: "sub",
|
|
718
|
+
children: [
|
|
719
|
+
/* @__PURE__ */ _(ae, { children: "設計" }, "design"),
|
|
720
|
+
/* @__PURE__ */ _(ae, { children: "預覽" }, "preview"),
|
|
721
|
+
/* @__PURE__ */ _(ae, { children: "進階" }, "advanced")
|
|
722
|
+
]
|
|
723
|
+
}),
|
|
724
|
+
R === "design" ? Fr() : null,
|
|
725
|
+
R === "preview" ? Ci() : null,
|
|
726
|
+
R === "advanced" ? wi() : null
|
|
727
|
+
]
|
|
728
|
+
}) }) })
|
|
729
|
+
] }), W ? /* @__PURE__ */ _(te, {
|
|
694
730
|
cancelText: "返回",
|
|
695
731
|
confirmText: "確認變更",
|
|
696
732
|
modalType: "standard",
|
|
697
733
|
onCancel: () => G(null),
|
|
698
734
|
onClose: () => G(null),
|
|
699
|
-
onConfirm:
|
|
735
|
+
onConfirm: Cr,
|
|
700
736
|
open: !0,
|
|
701
737
|
showModalFooter: !0,
|
|
702
738
|
showModalHeader: !0,
|
|
703
|
-
title:
|
|
739
|
+
title: Rn(W),
|
|
704
740
|
children: W.kind === "remove-field" ? /* @__PURE__ */ v("div", {
|
|
705
|
-
style:
|
|
741
|
+
style: en,
|
|
706
742
|
children: [/* @__PURE__ */ _(h, {
|
|
707
743
|
variant: "body",
|
|
708
744
|
children: "此欄位仍被下列 DataSource binding 使用;移除後請重新設定這些欄位。"
|
|
@@ -723,58 +759,58 @@ function z({ onChange: le, value: y }) {
|
|
|
723
759
|
children: W.impact
|
|
724
760
|
})
|
|
725
761
|
}) : null] });
|
|
726
|
-
function
|
|
762
|
+
function Fr() {
|
|
727
763
|
return /* @__PURE__ */ v("div", {
|
|
728
|
-
style:
|
|
764
|
+
style: P,
|
|
729
765
|
children: [/* @__PURE__ */ v("div", {
|
|
730
|
-
style:
|
|
766
|
+
style: Ot,
|
|
731
767
|
children: [/* @__PURE__ */ _(h, {
|
|
732
768
|
component: "h2",
|
|
733
769
|
variant: "label-primary",
|
|
734
770
|
children: "新增欄位"
|
|
735
771
|
}), /* @__PURE__ */ _("div", {
|
|
736
|
-
style:
|
|
737
|
-
children:
|
|
772
|
+
style: Et,
|
|
773
|
+
children: vt.map((e) => /* @__PURE__ */ _(c, {
|
|
738
774
|
icon: e.icon,
|
|
739
775
|
iconType: "leading",
|
|
740
|
-
onClick: () =>
|
|
776
|
+
onClick: () => ur(e.type),
|
|
741
777
|
size: "sub",
|
|
742
|
-
style:
|
|
778
|
+
style: Dt,
|
|
743
779
|
type: "button",
|
|
744
780
|
variant: "base-secondary",
|
|
745
781
|
children: e.label
|
|
746
782
|
}, e.type))
|
|
747
783
|
})]
|
|
748
784
|
}), /* @__PURE__ */ v("div", {
|
|
749
|
-
style:
|
|
785
|
+
style: yt,
|
|
750
786
|
children: [/* @__PURE__ */ v("div", {
|
|
751
787
|
style: {
|
|
752
|
-
...
|
|
753
|
-
...
|
|
788
|
+
...P,
|
|
789
|
+
...bt
|
|
754
790
|
},
|
|
755
791
|
children: [/* @__PURE__ */ _(h, {
|
|
756
792
|
component: "h2",
|
|
757
793
|
variant: "label-primary",
|
|
758
794
|
children: "表單畫布"
|
|
759
|
-
}),
|
|
760
|
-
onDragEnd:
|
|
761
|
-
children: /* @__PURE__ */ _(
|
|
795
|
+
}), x.fields.length > 0 ? /* @__PURE__ */ _(ft, {
|
|
796
|
+
onDragEnd: mr,
|
|
797
|
+
children: /* @__PURE__ */ _(mt, {
|
|
762
798
|
droppableId: "form-builder-fields",
|
|
763
799
|
children: (e) => /* @__PURE__ */ v("div", {
|
|
764
800
|
...e.droppableProps,
|
|
765
801
|
ref: e.innerRef,
|
|
766
|
-
style:
|
|
767
|
-
children: [
|
|
802
|
+
style: P,
|
|
803
|
+
children: [x.fields.map((e, t) => /* @__PURE__ */ _(pt, {
|
|
768
804
|
draggableId: e.fieldKey,
|
|
769
805
|
index: t,
|
|
770
|
-
children: (t, n) =>
|
|
806
|
+
children: (t, n) => xi(e, t, n.isDragging)
|
|
771
807
|
}, e.fieldKey)), e.placeholder]
|
|
772
808
|
})
|
|
773
809
|
})
|
|
774
810
|
}) : /* @__PURE__ */ v("div", {
|
|
775
|
-
style:
|
|
811
|
+
style: It,
|
|
776
812
|
children: [/* @__PURE__ */ v("div", {
|
|
777
|
-
style:
|
|
813
|
+
style: P,
|
|
778
814
|
children: [/* @__PURE__ */ _(h, {
|
|
779
815
|
component: "h3",
|
|
780
816
|
variant: "h3",
|
|
@@ -785,13 +821,13 @@ function z({ onChange: le, value: y }) {
|
|
|
785
821
|
children: "從上方新增第一個欄位,或直接建立常用文字欄位開始設計。"
|
|
786
822
|
})]
|
|
787
823
|
}), /* @__PURE__ */ v("div", {
|
|
788
|
-
style:
|
|
824
|
+
style: Lt,
|
|
789
825
|
children: [/* @__PURE__ */ _(c, {
|
|
790
|
-
onClick: () =>
|
|
826
|
+
onClick: () => ur("text"),
|
|
791
827
|
variant: "base-primary",
|
|
792
828
|
children: "新增文字欄位"
|
|
793
829
|
}), /* @__PURE__ */ _(c, {
|
|
794
|
-
onClick: () =>
|
|
830
|
+
onClick: () => ur("textarea"),
|
|
795
831
|
variant: "base-secondary",
|
|
796
832
|
children: "新增長文字"
|
|
797
833
|
})]
|
|
@@ -799,14 +835,14 @@ function z({ onChange: le, value: y }) {
|
|
|
799
835
|
})]
|
|
800
836
|
}), /* @__PURE__ */ v("div", {
|
|
801
837
|
style: {
|
|
802
|
-
...
|
|
803
|
-
...
|
|
838
|
+
...P,
|
|
839
|
+
...xt
|
|
804
840
|
},
|
|
805
841
|
children: [/* @__PURE__ */ _(h, {
|
|
806
842
|
component: "h2",
|
|
807
843
|
variant: "label-primary",
|
|
808
844
|
children: "欄位設定"
|
|
809
|
-
}), q ?
|
|
845
|
+
}), q ? Ir(q) : /* @__PURE__ */ _(h, {
|
|
810
846
|
color: "text-neutral",
|
|
811
847
|
variant: "body",
|
|
812
848
|
children: "請先新增或選取欄位。"
|
|
@@ -815,118 +851,137 @@ function z({ onChange: le, value: y }) {
|
|
|
815
851
|
})]
|
|
816
852
|
});
|
|
817
853
|
}
|
|
818
|
-
function
|
|
854
|
+
function Ir(e) {
|
|
819
855
|
return /* @__PURE__ */ v("div", {
|
|
820
|
-
style:
|
|
856
|
+
style: Rt,
|
|
821
857
|
children: [
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
858
|
+
Lr(e),
|
|
859
|
+
O(e) ? Vr(e) : null,
|
|
860
|
+
Rr(e)
|
|
825
861
|
]
|
|
826
862
|
});
|
|
827
863
|
}
|
|
828
|
-
function
|
|
864
|
+
function Lr(e) {
|
|
829
865
|
return /* @__PURE__ */ v("div", {
|
|
830
|
-
style:
|
|
866
|
+
style: zt,
|
|
831
867
|
children: [
|
|
832
868
|
/* @__PURE__ */ _("div", {
|
|
833
|
-
style:
|
|
869
|
+
style: Vt,
|
|
834
870
|
children: /* @__PURE__ */ _(o, {
|
|
835
871
|
size: "main",
|
|
836
|
-
text:
|
|
872
|
+
text: An(e.type),
|
|
837
873
|
variant: "text-info"
|
|
838
874
|
})
|
|
839
875
|
}),
|
|
840
876
|
$("標題", "fieldLabel", /* @__PURE__ */ _(f, {
|
|
841
|
-
onChange: (e) =>
|
|
877
|
+
onChange: (e) => hr({ label: e.target.value }),
|
|
842
878
|
placeholder: "例如:申請金額",
|
|
843
879
|
value: e.label,
|
|
844
880
|
variant: "base"
|
|
845
881
|
})),
|
|
846
882
|
$("欄位 Key", "fieldKey", /* @__PURE__ */ _(f, {
|
|
847
|
-
onChange: (e) =>
|
|
883
|
+
onChange: (e) => hr({ fieldKey: e.target.value }),
|
|
848
884
|
placeholder: "例如:amount",
|
|
849
885
|
value: e.fieldKey,
|
|
850
886
|
variant: "base"
|
|
851
887
|
})),
|
|
852
|
-
|
|
853
|
-
onChange: (e) =>
|
|
888
|
+
O(e) ? null : $("提示文字", "fieldPlaceholder", /* @__PURE__ */ _(f, {
|
|
889
|
+
onChange: (e) => hr({ placeholder: e.target.value || void 0 }),
|
|
854
890
|
placeholder: "例如:請輸入申請金額",
|
|
855
891
|
value: e.placeholder ?? "",
|
|
856
892
|
variant: "base"
|
|
857
893
|
})),
|
|
858
|
-
|
|
859
|
-
|
|
894
|
+
zr(e, gr, xr),
|
|
895
|
+
Jn(e) ? $("以連結顯示", "fieldDisplayAsLink", /* @__PURE__ */ _(m, {
|
|
860
896
|
checked: e.displayAs === "link",
|
|
861
|
-
onChange: (e) =>
|
|
897
|
+
onChange: (e) => J((t) => e.target.checked ? Jn(t) ? {
|
|
862
898
|
...t,
|
|
863
899
|
displayAs: "link"
|
|
864
|
-
} : t :
|
|
900
|
+
} : t : Gn(t, "displayAs"))
|
|
865
901
|
})) : null,
|
|
902
|
+
$("可篩選", "fieldFilterable", /* @__PURE__ */ _(m, {
|
|
903
|
+
checked: e.filterable === !0,
|
|
904
|
+
onChange: (e) => J((t) => e.target.checked ? {
|
|
905
|
+
...t,
|
|
906
|
+
filterable: !0
|
|
907
|
+
} : Gn(t, "filterable"))
|
|
908
|
+
})),
|
|
909
|
+
e.filterable === !0 ? /* @__PURE__ */ _(h, {
|
|
910
|
+
color: "text-neutral",
|
|
911
|
+
style: F,
|
|
912
|
+
variant: "body",
|
|
913
|
+
children: kn
|
|
914
|
+
}) : null,
|
|
915
|
+
L.has(e.fieldKey) ? /* @__PURE__ */ _(h, {
|
|
916
|
+
color: "text-error",
|
|
917
|
+
style: F,
|
|
918
|
+
variant: "body",
|
|
919
|
+
children: L.get(e.fieldKey)
|
|
920
|
+
}) : null,
|
|
866
921
|
$("只存不顯示(系統整合用)", "fieldHidden", /* @__PURE__ */ _(m, {
|
|
867
922
|
checked: e.hidden === !0,
|
|
868
|
-
onChange: (e) =>
|
|
923
|
+
onChange: (e) => J((t) => e.target.checked ? {
|
|
869
924
|
...t,
|
|
870
925
|
hidden: !0,
|
|
871
926
|
required: !1
|
|
872
|
-
} :
|
|
927
|
+
} : Gn(t, "hidden"))
|
|
873
928
|
})),
|
|
874
929
|
e.hidden === !0 ? /* @__PURE__ */ _(h, {
|
|
875
930
|
color: "text-neutral",
|
|
876
|
-
style:
|
|
931
|
+
style: F,
|
|
877
932
|
variant: "body",
|
|
878
933
|
children: "填寫、唯讀與重送畫面都不會顯示這個欄位,值仍會存下來; 透過 API 仍然讀得到這個值,不是權限控管。"
|
|
879
934
|
}) : null
|
|
880
935
|
]
|
|
881
936
|
});
|
|
882
937
|
}
|
|
883
|
-
function
|
|
938
|
+
function Rr(e) {
|
|
884
939
|
return /* @__PURE__ */ _(a, {
|
|
885
|
-
defaultExpanded:
|
|
940
|
+
defaultExpanded: Kn(e),
|
|
886
941
|
size: "sub",
|
|
887
942
|
title: "進階設定",
|
|
888
943
|
children: /* @__PURE__ */ v("div", {
|
|
889
|
-
style:
|
|
944
|
+
style: zt,
|
|
890
945
|
children: [
|
|
891
946
|
/* @__PURE__ */ _(h, {
|
|
892
947
|
component: "h3",
|
|
893
|
-
style:
|
|
948
|
+
style: Bt,
|
|
894
949
|
variant: "label-primary",
|
|
895
950
|
children: "條件規則"
|
|
896
951
|
}),
|
|
897
952
|
/* @__PURE__ */ _(h, {
|
|
898
953
|
color: "text-neutral",
|
|
899
|
-
style:
|
|
954
|
+
style: F,
|
|
900
955
|
variant: "body",
|
|
901
956
|
children: "只有需要根據其他欄位改變顯示、必填或唯讀狀態時才需要設定。"
|
|
902
957
|
}),
|
|
903
|
-
|
|
958
|
+
hi(e)
|
|
904
959
|
]
|
|
905
960
|
})
|
|
906
961
|
});
|
|
907
962
|
}
|
|
908
|
-
function
|
|
909
|
-
return
|
|
963
|
+
function zr(e, t, n, r) {
|
|
964
|
+
return Jn(e) ? qr(e, t) : Ce(e) ? Jr(e, t) : xe(e) ? Yr(e, t) : ot(e) ? Xr(e, t, n, r) : e.type === "boolean" ? fi(e, t) : e.type === "file_upload" ? mi(e, t) : ct(e) ? pi(e, t) : O(e) ? Br(e) : null;
|
|
910
965
|
}
|
|
911
|
-
function
|
|
912
|
-
let t =
|
|
966
|
+
function Br(e) {
|
|
967
|
+
let t = Ue(e);
|
|
913
968
|
return /* @__PURE__ */ v(g, { children: [
|
|
914
|
-
$("最少列數", "fieldMinRows", Q(e.minRows, (t) =>
|
|
969
|
+
$("最少列數", "fieldMinRows", Q(e.minRows, (t) => Y(e.fieldKey, (e) => ({
|
|
915
970
|
...e,
|
|
916
971
|
minRows: t
|
|
917
972
|
})), "例如:1", {
|
|
918
973
|
max: t.maxRows,
|
|
919
974
|
min: 0
|
|
920
975
|
})),
|
|
921
|
-
$("最多列數", "fieldMaxRows", Q(e.maxRows, (t) =>
|
|
976
|
+
$("最多列數", "fieldMaxRows", Q(e.maxRows, (t) => Y(e.fieldKey, (e) => ({
|
|
922
977
|
...e,
|
|
923
978
|
maxRows: t
|
|
924
|
-
})), `未設定即為 ${
|
|
925
|
-
max:
|
|
979
|
+
})), `未設定即為 ${rt}`, {
|
|
980
|
+
max: rt,
|
|
926
981
|
min: Math.max(t.minRows, 1)
|
|
927
982
|
})),
|
|
928
983
|
$("新增列按鈕文字", "fieldAddRowLabel", /* @__PURE__ */ _(f, {
|
|
929
|
-
onChange: (t) =>
|
|
984
|
+
onChange: (t) => Y(e.fieldKey, (e) => ({
|
|
930
985
|
...e,
|
|
931
986
|
addRowLabel: t.target.value || void 0
|
|
932
987
|
})),
|
|
@@ -936,11 +991,11 @@ function z({ onChange: le, value: y }) {
|
|
|
936
991
|
}))
|
|
937
992
|
] });
|
|
938
993
|
}
|
|
939
|
-
function
|
|
994
|
+
function Vr(e) {
|
|
940
995
|
return /* @__PURE__ */ v("div", {
|
|
941
|
-
style:
|
|
996
|
+
style: dn,
|
|
942
997
|
children: [/* @__PURE__ */ v("div", {
|
|
943
|
-
style:
|
|
998
|
+
style: fn,
|
|
944
999
|
children: [/* @__PURE__ */ v(h, {
|
|
945
1000
|
component: "h3",
|
|
946
1001
|
variant: "label-primary",
|
|
@@ -950,18 +1005,18 @@ function z({ onChange: le, value: y }) {
|
|
|
950
1005
|
")"
|
|
951
1006
|
]
|
|
952
1007
|
}), /* @__PURE__ */ _(c, {
|
|
953
|
-
icon:
|
|
1008
|
+
icon: et,
|
|
954
1009
|
iconType: "leading",
|
|
955
|
-
onClick: () =>
|
|
1010
|
+
onClick: () => _r(e),
|
|
956
1011
|
size: "sub",
|
|
957
1012
|
type: "button",
|
|
958
1013
|
variant: "base-secondary",
|
|
959
1014
|
children: "新增欄"
|
|
960
1015
|
})]
|
|
961
|
-
}),
|
|
1016
|
+
}), Hr(e)]
|
|
962
1017
|
});
|
|
963
1018
|
}
|
|
964
|
-
function
|
|
1019
|
+
function Hr(e) {
|
|
965
1020
|
let t = e.columns.map((t, n) => ({
|
|
966
1021
|
fieldKey: t.fieldKey,
|
|
967
1022
|
index: n,
|
|
@@ -973,8 +1028,8 @@ function z({ onChange: le, value: y }) {
|
|
|
973
1028
|
key: "label",
|
|
974
1029
|
render: (t) => /* @__PURE__ */ _(f, {
|
|
975
1030
|
fullWidth: !0,
|
|
976
|
-
onChange: (n) =>
|
|
977
|
-
...
|
|
1031
|
+
onChange: (n) => X(e, t.index, {
|
|
1032
|
+
...Kr(e, t.index),
|
|
978
1033
|
label: n.target.value
|
|
979
1034
|
}),
|
|
980
1035
|
placeholder: "例如:數量",
|
|
@@ -989,31 +1044,59 @@ function z({ onChange: le, value: y }) {
|
|
|
989
1044
|
render: (t) => /* @__PURE__ */ _(p, {
|
|
990
1045
|
fullWidth: !0,
|
|
991
1046
|
clearable: !1,
|
|
992
|
-
menuMaxHeight:
|
|
993
|
-
onChange: (n) =>
|
|
994
|
-
options: [...
|
|
1047
|
+
menuMaxHeight: St,
|
|
1048
|
+
onChange: (n) => Wr(e, t.index, n?.id),
|
|
1049
|
+
options: [...N],
|
|
995
1050
|
size: "sub",
|
|
996
|
-
value:
|
|
1051
|
+
value: b(N, t.type)
|
|
997
1052
|
}),
|
|
998
1053
|
title: "型別"
|
|
999
1054
|
},
|
|
1000
1055
|
{
|
|
1001
1056
|
key: "required",
|
|
1002
1057
|
render: (t) => /* @__PURE__ */ _(m, {
|
|
1003
|
-
checked:
|
|
1058
|
+
checked: Kr(e, t.index).required === !0,
|
|
1004
1059
|
inputProps: { "aria-label": `${t.label || t.fieldKey} 必填` },
|
|
1005
|
-
onChange: (n) =>
|
|
1006
|
-
...
|
|
1060
|
+
onChange: (n) => X(e, t.index, {
|
|
1061
|
+
...Kr(e, t.index),
|
|
1007
1062
|
required: n.target.checked
|
|
1008
1063
|
}),
|
|
1009
1064
|
size: "sub"
|
|
1010
1065
|
}),
|
|
1011
1066
|
title: "必填"
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
key: "filterable",
|
|
1070
|
+
render: (t) => {
|
|
1071
|
+
let n = Kr(e, t.index), r = L.get(`${e.fieldKey}.${n.fieldKey}`);
|
|
1072
|
+
return /* @__PURE__ */ v("div", { children: [
|
|
1073
|
+
/* @__PURE__ */ _(m, {
|
|
1074
|
+
checked: n.filterable === !0,
|
|
1075
|
+
inputProps: { "aria-label": `${t.label || t.fieldKey} 可篩選` },
|
|
1076
|
+
onChange: (r) => X(e, t.index, {
|
|
1077
|
+
...n,
|
|
1078
|
+
filterable: r.target.checked
|
|
1079
|
+
}),
|
|
1080
|
+
size: "sub"
|
|
1081
|
+
}),
|
|
1082
|
+
n.filterable === !0 ? /* @__PURE__ */ _(h, {
|
|
1083
|
+
color: "text-neutral",
|
|
1084
|
+
variant: "caption",
|
|
1085
|
+
children: kn
|
|
1086
|
+
}) : null,
|
|
1087
|
+
r ? /* @__PURE__ */ _(h, {
|
|
1088
|
+
color: "text-error",
|
|
1089
|
+
variant: "caption",
|
|
1090
|
+
children: r
|
|
1091
|
+
}) : null
|
|
1092
|
+
] });
|
|
1093
|
+
},
|
|
1094
|
+
title: "可篩選"
|
|
1012
1095
|
}
|
|
1013
1096
|
], r = {
|
|
1014
1097
|
render: (t) => [{
|
|
1015
1098
|
disabled: () => e.columns.length <= 1,
|
|
1016
|
-
icon:
|
|
1099
|
+
icon: tt,
|
|
1017
1100
|
iconType: "leading",
|
|
1018
1101
|
name: "移除此欄",
|
|
1019
1102
|
onClick: () => G({
|
|
@@ -1025,18 +1108,18 @@ function z({ onChange: le, value: y }) {
|
|
|
1025
1108
|
variant: "destructive-ghost"
|
|
1026
1109
|
}],
|
|
1027
1110
|
width: 104
|
|
1028
|
-
}, i =
|
|
1029
|
-
return /* @__PURE__ */ _(
|
|
1111
|
+
}, i = lr === null ? void 0 : t[lr]?.key;
|
|
1112
|
+
return /* @__PURE__ */ _(oe, {
|
|
1030
1113
|
actions: r,
|
|
1031
1114
|
columns: n,
|
|
1032
1115
|
dataSource: t,
|
|
1033
1116
|
draggable: {
|
|
1034
1117
|
enabled: !0,
|
|
1035
|
-
onDragEnd: (t, n) =>
|
|
1118
|
+
onDragEnd: (t, n) => yr(e, n.fromIndex, n.toIndex)
|
|
1036
1119
|
},
|
|
1037
1120
|
expandable: {
|
|
1038
1121
|
expandedRowKeys: i ? [i] : [],
|
|
1039
|
-
expandedRowRender: (t) =>
|
|
1122
|
+
expandedRowRender: (t) => Ur(e, t.index),
|
|
1040
1123
|
onExpand: (e, t) => K(e ? t.index : null)
|
|
1041
1124
|
},
|
|
1042
1125
|
fullWidth: !0,
|
|
@@ -1045,13 +1128,13 @@ function z({ onChange: le, value: y }) {
|
|
|
1045
1128
|
size: "sub"
|
|
1046
1129
|
});
|
|
1047
1130
|
}
|
|
1048
|
-
function
|
|
1131
|
+
function Ur(e, t) {
|
|
1049
1132
|
let n = e.columns[t];
|
|
1050
1133
|
return n ? /* @__PURE__ */ v("div", {
|
|
1051
|
-
style:
|
|
1134
|
+
style: un,
|
|
1052
1135
|
children: [
|
|
1053
1136
|
$("欄位 Key", "columnFieldKey", /* @__PURE__ */ _(f, {
|
|
1054
|
-
onChange: (r) =>
|
|
1137
|
+
onChange: (r) => X(e, t, {
|
|
1055
1138
|
...n,
|
|
1056
1139
|
fieldKey: r.target.value
|
|
1057
1140
|
}),
|
|
@@ -1060,7 +1143,7 @@ function z({ onChange: le, value: y }) {
|
|
|
1060
1143
|
variant: "base"
|
|
1061
1144
|
})),
|
|
1062
1145
|
$("提示文字", "columnPlaceholder", /* @__PURE__ */ _(f, {
|
|
1063
|
-
onChange: (r) =>
|
|
1146
|
+
onChange: (r) => X(e, t, {
|
|
1064
1147
|
...n,
|
|
1065
1148
|
placeholder: r.target.value || void 0
|
|
1066
1149
|
}),
|
|
@@ -1068,38 +1151,38 @@ function z({ onChange: le, value: y }) {
|
|
|
1068
1151
|
value: n.placeholder ?? "",
|
|
1069
1152
|
variant: "base"
|
|
1070
1153
|
})),
|
|
1071
|
-
|
|
1072
|
-
|
|
1154
|
+
zr(n, (n) => {
|
|
1155
|
+
ut(n.type) && X(e, t, n);
|
|
1073
1156
|
}, (n, r) => {
|
|
1074
|
-
|
|
1157
|
+
ut(r.type) && X(e, t, r);
|
|
1075
1158
|
}, e.columns)
|
|
1076
1159
|
]
|
|
1077
1160
|
}) : null;
|
|
1078
1161
|
}
|
|
1079
|
-
function
|
|
1080
|
-
let r = e.columns[t], i =
|
|
1162
|
+
function Wr(e, t, n) {
|
|
1163
|
+
let r = e.columns[t], i = N.find((e) => e.id === n)?.id;
|
|
1081
1164
|
if (!r || !i || r.type === i) return;
|
|
1082
|
-
let a =
|
|
1083
|
-
o.length === 0 ? (
|
|
1165
|
+
let a = Wn(r, i), o = zn(r);
|
|
1166
|
+
o.length === 0 ? (X(e, t, a), K(t)) : G({
|
|
1084
1167
|
columnIndex: t,
|
|
1085
1168
|
columnKey: r.fieldKey,
|
|
1086
1169
|
fieldKey: e.fieldKey,
|
|
1087
|
-
impact: `「${r.label || r.fieldKey}」改為${
|
|
1170
|
+
impact: `「${r.label || r.fieldKey}」改為${Gr(i)}後,這一欄的${o.join("、")}會被捨棄。`,
|
|
1088
1171
|
kind: "replace-column",
|
|
1089
1172
|
nextColumn: a
|
|
1090
1173
|
});
|
|
1091
1174
|
}
|
|
1092
|
-
function
|
|
1093
|
-
return
|
|
1175
|
+
function Gr(e) {
|
|
1176
|
+
return N.find((t) => t.id === e)?.name ?? e;
|
|
1094
1177
|
}
|
|
1095
|
-
function
|
|
1178
|
+
function Kr(e, t) {
|
|
1096
1179
|
let n = e.columns[t];
|
|
1097
1180
|
if (!n) throw Error(`Table ${e.fieldKey} has no column at index ${t}.`);
|
|
1098
1181
|
return n;
|
|
1099
1182
|
}
|
|
1100
|
-
function
|
|
1183
|
+
function qr(e, t) {
|
|
1101
1184
|
return /* @__PURE__ */ v(g, { children: [
|
|
1102
|
-
$("預設值", "fieldDefaultValue", e.type === "textarea" ?
|
|
1185
|
+
$("預設值", "fieldDefaultValue", e.type === "textarea" ? vi({
|
|
1103
1186
|
name: "fieldDefaultValue",
|
|
1104
1187
|
onChange: (n) => t({
|
|
1105
1188
|
...e,
|
|
@@ -1107,14 +1190,14 @@ function z({ onChange: le, value: y }) {
|
|
|
1107
1190
|
}),
|
|
1108
1191
|
placeholder: "輸入此欄位的預設文字",
|
|
1109
1192
|
rows: 3,
|
|
1110
|
-
value:
|
|
1193
|
+
value: Yn(e.defaultValue)
|
|
1111
1194
|
}) : /* @__PURE__ */ _(f, {
|
|
1112
1195
|
onChange: (n) => t({
|
|
1113
1196
|
...e,
|
|
1114
1197
|
defaultValue: n.target.value || void 0
|
|
1115
1198
|
}),
|
|
1116
1199
|
placeholder: "輸入此欄位的預設文字",
|
|
1117
|
-
value:
|
|
1200
|
+
value: Yn(e.defaultValue),
|
|
1118
1201
|
variant: "base"
|
|
1119
1202
|
})),
|
|
1120
1203
|
$("最小長度", "fieldMinLength", Q(e.minLength, (n) => t({
|
|
@@ -1126,20 +1209,20 @@ function z({ onChange: le, value: y }) {
|
|
|
1126
1209
|
maxLength: n
|
|
1127
1210
|
}), "例如:100", { min: 1 })),
|
|
1128
1211
|
$("格式(正規表示式)", "fieldPattern", /* @__PURE__ */ _(f, {
|
|
1129
|
-
onChange: (n) => t(
|
|
1212
|
+
onChange: (n) => t(Bn(e, n.target.value)),
|
|
1130
1213
|
placeholder: "例如:[0-9]{8}",
|
|
1131
1214
|
value: e.pattern ?? "",
|
|
1132
1215
|
variant: "base"
|
|
1133
|
-
}), !1,
|
|
1216
|
+
}), !1, Hn(e.pattern)),
|
|
1134
1217
|
e.pattern ? $("格式錯誤訊息", "fieldPatternErrorMessage", /* @__PURE__ */ _(f, {
|
|
1135
|
-
onChange: (n) => t(
|
|
1218
|
+
onChange: (n) => t(Vn(e, n.target.value)),
|
|
1136
1219
|
placeholder: "例如:統一編號為 8 位數字。",
|
|
1137
1220
|
value: e.patternErrorMessage ?? "",
|
|
1138
1221
|
variant: "base"
|
|
1139
|
-
}), !1,
|
|
1222
|
+
}), !1, Un(e.patternErrorMessage)) : null
|
|
1140
1223
|
] });
|
|
1141
1224
|
}
|
|
1142
|
-
function
|
|
1225
|
+
function Jr(e, t) {
|
|
1143
1226
|
return /* @__PURE__ */ v(g, { children: [
|
|
1144
1227
|
$("預設值", "fieldDefaultValue", Q(typeof e.defaultValue == "number" ? e.defaultValue : void 0, (n) => t({
|
|
1145
1228
|
...e,
|
|
@@ -1158,32 +1241,32 @@ function z({ onChange: le, value: y }) {
|
|
|
1158
1241
|
}), "例如:999999"))
|
|
1159
1242
|
] });
|
|
1160
1243
|
}
|
|
1161
|
-
function
|
|
1162
|
-
return $("預設值", "fieldDefaultValue",
|
|
1244
|
+
function Yr(e, t) {
|
|
1245
|
+
return $("預設值", "fieldDefaultValue", yi(e, Yn(e.defaultValue), (n) => t({
|
|
1163
1246
|
...e,
|
|
1164
1247
|
defaultValue: n
|
|
1165
1248
|
})));
|
|
1166
1249
|
}
|
|
1167
|
-
function
|
|
1168
|
-
let i =
|
|
1250
|
+
function Xr(e, t, n, r) {
|
|
1251
|
+
let i = Ae(e.type, H), a = {
|
|
1169
1252
|
commit: (e) => t(e),
|
|
1170
1253
|
rowColumns: r
|
|
1171
|
-
}, o =
|
|
1172
|
-
...
|
|
1173
|
-
...i.map(
|
|
1174
|
-
...
|
|
1254
|
+
}, o = D(e) ? jn(e.dataSource) : vn, s = D(e) ? H.find((t) => t.key === e.dataSource.key && t.version === e.dataSource.version) : null, c = s ? i.some((e) => e.key === s.key && e.version === s.version) : !1, l = [
|
|
1255
|
+
...Cn,
|
|
1256
|
+
...i.map(Nn),
|
|
1257
|
+
...D(e) && !c ? [{
|
|
1175
1258
|
id: o,
|
|
1176
1259
|
name: `${e.dataSource.key} v${e.dataSource.version}(目前不可用或不支援)`
|
|
1177
1260
|
}] : []
|
|
1178
|
-
], u =
|
|
1261
|
+
], u = dt(e);
|
|
1179
1262
|
return /* @__PURE__ */ v(g, { children: [
|
|
1180
1263
|
e.type === "select" || e.type === "autocomplete" ? $("選擇模式", "fieldSelectionMode", /* @__PURE__ */ _(p, {
|
|
1181
1264
|
clearable: !1,
|
|
1182
1265
|
onChange: (t) => {
|
|
1183
|
-
(t?.id === "single" || t?.id === "multiple") &&
|
|
1266
|
+
(t?.id === "single" || t?.id === "multiple") && br(e, t.id, n);
|
|
1184
1267
|
},
|
|
1185
|
-
options: [...
|
|
1186
|
-
value:
|
|
1268
|
+
options: [...wn],
|
|
1269
|
+
value: b(wn, u)
|
|
1187
1270
|
})) : $("選擇模式", "fieldSelectionMode", /* @__PURE__ */ _(h, {
|
|
1188
1271
|
color: "text-neutral",
|
|
1189
1272
|
variant: "body",
|
|
@@ -1191,29 +1274,29 @@ function z({ onChange: le, value: y }) {
|
|
|
1191
1274
|
})),
|
|
1192
1275
|
$("選項來源", "fieldOptionSource", /* @__PURE__ */ _(p, {
|
|
1193
1276
|
clearable: !1,
|
|
1194
|
-
disabled:
|
|
1195
|
-
onChange: (n) =>
|
|
1277
|
+
disabled: ir === "loading" && !D(e),
|
|
1278
|
+
onChange: (n) => Sr(e, n?.id, t),
|
|
1196
1279
|
options: l,
|
|
1197
1280
|
placeholder: "選擇選項來源",
|
|
1198
|
-
value:
|
|
1281
|
+
value: b(l, o)
|
|
1199
1282
|
})),
|
|
1200
|
-
|
|
1283
|
+
D(e) ? Zr(e, i, a) : di(e, t)
|
|
1201
1284
|
] });
|
|
1202
1285
|
}
|
|
1203
|
-
function
|
|
1204
|
-
let r =
|
|
1286
|
+
function Zr(e, t, n) {
|
|
1287
|
+
let r = H.find((t) => t.key === e.dataSource.key && t.version === e.dataSource.version), i = r && !Se(r, e.type);
|
|
1205
1288
|
return /* @__PURE__ */ v("div", {
|
|
1206
|
-
style:
|
|
1289
|
+
style: rn,
|
|
1207
1290
|
children: [
|
|
1208
|
-
|
|
1291
|
+
ir === "loading" ? /* @__PURE__ */ _(h, {
|
|
1209
1292
|
color: "text-neutral",
|
|
1210
1293
|
variant: "body",
|
|
1211
1294
|
children: "正在載入可用的選項來源…"
|
|
1212
1295
|
}) : null,
|
|
1213
|
-
|
|
1296
|
+
nr ? /* @__PURE__ */ _(h, {
|
|
1214
1297
|
color: "text-error",
|
|
1215
1298
|
variant: "body",
|
|
1216
|
-
children:
|
|
1299
|
+
children: nr
|
|
1217
1300
|
}) : null,
|
|
1218
1301
|
r ? null : /* @__PURE__ */ _(h, {
|
|
1219
1302
|
color: "text-warning",
|
|
@@ -1225,28 +1308,28 @@ function z({ onChange: le, value: y }) {
|
|
|
1225
1308
|
variant: "body",
|
|
1226
1309
|
children: "這個來源不支援目前的控制項,請改選其他來源。"
|
|
1227
1310
|
}) : null,
|
|
1228
|
-
r ?
|
|
1229
|
-
r && r.parameters.length > 0 ?
|
|
1230
|
-
t.length === 0 && !
|
|
1311
|
+
r ? Qr(r) : null,
|
|
1312
|
+
r && r.parameters.length > 0 ? $r(e, r, n) : null,
|
|
1313
|
+
t.length === 0 && !nr ? /* @__PURE__ */ _(h, {
|
|
1231
1314
|
color: "text-warning",
|
|
1232
1315
|
variant: "body",
|
|
1233
1316
|
children: "沒有支援目前控制項的已註冊來源。"
|
|
1234
1317
|
}) : null,
|
|
1235
1318
|
/* @__PURE__ */ _("div", {
|
|
1236
|
-
style:
|
|
1319
|
+
style: sn,
|
|
1237
1320
|
children: /* @__PURE__ */ _(c, {
|
|
1238
|
-
disabled:
|
|
1239
|
-
loading:
|
|
1240
|
-
onClick: () => void
|
|
1321
|
+
disabled: sr,
|
|
1322
|
+
loading: sr,
|
|
1323
|
+
onClick: () => void Tr(),
|
|
1241
1324
|
size: "sub",
|
|
1242
1325
|
type: "button",
|
|
1243
1326
|
variant: "base-secondary",
|
|
1244
1327
|
children: "檢查全部動態選項設定"
|
|
1245
1328
|
})
|
|
1246
1329
|
}),
|
|
1247
|
-
|
|
1248
|
-
style:
|
|
1249
|
-
children:
|
|
1330
|
+
or ? /* @__PURE__ */ _("div", {
|
|
1331
|
+
style: an,
|
|
1332
|
+
children: or.length > 0 ? or.map((e) => /* @__PURE__ */ _(h, {
|
|
1250
1333
|
color: "text-error",
|
|
1251
1334
|
variant: "caption",
|
|
1252
1335
|
children: e
|
|
@@ -1259,17 +1342,17 @@ function z({ onChange: le, value: y }) {
|
|
|
1259
1342
|
]
|
|
1260
1343
|
});
|
|
1261
1344
|
}
|
|
1262
|
-
function
|
|
1345
|
+
function Qr(e) {
|
|
1263
1346
|
return /* @__PURE__ */ v("div", {
|
|
1264
|
-
style:
|
|
1347
|
+
style: ln,
|
|
1265
1348
|
children: [
|
|
1266
1349
|
e.description ? /* @__PURE__ */ _(h, {
|
|
1267
1350
|
variant: "body",
|
|
1268
1351
|
children: e.description
|
|
1269
1352
|
}) : null,
|
|
1270
1353
|
/* @__PURE__ */ _("div", {
|
|
1271
|
-
style:
|
|
1272
|
-
children:
|
|
1354
|
+
style: cn,
|
|
1355
|
+
children: Mn(e).map((e) => /* @__PURE__ */ _(se, {
|
|
1273
1356
|
label: e,
|
|
1274
1357
|
readOnly: !0,
|
|
1275
1358
|
size: "minor"
|
|
@@ -1288,26 +1371,26 @@ function z({ onChange: le, value: y }) {
|
|
|
1288
1371
|
]
|
|
1289
1372
|
});
|
|
1290
1373
|
}
|
|
1291
|
-
function
|
|
1374
|
+
function $r(e, t, n) {
|
|
1292
1375
|
let r = t.parameters.map((e, t) => ({
|
|
1293
1376
|
key: e.key,
|
|
1294
1377
|
index: t,
|
|
1295
1378
|
parameter: e
|
|
1296
1379
|
}));
|
|
1297
1380
|
return /* @__PURE__ */ v("div", {
|
|
1298
|
-
style:
|
|
1381
|
+
style: on,
|
|
1299
1382
|
children: [
|
|
1300
1383
|
/* @__PURE__ */ _(h, {
|
|
1301
1384
|
color: "text-neutral",
|
|
1302
1385
|
variant: "label-secondary",
|
|
1303
1386
|
children: "這個來源需要的條件"
|
|
1304
1387
|
}),
|
|
1305
|
-
/* @__PURE__ */ _(
|
|
1388
|
+
/* @__PURE__ */ _(oe, {
|
|
1306
1389
|
columns: [
|
|
1307
1390
|
{
|
|
1308
1391
|
key: "parameter",
|
|
1309
1392
|
render: (e) => /* @__PURE__ */ v("div", {
|
|
1310
|
-
style:
|
|
1393
|
+
style: pn,
|
|
1311
1394
|
children: [/* @__PURE__ */ _(h, {
|
|
1312
1395
|
variant: "input",
|
|
1313
1396
|
children: e.parameter.label ?? e.parameter.key
|
|
@@ -1323,15 +1406,15 @@ function z({ onChange: le, value: y }) {
|
|
|
1323
1406
|
{
|
|
1324
1407
|
key: "binding",
|
|
1325
1408
|
width: 268,
|
|
1326
|
-
render: (t) =>
|
|
1409
|
+
render: (t) => ni(e, t.parameter, n),
|
|
1327
1410
|
title: "值從哪裡來"
|
|
1328
1411
|
},
|
|
1329
1412
|
{
|
|
1330
1413
|
key: "constant",
|
|
1331
1414
|
width: 140,
|
|
1332
1415
|
render: (t) => {
|
|
1333
|
-
let r =
|
|
1334
|
-
return r === "CONSTANT" ?
|
|
1416
|
+
let r = Be(y(e, t.parameter.key));
|
|
1417
|
+
return r === "CONSTANT" ? oi(e, t.parameter.key, t.parameter.type, y(e, t.parameter.key), n) : /* @__PURE__ */ _(h, {
|
|
1335
1418
|
color: "text-neutral",
|
|
1336
1419
|
variant: "caption",
|
|
1337
1420
|
children: r === "EXPRESSION" ? "見下方運算式" : "—"
|
|
@@ -1344,7 +1427,7 @@ function z({ onChange: le, value: y }) {
|
|
|
1344
1427
|
render: (t) => /* @__PURE__ */ _(h, {
|
|
1345
1428
|
color: "text-neutral",
|
|
1346
1429
|
variant: "caption",
|
|
1347
|
-
children:
|
|
1430
|
+
children: ii(y(e, t.parameter.key), t.parameter, n, ti(e, t.parameter, n))
|
|
1348
1431
|
}),
|
|
1349
1432
|
title: "填寫時的行為"
|
|
1350
1433
|
}
|
|
@@ -1354,31 +1437,31 @@ function z({ onChange: le, value: y }) {
|
|
|
1354
1437
|
showHeader: !0,
|
|
1355
1438
|
size: "sub"
|
|
1356
1439
|
}),
|
|
1357
|
-
|
|
1440
|
+
ei(e, t, n)
|
|
1358
1441
|
]
|
|
1359
1442
|
});
|
|
1360
1443
|
}
|
|
1361
|
-
function
|
|
1362
|
-
let r = t.parameters.filter((t) =>
|
|
1444
|
+
function ei(e, t, n) {
|
|
1445
|
+
let r = t.parameters.filter((t) => Be(y(e, t.key)) === "EXPRESSION");
|
|
1363
1446
|
return r.length === 0 ? null : /* @__PURE__ */ _("div", {
|
|
1364
|
-
style:
|
|
1447
|
+
style: on,
|
|
1365
1448
|
children: r.map((t) => {
|
|
1366
1449
|
let r = `${t.label ?? t.key} 的運算式`;
|
|
1367
1450
|
return /* @__PURE__ */ v("div", {
|
|
1368
1451
|
"data-data-source-expression": t.key,
|
|
1369
|
-
style:
|
|
1452
|
+
style: on,
|
|
1370
1453
|
children: [
|
|
1371
1454
|
/* @__PURE__ */ _(h, {
|
|
1372
1455
|
color: "text-neutral",
|
|
1373
1456
|
variant: "label-secondary",
|
|
1374
1457
|
children: r
|
|
1375
1458
|
}),
|
|
1376
|
-
|
|
1459
|
+
vi({
|
|
1377
1460
|
name: r,
|
|
1378
|
-
onChange: (r) =>
|
|
1461
|
+
onChange: (r) => li(e, t.key, r, n),
|
|
1379
1462
|
placeholder: n.rowColumns ? "例如:row.plant == \"\" ? form.plant : row.plant" : "例如:form.chargeTo == \"OTHER\" ? \"TW02\" : form.plant",
|
|
1380
1463
|
rows: 2,
|
|
1381
|
-
value:
|
|
1464
|
+
value: Re(e, t.key) ?? ""
|
|
1382
1465
|
}),
|
|
1383
1466
|
/* @__PURE__ */ _(h, {
|
|
1384
1467
|
color: "text-neutral",
|
|
@@ -1390,61 +1473,61 @@ function z({ onChange: le, value: y }) {
|
|
|
1390
1473
|
})
|
|
1391
1474
|
});
|
|
1392
1475
|
}
|
|
1393
|
-
function
|
|
1394
|
-
return
|
|
1476
|
+
function ti(e, t, n) {
|
|
1477
|
+
return ke(t.type, x.fields, e.fieldKey).length + (n.rowColumns ? je(t.type, n.rowColumns, e.fieldKey).length : 0);
|
|
1395
1478
|
}
|
|
1396
|
-
function
|
|
1397
|
-
let r =
|
|
1398
|
-
id: `${
|
|
1479
|
+
function ni(e, t, n) {
|
|
1480
|
+
let r = Pn(y(e, t.key)), i = n.rowColumns ? je(t.type, n.rowColumns, e.fieldKey).map((e) => ({
|
|
1481
|
+
id: `${xn}${e.id}`,
|
|
1399
1482
|
name: `同列:${e.name}`
|
|
1400
1483
|
})) : [], a = [
|
|
1401
1484
|
...t.required ? [] : [{
|
|
1402
|
-
id:
|
|
1485
|
+
id: Sn,
|
|
1403
1486
|
name: "未綁定"
|
|
1404
1487
|
}],
|
|
1405
1488
|
...i,
|
|
1406
|
-
...
|
|
1489
|
+
...ke(t.type, x.fields, e.fieldKey),
|
|
1407
1490
|
...t.type === "STRING_ARRAY" ? [] : [{
|
|
1408
|
-
id:
|
|
1491
|
+
id: yn,
|
|
1409
1492
|
name: "固定常數"
|
|
1410
1493
|
}, {
|
|
1411
|
-
id:
|
|
1494
|
+
id: bn,
|
|
1412
1495
|
name: "運算式"
|
|
1413
1496
|
}],
|
|
1414
|
-
...r ===
|
|
1415
|
-
id:
|
|
1497
|
+
...r === I ? [{
|
|
1498
|
+
id: I,
|
|
1416
1499
|
name: "不支援的來源(請重新設定)"
|
|
1417
1500
|
}] : []
|
|
1418
1501
|
];
|
|
1419
1502
|
return /* @__PURE__ */ _("div", {
|
|
1420
1503
|
"data-data-source-parameter": t.key,
|
|
1421
|
-
style:
|
|
1504
|
+
style: mn,
|
|
1422
1505
|
children: /* @__PURE__ */ _(p, {
|
|
1423
1506
|
clearable: !1,
|
|
1424
1507
|
fullWidth: !0,
|
|
1425
1508
|
inputProps: {
|
|
1426
1509
|
"aria-label": `${t.label ?? t.key} 的值來源`,
|
|
1427
|
-
title:
|
|
1510
|
+
title: b(a, r)?.name ?? ""
|
|
1428
1511
|
},
|
|
1429
|
-
onChange: (r) =>
|
|
1512
|
+
onChange: (r) => ci(e, t.key, t.type, r?.id, n),
|
|
1430
1513
|
options: a,
|
|
1431
1514
|
placeholder: "選擇欄位或常數",
|
|
1432
1515
|
size: "sub",
|
|
1433
|
-
value:
|
|
1516
|
+
value: b(a, r)
|
|
1434
1517
|
})
|
|
1435
1518
|
});
|
|
1436
1519
|
}
|
|
1437
|
-
function
|
|
1438
|
-
return
|
|
1520
|
+
function ri(e) {
|
|
1521
|
+
return Ct[e];
|
|
1439
1522
|
}
|
|
1440
|
-
function
|
|
1441
|
-
let i =
|
|
1442
|
-
return i === "CONSTANT" ? "固定值,不隨填寫變動" : i === "FIELD" ? `隨欄位「${
|
|
1523
|
+
function ii(e, t, n, r) {
|
|
1524
|
+
let i = Be(e);
|
|
1525
|
+
return i === "CONSTANT" ? "固定值,不隨填寫變動" : i === "FIELD" ? `隨欄位「${ai(e, n)}」變動` : i === "ROW_FIELD" ? `隨同列「${ai(e, n)}」變動` : i === "EXPRESSION" ? "由運算式計算,隨引用的欄位變動" : e ? "這個來源目前的版本不支援,選項無法載入" : t.required ? r > 0 ? "尚未設定,選項無法載入" : `沒有相容的${ri(t.type)}欄位,請改用固定值` : "未設定,不做這層篩選";
|
|
1443
1526
|
}
|
|
1444
|
-
function
|
|
1527
|
+
function ai(e, t) {
|
|
1445
1528
|
let n = e?.from;
|
|
1446
1529
|
if (n?.kind === "FIELD") {
|
|
1447
|
-
let e =
|
|
1530
|
+
let e = x.fields.find((e) => e.fieldKey === n.fieldKey);
|
|
1448
1531
|
return e ? e.label || e.fieldKey : "";
|
|
1449
1532
|
}
|
|
1450
1533
|
if (n?.kind === "ROW_FIELD") {
|
|
@@ -1453,14 +1536,14 @@ function z({ onChange: le, value: y }) {
|
|
|
1453
1536
|
}
|
|
1454
1537
|
return "";
|
|
1455
1538
|
}
|
|
1456
|
-
function
|
|
1539
|
+
function oi(e, t, n, r, i) {
|
|
1457
1540
|
return /* @__PURE__ */ _("div", {
|
|
1458
1541
|
"data-data-source-constant": t,
|
|
1459
|
-
children:
|
|
1542
|
+
children: si(e, t, n, r, i)
|
|
1460
1543
|
});
|
|
1461
1544
|
}
|
|
1462
|
-
function
|
|
1463
|
-
let a =
|
|
1545
|
+
function si(e, t, n, r, i) {
|
|
1546
|
+
let a = ze(e, t);
|
|
1464
1547
|
if (n === "BOOLEAN") {
|
|
1465
1548
|
let n = [{
|
|
1466
1549
|
id: "true",
|
|
@@ -1472,10 +1555,10 @@ function z({ onChange: le, value: y }) {
|
|
|
1472
1555
|
return /* @__PURE__ */ _(p, {
|
|
1473
1556
|
clearable: !1,
|
|
1474
1557
|
fullWidth: !0,
|
|
1475
|
-
onChange: (n) =>
|
|
1558
|
+
onChange: (n) => ui(e, t, n?.id === "true", i),
|
|
1476
1559
|
options: n,
|
|
1477
1560
|
size: "sub",
|
|
1478
|
-
value:
|
|
1561
|
+
value: b(n, a === !0 ? "true" : "false")
|
|
1479
1562
|
});
|
|
1480
1563
|
}
|
|
1481
1564
|
return n === "STRING_ARRAY" ? /* @__PURE__ */ _(h, {
|
|
@@ -1483,17 +1566,17 @@ function z({ onChange: le, value: y }) {
|
|
|
1483
1566
|
variant: "caption",
|
|
1484
1567
|
children: "這個條件要收多個值,請綁定一個複選欄位;不接受固定值。"
|
|
1485
1568
|
}) : /* @__PURE__ */ _(f, {
|
|
1486
|
-
onChange: (r) =>
|
|
1569
|
+
onChange: (r) => ui(e, t, n === "NUMBER" ? Oe(r.target.value) ?? 0 : r.target.value, i),
|
|
1487
1570
|
placeholder: n === "NUMBER" ? "輸入數字" : "輸入固定值",
|
|
1488
|
-
value:
|
|
1571
|
+
value: In(r, n),
|
|
1489
1572
|
variant: "base"
|
|
1490
1573
|
});
|
|
1491
1574
|
}
|
|
1492
|
-
function
|
|
1493
|
-
r !==
|
|
1575
|
+
function ci(e, t, n, r, i) {
|
|
1576
|
+
r !== I && i.commit(Ke(e, t, Ln(t, n, r)));
|
|
1494
1577
|
}
|
|
1495
|
-
function
|
|
1496
|
-
r.commit(
|
|
1578
|
+
function li(e, t, n, r) {
|
|
1579
|
+
r.commit(Ke(e, t, {
|
|
1497
1580
|
from: {
|
|
1498
1581
|
expression: n,
|
|
1499
1582
|
kind: "EXPRESSION"
|
|
@@ -1501,8 +1584,8 @@ function z({ onChange: le, value: y }) {
|
|
|
1501
1584
|
parameter: t
|
|
1502
1585
|
}));
|
|
1503
1586
|
}
|
|
1504
|
-
function
|
|
1505
|
-
r.commit(
|
|
1587
|
+
function ui(e, t, n, r) {
|
|
1588
|
+
r.commit(Ke(e, t, {
|
|
1506
1589
|
from: {
|
|
1507
1590
|
kind: "CONSTANT",
|
|
1508
1591
|
value: n
|
|
@@ -1510,8 +1593,8 @@ function z({ onChange: le, value: y }) {
|
|
|
1510
1593
|
parameter: t
|
|
1511
1594
|
}));
|
|
1512
1595
|
}
|
|
1513
|
-
function
|
|
1514
|
-
let n =
|
|
1596
|
+
function di(e, t) {
|
|
1597
|
+
let n = dt(e), r = Array.isArray(e.defaultValue) ? e.defaultValue : [], i = e.options.map(Le), a = i.filter((e) => r.includes(e.id));
|
|
1515
1598
|
return /* @__PURE__ */ v(g, { children: [$("預設值", "fieldDefaultValue", n === "multiple" ? /* @__PURE__ */ _(p, {
|
|
1516
1599
|
clearable: !0,
|
|
1517
1600
|
mode: "multiple",
|
|
@@ -1530,10 +1613,10 @@ function z({ onChange: le, value: y }) {
|
|
|
1530
1613
|
}),
|
|
1531
1614
|
options: i,
|
|
1532
1615
|
placeholder: "選擇預設選項",
|
|
1533
|
-
value: typeof e.defaultValue == "string" ?
|
|
1534
|
-
})), $("選項", "fieldOptions",
|
|
1616
|
+
value: typeof e.defaultValue == "string" ? b(i, e.defaultValue) : null
|
|
1617
|
+
})), $("選項", "fieldOptions", bi(e, t), !0)] });
|
|
1535
1618
|
}
|
|
1536
|
-
function
|
|
1619
|
+
function fi(e, t) {
|
|
1537
1620
|
let n = typeof e.defaultValue == "boolean" ? String(e.defaultValue) : "unset";
|
|
1538
1621
|
return $("預設值", "fieldDefaultValue", /* @__PURE__ */ _(p, {
|
|
1539
1622
|
clearable: !1,
|
|
@@ -1541,12 +1624,12 @@ function z({ onChange: le, value: y }) {
|
|
|
1541
1624
|
...e,
|
|
1542
1625
|
defaultValue: n?.id === "true" || n?.id !== "false" && void 0
|
|
1543
1626
|
}),
|
|
1544
|
-
options: [...
|
|
1627
|
+
options: [...Tn],
|
|
1545
1628
|
placeholder: "選擇預設狀態",
|
|
1546
|
-
value:
|
|
1629
|
+
value: b(Tn, n)
|
|
1547
1630
|
}));
|
|
1548
1631
|
}
|
|
1549
|
-
function
|
|
1632
|
+
function pi(e, t) {
|
|
1550
1633
|
return $("可複選", "fieldMemberMultiple", /* @__PURE__ */ _(m, {
|
|
1551
1634
|
checked: e.multiple === !0,
|
|
1552
1635
|
label: e.multiple === !0 ? "可選多位" : "只能選一位",
|
|
@@ -1558,106 +1641,106 @@ function z({ onChange: le, value: y }) {
|
|
|
1558
1641
|
size: "sub"
|
|
1559
1642
|
}));
|
|
1560
1643
|
}
|
|
1561
|
-
function
|
|
1644
|
+
function mi(e, t) {
|
|
1562
1645
|
return /* @__PURE__ */ v(g, { children: [$("檔案數", "fieldMaxFiles", Q(e.maxFiles, (n) => t({
|
|
1563
1646
|
...e,
|
|
1564
1647
|
maxFiles: n
|
|
1565
|
-
}), "例如:1", { min: 1 })), $("MIME", "fieldAcceptedMimeTypes",
|
|
1648
|
+
}), "例如:1", { min: 1 })), $("MIME", "fieldAcceptedMimeTypes", vi({
|
|
1566
1649
|
name: "fieldAcceptedMimeTypes",
|
|
1567
1650
|
onChange: (n) => t({
|
|
1568
1651
|
...e,
|
|
1569
|
-
acceptedMimeTypes:
|
|
1652
|
+
acceptedMimeTypes: Xn(n)
|
|
1570
1653
|
}),
|
|
1571
1654
|
placeholder: "每行一個 MIME type,例如:application/pdf",
|
|
1572
1655
|
rows: 3,
|
|
1573
|
-
value:
|
|
1656
|
+
value: Zn(e.acceptedMimeTypes)
|
|
1574
1657
|
}), !1)] });
|
|
1575
1658
|
}
|
|
1576
|
-
function
|
|
1577
|
-
let t =
|
|
1578
|
-
return t.length ? /* @__PURE__ */ _(g, { children:
|
|
1659
|
+
function hi(e) {
|
|
1660
|
+
let t = x.fields.filter((t) => t.fieldKey !== e.fieldKey && !ct(t) && !lt(t));
|
|
1661
|
+
return t.length ? /* @__PURE__ */ _(g, { children: Dn.map((n) => gi(e, n, t)) }) : /* @__PURE__ */ _(h, {
|
|
1579
1662
|
color: "text-neutral",
|
|
1580
|
-
style:
|
|
1663
|
+
style: F,
|
|
1581
1664
|
variant: "body",
|
|
1582
1665
|
children: "目前沒有其他欄位可作為條件來源。新增更多欄位後即可設定條件規則。"
|
|
1583
1666
|
});
|
|
1584
1667
|
}
|
|
1585
|
-
function
|
|
1586
|
-
let r = e[t.target], i = r ?
|
|
1668
|
+
function gi(e, t, n) {
|
|
1669
|
+
let r = e[t.target], i = r ? De(r) : null, a = n.find((e) => e.fieldKey === i?.fieldKey), o = a ?? n[0], s = n.map(qn), c = Ne(o), l = i && c.some((e) => e.id === i.operator) ? i.operator : Fe(o), u = i?.value ?? Ie(o), d = !!r, ee = d && (!i || !a);
|
|
1587
1670
|
return $(t.label, t.name, /* @__PURE__ */ v("div", {
|
|
1588
|
-
style:
|
|
1671
|
+
style: Xt,
|
|
1589
1672
|
children: [/* @__PURE__ */ _(m, {
|
|
1590
1673
|
checked: d,
|
|
1591
1674
|
label: d ? "已啟用" : "不啟用",
|
|
1592
|
-
onChange: (e) =>
|
|
1675
|
+
onChange: (e) => Z(t.target, e.target.checked ? me(o, Fe(o), Ie(o)) : void 0),
|
|
1593
1676
|
size: "sub",
|
|
1594
1677
|
supportingText: t.supportingText
|
|
1595
|
-
}), d ?
|
|
1678
|
+
}), d ? ee ? /* @__PURE__ */ _(h, {
|
|
1596
1679
|
color: "text-warning",
|
|
1597
1680
|
variant: "body",
|
|
1598
1681
|
children: "這個規則不是目前 UI 支援的格式。重新選擇條件後會取代既有規則。"
|
|
1599
1682
|
}) : /* @__PURE__ */ v("div", {
|
|
1600
|
-
style:
|
|
1683
|
+
style: Zt,
|
|
1601
1684
|
children: [
|
|
1602
1685
|
/* @__PURE__ */ _(p, {
|
|
1603
1686
|
clearable: !1,
|
|
1604
1687
|
onChange: (e) => {
|
|
1605
1688
|
let r = n.find((t) => t.fieldKey === e?.id) ?? o;
|
|
1606
|
-
|
|
1689
|
+
Z(t.target, me(r, Fe(r), Ie(r)));
|
|
1607
1690
|
},
|
|
1608
1691
|
options: s,
|
|
1609
1692
|
placeholder: "選擇欄位",
|
|
1610
|
-
value:
|
|
1693
|
+
value: b(s, o.fieldKey)
|
|
1611
1694
|
}),
|
|
1612
1695
|
/* @__PURE__ */ _(p, {
|
|
1613
1696
|
clearable: !1,
|
|
1614
|
-
onChange: (e) =>
|
|
1697
|
+
onChange: (e) => Z(t.target, me(o, Me(e?.id) ?? l, u)),
|
|
1615
1698
|
options: [...c],
|
|
1616
1699
|
placeholder: "判斷方式",
|
|
1617
|
-
value:
|
|
1700
|
+
value: b(c, l)
|
|
1618
1701
|
}),
|
|
1619
|
-
|
|
1702
|
+
_i(o, u, (e) => Z(t.target, me(o, l, e)))
|
|
1620
1703
|
]
|
|
1621
1704
|
}) : null]
|
|
1622
1705
|
}), !0);
|
|
1623
1706
|
}
|
|
1624
|
-
function
|
|
1625
|
-
|
|
1707
|
+
function Z(e, t) {
|
|
1708
|
+
hr({ [e]: t });
|
|
1626
1709
|
}
|
|
1627
|
-
function
|
|
1710
|
+
function _i(e, t, n) {
|
|
1628
1711
|
if (e.type === "boolean") return /* @__PURE__ */ _(p, {
|
|
1629
1712
|
clearable: !1,
|
|
1630
1713
|
onChange: (e) => n(e?.id ?? "true"),
|
|
1631
|
-
options: [...
|
|
1714
|
+
options: [...En],
|
|
1632
1715
|
placeholder: "比較值",
|
|
1633
|
-
value:
|
|
1716
|
+
value: b(En, t === "false" ? "false" : "true")
|
|
1634
1717
|
});
|
|
1635
|
-
if (
|
|
1636
|
-
let r = e.options.map(
|
|
1718
|
+
if (we(e)) {
|
|
1719
|
+
let r = e.options.map(Le);
|
|
1637
1720
|
return /* @__PURE__ */ _(p, {
|
|
1638
1721
|
clearable: !1,
|
|
1639
1722
|
onChange: (e) => n(e?.id ?? r[0]?.id ?? ""),
|
|
1640
1723
|
options: r,
|
|
1641
1724
|
placeholder: "比較值",
|
|
1642
|
-
value:
|
|
1725
|
+
value: b(r, t)
|
|
1643
1726
|
});
|
|
1644
1727
|
}
|
|
1645
|
-
return
|
|
1728
|
+
return Ce(e) ? Q(Oe(t), (e) => n(String(e ?? 0)), "比較值") : xe(e) ? yi(e, t, (e) => n(e ?? "")) : /* @__PURE__ */ _(f, {
|
|
1646
1729
|
onChange: (e) => n(e.target.value),
|
|
1647
1730
|
placeholder: "比較值",
|
|
1648
1731
|
value: t,
|
|
1649
1732
|
variant: "base"
|
|
1650
1733
|
});
|
|
1651
1734
|
}
|
|
1652
|
-
function
|
|
1653
|
-
return /* @__PURE__ */ _(
|
|
1735
|
+
function vi({ name: e, onChange: t, placeholder: n, rows: r, value: i }) {
|
|
1736
|
+
return /* @__PURE__ */ _(ce, {
|
|
1654
1737
|
"aria-label": e,
|
|
1655
1738
|
onChange: (e) => t(e.target.value),
|
|
1656
1739
|
placeholder: n,
|
|
1657
|
-
ref:
|
|
1740
|
+
ref: hn,
|
|
1658
1741
|
resize: "vertical",
|
|
1659
1742
|
rows: r,
|
|
1660
|
-
style:
|
|
1743
|
+
style: Gt,
|
|
1661
1744
|
value: i
|
|
1662
1745
|
});
|
|
1663
1746
|
}
|
|
@@ -1665,7 +1748,7 @@ function z({ onChange: le, value: y }) {
|
|
|
1665
1748
|
return /* @__PURE__ */ _(f, {
|
|
1666
1749
|
max: r.max,
|
|
1667
1750
|
min: r.min,
|
|
1668
|
-
onChange: (e) => t(
|
|
1751
|
+
onChange: (e) => t(ge(Oe(e.target.value), r)),
|
|
1669
1752
|
placeholder: n,
|
|
1670
1753
|
showSpinner: !0,
|
|
1671
1754
|
step: r.step ?? 1,
|
|
@@ -1673,23 +1756,23 @@ function z({ onChange: le, value: y }) {
|
|
|
1673
1756
|
variant: "measure"
|
|
1674
1757
|
});
|
|
1675
1758
|
}
|
|
1676
|
-
function
|
|
1759
|
+
function yi(e, t, n) {
|
|
1677
1760
|
return e.type === "datetime" ? /* @__PURE__ */ _(u, {
|
|
1678
1761
|
formatDate: "YYYY-MM-DD",
|
|
1679
1762
|
formatTime: "HH:mm",
|
|
1680
1763
|
hideSecond: !0,
|
|
1681
|
-
onChange: (e) => n(
|
|
1764
|
+
onChange: (e) => n(be(e)),
|
|
1682
1765
|
placeholderLeft: "選擇日期",
|
|
1683
1766
|
placeholderRight: "選擇時間",
|
|
1684
|
-
value:
|
|
1767
|
+
value: Pe(t)
|
|
1685
1768
|
}) : /* @__PURE__ */ _(l, {
|
|
1686
1769
|
format: "YYYY-MM-DD",
|
|
1687
|
-
onChange: (e) => n(
|
|
1770
|
+
onChange: (e) => n(ye(e)),
|
|
1688
1771
|
placeholder: "選擇日期",
|
|
1689
|
-
value:
|
|
1772
|
+
value: Pe(t)
|
|
1690
1773
|
});
|
|
1691
1774
|
}
|
|
1692
|
-
function
|
|
1775
|
+
function bi(e, t) {
|
|
1693
1776
|
let n = e.options.map((t, n) => ({
|
|
1694
1777
|
index: n,
|
|
1695
1778
|
key: `${e.fieldKey}-${n}`,
|
|
@@ -1697,12 +1780,12 @@ function z({ onChange: le, value: y }) {
|
|
|
1697
1780
|
value: t.value
|
|
1698
1781
|
}));
|
|
1699
1782
|
return /* @__PURE__ */ v("div", {
|
|
1700
|
-
style:
|
|
1701
|
-
children: [/* @__PURE__ */ _(
|
|
1783
|
+
style: en,
|
|
1784
|
+
children: [/* @__PURE__ */ _(oe, {
|
|
1702
1785
|
actions: {
|
|
1703
1786
|
render: (n) => [{
|
|
1704
1787
|
disabled: () => e.options.length <= 1,
|
|
1705
|
-
icon:
|
|
1788
|
+
icon: tt,
|
|
1706
1789
|
iconType: "icon-only",
|
|
1707
1790
|
name: "移除選項",
|
|
1708
1791
|
onClick: () => t({
|
|
@@ -1718,7 +1801,7 @@ function z({ onChange: le, value: y }) {
|
|
|
1718
1801
|
render: (n) => /* @__PURE__ */ _(f, {
|
|
1719
1802
|
onChange: (r) => t({
|
|
1720
1803
|
...e,
|
|
1721
|
-
options:
|
|
1804
|
+
options: Qn(e.options, n.index, { label: r.target.value })
|
|
1722
1805
|
}),
|
|
1723
1806
|
placeholder: "例如:主管",
|
|
1724
1807
|
size: "sub",
|
|
@@ -1731,7 +1814,7 @@ function z({ onChange: le, value: y }) {
|
|
|
1731
1814
|
render: (n) => /* @__PURE__ */ _(f, {
|
|
1732
1815
|
onChange: (r) => t({
|
|
1733
1816
|
...e,
|
|
1734
|
-
options:
|
|
1817
|
+
options: Qn(e.options, n.index, { value: r.target.value })
|
|
1735
1818
|
}),
|
|
1736
1819
|
placeholder: "例如:manager",
|
|
1737
1820
|
size: "sub",
|
|
@@ -1744,13 +1827,13 @@ function z({ onChange: le, value: y }) {
|
|
|
1744
1827
|
showHeader: !0,
|
|
1745
1828
|
size: "sub"
|
|
1746
1829
|
}), /* @__PURE__ */ _("div", {
|
|
1747
|
-
style:
|
|
1830
|
+
style: tn,
|
|
1748
1831
|
children: /* @__PURE__ */ _(c, {
|
|
1749
|
-
icon:
|
|
1832
|
+
icon: et,
|
|
1750
1833
|
iconType: "leading",
|
|
1751
1834
|
onClick: () => t({
|
|
1752
1835
|
...e,
|
|
1753
|
-
options: [...e.options,
|
|
1836
|
+
options: [...e.options, $n(e.options)]
|
|
1754
1837
|
}),
|
|
1755
1838
|
variant: "base-secondary",
|
|
1756
1839
|
children: "新增選項"
|
|
@@ -1758,30 +1841,30 @@ function z({ onChange: le, value: y }) {
|
|
|
1758
1841
|
})]
|
|
1759
1842
|
});
|
|
1760
1843
|
}
|
|
1761
|
-
function
|
|
1844
|
+
function xi(e, t, n) {
|
|
1762
1845
|
return /* @__PURE__ */ _("div", {
|
|
1763
1846
|
...t.draggableProps,
|
|
1764
1847
|
"data-form-builder-field-key": e.fieldKey,
|
|
1765
1848
|
ref: t.innerRef,
|
|
1766
1849
|
style: {
|
|
1767
|
-
...
|
|
1768
|
-
...n ?
|
|
1850
|
+
...Nt,
|
|
1851
|
+
...n ? Pt : null,
|
|
1769
1852
|
...t.draggableProps.style
|
|
1770
1853
|
},
|
|
1771
1854
|
children: /* @__PURE__ */ _(s, {
|
|
1772
|
-
style: e.fieldKey === q?.fieldKey ?
|
|
1773
|
-
children:
|
|
1855
|
+
style: e.fieldKey === q?.fieldKey ? Ft : void 0,
|
|
1856
|
+
children: Si(e, t, n)
|
|
1774
1857
|
})
|
|
1775
1858
|
});
|
|
1776
1859
|
}
|
|
1777
1860
|
function $(t, n, r, i = !1, a) {
|
|
1778
1861
|
return /* @__PURE__ */ _("div", {
|
|
1779
|
-
style: i ?
|
|
1862
|
+
style: i ? Ut : Ht,
|
|
1780
1863
|
children: /* @__PURE__ */ _("div", {
|
|
1781
|
-
style:
|
|
1864
|
+
style: Wt,
|
|
1782
1865
|
children: /* @__PURE__ */ _(e, {
|
|
1783
1866
|
label: t,
|
|
1784
|
-
layout: i ?
|
|
1867
|
+
layout: i ? ue.VERTICAL : ue.STRETCH,
|
|
1785
1868
|
name: n,
|
|
1786
1869
|
...a ? {
|
|
1787
1870
|
hintText: a.text,
|
|
@@ -1792,33 +1875,33 @@ function z({ onChange: le, value: y }) {
|
|
|
1792
1875
|
})
|
|
1793
1876
|
});
|
|
1794
1877
|
}
|
|
1795
|
-
function
|
|
1878
|
+
function Si(e, t, n) {
|
|
1796
1879
|
return /* @__PURE__ */ v("div", {
|
|
1797
1880
|
...t.dragHandleProps ?? {},
|
|
1798
1881
|
"aria-label": "選取或拖曳排序欄位",
|
|
1799
|
-
onClick: () =>
|
|
1800
|
-
style:
|
|
1882
|
+
onClick: () => B(e.fieldKey),
|
|
1883
|
+
style: kt,
|
|
1801
1884
|
title: "點擊選取,拖曳排序",
|
|
1802
1885
|
children: [
|
|
1803
1886
|
/* @__PURE__ */ _("span", {
|
|
1804
1887
|
"aria-label": "拖曳排序",
|
|
1805
1888
|
role: "img",
|
|
1806
|
-
style:
|
|
1889
|
+
style: Qt,
|
|
1807
1890
|
title: "拖曳排序",
|
|
1808
1891
|
children: /* @__PURE__ */ _(d, {
|
|
1809
|
-
icon:
|
|
1892
|
+
icon: Qe,
|
|
1810
1893
|
size: 20
|
|
1811
1894
|
})
|
|
1812
1895
|
}),
|
|
1813
1896
|
/* @__PURE__ */ v("div", {
|
|
1814
|
-
style:
|
|
1897
|
+
style: At,
|
|
1815
1898
|
children: [/* @__PURE__ */ v(h, {
|
|
1816
1899
|
component: "span",
|
|
1817
1900
|
ellipsis: !0,
|
|
1818
1901
|
variant: "label-primary",
|
|
1819
1902
|
children: [e.label, e.required ? /* @__PURE__ */ _("sup", {
|
|
1820
1903
|
"aria-label": "必填",
|
|
1821
|
-
style:
|
|
1904
|
+
style: nn,
|
|
1822
1905
|
children: "*"
|
|
1823
1906
|
}) : null]
|
|
1824
1907
|
}), /* @__PURE__ */ v(h, {
|
|
@@ -1827,7 +1910,7 @@ function z({ onChange: le, value: y }) {
|
|
|
1827
1910
|
ellipsis: !0,
|
|
1828
1911
|
variant: "caption",
|
|
1829
1912
|
children: [
|
|
1830
|
-
|
|
1913
|
+
An(e.type),
|
|
1831
1914
|
" ·",
|
|
1832
1915
|
e.required ? " 必填" : " 選填",
|
|
1833
1916
|
" ·",
|
|
@@ -1838,20 +1921,20 @@ function z({ onChange: le, value: y }) {
|
|
|
1838
1921
|
}),
|
|
1839
1922
|
/* @__PURE__ */ v("div", {
|
|
1840
1923
|
onClick: (e) => e.stopPropagation(),
|
|
1841
|
-
style:
|
|
1924
|
+
style: jt,
|
|
1842
1925
|
children: [/* @__PURE__ */ _("div", {
|
|
1843
|
-
style:
|
|
1926
|
+
style: Mt,
|
|
1844
1927
|
children: /* @__PURE__ */ _(m, {
|
|
1845
1928
|
checked: !!e.required,
|
|
1846
1929
|
disabled: n || e.hidden === !0,
|
|
1847
1930
|
label: "必填",
|
|
1848
|
-
onChange: (t) =>
|
|
1931
|
+
onChange: (t) => Mr(e.fieldKey, t.target.checked)
|
|
1849
1932
|
})
|
|
1850
1933
|
}), /* @__PURE__ */ _(c, {
|
|
1851
1934
|
disabled: n,
|
|
1852
|
-
icon:
|
|
1935
|
+
icon: tt,
|
|
1853
1936
|
iconType: "icon-only",
|
|
1854
|
-
onClick: () =>
|
|
1937
|
+
onClick: () => fr(e.fieldKey),
|
|
1855
1938
|
variant: "destructive-ghost",
|
|
1856
1939
|
children: "移除欄位"
|
|
1857
1940
|
})]
|
|
@@ -1859,61 +1942,61 @@ function z({ onChange: le, value: y }) {
|
|
|
1859
1942
|
]
|
|
1860
1943
|
});
|
|
1861
1944
|
}
|
|
1862
|
-
function
|
|
1945
|
+
function Ci() {
|
|
1863
1946
|
return /* @__PURE__ */ v("div", {
|
|
1864
|
-
style:
|
|
1947
|
+
style: P,
|
|
1865
1948
|
children: [/* @__PURE__ */ _(h, {
|
|
1866
1949
|
component: "h2",
|
|
1867
1950
|
variant: "h3",
|
|
1868
1951
|
children: "填寫預覽"
|
|
1869
1952
|
}), /* @__PURE__ */ _(t, {
|
|
1870
1953
|
dataSourceContext: { kind: "preview" },
|
|
1871
|
-
onChange:
|
|
1872
|
-
schema:
|
|
1873
|
-
uiSchema:
|
|
1874
|
-
value:
|
|
1954
|
+
onChange: jr,
|
|
1955
|
+
schema: x,
|
|
1956
|
+
uiSchema: C,
|
|
1957
|
+
value: at
|
|
1875
1958
|
})]
|
|
1876
1959
|
});
|
|
1877
1960
|
}
|
|
1878
|
-
function
|
|
1961
|
+
function wi() {
|
|
1879
1962
|
return /* @__PURE__ */ v("div", {
|
|
1880
|
-
style:
|
|
1963
|
+
style: P,
|
|
1881
1964
|
children: [/* @__PURE__ */ _(h, {
|
|
1882
1965
|
component: "h2",
|
|
1883
1966
|
variant: "h3",
|
|
1884
1967
|
children: "Schema"
|
|
1885
1968
|
}), /* @__PURE__ */ v("div", {
|
|
1886
|
-
style:
|
|
1969
|
+
style: Kt,
|
|
1887
1970
|
children: [
|
|
1888
|
-
|
|
1971
|
+
Ti("Form Schema", "schemaJson", /* @__PURE__ */ _(_t, {
|
|
1889
1972
|
height: "360px",
|
|
1890
1973
|
name: "schemaJson",
|
|
1891
|
-
onChange:
|
|
1974
|
+
onChange: Nr,
|
|
1892
1975
|
placeholder: "輸入 Form Schema JSON",
|
|
1893
|
-
value:
|
|
1976
|
+
value: nt
|
|
1894
1977
|
})),
|
|
1895
|
-
|
|
1978
|
+
Ti("UI Schema", "uiSchemaJson", /* @__PURE__ */ _(_t, {
|
|
1896
1979
|
height: "240px",
|
|
1897
1980
|
name: "uiSchemaJson",
|
|
1898
|
-
onChange:
|
|
1981
|
+
onChange: Pr,
|
|
1899
1982
|
placeholder: "輸入 UI Schema JSON",
|
|
1900
|
-
value:
|
|
1983
|
+
value: it
|
|
1901
1984
|
})),
|
|
1902
|
-
|
|
1985
|
+
ht ? /* @__PURE__ */ _(h, {
|
|
1903
1986
|
color: "text-error",
|
|
1904
|
-
style:
|
|
1987
|
+
style: Yt,
|
|
1905
1988
|
variant: "body",
|
|
1906
|
-
children:
|
|
1989
|
+
children: ht
|
|
1907
1990
|
}) : null
|
|
1908
1991
|
]
|
|
1909
1992
|
})]
|
|
1910
1993
|
});
|
|
1911
1994
|
}
|
|
1912
|
-
function
|
|
1995
|
+
function Ti(t, n, r) {
|
|
1913
1996
|
return /* @__PURE__ */ _("div", {
|
|
1914
|
-
style:
|
|
1997
|
+
style: qt,
|
|
1915
1998
|
children: /* @__PURE__ */ _("div", {
|
|
1916
|
-
style:
|
|
1999
|
+
style: Jt,
|
|
1917
2000
|
children: /* @__PURE__ */ _(e, {
|
|
1918
2001
|
label: t,
|
|
1919
2002
|
name: n,
|
|
@@ -1923,40 +2006,40 @@ function z({ onChange: le, value: y }) {
|
|
|
1923
2006
|
});
|
|
1924
2007
|
}
|
|
1925
2008
|
}
|
|
1926
|
-
function
|
|
1927
|
-
return
|
|
2009
|
+
function An(e) {
|
|
2010
|
+
return vt.find((t) => t.type === e)?.label ?? e;
|
|
1928
2011
|
}
|
|
1929
|
-
function
|
|
2012
|
+
function jn(e) {
|
|
1930
2013
|
return `${e.key}@${e.version}`;
|
|
1931
2014
|
}
|
|
1932
|
-
function
|
|
2015
|
+
function Mn(e) {
|
|
1933
2016
|
return [
|
|
1934
2017
|
e.supportsSearch ? `可輸入關鍵字搜尋${e.minimumSearchLength > 1 ? `(至少 ${e.minimumSearchLength} 字)` : ""}` : "不支援搜尋",
|
|
1935
2018
|
e.paginationMode === "CURSOR" ? `捲動載入更多(每次 ${e.pageSize} 筆)` : `一次載入完整清單(最多 ${e.maximumResultCount} 筆)`,
|
|
1936
2019
|
e.revalidationPolicy === "ALWAYS" ? "退回重送時一律重新確認" : "值與條件未變時沿用上次結果"
|
|
1937
2020
|
];
|
|
1938
2021
|
}
|
|
1939
|
-
function
|
|
2022
|
+
function Nn(e) {
|
|
1940
2023
|
return {
|
|
1941
|
-
id:
|
|
2024
|
+
id: jn(e),
|
|
1942
2025
|
name: e.label
|
|
1943
2026
|
};
|
|
1944
2027
|
}
|
|
1945
|
-
function
|
|
1946
|
-
if (!e) return
|
|
2028
|
+
function Pn(e) {
|
|
2029
|
+
if (!e) return Sn;
|
|
1947
2030
|
let t = e.from;
|
|
1948
2031
|
switch (t.kind) {
|
|
1949
2032
|
case "FIELD": return t.fieldKey;
|
|
1950
|
-
case "ROW_FIELD": return `${
|
|
1951
|
-
case "CONSTANT": return
|
|
1952
|
-
case "EXPRESSION": return
|
|
1953
|
-
default: return
|
|
2033
|
+
case "ROW_FIELD": return `${xn}${t.columnKey}`;
|
|
2034
|
+
case "CONSTANT": return yn;
|
|
2035
|
+
case "EXPRESSION": return bn;
|
|
2036
|
+
default: return R(t);
|
|
1954
2037
|
}
|
|
1955
2038
|
}
|
|
1956
|
-
function
|
|
1957
|
-
return
|
|
2039
|
+
function R(e) {
|
|
2040
|
+
return I;
|
|
1958
2041
|
}
|
|
1959
|
-
function
|
|
2042
|
+
function Fn(e) {
|
|
1960
2043
|
switch (e) {
|
|
1961
2044
|
case "BOOLEAN": return !1;
|
|
1962
2045
|
case "NUMBER": return 0;
|
|
@@ -1965,24 +2048,24 @@ function kn(e) {
|
|
|
1965
2048
|
default: return "";
|
|
1966
2049
|
}
|
|
1967
2050
|
}
|
|
1968
|
-
function
|
|
2051
|
+
function In(e, t) {
|
|
1969
2052
|
let n = e?.from.kind === "CONSTANT" ? e.from.value : "";
|
|
1970
2053
|
return t === "NUMBER" ? typeof n == "number" ? String(n) : "" : typeof n == "string" ? n : "";
|
|
1971
2054
|
}
|
|
1972
|
-
function
|
|
1973
|
-
return !n || n ===
|
|
2055
|
+
function Ln(e, t, n) {
|
|
2056
|
+
return !n || n === Sn ? null : n === bn ? {
|
|
1974
2057
|
from: {
|
|
1975
2058
|
expression: "",
|
|
1976
2059
|
kind: "EXPRESSION"
|
|
1977
2060
|
},
|
|
1978
2061
|
parameter: e
|
|
1979
|
-
} : n ===
|
|
2062
|
+
} : n === yn ? {
|
|
1980
2063
|
from: {
|
|
1981
2064
|
kind: "CONSTANT",
|
|
1982
|
-
value:
|
|
2065
|
+
value: Fn(t)
|
|
1983
2066
|
},
|
|
1984
2067
|
parameter: e
|
|
1985
|
-
} : n.startsWith(
|
|
2068
|
+
} : n.startsWith(xn) ? {
|
|
1986
2069
|
from: {
|
|
1987
2070
|
columnKey: n.slice(14),
|
|
1988
2071
|
kind: "ROW_FIELD"
|
|
@@ -1996,46 +2079,46 @@ function jn(e, t, n) {
|
|
|
1996
2079
|
parameter: e
|
|
1997
2080
|
};
|
|
1998
2081
|
}
|
|
1999
|
-
function
|
|
2082
|
+
function Rn(e) {
|
|
2000
2083
|
return e.kind === "remove-field" ? "確認移除 dependency 欄位" : e.kind === "remove-column" ? "確認移除表格欄" : e.kind === "replace-column" ? "確認變更欄型別" : "確認變更選擇模式";
|
|
2001
2084
|
}
|
|
2002
|
-
var
|
|
2085
|
+
var z = [{
|
|
2003
2086
|
label: "選項 A",
|
|
2004
2087
|
value: "option_a"
|
|
2005
2088
|
}, {
|
|
2006
2089
|
label: "選項 B",
|
|
2007
2090
|
value: "option_b"
|
|
2008
2091
|
}];
|
|
2009
|
-
function
|
|
2092
|
+
function zn(e) {
|
|
2010
2093
|
let t = [];
|
|
2011
|
-
return e.defaultValue !== void 0 && t.push("預設值"), e.type === "text" && (typeof e.minLength == "number" || typeof e.maxLength == "number") && t.push("長度限制"), e.type === "text" && e.pattern && t.push("格式"), e.type !== "number" && e.type !== "money" || typeof e.minimum != "number" && typeof e.maximum != "number" || t.push("數值範圍"),
|
|
2094
|
+
return e.defaultValue !== void 0 && t.push("預設值"), e.type === "text" && (typeof e.minLength == "number" || typeof e.maxLength == "number") && t.push("長度限制"), e.type === "text" && e.pattern && t.push("格式"), e.type !== "number" && e.type !== "money" || typeof e.minimum != "number" && typeof e.maximum != "number" || t.push("數值範圍"), D(e) ? t.push("選項來源設定") : st(e) && !B(e.options) && t.push(`${e.options.length} 個選項`), (e.type === "select" || e.type === "autocomplete") && e.mode === "multiple" && t.push("選擇模式"), t;
|
|
2012
2095
|
}
|
|
2013
|
-
function
|
|
2014
|
-
return e.length ===
|
|
2096
|
+
function B(e) {
|
|
2097
|
+
return e.length === z.length && e.every((e, t) => e.label === z[t]?.label && e.value === z[t]?.value);
|
|
2015
2098
|
}
|
|
2016
|
-
function
|
|
2099
|
+
function Bn(e, t) {
|
|
2017
2100
|
return t ? {
|
|
2018
2101
|
...e,
|
|
2019
2102
|
pattern: t
|
|
2020
2103
|
} : Object.fromEntries(Object.entries(e).filter(([e]) => e !== "pattern" && e !== "patternErrorMessage"));
|
|
2021
2104
|
}
|
|
2022
|
-
function
|
|
2105
|
+
function Vn(e, t) {
|
|
2023
2106
|
return t ? {
|
|
2024
2107
|
...e,
|
|
2025
2108
|
patternErrorMessage: t
|
|
2026
2109
|
} : Object.fromEntries(Object.entries(e).filter(([e]) => e !== "patternErrorMessage"));
|
|
2027
2110
|
}
|
|
2028
|
-
function
|
|
2111
|
+
function Hn(e) {
|
|
2029
2112
|
return e && !e.trim() ? {
|
|
2030
2113
|
severity: "error",
|
|
2031
2114
|
text: "格式不能只有空白,儲存時會被拒絕。"
|
|
2032
|
-
} : e && e.length >
|
|
2115
|
+
} : e && e.length > it ? {
|
|
2033
2116
|
severity: "error",
|
|
2034
|
-
text: `格式最多 ${
|
|
2035
|
-
} : e && !
|
|
2117
|
+
text: `格式最多 ${it} 個字元,儲存時會被拒絕。`
|
|
2118
|
+
} : e && !E(e) ? {
|
|
2036
2119
|
severity: "error",
|
|
2037
2120
|
text: "這不是有效的正規表示式,儲存時會被拒絕。格式以 u 模式檢查,多餘的跳脫(例如在方括號 [ ] 外寫 \\-)也算錯誤。"
|
|
2038
|
-
} : e &&
|
|
2121
|
+
} : e && at(e) ? {
|
|
2039
2122
|
severity: "error",
|
|
2040
2123
|
text: "格式裡的括號群組後面不能接重複次數(例如 (ab)+、(\\w|\\d)*、(ab){2}),填寫的內容可能讓系統卡住,儲存時會被拒絕。請把重複的部分直接寫出來,或改用 [ ] 字元集合加次數。"
|
|
2041
2124
|
} : {
|
|
@@ -2043,13 +2126,13 @@ function In(e) {
|
|
|
2043
2126
|
text: "填寫的內容要整段符合格式才能送出;留空表示不檢查格式。"
|
|
2044
2127
|
};
|
|
2045
2128
|
}
|
|
2046
|
-
function
|
|
2047
|
-
return e && e.length >
|
|
2129
|
+
function Un(e) {
|
|
2130
|
+
return e && e.length > T ? {
|
|
2048
2131
|
severity: "error",
|
|
2049
|
-
text: `錯誤訊息最多 ${
|
|
2132
|
+
text: `錯誤訊息最多 ${T} 個字元,儲存時會被拒絕。`
|
|
2050
2133
|
} : void 0;
|
|
2051
2134
|
}
|
|
2052
|
-
function
|
|
2135
|
+
function Wn(e, t) {
|
|
2053
2136
|
let n = {
|
|
2054
2137
|
fieldKey: e.fieldKey,
|
|
2055
2138
|
label: e.label,
|
|
@@ -2060,59 +2143,59 @@ function Rn(e, t) {
|
|
|
2060
2143
|
return t === "select" || t === "autocomplete" ? {
|
|
2061
2144
|
...n,
|
|
2062
2145
|
mode: "single",
|
|
2063
|
-
options: [...
|
|
2146
|
+
options: [...z],
|
|
2064
2147
|
type: t
|
|
2065
2148
|
} : {
|
|
2066
2149
|
...n,
|
|
2067
2150
|
type: t
|
|
2068
2151
|
};
|
|
2069
2152
|
}
|
|
2070
|
-
function
|
|
2153
|
+
function Gn(e, t) {
|
|
2071
2154
|
return Object.fromEntries(Object.entries(e).filter(([e]) => e !== t));
|
|
2072
2155
|
}
|
|
2073
|
-
function
|
|
2156
|
+
function Kn(e) {
|
|
2074
2157
|
return !!(e.visibleWhen || e.requiredWhen || e.readonlyWhen);
|
|
2075
2158
|
}
|
|
2076
|
-
function
|
|
2159
|
+
function qn(e) {
|
|
2077
2160
|
return {
|
|
2078
2161
|
id: e.fieldKey,
|
|
2079
2162
|
name: e.label
|
|
2080
2163
|
};
|
|
2081
2164
|
}
|
|
2082
|
-
function
|
|
2165
|
+
function Jn(e) {
|
|
2083
2166
|
return e.type === "text" || e.type === "textarea";
|
|
2084
2167
|
}
|
|
2085
|
-
function
|
|
2168
|
+
function Yn(e) {
|
|
2086
2169
|
return typeof e == "string" ? e : "";
|
|
2087
2170
|
}
|
|
2088
|
-
function
|
|
2171
|
+
function Xn(e) {
|
|
2089
2172
|
let t = e.split(/[\n,]/u).map((e) => e.trim()).filter(Boolean);
|
|
2090
2173
|
return t.length ? t : void 0;
|
|
2091
2174
|
}
|
|
2092
|
-
function
|
|
2175
|
+
function Zn(e) {
|
|
2093
2176
|
return e?.join("\n") ?? "";
|
|
2094
2177
|
}
|
|
2095
|
-
function
|
|
2178
|
+
function V(e) {
|
|
2096
2179
|
return JSON.stringify(e, null, 2);
|
|
2097
2180
|
}
|
|
2098
|
-
function
|
|
2181
|
+
function Qn(e, t, n) {
|
|
2099
2182
|
return e.map((e, r) => r === t ? {
|
|
2100
2183
|
...e,
|
|
2101
2184
|
...n
|
|
2102
2185
|
} : e);
|
|
2103
2186
|
}
|
|
2104
|
-
function
|
|
2187
|
+
function $n(e) {
|
|
2105
2188
|
let t = e.length + 1;
|
|
2106
2189
|
return {
|
|
2107
2190
|
label: `選項 ${t}`,
|
|
2108
|
-
value:
|
|
2191
|
+
value: H(e, t)
|
|
2109
2192
|
};
|
|
2110
2193
|
}
|
|
2111
|
-
function
|
|
2194
|
+
function H(e, t) {
|
|
2112
2195
|
let n = `option_${t}`;
|
|
2113
|
-
return e.some((e) => e.value === n) ?
|
|
2196
|
+
return e.some((e) => e.value === n) ? H(e, t + 1) : n;
|
|
2114
2197
|
}
|
|
2115
|
-
function
|
|
2198
|
+
function er(e, t, n) {
|
|
2116
2199
|
let r = e[t];
|
|
2117
2200
|
if (!r || t === n) return [...e];
|
|
2118
2201
|
let i = e.filter((e, n) => n !== t);
|
|
@@ -2122,6 +2205,6 @@ function Jn(e, t, n) {
|
|
|
2122
2205
|
...i.slice(n)
|
|
2123
2206
|
];
|
|
2124
2207
|
}
|
|
2125
|
-
export {
|
|
2208
|
+
export { L as t };
|
|
2126
2209
|
|
|
2127
|
-
//# sourceMappingURL=FormBuilderView-
|
|
2210
|
+
//# sourceMappingURL=FormBuilderView-WtC2iW5f.js.map
|