@rytass/bpm-core-react 0.3.1 → 0.3.3
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 +166 -0
- package/dist/chunks/app-navigation-BSkMsEhy.js +268 -0
- package/dist/chunks/app-navigation-BSkMsEhy.js.map +1 -0
- package/dist/chunks/app-navigation-KnlJCUp1.cjs +2 -0
- package/dist/chunks/app-navigation-KnlJCUp1.cjs.map +1 -0
- package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs +2 -0
- package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs.map +1 -0
- package/dist/chunks/{approval-instance-list-page-nmzMrj0b.js → approval-instance-list-page-CqNdoZqx.js} +73 -72
- package/dist/chunks/approval-instance-list-page-CqNdoZqx.js.map +1 -0
- package/dist/chunks/builder-CMlJfQHE.cjs +3 -0
- package/dist/chunks/builder-CMlJfQHE.cjs.map +1 -0
- package/dist/chunks/{builder-DqZskyXC.js → builder-D950gct_.js} +492 -491
- package/dist/chunks/builder-D950gct_.js.map +1 -0
- package/dist/chunks/categories-5yEM3p3N.cjs +2 -0
- package/dist/chunks/categories-5yEM3p3N.cjs.map +1 -0
- package/dist/chunks/{categories-DTEl182t.js → categories-BIpOG451.js} +115 -114
- package/dist/chunks/categories-BIpOG451.js.map +1 -0
- package/dist/chunks/dashboard-page-1K_jQXQk.cjs +2 -0
- package/dist/chunks/dashboard-page-1K_jQXQk.cjs.map +1 -0
- package/dist/chunks/dashboard-page-R_T2OEiE.js +122 -0
- package/dist/chunks/dashboard-page-R_T2OEiE.js.map +1 -0
- package/dist/chunks/{delegations-C5PzZ5Kn.js → delegations-B2j-wNEO.js} +193 -192
- package/dist/chunks/delegations-B2j-wNEO.js.map +1 -0
- package/dist/chunks/delegations-CsB9ozLu.cjs +2 -0
- package/dist/chunks/delegations-CsB9ozLu.cjs.map +1 -0
- package/dist/chunks/delegations-CvtwTXNP.cjs +2 -0
- package/dist/chunks/delegations-CvtwTXNP.cjs.map +1 -0
- package/dist/chunks/{delegations-C-ZrwzvU.js → delegations-dKodb0WW.js} +175 -174
- package/dist/chunks/delegations-dKodb0WW.js.map +1 -0
- package/dist/chunks/{detail-CfFyU5zC.js → detail-BcGAqJ_R.js} +465 -464
- package/dist/chunks/detail-BcGAqJ_R.js.map +1 -0
- package/dist/chunks/detail-CqjqLd65.cjs +2 -0
- package/dist/chunks/detail-CqjqLd65.cjs.map +1 -0
- package/dist/chunks/{format-date-time-isOa3e9q.cjs → format-date-time-26_pFvv4.cjs} +2 -2
- package/dist/chunks/{format-date-time-isOa3e9q.cjs.map → format-date-time-26_pFvv4.cjs.map} +1 -1
- package/dist/chunks/notifications-2swRqDPF.js +198 -0
- package/dist/chunks/notifications-2swRqDPF.js.map +1 -0
- package/dist/chunks/notifications-BaYDebFt.cjs +2 -0
- package/dist/chunks/notifications-BaYDebFt.cjs.map +1 -0
- package/dist/chunks/{orgs-xrdhb3hS.js → orgs-CuHxxd_n.js} +608 -607
- package/dist/chunks/orgs-CuHxxd_n.js.map +1 -0
- package/dist/chunks/orgs-YMiVLNvL.cjs +2 -0
- package/dist/chunks/orgs-YMiVLNvL.cjs.map +1 -0
- package/dist/chunks/routes-config-2aKbWq2H.cjs +2 -0
- package/dist/chunks/routes-config-2aKbWq2H.cjs.map +1 -0
- package/dist/chunks/routes-config-dxahImVe.js +43 -0
- package/dist/chunks/routes-config-dxahImVe.js.map +1 -0
- package/dist/chunks/templates-DTkbSgFY.cjs +2 -0
- package/dist/chunks/templates-DTkbSgFY.cjs.map +1 -0
- package/dist/chunks/templates-DoDWM68t.js +384 -0
- package/dist/chunks/templates-DoDWM68t.js.map +1 -0
- package/dist/chunks/users-3ySyUW4u.cjs +2 -0
- package/dist/chunks/users-3ySyUW4u.cjs.map +1 -0
- package/dist/chunks/{users-CY4-NK3j.js → users-sMfrSjRQ.js} +75 -74
- package/dist/chunks/users-sMfrSjRQ.js.map +1 -0
- package/dist/components/admin-pickers.d.ts +1 -1
- package/dist/components/approval-instance-list-page.d.ts +1 -1
- package/dist/components/org-unit-tree-draft-editor.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +101 -99
- package/dist/index.js.map +1 -1
- package/dist/lib/auth-provider.d.ts +1 -1
- package/dist/lib/org-tree-draft.d.ts +1 -1
- package/dist/lib/routes-config.d.ts +105 -0
- package/dist/next/BPMNextProviders.d.ts +48 -3
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.ts +1 -0
- package/dist/next/index.js +27 -21
- package/dist/next/index.js.map +1 -1
- package/dist/pages/admin/delegations/index.cjs +1 -1
- package/dist/pages/admin/delegations/index.js +1 -1
- package/dist/pages/admin/orgs/index.cjs +1 -1
- package/dist/pages/admin/orgs/index.js +1 -1
- package/dist/pages/admin/users/index.cjs +1 -1
- package/dist/pages/admin/users/index.js +1 -1
- package/dist/pages/delegations/index.cjs +1 -1
- package/dist/pages/delegations/index.js +1 -1
- package/dist/pages/forms/builder/index.cjs +1 -1
- package/dist/pages/forms/builder/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/settings/notifications/index.cjs +1 -1
- package/dist/pages/settings/notifications/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/index.cjs +1 -1
- package/dist/pages/templates/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 +3 -3
- package/dist/views/admin/orgs/index.cjs +1 -1
- package/dist/views/admin/orgs/index.js +1 -1
- package/dist/views/admin/users/index.cjs +1 -1
- package/dist/views/admin/users/index.js +1 -1
- package/dist/views/cc/index.cjs +1 -1
- package/dist/views/cc/index.js +1 -1
- package/dist/views/dashboard/index.cjs +1 -1
- package/dist/views/dashboard/index.js +1 -1
- package/dist/views/delegations/index.cjs +1 -1
- package/dist/views/delegations/index.js +1 -1
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/index.cjs +1 -1
- package/dist/views/forms/index.cjs.map +1 -1
- package/dist/views/forms/index.js +78 -77
- package/dist/views/forms/index.js.map +1 -1
- package/dist/views/forms/renderer/FormRendererView.d.ts +2 -2
- package/dist/views/inbox/index.cjs +1 -1
- package/dist/views/inbox/index.cjs.map +1 -1
- package/dist/views/inbox/index.js +106 -105
- package/dist/views/inbox/index.js.map +1 -1
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -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 +90 -89
- 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/settings/index.cjs +1 -1
- package/dist/views/settings/index.js +1 -1
- package/dist/views/settings/notifications/index.cjs +1 -1
- package/dist/views/settings/notifications/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/designer/index.cjs +6 -6
- package/dist/views/templates/designer/index.cjs.map +1 -1
- package/dist/views/templates/designer/index.js +589 -588
- package/dist/views/templates/designer/index.js.map +1 -1
- package/dist/views/templates/index.cjs +1 -1
- package/dist/views/templates/index.js +2 -2
- package/dist/views/templates/versions/index.cjs +1 -1
- package/dist/views/templates/versions/index.cjs.map +1 -1
- package/dist/views/templates/versions/index.js +44 -43
- package/dist/views/templates/versions/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunks/app-navigation-C_mbz7jx.cjs +0 -2
- package/dist/chunks/app-navigation-C_mbz7jx.cjs.map +0 -1
- package/dist/chunks/app-navigation-uwbNEw9P.js +0 -262
- package/dist/chunks/app-navigation-uwbNEw9P.js.map +0 -1
- package/dist/chunks/approval-instance-list-page-Mo6wpDPb.cjs +0 -2
- package/dist/chunks/approval-instance-list-page-Mo6wpDPb.cjs.map +0 -1
- package/dist/chunks/approval-instance-list-page-nmzMrj0b.js.map +0 -1
- package/dist/chunks/builder-DPhAH381.cjs +0 -3
- package/dist/chunks/builder-DPhAH381.cjs.map +0 -1
- package/dist/chunks/builder-DqZskyXC.js.map +0 -1
- package/dist/chunks/categories-DEijUOnw.cjs +0 -2
- package/dist/chunks/categories-DEijUOnw.cjs.map +0 -1
- package/dist/chunks/categories-DTEl182t.js.map +0 -1
- package/dist/chunks/dashboard-page-DCmuB0Rw.cjs +0 -2
- package/dist/chunks/dashboard-page-DCmuB0Rw.cjs.map +0 -1
- package/dist/chunks/dashboard-page-Dx5PeEeN.js +0 -117
- package/dist/chunks/dashboard-page-Dx5PeEeN.js.map +0 -1
- package/dist/chunks/delegations-C-ZrwzvU.js.map +0 -1
- package/dist/chunks/delegations-C5PzZ5Kn.js.map +0 -1
- package/dist/chunks/delegations-DOGDvybX.cjs +0 -2
- package/dist/chunks/delegations-DOGDvybX.cjs.map +0 -1
- package/dist/chunks/delegations-DkDBWOQ7.cjs +0 -2
- package/dist/chunks/delegations-DkDBWOQ7.cjs.map +0 -1
- package/dist/chunks/detail-B2gcOPkd.cjs +0 -2
- package/dist/chunks/detail-B2gcOPkd.cjs.map +0 -1
- package/dist/chunks/detail-CfFyU5zC.js.map +0 -1
- package/dist/chunks/notifications-CPQ-nVar.cjs +0 -2
- package/dist/chunks/notifications-CPQ-nVar.cjs.map +0 -1
- package/dist/chunks/notifications-DweexUVy.js +0 -197
- package/dist/chunks/notifications-DweexUVy.js.map +0 -1
- package/dist/chunks/orgs-DgZ0DQ3-.cjs +0 -2
- package/dist/chunks/orgs-DgZ0DQ3-.cjs.map +0 -1
- package/dist/chunks/orgs-xrdhb3hS.js.map +0 -1
- package/dist/chunks/templates-PK_VYvcy.js +0 -383
- package/dist/chunks/templates-PK_VYvcy.js.map +0 -1
- package/dist/chunks/templates-x1OJZmsG.cjs +0 -2
- package/dist/chunks/templates-x1OJZmsG.cjs.map +0 -1
- package/dist/chunks/users-CY4-NK3j.js.map +0 -1
- package/dist/chunks/users-DHnu_056.cjs +0 -2
- package/dist/chunks/users-DHnu_056.cjs.map +0 -1
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { a as e } from "./auth-provider-Bnox5gsx.js";
|
|
3
3
|
import { t } from "./format-date-time-CB-LxzqT.js";
|
|
4
|
-
import { t as n } from "./app-navigation-
|
|
5
|
-
import {
|
|
6
|
-
import { t as i } from "./
|
|
7
|
-
import { t as a } from "./
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import ye from "@mezzanine-ui/
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
4
|
+
import { t as n } from "./app-navigation-BSkMsEhy.js";
|
|
5
|
+
import { r } from "./routes-config-dxahImVe.js";
|
|
6
|
+
import { t as i } from "./bpm-form-field-Cao0rMol.js";
|
|
7
|
+
import { t as a } from "./FormRendererView-DrHsuSVo.js";
|
|
8
|
+
import { t as o } from "./form-name-modal-C3OEvkCV.js";
|
|
9
|
+
import { useEffect as s, useMemo as c, useState as l } from "react";
|
|
10
|
+
import { Accordion as ee, Badge as u, BaseCard as te, Button as d, DatePicker as ne, DateTimePicker as re, Icon as ie, Input as f, PageHeader as ae, Section as oe, SectionGroup as se, Select as p, Tab as ce, TabItem as m, Table as le, Textarea as ue, Toggle as de, Typography as h } from "@mezzanine-ui/react";
|
|
11
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
12
|
+
import { AlignLeftIcon as fe, CalendarIcon as pe, CheckedIcon as me, CheckedOutlineIcon as he, CurrencyDollarIcon as y, DotDragVerticalIcon as ge, DotGridIcon as b, EditIcon as _e, FileAttachmentIcon as x, FileIcon as S, ListIcon as C, PlusIcon as ve, SaveIcon as ye, TrashIcon as be } from "@mezzanine-ui/icons";
|
|
13
|
+
import xe from "@mezzanine-ui/react/ContentHeader";
|
|
14
|
+
import { buildConditionExpression as w, buildFormRendererValues as Se, clampOptionalNumber as Ce, createFieldDefinition as we, forkFormDefinition as Te, formatDatePickerValue as Ee, formatDateTimePickerValue as De, isDateFieldDefinition as Oe, isNumberFieldDefinition as ke, isSelectFieldDefinition as Ae, parseConditionRule as je, parseOptionalNumberInput as Me, publishFormDefinitionVersion as Ne, readConditionOperatorOption as Pe, readConditionOperatorOptions as Fe, readDatePickerValue as Ie, readDefaultConditionOperator as Le, readDefaultConditionValue as Re, readFieldOptionAsSelectOption as T, readFormBuilder as ze, readSelectOption as E, updateFormDefinition as Be, updateFormDefinitionDraft as Ve } from "@rytass/bpm-core-client/form";
|
|
15
|
+
import { DragDropContext as He, Draggable as Ue, Droppable as We } from "@hello-pangea/dnd";
|
|
16
|
+
import D from "next/dynamic";
|
|
17
|
+
import { json as O } from "@codemirror/lang-json";
|
|
18
|
+
import { EditorView as k } from "@codemirror/view";
|
|
18
19
|
//#region src/views/forms/builder/json-code-editor.tsx
|
|
19
|
-
var
|
|
20
|
+
var A = {
|
|
20
21
|
alignItems: "center",
|
|
21
22
|
border: "1px solid var(--mzn-color-border-neutral)",
|
|
22
23
|
borderRadius: 4,
|
|
@@ -25,10 +26,10 @@ var Ue = {
|
|
|
25
26
|
minHeight: 160,
|
|
26
27
|
padding: 12,
|
|
27
28
|
width: "100%"
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
}, Ge = [
|
|
30
|
+
O(),
|
|
31
|
+
k.lineWrapping,
|
|
32
|
+
k.theme({
|
|
32
33
|
"&": {
|
|
33
34
|
border: "1px solid var(--mzn-color-border-neutral)",
|
|
34
35
|
borderRadius: "4px",
|
|
@@ -44,15 +45,15 @@ var Ue = {
|
|
|
44
45
|
".cm-gutters": { borderRight: "1px solid var(--mzn-color-border-neutral)" },
|
|
45
46
|
".cm-scroller": { fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", monospace" }
|
|
46
47
|
})
|
|
47
|
-
],
|
|
48
|
-
loading: () => /* @__PURE__ */
|
|
49
|
-
style:
|
|
48
|
+
], j = D(() => import("@uiw/react-codemirror"), {
|
|
49
|
+
loading: () => /* @__PURE__ */ _("div", {
|
|
50
|
+
style: A,
|
|
50
51
|
children: "載入 JSON 編輯器"
|
|
51
52
|
}),
|
|
52
53
|
ssr: !1
|
|
53
54
|
});
|
|
54
|
-
function
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
function Ke({ disabled: e, height: t, name: n, onChange: r, placeholder: i, value: a }) {
|
|
56
|
+
return /* @__PURE__ */ _(j, {
|
|
56
57
|
"aria-label": n,
|
|
57
58
|
basicSetup: {
|
|
58
59
|
autocompletion: !0,
|
|
@@ -66,7 +67,7 @@ function Ge({ disabled: e, height: t, name: n, onChange: r, placeholder: i, valu
|
|
|
66
67
|
syntaxHighlighting: !0
|
|
67
68
|
},
|
|
68
69
|
editable: !e,
|
|
69
|
-
extensions: [...
|
|
70
|
+
extensions: [...Ge],
|
|
70
71
|
height: t,
|
|
71
72
|
indentWithTab: !1,
|
|
72
73
|
onChange: r,
|
|
@@ -79,118 +80,118 @@ function Ge({ disabled: e, height: t, name: n, onChange: r, placeholder: i, valu
|
|
|
79
80
|
}
|
|
80
81
|
//#endregion
|
|
81
82
|
//#region src/views/forms/builder/FormBuilderView.tsx
|
|
82
|
-
var
|
|
83
|
+
var qe = [
|
|
83
84
|
{
|
|
84
85
|
description: "單行文字、姓名、編號",
|
|
85
|
-
icon:
|
|
86
|
+
icon: fe,
|
|
86
87
|
label: "文字",
|
|
87
88
|
type: "text"
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
91
|
description: "多行補充內容",
|
|
91
|
-
icon:
|
|
92
|
+
icon: S,
|
|
92
93
|
label: "長文字",
|
|
93
94
|
type: "textarea"
|
|
94
95
|
},
|
|
95
96
|
{
|
|
96
97
|
description: "金額、數量、分數",
|
|
97
|
-
icon:
|
|
98
|
+
icon: y,
|
|
98
99
|
label: "數字",
|
|
99
100
|
type: "number"
|
|
100
101
|
},
|
|
101
102
|
{
|
|
102
103
|
description: "金額與費用",
|
|
103
|
-
icon:
|
|
104
|
+
icon: y,
|
|
104
105
|
label: "金額",
|
|
105
106
|
type: "money"
|
|
106
107
|
},
|
|
107
108
|
{
|
|
108
109
|
description: "日期或到期日",
|
|
109
|
-
icon:
|
|
110
|
+
icon: pe,
|
|
110
111
|
label: "日期",
|
|
111
112
|
type: "date"
|
|
112
113
|
},
|
|
113
114
|
{
|
|
114
115
|
description: "日期與時間",
|
|
115
|
-
icon:
|
|
116
|
+
icon: pe,
|
|
116
117
|
label: "日期時間",
|
|
117
118
|
type: "datetime"
|
|
118
119
|
},
|
|
119
120
|
{
|
|
120
121
|
description: "是 / 否狀態",
|
|
121
|
-
icon:
|
|
122
|
+
icon: me,
|
|
122
123
|
label: "開關",
|
|
123
124
|
type: "boolean"
|
|
124
125
|
},
|
|
125
126
|
{
|
|
126
127
|
description: "固定選項擇一",
|
|
127
|
-
icon:
|
|
128
|
+
icon: C,
|
|
128
129
|
label: "下拉選單",
|
|
129
130
|
type: "select"
|
|
130
131
|
},
|
|
131
132
|
{
|
|
132
133
|
description: "固定選項單選",
|
|
133
|
-
icon:
|
|
134
|
+
icon: b,
|
|
134
135
|
label: "單選",
|
|
135
136
|
type: "radio"
|
|
136
137
|
},
|
|
137
138
|
{
|
|
138
139
|
description: "固定選項複選",
|
|
139
|
-
icon:
|
|
140
|
+
icon: he,
|
|
140
141
|
label: "複選",
|
|
141
142
|
type: "checkbox"
|
|
142
143
|
},
|
|
143
144
|
{
|
|
144
145
|
description: "附件或佐證資料",
|
|
145
|
-
icon:
|
|
146
|
+
icon: x,
|
|
146
147
|
label: "附件",
|
|
147
148
|
type: "file_upload"
|
|
148
149
|
}
|
|
149
|
-
],
|
|
150
|
+
], Je = {
|
|
150
151
|
alignItems: "start",
|
|
151
152
|
display: "flex",
|
|
152
153
|
flexWrap: "wrap",
|
|
153
154
|
gap: 16
|
|
154
|
-
},
|
|
155
|
+
}, Ye = {
|
|
155
156
|
flex: "0.55 1 300px",
|
|
156
157
|
minWidth: 0
|
|
157
|
-
},
|
|
158
|
+
}, Xe = {
|
|
158
159
|
flex: "1.45 1 720px",
|
|
159
160
|
minWidth: 620
|
|
160
161
|
}, M = {
|
|
161
162
|
display: "grid",
|
|
162
163
|
gap: 12
|
|
163
|
-
},
|
|
164
|
+
}, Ze = {
|
|
164
165
|
display: "flex",
|
|
165
166
|
flexWrap: "wrap",
|
|
166
167
|
gap: 6
|
|
167
|
-
},
|
|
168
|
+
}, Qe = {
|
|
168
169
|
flex: "0 0 auto",
|
|
169
170
|
whiteSpace: "nowrap"
|
|
170
|
-
},
|
|
171
|
+
}, $e = {
|
|
171
172
|
display: "grid",
|
|
172
173
|
gap: 8
|
|
173
|
-
},
|
|
174
|
+
}, et = {
|
|
174
175
|
alignItems: "center",
|
|
175
176
|
cursor: "grab",
|
|
176
177
|
display: "flex",
|
|
177
178
|
gap: 12,
|
|
178
179
|
touchAction: "none"
|
|
179
|
-
},
|
|
180
|
+
}, tt = {
|
|
180
181
|
display: "grid",
|
|
181
182
|
flex: "1 1 auto",
|
|
182
183
|
gap: 2,
|
|
183
184
|
minWidth: 0
|
|
184
|
-
},
|
|
185
|
+
}, nt = {
|
|
185
186
|
alignItems: "center",
|
|
186
187
|
display: "flex",
|
|
187
188
|
flex: "0 0 auto",
|
|
188
189
|
gap: 4
|
|
189
|
-
},
|
|
190
|
+
}, rt = {
|
|
190
191
|
alignItems: "center",
|
|
191
192
|
display: "flex",
|
|
192
193
|
gap: 6
|
|
193
|
-
},
|
|
194
|
+
}, it = { userSelect: "none" }, at = { filter: "drop-shadow(0 8px 18px rgba(0, 0, 0, 0.12))" }, ot = {
|
|
194
195
|
alignItems: "center",
|
|
195
196
|
border: "1px dashed var(--mzn-color-border-neutral)",
|
|
196
197
|
borderRadius: 6,
|
|
@@ -199,72 +200,72 @@ var Ke = [
|
|
|
199
200
|
minHeight: 240,
|
|
200
201
|
padding: 32,
|
|
201
202
|
textAlign: "center"
|
|
202
|
-
},
|
|
203
|
+
}, st = {
|
|
203
204
|
display: "flex",
|
|
204
205
|
gap: 8,
|
|
205
206
|
justifyContent: "center"
|
|
206
|
-
},
|
|
207
|
+
}, ct = {
|
|
207
208
|
display: "grid",
|
|
208
209
|
gap: 14
|
|
209
|
-
},
|
|
210
|
+
}, lt = {
|
|
210
211
|
display: "grid",
|
|
211
212
|
columnGap: 16,
|
|
212
213
|
gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))",
|
|
213
214
|
rowGap: 8
|
|
214
|
-
},
|
|
215
|
+
}, ut = { gridColumn: "1 / -1" }, dt = {
|
|
215
216
|
alignItems: "center",
|
|
216
217
|
display: "flex",
|
|
217
218
|
gap: 8,
|
|
218
219
|
gridColumn: "1 / -1",
|
|
219
220
|
justifyContent: "flex-end"
|
|
220
|
-
},
|
|
221
|
+
}, ft = { gridColumn: "1 / -1" }, pt = {
|
|
221
222
|
alignItems: "start",
|
|
222
223
|
display: "block",
|
|
223
224
|
width: "100%"
|
|
224
|
-
}, pt = {
|
|
225
|
-
...ft,
|
|
226
|
-
gridColumn: "1 / -1"
|
|
227
225
|
}, mt = {
|
|
226
|
+
...pt,
|
|
227
|
+
gridColumn: "1 / -1"
|
|
228
|
+
}, ht = {
|
|
228
229
|
minWidth: 0,
|
|
229
230
|
width: "100%"
|
|
230
|
-
},
|
|
231
|
+
}, gt = {
|
|
231
232
|
minWidth: "100%",
|
|
232
233
|
width: "100%"
|
|
233
|
-
},
|
|
234
|
+
}, _t = {
|
|
234
235
|
display: "grid",
|
|
235
236
|
gap: 14
|
|
236
|
-
},
|
|
237
|
+
}, vt = {
|
|
237
238
|
alignItems: "start",
|
|
238
239
|
display: "block",
|
|
239
240
|
width: "100%"
|
|
240
|
-
},
|
|
241
|
+
}, yt = {
|
|
241
242
|
minWidth: 0,
|
|
242
243
|
width: "100%"
|
|
243
|
-
},
|
|
244
|
+
}, bt = { gridColumn: "2 / -1" }, xt = {
|
|
244
245
|
display: "grid",
|
|
245
246
|
gap: 10,
|
|
246
247
|
width: "100%"
|
|
247
|
-
},
|
|
248
|
+
}, St = {
|
|
248
249
|
display: "grid",
|
|
249
250
|
gap: 8,
|
|
250
251
|
gridTemplateColumns: "repeat(auto-fit, minmax(160px, 1fr))"
|
|
251
|
-
},
|
|
252
|
+
}, Ct = { display: "inline-flex" }, wt = {
|
|
252
253
|
display: "grid",
|
|
253
254
|
gap: 16
|
|
254
|
-
},
|
|
255
|
+
}, Tt = {
|
|
255
256
|
display: "grid",
|
|
256
257
|
gap: 8
|
|
257
|
-
},
|
|
258
|
+
}, Et = {
|
|
258
259
|
display: "flex",
|
|
259
260
|
justifyContent: "flex-end"
|
|
260
|
-
},
|
|
261
|
+
}, Dt = {
|
|
261
262
|
color: "var(--mzn-color-text-error)",
|
|
262
263
|
fontSize: "0.72em",
|
|
263
264
|
lineHeight: 0,
|
|
264
265
|
marginLeft: 2,
|
|
265
266
|
verticalAlign: "super"
|
|
266
267
|
};
|
|
267
|
-
function
|
|
268
|
+
function Ot(e) {
|
|
268
269
|
e && (e.style.width = "100%");
|
|
269
270
|
}
|
|
270
271
|
var N = {
|
|
@@ -273,7 +274,7 @@ var N = {
|
|
|
273
274
|
}, P = {
|
|
274
275
|
layout: [],
|
|
275
276
|
schemaVersion: 1
|
|
276
|
-
},
|
|
277
|
+
}, kt = [
|
|
277
278
|
{
|
|
278
279
|
id: "unset",
|
|
279
280
|
name: "不預設"
|
|
@@ -286,13 +287,13 @@ var N = {
|
|
|
286
287
|
id: "false",
|
|
287
288
|
name: "否"
|
|
288
289
|
}
|
|
289
|
-
],
|
|
290
|
+
], At = [{
|
|
290
291
|
id: "true",
|
|
291
292
|
name: "是"
|
|
292
293
|
}, {
|
|
293
294
|
id: "false",
|
|
294
295
|
name: "否"
|
|
295
|
-
}],
|
|
296
|
+
}], jt = [
|
|
296
297
|
{
|
|
297
298
|
label: "顯示",
|
|
298
299
|
name: "fieldVisibleWhen",
|
|
@@ -312,28 +313,28 @@ var N = {
|
|
|
312
313
|
target: "readonlyWhen"
|
|
313
314
|
}
|
|
314
315
|
];
|
|
315
|
-
function
|
|
316
|
-
let
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}, [
|
|
320
|
-
|
|
321
|
-
}, [
|
|
322
|
-
|
|
323
|
-
}, [
|
|
324
|
-
|
|
316
|
+
function Mt({ formId: fe }) {
|
|
317
|
+
let pe = e(), he = r(), y = fe, [b, x] = l(null), [S, C] = l(null), [D, O] = l(N), [k, A] = l(P), [Ge, j] = l(F(N)), [Mt, I] = l(F(P)), [Gt, Yt] = l({}), [Xt, L] = l(null), [R, Zt] = l("design"), [z, B] = l(null), [Qt, V] = l(null), [$t, en] = l(!1), [tn, nn] = l(Ht(N, P)), [rn, an] = l(!0), [on, sn] = l(!1), [H, U] = l(!1);
|
|
318
|
+
s(() => {
|
|
319
|
+
vn();
|
|
320
|
+
}, [y]), s(() => {
|
|
321
|
+
D.fields.some((e) => e.fieldKey === z) || B(D.fields[0]?.fieldKey ?? null);
|
|
322
|
+
}, [D.fields, z]), s(() => {
|
|
323
|
+
Yt((e) => Se(D.fields, e));
|
|
324
|
+
}, [D.fields]), s(() => {
|
|
325
|
+
R !== "advanced" && (j(F(D)), I(F(k)));
|
|
325
326
|
}, [
|
|
326
|
-
|
|
327
|
-
|
|
327
|
+
R,
|
|
328
|
+
D,
|
|
328
329
|
k
|
|
329
330
|
]);
|
|
330
|
-
let
|
|
331
|
+
let W = c(() => D.fields.find((e) => e.fieldKey === z) ?? D.fields[0] ?? null, [D.fields, z]), cn = c(() => (b?.versions ?? []).map((e) => ({
|
|
331
332
|
key: e.id,
|
|
332
333
|
publishedAt: t(e.publishedAt),
|
|
333
334
|
status: e.status,
|
|
334
335
|
updatedAt: t(e.updatedAt),
|
|
335
336
|
version: `v${e.version}`
|
|
336
|
-
})), [
|
|
337
|
+
})), [b]), ln = c(() => [
|
|
337
338
|
{
|
|
338
339
|
dataIndex: "version",
|
|
339
340
|
key: "version",
|
|
@@ -342,7 +343,7 @@ function F({ formId: ue }) {
|
|
|
342
343
|
},
|
|
343
344
|
{
|
|
344
345
|
key: "status",
|
|
345
|
-
render: (e) => /* @__PURE__ */
|
|
346
|
+
render: (e) => /* @__PURE__ */ _(qt, { status: e.status }),
|
|
346
347
|
title: "狀態",
|
|
347
348
|
width: 140
|
|
348
349
|
},
|
|
@@ -358,351 +359,351 @@ function F({ formId: ue }) {
|
|
|
358
359
|
title: "發布時間",
|
|
359
360
|
width: 180
|
|
360
361
|
}
|
|
361
|
-
], []),
|
|
362
|
-
|
|
362
|
+
], []), un = c(() => Ht(D, k), [D, k]), G = un.schemaJson !== tn.schemaJson || un.uiSchemaJson !== tn.uiSchemaJson;
|
|
363
|
+
s(() => {
|
|
363
364
|
function e(e) {
|
|
364
|
-
|
|
365
|
+
G && (e.preventDefault(), e.returnValue = "");
|
|
365
366
|
}
|
|
366
367
|
return window.addEventListener("beforeunload", e), () => {
|
|
367
368
|
window.removeEventListener("beforeunload", e);
|
|
368
369
|
};
|
|
369
|
-
}, [
|
|
370
|
-
function
|
|
371
|
-
|
|
370
|
+
}, [G]);
|
|
371
|
+
function dn() {
|
|
372
|
+
G && !window.confirm("目前有尚未儲存的表單草稿,確定要離開嗎?") || pe.push(he.forms());
|
|
372
373
|
}
|
|
373
|
-
let
|
|
374
|
-
hasUnsavedChanges:
|
|
375
|
-
latestPublishedVersion:
|
|
376
|
-
openedContentPublished:
|
|
377
|
-
openedVersion:
|
|
378
|
-
}),
|
|
379
|
-
async function
|
|
380
|
-
|
|
374
|
+
let fn = c(() => Ut(b?.versions ?? [], b?.definition.currentVersionId), [b?.definition.currentVersionId, b?.versions]), pn = S ?? fn ?? b?.versions[0] ?? null, mn = !G && pn?.status === "PUBLISHED", hn = Wt({
|
|
375
|
+
hasUnsavedChanges: G,
|
|
376
|
+
latestPublishedVersion: fn,
|
|
377
|
+
openedContentPublished: mn,
|
|
378
|
+
openedVersion: pn
|
|
379
|
+
}), gn = H || !G && mn && !S, _n = G ? "保存並發布" : S ? "發布草稿" : mn ? "已發布" : "發布版本";
|
|
380
|
+
async function vn() {
|
|
381
|
+
an(!0), V(null);
|
|
381
382
|
try {
|
|
382
|
-
let e = await
|
|
383
|
-
|
|
383
|
+
let e = await ze(y), t = e.versions.find((e) => e.status === "DRAFT") ?? null;
|
|
384
|
+
x(e), C(t);
|
|
384
385
|
let n = t?.schema ?? e.versions[0]?.schema ?? N, r = t?.uiSchema ?? e.versions[0]?.uiSchema ?? P;
|
|
385
|
-
O(n), A(r),
|
|
386
|
+
O(n), A(r), nn(Ht(n, r)), j(F(n)), I(F(r)), B(t?.schema.fields[0]?.fieldKey ?? e.versions[0]?.schema.fields[0]?.fieldKey ?? null), L(null);
|
|
386
387
|
} catch (e) {
|
|
387
|
-
|
|
388
|
+
V(Jt(e));
|
|
388
389
|
} finally {
|
|
389
|
-
|
|
390
|
+
an(!1);
|
|
390
391
|
}
|
|
391
392
|
}
|
|
392
|
-
async function
|
|
393
|
-
let e = await
|
|
393
|
+
async function yn() {
|
|
394
|
+
let e = await Ve((S ?? await Te(y)).id, D, k);
|
|
394
395
|
return C(e), e;
|
|
395
396
|
}
|
|
396
|
-
async function
|
|
397
|
-
|
|
397
|
+
async function bn() {
|
|
398
|
+
U(!0), V(null);
|
|
398
399
|
try {
|
|
399
|
-
await
|
|
400
|
+
await yn(), await vn();
|
|
400
401
|
} catch (e) {
|
|
401
|
-
|
|
402
|
+
V(Jt(e));
|
|
402
403
|
} finally {
|
|
403
|
-
|
|
404
|
+
U(!1);
|
|
404
405
|
}
|
|
405
406
|
}
|
|
406
|
-
async function
|
|
407
|
-
|
|
407
|
+
async function xn() {
|
|
408
|
+
U(!0), V(null);
|
|
408
409
|
try {
|
|
409
|
-
await
|
|
410
|
+
await Ne((await yn()).id), await vn();
|
|
410
411
|
} catch (e) {
|
|
411
|
-
|
|
412
|
+
V(Jt(e));
|
|
412
413
|
} finally {
|
|
413
|
-
|
|
414
|
+
U(!1);
|
|
414
415
|
}
|
|
415
416
|
}
|
|
416
|
-
async function
|
|
417
|
-
if (!
|
|
418
|
-
|
|
417
|
+
async function Sn(e) {
|
|
418
|
+
if (!b) throw Error("尚未載入表單資料");
|
|
419
|
+
sn(!0);
|
|
419
420
|
try {
|
|
420
|
-
let t = await
|
|
421
|
-
|
|
422
|
-
...
|
|
421
|
+
let t = await Be(b.definition.id, e);
|
|
422
|
+
x({
|
|
423
|
+
...b,
|
|
423
424
|
definition: t
|
|
424
|
-
}),
|
|
425
|
+
}), en(!1);
|
|
425
426
|
} finally {
|
|
426
|
-
|
|
427
|
+
sn(!1);
|
|
427
428
|
}
|
|
428
429
|
}
|
|
429
|
-
function
|
|
430
|
-
let t =
|
|
430
|
+
function Cn(e) {
|
|
431
|
+
let t = we(e, D.fields.length + 1);
|
|
431
432
|
O({
|
|
432
|
-
...
|
|
433
|
-
fields: [...
|
|
433
|
+
...D,
|
|
434
|
+
fields: [...D.fields, t]
|
|
434
435
|
}), A({
|
|
435
436
|
...k,
|
|
436
437
|
layout: [...k.layout, {
|
|
437
438
|
fieldKey: t.fieldKey,
|
|
438
439
|
width: e === "textarea" || e === "file_upload" ? "FULL" : "HALF"
|
|
439
440
|
}]
|
|
440
|
-
}),
|
|
441
|
+
}), B(t.fieldKey), Zt("design"), L(null);
|
|
441
442
|
}
|
|
442
|
-
function
|
|
443
|
+
function wn(e) {
|
|
443
444
|
let t = e;
|
|
444
|
-
t === "advanced" &&
|
|
445
|
+
t === "advanced" && R !== "advanced" && (j(F(D)), I(F(k))), Zt(t);
|
|
445
446
|
}
|
|
446
|
-
function
|
|
447
|
-
let t =
|
|
447
|
+
function Tn(e) {
|
|
448
|
+
let t = D.fields.filter((t) => t.fieldKey !== e);
|
|
448
449
|
O({
|
|
449
|
-
...
|
|
450
|
+
...D,
|
|
450
451
|
fields: t
|
|
451
452
|
}), A({
|
|
452
453
|
...k,
|
|
453
454
|
layout: k.layout.filter((t) => t.fieldKey !== e)
|
|
454
|
-
}),
|
|
455
|
+
}), B(z === e ? t[0]?.fieldKey ?? null : z), L(null);
|
|
455
456
|
}
|
|
456
|
-
function
|
|
457
|
+
function En(e) {
|
|
457
458
|
let t = e.destination;
|
|
458
459
|
t && e.source.index !== t.index && (O((n) => ({
|
|
459
460
|
...n,
|
|
460
|
-
fields:
|
|
461
|
+
fields: Kt(n.fields, e.source.index, t.index)
|
|
461
462
|
})), A((n) => ({
|
|
462
463
|
...n,
|
|
463
|
-
layout:
|
|
464
|
-
})),
|
|
464
|
+
layout: Kt(n.layout, e.source.index, t.index)
|
|
465
|
+
})), L(null));
|
|
465
466
|
}
|
|
466
|
-
function
|
|
467
|
-
|
|
467
|
+
function K(e) {
|
|
468
|
+
q((t) => ({
|
|
468
469
|
...t,
|
|
469
470
|
...e
|
|
470
471
|
}));
|
|
471
472
|
}
|
|
472
|
-
function
|
|
473
|
-
if (!
|
|
474
|
-
let t =
|
|
473
|
+
function q(e) {
|
|
474
|
+
if (!W) return;
|
|
475
|
+
let t = W.fieldKey, n = e(W), r = n.fieldKey;
|
|
475
476
|
O({
|
|
476
|
-
...
|
|
477
|
-
fields:
|
|
477
|
+
...D,
|
|
478
|
+
fields: D.fields.map((e) => e.fieldKey === t ? n : e)
|
|
478
479
|
}), A({
|
|
479
480
|
...k,
|
|
480
481
|
layout: k.layout.map((e) => e.fieldKey === t ? {
|
|
481
482
|
...e,
|
|
482
483
|
fieldKey: r
|
|
483
484
|
} : e)
|
|
484
|
-
}),
|
|
485
|
+
}), B(r), L(null);
|
|
485
486
|
}
|
|
486
|
-
function
|
|
487
|
-
|
|
487
|
+
function J(e) {
|
|
488
|
+
q((t) => It(t) ? {
|
|
488
489
|
...t,
|
|
489
490
|
...e
|
|
490
491
|
} : t);
|
|
491
492
|
}
|
|
492
|
-
function
|
|
493
|
-
|
|
493
|
+
function Y(e) {
|
|
494
|
+
q((t) => ke(t) ? {
|
|
494
495
|
...t,
|
|
495
496
|
...e
|
|
496
497
|
} : t);
|
|
497
498
|
}
|
|
498
|
-
function
|
|
499
|
-
|
|
499
|
+
function Dn(e) {
|
|
500
|
+
q((t) => Oe(t) ? {
|
|
500
501
|
...t,
|
|
501
502
|
...e
|
|
502
503
|
} : t);
|
|
503
504
|
}
|
|
504
505
|
function X(e) {
|
|
505
|
-
|
|
506
|
+
q((t) => Ae(t) ? {
|
|
506
507
|
...t,
|
|
507
508
|
...e
|
|
508
509
|
} : t);
|
|
509
510
|
}
|
|
510
|
-
function
|
|
511
|
-
|
|
511
|
+
function On(e) {
|
|
512
|
+
q((t) => t.type === "boolean" ? {
|
|
512
513
|
...t,
|
|
513
514
|
...e
|
|
514
515
|
} : t);
|
|
515
516
|
}
|
|
516
|
-
function
|
|
517
|
-
|
|
517
|
+
function kn(e) {
|
|
518
|
+
q((t) => t.type === "file_upload" ? {
|
|
518
519
|
...t,
|
|
519
520
|
...e
|
|
520
521
|
} : t);
|
|
521
522
|
}
|
|
522
|
-
function
|
|
523
|
-
|
|
523
|
+
function An(e) {
|
|
524
|
+
Yt(e);
|
|
524
525
|
}
|
|
525
|
-
function
|
|
526
|
+
function jn(e, t) {
|
|
526
527
|
O((n) => ({
|
|
527
528
|
...n,
|
|
528
529
|
fields: n.fields.map((n) => n.fieldKey === e ? {
|
|
529
530
|
...n,
|
|
530
531
|
required: t
|
|
531
532
|
} : n)
|
|
532
|
-
})),
|
|
533
|
+
})), L(null);
|
|
533
534
|
}
|
|
534
|
-
function
|
|
535
|
+
function Mn(e) {
|
|
535
536
|
j(e);
|
|
536
537
|
try {
|
|
537
|
-
O(JSON.parse(e)),
|
|
538
|
+
O(JSON.parse(e)), L(null);
|
|
538
539
|
} catch {
|
|
539
|
-
|
|
540
|
+
L("Form Schema JSON 格式不正確");
|
|
540
541
|
}
|
|
541
542
|
}
|
|
542
|
-
function
|
|
543
|
-
|
|
543
|
+
function Nn(e) {
|
|
544
|
+
I(e);
|
|
544
545
|
try {
|
|
545
|
-
A(JSON.parse(e)),
|
|
546
|
+
A(JSON.parse(e)), L(null);
|
|
546
547
|
} catch {
|
|
547
|
-
|
|
548
|
+
L("UI Schema JSON 格式不正確");
|
|
548
549
|
}
|
|
549
550
|
}
|
|
550
|
-
return /* @__PURE__ */
|
|
551
|
-
activeHref:
|
|
552
|
-
children: [/* @__PURE__ */
|
|
553
|
-
description:
|
|
554
|
-
onBackClick:
|
|
555
|
-
title:
|
|
551
|
+
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v(n, {
|
|
552
|
+
activeHref: he.forms(),
|
|
553
|
+
children: [/* @__PURE__ */ _(ae, { children: /* @__PURE__ */ v(xe, {
|
|
554
|
+
description: hn,
|
|
555
|
+
onBackClick: dn,
|
|
556
|
+
title: b?.definition.name ?? "表單設計器",
|
|
556
557
|
children: [
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ _(d, {
|
|
558
559
|
"aria-label": "修改表單名稱",
|
|
559
|
-
disabled:
|
|
560
|
-
icon:
|
|
560
|
+
disabled: on || !b,
|
|
561
|
+
icon: _e,
|
|
561
562
|
iconType: "icon-only",
|
|
562
|
-
onClick: () =>
|
|
563
|
+
onClick: () => en(!0),
|
|
563
564
|
variant: "base-ghost",
|
|
564
565
|
children: "修改表單名稱"
|
|
565
566
|
}),
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ _(d, {
|
|
567
568
|
"aria-label": "儲存草稿",
|
|
568
|
-
disabled:
|
|
569
|
-
icon:
|
|
569
|
+
disabled: H || !G,
|
|
570
|
+
icon: ye,
|
|
570
571
|
iconType: "icon-only",
|
|
571
|
-
onClick: () => void
|
|
572
|
+
onClick: () => void bn(),
|
|
572
573
|
variant: "base-secondary",
|
|
573
574
|
children: "儲存草稿"
|
|
574
575
|
}),
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
disabled:
|
|
577
|
-
icon:
|
|
576
|
+
/* @__PURE__ */ _(d, {
|
|
577
|
+
disabled: gn,
|
|
578
|
+
icon: me,
|
|
578
579
|
iconType: "leading",
|
|
579
|
-
onClick: () => void
|
|
580
|
+
onClick: () => void xn(),
|
|
580
581
|
variant: "base-primary",
|
|
581
|
-
children:
|
|
582
|
+
children: _n
|
|
582
583
|
})
|
|
583
584
|
]
|
|
584
|
-
}) }), /* @__PURE__ */
|
|
585
|
-
style:
|
|
585
|
+
}) }), /* @__PURE__ */ _(se, { children: /* @__PURE__ */ _(oe, { children: /* @__PURE__ */ v("div", {
|
|
586
|
+
style: wt,
|
|
586
587
|
children: [
|
|
587
|
-
|
|
588
|
+
Qt ? /* @__PURE__ */ _(h, {
|
|
588
589
|
color: "text-error",
|
|
589
590
|
variant: "body",
|
|
590
|
-
children:
|
|
591
|
+
children: Qt
|
|
591
592
|
}) : null,
|
|
592
|
-
/* @__PURE__ */
|
|
593
|
-
activeKey:
|
|
594
|
-
onChange:
|
|
593
|
+
/* @__PURE__ */ v(ce, {
|
|
594
|
+
activeKey: R,
|
|
595
|
+
onChange: wn,
|
|
595
596
|
size: "sub",
|
|
596
597
|
children: [
|
|
597
|
-
/* @__PURE__ */
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
/* @__PURE__ */
|
|
600
|
-
/* @__PURE__ */
|
|
598
|
+
/* @__PURE__ */ _(m, { children: "設計" }, "design"),
|
|
599
|
+
/* @__PURE__ */ _(m, { children: "預覽" }, "preview"),
|
|
600
|
+
/* @__PURE__ */ _(m, { children: "版本" }, "versions"),
|
|
601
|
+
/* @__PURE__ */ _(m, { children: "進階" }, "advanced")
|
|
601
602
|
]
|
|
602
603
|
}),
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
604
|
+
R === "design" ? Pn() : null,
|
|
605
|
+
R === "preview" ? $n() : null,
|
|
606
|
+
R === "versions" ? er() : null,
|
|
607
|
+
R === "advanced" ? tr() : null
|
|
607
608
|
]
|
|
608
609
|
}) }) })]
|
|
609
|
-
}), /* @__PURE__ */
|
|
610
|
+
}), /* @__PURE__ */ _(o, {
|
|
610
611
|
confirmText: "儲存",
|
|
611
|
-
initialName:
|
|
612
|
-
loading:
|
|
613
|
-
onClose: () =>
|
|
614
|
-
onSubmit:
|
|
615
|
-
open:
|
|
612
|
+
initialName: b?.definition.name ?? "",
|
|
613
|
+
loading: on,
|
|
614
|
+
onClose: () => en(!1),
|
|
615
|
+
onSubmit: Sn,
|
|
616
|
+
open: $t,
|
|
616
617
|
title: "修改表單名稱"
|
|
617
618
|
})] });
|
|
618
|
-
function
|
|
619
|
-
return /* @__PURE__ */
|
|
619
|
+
function Pn() {
|
|
620
|
+
return /* @__PURE__ */ v("div", {
|
|
620
621
|
style: M,
|
|
621
|
-
children: [/* @__PURE__ */
|
|
622
|
-
style:
|
|
623
|
-
children: [/* @__PURE__ */
|
|
622
|
+
children: [/* @__PURE__ */ v("div", {
|
|
623
|
+
style: $e,
|
|
624
|
+
children: [/* @__PURE__ */ _(h, {
|
|
624
625
|
component: "h2",
|
|
625
626
|
variant: "label-primary",
|
|
626
627
|
children: "新增欄位"
|
|
627
|
-
}), /* @__PURE__ */
|
|
628
|
-
style:
|
|
629
|
-
children:
|
|
630
|
-
disabled:
|
|
628
|
+
}), /* @__PURE__ */ _("div", {
|
|
629
|
+
style: Ze,
|
|
630
|
+
children: qe.map((e) => /* @__PURE__ */ _(d, {
|
|
631
|
+
disabled: H,
|
|
631
632
|
icon: e.icon,
|
|
632
633
|
iconType: "leading",
|
|
633
|
-
onClick: () =>
|
|
634
|
+
onClick: () => Cn(e.type),
|
|
634
635
|
size: "sub",
|
|
635
|
-
style:
|
|
636
|
+
style: Qe,
|
|
636
637
|
type: "button",
|
|
637
638
|
variant: "base-secondary",
|
|
638
639
|
children: e.label
|
|
639
640
|
}, e.type))
|
|
640
641
|
})]
|
|
641
|
-
}), /* @__PURE__ */
|
|
642
|
-
style:
|
|
643
|
-
children: [/* @__PURE__ */
|
|
642
|
+
}), /* @__PURE__ */ v("div", {
|
|
643
|
+
style: Je,
|
|
644
|
+
children: [/* @__PURE__ */ v("div", {
|
|
644
645
|
style: {
|
|
645
646
|
...M,
|
|
646
|
-
...
|
|
647
|
+
...Ye
|
|
647
648
|
},
|
|
648
|
-
children: [/* @__PURE__ */
|
|
649
|
+
children: [/* @__PURE__ */ _(h, {
|
|
649
650
|
component: "h2",
|
|
650
651
|
variant: "label-primary",
|
|
651
652
|
children: "表單畫布"
|
|
652
|
-
}),
|
|
653
|
-
onDragEnd:
|
|
654
|
-
children: /* @__PURE__ */
|
|
653
|
+
}), D.fields.length > 0 ? /* @__PURE__ */ _(He, {
|
|
654
|
+
onDragEnd: En,
|
|
655
|
+
children: /* @__PURE__ */ _(We, {
|
|
655
656
|
droppableId: "form-builder-fields",
|
|
656
|
-
children: (e) => /* @__PURE__ */
|
|
657
|
+
children: (e) => /* @__PURE__ */ v("div", {
|
|
657
658
|
...e.droppableProps,
|
|
658
659
|
ref: e.innerRef,
|
|
659
660
|
style: M,
|
|
660
|
-
children: [
|
|
661
|
+
children: [D.fields.map((e, t) => /* @__PURE__ */ _(Ue, {
|
|
661
662
|
draggableId: e.fieldKey,
|
|
662
663
|
index: t,
|
|
663
|
-
isDragDisabled:
|
|
664
|
-
children: (t, n) =>
|
|
664
|
+
isDragDisabled: H,
|
|
665
|
+
children: (t, n) => Zn(e, t, n.isDragging)
|
|
665
666
|
}, e.fieldKey)), e.placeholder]
|
|
666
667
|
})
|
|
667
668
|
})
|
|
668
|
-
}) : /* @__PURE__ */
|
|
669
|
-
style:
|
|
670
|
-
children: [/* @__PURE__ */
|
|
669
|
+
}) : /* @__PURE__ */ v("div", {
|
|
670
|
+
style: ot,
|
|
671
|
+
children: [/* @__PURE__ */ v("div", {
|
|
671
672
|
style: M,
|
|
672
|
-
children: [/* @__PURE__ */
|
|
673
|
+
children: [/* @__PURE__ */ _(h, {
|
|
673
674
|
component: "h3",
|
|
674
675
|
variant: "h3",
|
|
675
676
|
children: "尚未建立欄位"
|
|
676
|
-
}), /* @__PURE__ */
|
|
677
|
+
}), /* @__PURE__ */ _(h, {
|
|
677
678
|
color: "text-neutral",
|
|
678
679
|
variant: "body",
|
|
679
680
|
children: "從上方新增第一個欄位,或直接建立常用文字欄位開始設計。"
|
|
680
681
|
})]
|
|
681
|
-
}), /* @__PURE__ */
|
|
682
|
-
style:
|
|
683
|
-
children: [/* @__PURE__ */
|
|
684
|
-
disabled:
|
|
685
|
-
onClick: () =>
|
|
682
|
+
}), /* @__PURE__ */ v("div", {
|
|
683
|
+
style: st,
|
|
684
|
+
children: [/* @__PURE__ */ _(d, {
|
|
685
|
+
disabled: H,
|
|
686
|
+
onClick: () => Cn("text"),
|
|
686
687
|
variant: "base-primary",
|
|
687
688
|
children: "新增文字欄位"
|
|
688
|
-
}), /* @__PURE__ */
|
|
689
|
-
disabled:
|
|
690
|
-
onClick: () =>
|
|
689
|
+
}), /* @__PURE__ */ _(d, {
|
|
690
|
+
disabled: H,
|
|
691
|
+
onClick: () => Cn("textarea"),
|
|
691
692
|
variant: "base-secondary",
|
|
692
693
|
children: "新增長文字"
|
|
693
694
|
})]
|
|
694
695
|
})]
|
|
695
696
|
})]
|
|
696
|
-
}), /* @__PURE__ */
|
|
697
|
+
}), /* @__PURE__ */ v("div", {
|
|
697
698
|
style: {
|
|
698
699
|
...M,
|
|
699
|
-
...
|
|
700
|
+
...Xe
|
|
700
701
|
},
|
|
701
|
-
children: [/* @__PURE__ */
|
|
702
|
+
children: [/* @__PURE__ */ _(h, {
|
|
702
703
|
component: "h2",
|
|
703
704
|
variant: "label-primary",
|
|
704
705
|
children: "欄位設定"
|
|
705
|
-
}),
|
|
706
|
+
}), W ? Fn(W) : /* @__PURE__ */ _(h, {
|
|
706
707
|
color: "text-neutral",
|
|
707
708
|
variant: "body",
|
|
708
709
|
children: "請先新增或選取欄位。"
|
|
@@ -711,238 +712,238 @@ function F({ formId: ue }) {
|
|
|
711
712
|
})]
|
|
712
713
|
});
|
|
713
714
|
}
|
|
714
|
-
function
|
|
715
|
-
return /* @__PURE__ */
|
|
716
|
-
style:
|
|
717
|
-
children: [
|
|
715
|
+
function Fn(e) {
|
|
716
|
+
return /* @__PURE__ */ v("div", {
|
|
717
|
+
style: ct,
|
|
718
|
+
children: [In(e), Ln(e)]
|
|
718
719
|
});
|
|
719
720
|
}
|
|
720
|
-
function
|
|
721
|
-
return /* @__PURE__ */
|
|
722
|
-
style:
|
|
721
|
+
function In(e) {
|
|
722
|
+
return /* @__PURE__ */ v("div", {
|
|
723
|
+
style: lt,
|
|
723
724
|
children: [
|
|
724
|
-
/* @__PURE__ */
|
|
725
|
-
style:
|
|
726
|
-
children: /* @__PURE__ */
|
|
725
|
+
/* @__PURE__ */ _("div", {
|
|
726
|
+
style: dt,
|
|
727
|
+
children: /* @__PURE__ */ _(u, {
|
|
727
728
|
size: "main",
|
|
728
|
-
text:
|
|
729
|
+
text: Nt(e.type),
|
|
729
730
|
variant: "text-info"
|
|
730
731
|
})
|
|
731
732
|
}),
|
|
732
|
-
$("標題", "fieldLabel", /* @__PURE__ */
|
|
733
|
-
onChange: (e) =>
|
|
733
|
+
$("標題", "fieldLabel", /* @__PURE__ */ _(f, {
|
|
734
|
+
onChange: (e) => K({ label: e.target.value }),
|
|
734
735
|
placeholder: "例如:申請金額",
|
|
735
736
|
value: e.label,
|
|
736
737
|
variant: "base"
|
|
737
|
-
}),
|
|
738
|
-
$("欄位 Key", "fieldKey", /* @__PURE__ */
|
|
739
|
-
onChange: (e) =>
|
|
738
|
+
}), H),
|
|
739
|
+
$("欄位 Key", "fieldKey", /* @__PURE__ */ _(f, {
|
|
740
|
+
onChange: (e) => K({ fieldKey: e.target.value }),
|
|
740
741
|
placeholder: "例如:amount",
|
|
741
742
|
value: e.fieldKey,
|
|
742
743
|
variant: "base"
|
|
743
|
-
}),
|
|
744
|
-
$("提示文字", "fieldPlaceholder", /* @__PURE__ */
|
|
745
|
-
onChange: (e) =>
|
|
744
|
+
}), H),
|
|
745
|
+
$("提示文字", "fieldPlaceholder", /* @__PURE__ */ _(f, {
|
|
746
|
+
onChange: (e) => K({ placeholder: e.target.value || void 0 }),
|
|
746
747
|
placeholder: "例如:請輸入申請金額",
|
|
747
748
|
value: e.placeholder ?? "",
|
|
748
749
|
variant: "base"
|
|
749
|
-
}),
|
|
750
|
-
|
|
750
|
+
}), H),
|
|
751
|
+
Rn(e)
|
|
751
752
|
]
|
|
752
753
|
});
|
|
753
754
|
}
|
|
754
|
-
function
|
|
755
|
-
return /* @__PURE__ */
|
|
756
|
-
defaultExpanded:
|
|
755
|
+
function Ln(e) {
|
|
756
|
+
return /* @__PURE__ */ _(ee, {
|
|
757
|
+
defaultExpanded: Pt(e),
|
|
757
758
|
size: "sub",
|
|
758
759
|
title: "進階設定",
|
|
759
|
-
children: /* @__PURE__ */
|
|
760
|
-
style:
|
|
760
|
+
children: /* @__PURE__ */ v("div", {
|
|
761
|
+
style: lt,
|
|
761
762
|
children: [
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ _(h, {
|
|
763
764
|
component: "h3",
|
|
764
|
-
style:
|
|
765
|
+
style: ut,
|
|
765
766
|
variant: "label-primary",
|
|
766
767
|
children: "條件規則"
|
|
767
768
|
}),
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
+
/* @__PURE__ */ _(h, {
|
|
769
770
|
color: "text-neutral",
|
|
770
|
-
style:
|
|
771
|
+
style: ft,
|
|
771
772
|
variant: "body",
|
|
772
773
|
children: "只有需要根據其他欄位改變顯示、必填或唯讀狀態時才需要設定。"
|
|
773
774
|
}),
|
|
774
|
-
|
|
775
|
+
Gn(e)
|
|
775
776
|
]
|
|
776
777
|
})
|
|
777
778
|
});
|
|
778
779
|
}
|
|
779
|
-
function
|
|
780
|
-
return
|
|
780
|
+
function Rn(e) {
|
|
781
|
+
return It(e) ? zn(e) : ke(e) ? Bn(e) : Oe(e) ? Vn(e) : Ae(e) ? Hn(e) : e.type === "boolean" ? Un(e) : Wn(e);
|
|
781
782
|
}
|
|
782
|
-
function
|
|
783
|
-
return /* @__PURE__ */
|
|
784
|
-
$("預設值", "fieldDefaultValue", e.type === "textarea" ?
|
|
785
|
-
disabled:
|
|
783
|
+
function zn(e) {
|
|
784
|
+
return /* @__PURE__ */ v(g, { children: [
|
|
785
|
+
$("預設值", "fieldDefaultValue", e.type === "textarea" ? Jn({
|
|
786
|
+
disabled: H,
|
|
786
787
|
name: "fieldDefaultValue",
|
|
787
|
-
onChange: (e) =>
|
|
788
|
+
onChange: (e) => J({ defaultValue: e || void 0 }),
|
|
788
789
|
placeholder: "輸入此欄位的預設文字",
|
|
789
790
|
rows: 3,
|
|
790
|
-
value:
|
|
791
|
-
}) : /* @__PURE__ */
|
|
792
|
-
onChange: (e) =>
|
|
791
|
+
value: Lt(e.defaultValue)
|
|
792
|
+
}) : /* @__PURE__ */ _(f, {
|
|
793
|
+
onChange: (e) => J({ defaultValue: e.target.value || void 0 }),
|
|
793
794
|
placeholder: "輸入此欄位的預設文字",
|
|
794
|
-
value:
|
|
795
|
+
value: Lt(e.defaultValue),
|
|
795
796
|
variant: "base"
|
|
796
|
-
}),
|
|
797
|
-
$("最小長度", "fieldMinLength", Q(e.minLength, (e) =>
|
|
798
|
-
$("最大長度", "fieldMaxLength", Q(e.maxLength, (e) =>
|
|
797
|
+
}), H),
|
|
798
|
+
$("最小長度", "fieldMinLength", Q(e.minLength, (e) => J({ minLength: e }), "例如:2", { min: 0 }), H),
|
|
799
|
+
$("最大長度", "fieldMaxLength", Q(e.maxLength, (e) => J({ maxLength: e }), "例如:100", { min: 1 }), H)
|
|
799
800
|
] });
|
|
800
801
|
}
|
|
801
|
-
function
|
|
802
|
-
return /* @__PURE__ */
|
|
803
|
-
$("預設值", "fieldDefaultValue", Q(typeof e.defaultValue == "number" ? e.defaultValue : void 0, (e) =>
|
|
802
|
+
function Bn(e) {
|
|
803
|
+
return /* @__PURE__ */ v(g, { children: [
|
|
804
|
+
$("預設值", "fieldDefaultValue", Q(typeof e.defaultValue == "number" ? e.defaultValue : void 0, (e) => Y({ defaultValue: e }), e.type === "money" ? "例如:1000" : "輸入預設數值", {
|
|
804
805
|
max: e.maximum,
|
|
805
806
|
min: e.minimum
|
|
806
|
-
}),
|
|
807
|
-
$("最小值", "fieldMinimum", Q(e.minimum, (e) =>
|
|
808
|
-
$("最大值", "fieldMaximum", Q(e.maximum, (e) =>
|
|
807
|
+
}), H),
|
|
808
|
+
$("最小值", "fieldMinimum", Q(e.minimum, (e) => Y({ minimum: e }), "例如:0"), H),
|
|
809
|
+
$("最大值", "fieldMaximum", Q(e.maximum, (e) => Y({ maximum: e }), "例如:999999"), H)
|
|
809
810
|
] });
|
|
810
811
|
}
|
|
811
|
-
function
|
|
812
|
-
return $("預設值", "fieldDefaultValue",
|
|
812
|
+
function Vn(e) {
|
|
813
|
+
return $("預設值", "fieldDefaultValue", Yn(e, Lt(e.defaultValue), (e) => Dn({ defaultValue: e })), H);
|
|
813
814
|
}
|
|
814
|
-
function
|
|
815
|
-
let t = Array.isArray(e.defaultValue) ? e.defaultValue : [], n = e.options.filter((e) => t.includes(e.value)).map(
|
|
816
|
-
return /* @__PURE__ */
|
|
815
|
+
function Hn(e) {
|
|
816
|
+
let t = Array.isArray(e.defaultValue) ? e.defaultValue : [], n = e.options.filter((e) => t.includes(e.value)).map(T);
|
|
817
|
+
return /* @__PURE__ */ v(g, { children: [$("預設值", "fieldDefaultValue", e.type === "checkbox" ? /* @__PURE__ */ _(p, {
|
|
817
818
|
clearable: !0,
|
|
818
819
|
mode: "multiple",
|
|
819
820
|
onChange: (e) => X({ defaultValue: e.length ? e.map((e) => e.id) : void 0 }),
|
|
820
|
-
options: e.options.map(
|
|
821
|
+
options: e.options.map(T),
|
|
821
822
|
placeholder: "選擇一或多個預設選項",
|
|
822
823
|
value: n
|
|
823
|
-
}) : /* @__PURE__ */
|
|
824
|
+
}) : /* @__PURE__ */ _(p, {
|
|
824
825
|
clearable: !0,
|
|
825
826
|
onChange: (e) => X({ defaultValue: e?.id || void 0 }),
|
|
826
|
-
options: e.options.map(
|
|
827
|
+
options: e.options.map(T),
|
|
827
828
|
placeholder: "選擇預設選項",
|
|
828
|
-
value: typeof e.defaultValue == "string" ?
|
|
829
|
-
}),
|
|
829
|
+
value: typeof e.defaultValue == "string" ? E(e.options.map(T), e.defaultValue) : null
|
|
830
|
+
}), H), $("選項", "fieldOptions", Xn(e), H, !0)] });
|
|
830
831
|
}
|
|
831
|
-
function
|
|
832
|
+
function Un(e) {
|
|
832
833
|
let t = typeof e.defaultValue == "boolean" ? String(e.defaultValue) : "unset";
|
|
833
|
-
return $("預設值", "fieldDefaultValue", /* @__PURE__ */
|
|
834
|
+
return $("預設值", "fieldDefaultValue", /* @__PURE__ */ _(p, {
|
|
834
835
|
clearable: !1,
|
|
835
|
-
onChange: (e) =>
|
|
836
|
-
options: [...
|
|
836
|
+
onChange: (e) => On({ defaultValue: e?.id === "true" ? !0 : e?.id === "false" ? !1 : void 0 }),
|
|
837
|
+
options: [...kt],
|
|
837
838
|
placeholder: "選擇預設狀態",
|
|
838
|
-
value:
|
|
839
|
-
}),
|
|
839
|
+
value: E(kt, t)
|
|
840
|
+
}), H);
|
|
840
841
|
}
|
|
841
|
-
function
|
|
842
|
-
return /* @__PURE__ */
|
|
843
|
-
disabled:
|
|
842
|
+
function Wn(e) {
|
|
843
|
+
return /* @__PURE__ */ v(g, { children: [$("檔案數", "fieldMaxFiles", Q(e.maxFiles, (e) => kn({ maxFiles: e }), "例如:1", { min: 1 }), H), $("MIME", "fieldAcceptedMimeTypes", Jn({
|
|
844
|
+
disabled: H,
|
|
844
845
|
name: "fieldAcceptedMimeTypes",
|
|
845
|
-
onChange: (e) =>
|
|
846
|
+
onChange: (e) => kn({ acceptedMimeTypes: Rt(e) }),
|
|
846
847
|
placeholder: "每行一個 MIME type,例如:application/pdf",
|
|
847
848
|
rows: 3,
|
|
848
|
-
value:
|
|
849
|
+
value: zt(e.acceptedMimeTypes)
|
|
849
850
|
}), !1)] });
|
|
850
851
|
}
|
|
851
|
-
function
|
|
852
|
-
let t =
|
|
853
|
-
return t.length ? /* @__PURE__ */
|
|
852
|
+
function Gn(e) {
|
|
853
|
+
let t = D.fields.filter((t) => t.fieldKey !== e.fieldKey);
|
|
854
|
+
return t.length ? /* @__PURE__ */ _(g, { children: jt.map((n) => Kn(e, n, t)) }) : /* @__PURE__ */ _(h, {
|
|
854
855
|
color: "text-neutral",
|
|
855
|
-
style:
|
|
856
|
+
style: ft,
|
|
856
857
|
variant: "body",
|
|
857
858
|
children: "目前沒有其他欄位可作為條件來源。新增更多欄位後即可設定條件規則。"
|
|
858
859
|
});
|
|
859
860
|
}
|
|
860
|
-
function
|
|
861
|
-
let r = e[t.target], i = r ?
|
|
862
|
-
return $(t.label, t.name, /* @__PURE__ */
|
|
863
|
-
style:
|
|
864
|
-
children: [/* @__PURE__ */
|
|
865
|
-
checked:
|
|
866
|
-
disabled:
|
|
867
|
-
label:
|
|
868
|
-
onChange: (e) => Z(t.target, e.target.checked ?
|
|
861
|
+
function Kn(e, t, n) {
|
|
862
|
+
let r = e[t.target], i = r ? je(r) : null, a = n.find((e) => e.fieldKey === i?.fieldKey), o = a ?? n[0], s = n.map(Ft), c = Fe(o), l = i && c.some((e) => e.id === i.operator) ? i.operator : Le(o), ee = i?.value ?? Re(o), u = !!r, te = u && (!i || !a);
|
|
863
|
+
return $(t.label, t.name, /* @__PURE__ */ v("div", {
|
|
864
|
+
style: xt,
|
|
865
|
+
children: [/* @__PURE__ */ _(de, {
|
|
866
|
+
checked: u,
|
|
867
|
+
disabled: H,
|
|
868
|
+
label: u ? "已啟用" : "不啟用",
|
|
869
|
+
onChange: (e) => Z(t.target, e.target.checked ? w(o, Le(o), Re(o)) : void 0),
|
|
869
870
|
size: "sub",
|
|
870
871
|
supportingText: t.supportingText
|
|
871
|
-
}),
|
|
872
|
+
}), u ? te ? /* @__PURE__ */ _(h, {
|
|
872
873
|
color: "text-warning",
|
|
873
874
|
variant: "body",
|
|
874
875
|
children: "這個規則不是目前 UI 支援的格式。重新選擇條件後會取代既有規則。"
|
|
875
|
-
}) : /* @__PURE__ */
|
|
876
|
-
style:
|
|
876
|
+
}) : /* @__PURE__ */ v("div", {
|
|
877
|
+
style: St,
|
|
877
878
|
children: [
|
|
878
|
-
/* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ _(p, {
|
|
879
880
|
clearable: !1,
|
|
880
881
|
onChange: (e) => {
|
|
881
882
|
let r = n.find((t) => t.fieldKey === e?.id) ?? o;
|
|
882
|
-
Z(t.target,
|
|
883
|
+
Z(t.target, w(r, Le(r), Re(r)));
|
|
883
884
|
},
|
|
884
885
|
options: s,
|
|
885
886
|
placeholder: "選擇欄位",
|
|
886
|
-
value:
|
|
887
|
+
value: E(s, o.fieldKey)
|
|
887
888
|
}),
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ _(p, {
|
|
889
890
|
clearable: !1,
|
|
890
|
-
onChange: (e) => Z(t.target,
|
|
891
|
+
onChange: (e) => Z(t.target, w(o, Pe(e?.id) ?? l, ee)),
|
|
891
892
|
options: [...c],
|
|
892
893
|
placeholder: "判斷方式",
|
|
893
|
-
value:
|
|
894
|
+
value: E(c, l)
|
|
894
895
|
}),
|
|
895
|
-
|
|
896
|
+
qn(o, ee, (e) => Z(t.target, w(o, l, e)))
|
|
896
897
|
]
|
|
897
898
|
}) : null]
|
|
898
|
-
}),
|
|
899
|
+
}), H, !0);
|
|
899
900
|
}
|
|
900
901
|
function Z(e, t) {
|
|
901
|
-
|
|
902
|
+
K({ [e]: t });
|
|
902
903
|
}
|
|
903
|
-
function
|
|
904
|
-
if (e.type === "boolean") return /* @__PURE__ */
|
|
904
|
+
function qn(e, t, n) {
|
|
905
|
+
if (e.type === "boolean") return /* @__PURE__ */ _(p, {
|
|
905
906
|
clearable: !1,
|
|
906
907
|
onChange: (e) => n(e?.id ?? "true"),
|
|
907
|
-
options: [...
|
|
908
|
+
options: [...At],
|
|
908
909
|
placeholder: "比較值",
|
|
909
|
-
value:
|
|
910
|
+
value: E(At, t === "false" ? "false" : "true")
|
|
910
911
|
});
|
|
911
|
-
if (
|
|
912
|
-
let r = e.options.map(
|
|
913
|
-
return /* @__PURE__ */
|
|
912
|
+
if (Ae(e)) {
|
|
913
|
+
let r = e.options.map(T);
|
|
914
|
+
return /* @__PURE__ */ _(p, {
|
|
914
915
|
clearable: !1,
|
|
915
916
|
onChange: (e) => n(e?.id ?? r[0]?.id ?? ""),
|
|
916
917
|
options: r,
|
|
917
918
|
placeholder: "比較值",
|
|
918
|
-
value:
|
|
919
|
+
value: E(r, t)
|
|
919
920
|
});
|
|
920
921
|
}
|
|
921
|
-
return
|
|
922
|
+
return ke(e) ? Q(Me(t), (e) => n(String(e ?? 0)), "比較值") : Oe(e) ? Yn(e, t, (e) => n(e ?? "")) : /* @__PURE__ */ _(f, {
|
|
922
923
|
onChange: (e) => n(e.target.value),
|
|
923
924
|
placeholder: "比較值",
|
|
924
925
|
value: t,
|
|
925
926
|
variant: "base"
|
|
926
927
|
});
|
|
927
928
|
}
|
|
928
|
-
function
|
|
929
|
-
return /* @__PURE__ */
|
|
929
|
+
function Jn({ disabled: e, name: t, onChange: n, placeholder: r, rows: i, value: a }) {
|
|
930
|
+
return /* @__PURE__ */ _(ue, {
|
|
930
931
|
"aria-label": t,
|
|
931
932
|
disabled: e,
|
|
932
933
|
onChange: (e) => n(e.target.value),
|
|
933
934
|
placeholder: r,
|
|
934
|
-
ref:
|
|
935
|
+
ref: Ot,
|
|
935
936
|
resize: "vertical",
|
|
936
937
|
rows: i,
|
|
937
|
-
style:
|
|
938
|
+
style: gt,
|
|
938
939
|
value: a
|
|
939
940
|
});
|
|
940
941
|
}
|
|
941
942
|
function Q(e, t, n, r = {}) {
|
|
942
|
-
return /* @__PURE__ */
|
|
943
|
+
return /* @__PURE__ */ _(f, {
|
|
943
944
|
max: r.max,
|
|
944
945
|
min: r.min,
|
|
945
|
-
onChange: (e) => t(
|
|
946
|
+
onChange: (e) => t(Ce(Me(e.target.value), r)),
|
|
946
947
|
placeholder: n,
|
|
947
948
|
showSpinner: !0,
|
|
948
949
|
step: r.step ?? 1,
|
|
@@ -950,30 +951,30 @@ function F({ formId: ue }) {
|
|
|
950
951
|
variant: "measure"
|
|
951
952
|
});
|
|
952
953
|
}
|
|
953
|
-
function
|
|
954
|
-
return e.type === "datetime" ? /* @__PURE__ */
|
|
954
|
+
function Yn(e, t, n) {
|
|
955
|
+
return e.type === "datetime" ? /* @__PURE__ */ _(re, {
|
|
955
956
|
formatDate: "YYYY-MM-DD",
|
|
956
957
|
formatTime: "HH:mm",
|
|
957
958
|
hideSecond: !0,
|
|
958
|
-
onChange: (e) => n(
|
|
959
|
+
onChange: (e) => n(De(e)),
|
|
959
960
|
placeholderLeft: "選擇日期",
|
|
960
961
|
placeholderRight: "選擇時間",
|
|
961
|
-
value:
|
|
962
|
-
}) : /* @__PURE__ */
|
|
962
|
+
value: Ie(t)
|
|
963
|
+
}) : /* @__PURE__ */ _(ne, {
|
|
963
964
|
format: "YYYY-MM-DD",
|
|
964
|
-
onChange: (e) => n(
|
|
965
|
+
onChange: (e) => n(Ee(e)),
|
|
965
966
|
placeholder: "選擇日期",
|
|
966
|
-
value:
|
|
967
|
+
value: Ie(t)
|
|
967
968
|
});
|
|
968
969
|
}
|
|
969
|
-
function
|
|
970
|
-
return /* @__PURE__ */
|
|
971
|
-
style:
|
|
972
|
-
children: [/* @__PURE__ */
|
|
970
|
+
function Xn(e) {
|
|
971
|
+
return /* @__PURE__ */ v("div", {
|
|
972
|
+
style: Tt,
|
|
973
|
+
children: [/* @__PURE__ */ _(le, {
|
|
973
974
|
actions: {
|
|
974
975
|
render: (t) => [{
|
|
975
|
-
disabled: () =>
|
|
976
|
-
icon:
|
|
976
|
+
disabled: () => H || e.options.length <= 1,
|
|
977
|
+
icon: be,
|
|
977
978
|
iconType: "icon-only",
|
|
978
979
|
name: "移除選項",
|
|
979
980
|
onClick: () => X({ options: e.options.filter((e, n) => n !== t.index) }),
|
|
@@ -983,8 +984,8 @@ function F({ formId: ue }) {
|
|
|
983
984
|
},
|
|
984
985
|
columns: [{
|
|
985
986
|
key: "label",
|
|
986
|
-
render: (t) => /* @__PURE__ */
|
|
987
|
-
onChange: (n) => X({ options:
|
|
987
|
+
render: (t) => /* @__PURE__ */ _(f, {
|
|
988
|
+
onChange: (n) => X({ options: Bt(e.options, t.index, { label: n.target.value }) }),
|
|
988
989
|
placeholder: "例如:主管",
|
|
989
990
|
size: "sub",
|
|
990
991
|
value: t.label,
|
|
@@ -993,8 +994,8 @@ function F({ formId: ue }) {
|
|
|
993
994
|
title: "Label"
|
|
994
995
|
}, {
|
|
995
996
|
key: "value",
|
|
996
|
-
render: (t) => /* @__PURE__ */
|
|
997
|
-
onChange: (n) => X({ options:
|
|
997
|
+
render: (t) => /* @__PURE__ */ _(f, {
|
|
998
|
+
onChange: (n) => X({ options: Bt(e.options, t.index, { value: n.target.value }) }),
|
|
998
999
|
placeholder: "例如:manager",
|
|
999
1000
|
size: "sub",
|
|
1000
1001
|
value: t.value,
|
|
@@ -1010,39 +1011,39 @@ function F({ formId: ue }) {
|
|
|
1010
1011
|
})),
|
|
1011
1012
|
showHeader: !0,
|
|
1012
1013
|
size: "sub"
|
|
1013
|
-
}), /* @__PURE__ */
|
|
1014
|
-
style:
|
|
1015
|
-
children: /* @__PURE__ */
|
|
1016
|
-
disabled:
|
|
1017
|
-
icon:
|
|
1014
|
+
}), /* @__PURE__ */ _("div", {
|
|
1015
|
+
style: Et,
|
|
1016
|
+
children: /* @__PURE__ */ _(d, {
|
|
1017
|
+
disabled: H,
|
|
1018
|
+
icon: ve,
|
|
1018
1019
|
iconType: "leading",
|
|
1019
|
-
onClick: () => X({ options: [...e.options,
|
|
1020
|
+
onClick: () => X({ options: [...e.options, Vt(e.options)] }),
|
|
1020
1021
|
variant: "base-secondary",
|
|
1021
1022
|
children: "新增選項"
|
|
1022
1023
|
})
|
|
1023
1024
|
})]
|
|
1024
1025
|
});
|
|
1025
1026
|
}
|
|
1026
|
-
function
|
|
1027
|
-
return /* @__PURE__ */
|
|
1027
|
+
function Zn(e, t, n) {
|
|
1028
|
+
return /* @__PURE__ */ _("div", {
|
|
1028
1029
|
...t.draggableProps,
|
|
1029
1030
|
"data-form-builder-field-key": e.fieldKey,
|
|
1030
1031
|
ref: t.innerRef,
|
|
1031
1032
|
style: {
|
|
1032
|
-
...
|
|
1033
|
-
...n ?
|
|
1033
|
+
...it,
|
|
1034
|
+
...n ? at : null,
|
|
1034
1035
|
...t.draggableProps.style
|
|
1035
1036
|
},
|
|
1036
|
-
children: /* @__PURE__ */
|
|
1037
|
+
children: /* @__PURE__ */ _(te, { children: Qn(e, t, n) })
|
|
1037
1038
|
});
|
|
1038
1039
|
}
|
|
1039
|
-
function $(e, t, n,
|
|
1040
|
-
return /* @__PURE__ */
|
|
1041
|
-
style: a ?
|
|
1042
|
-
children: /* @__PURE__ */
|
|
1043
|
-
style:
|
|
1044
|
-
children: /* @__PURE__ */
|
|
1045
|
-
disabled:
|
|
1040
|
+
function $(e, t, n, r, a = !1) {
|
|
1041
|
+
return /* @__PURE__ */ _("div", {
|
|
1042
|
+
style: a ? mt : pt,
|
|
1043
|
+
children: /* @__PURE__ */ _("div", {
|
|
1044
|
+
style: ht,
|
|
1045
|
+
children: /* @__PURE__ */ _(i, {
|
|
1046
|
+
disabled: r,
|
|
1046
1047
|
label: e,
|
|
1047
1048
|
name: t,
|
|
1048
1049
|
children: n
|
|
@@ -1050,41 +1051,41 @@ function F({ formId: ue }) {
|
|
|
1050
1051
|
})
|
|
1051
1052
|
});
|
|
1052
1053
|
}
|
|
1053
|
-
function
|
|
1054
|
-
return /* @__PURE__ */
|
|
1054
|
+
function Qn(e, t, n) {
|
|
1055
|
+
return /* @__PURE__ */ v("div", {
|
|
1055
1056
|
...t.dragHandleProps ?? {},
|
|
1056
1057
|
"aria-label": "拖曳排序欄位",
|
|
1057
|
-
style:
|
|
1058
|
+
style: et,
|
|
1058
1059
|
title: "拖曳排序",
|
|
1059
1060
|
children: [
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
+
/* @__PURE__ */ _("span", {
|
|
1061
1062
|
"aria-label": "拖曳排序",
|
|
1062
1063
|
role: "img",
|
|
1063
|
-
style:
|
|
1064
|
+
style: Ct,
|
|
1064
1065
|
title: "拖曳排序",
|
|
1065
|
-
children: /* @__PURE__ */
|
|
1066
|
-
icon:
|
|
1066
|
+
children: /* @__PURE__ */ _(ie, {
|
|
1067
|
+
icon: ge,
|
|
1067
1068
|
size: 20
|
|
1068
1069
|
})
|
|
1069
1070
|
}),
|
|
1070
|
-
/* @__PURE__ */
|
|
1071
|
-
style:
|
|
1072
|
-
children: [/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ v("div", {
|
|
1072
|
+
style: tt,
|
|
1073
|
+
children: [/* @__PURE__ */ v(h, {
|
|
1073
1074
|
component: "span",
|
|
1074
1075
|
ellipsis: !0,
|
|
1075
1076
|
variant: "label-primary",
|
|
1076
|
-
children: [e.label, e.required ? /* @__PURE__ */
|
|
1077
|
+
children: [e.label, e.required ? /* @__PURE__ */ _("sup", {
|
|
1077
1078
|
"aria-label": "必填",
|
|
1078
|
-
style:
|
|
1079
|
+
style: Dt,
|
|
1079
1080
|
children: "*"
|
|
1080
1081
|
}) : null]
|
|
1081
|
-
}), /* @__PURE__ */
|
|
1082
|
+
}), /* @__PURE__ */ v(h, {
|
|
1082
1083
|
color: "text-neutral",
|
|
1083
1084
|
component: "span",
|
|
1084
1085
|
ellipsis: !0,
|
|
1085
1086
|
variant: "caption",
|
|
1086
1087
|
children: [
|
|
1087
|
-
|
|
1088
|
+
Nt(e.type),
|
|
1088
1089
|
" ·",
|
|
1089
1090
|
e.required ? " 必填" : " 選填",
|
|
1090
1091
|
" ·",
|
|
@@ -1092,31 +1093,31 @@ function F({ formId: ue }) {
|
|
|
1092
1093
|
]
|
|
1093
1094
|
})]
|
|
1094
1095
|
}),
|
|
1095
|
-
/* @__PURE__ */
|
|
1096
|
-
style:
|
|
1096
|
+
/* @__PURE__ */ v("div", {
|
|
1097
|
+
style: nt,
|
|
1097
1098
|
children: [
|
|
1098
|
-
/* @__PURE__ */
|
|
1099
|
-
style:
|
|
1100
|
-
children: /* @__PURE__ */
|
|
1099
|
+
/* @__PURE__ */ _("div", {
|
|
1100
|
+
style: rt,
|
|
1101
|
+
children: /* @__PURE__ */ _(de, {
|
|
1101
1102
|
checked: !!e.required,
|
|
1102
|
-
disabled:
|
|
1103
|
+
disabled: H || n,
|
|
1103
1104
|
label: "必填",
|
|
1104
|
-
onChange: (t) =>
|
|
1105
|
+
onChange: (t) => jn(e.fieldKey, t.target.checked)
|
|
1105
1106
|
})
|
|
1106
1107
|
}),
|
|
1107
|
-
/* @__PURE__ */
|
|
1108
|
+
/* @__PURE__ */ _(d, {
|
|
1108
1109
|
disabled: n,
|
|
1109
|
-
icon:
|
|
1110
|
+
icon: _e,
|
|
1110
1111
|
iconType: "icon-only",
|
|
1111
|
-
onClick: () =>
|
|
1112
|
-
variant: e.fieldKey ===
|
|
1112
|
+
onClick: () => B(e.fieldKey),
|
|
1113
|
+
variant: e.fieldKey === W?.fieldKey ? "base-primary" : "base-ghost",
|
|
1113
1114
|
children: "編輯欄位"
|
|
1114
1115
|
}),
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
disabled:
|
|
1117
|
-
icon:
|
|
1116
|
+
/* @__PURE__ */ _(d, {
|
|
1117
|
+
disabled: H || n,
|
|
1118
|
+
icon: be,
|
|
1118
1119
|
iconType: "icon-only",
|
|
1119
|
-
onClick: () =>
|
|
1120
|
+
onClick: () => Tn(e.fieldKey),
|
|
1120
1121
|
variant: "destructive-ghost",
|
|
1121
1122
|
children: "移除欄位"
|
|
1122
1123
|
})
|
|
@@ -1125,78 +1126,78 @@ function F({ formId: ue }) {
|
|
|
1125
1126
|
]
|
|
1126
1127
|
});
|
|
1127
1128
|
}
|
|
1128
|
-
function
|
|
1129
|
-
return /* @__PURE__ */
|
|
1129
|
+
function $n() {
|
|
1130
|
+
return /* @__PURE__ */ v("div", {
|
|
1130
1131
|
style: M,
|
|
1131
|
-
children: [/* @__PURE__ */
|
|
1132
|
+
children: [/* @__PURE__ */ _(h, {
|
|
1132
1133
|
component: "h2",
|
|
1133
1134
|
variant: "h3",
|
|
1134
1135
|
children: "填寫預覽"
|
|
1135
|
-
}), /* @__PURE__ */
|
|
1136
|
-
onChange:
|
|
1137
|
-
schema:
|
|
1136
|
+
}), /* @__PURE__ */ _(a, {
|
|
1137
|
+
onChange: An,
|
|
1138
|
+
schema: D,
|
|
1138
1139
|
uiSchema: k,
|
|
1139
|
-
value:
|
|
1140
|
+
value: Gt
|
|
1140
1141
|
})]
|
|
1141
1142
|
});
|
|
1142
1143
|
}
|
|
1143
|
-
function
|
|
1144
|
-
return /* @__PURE__ */
|
|
1144
|
+
function er() {
|
|
1145
|
+
return /* @__PURE__ */ v("div", {
|
|
1145
1146
|
style: M,
|
|
1146
|
-
children: [/* @__PURE__ */
|
|
1147
|
+
children: [/* @__PURE__ */ _(h, {
|
|
1147
1148
|
component: "h2",
|
|
1148
1149
|
variant: "h3",
|
|
1149
1150
|
children: "版本紀錄"
|
|
1150
|
-
}), /* @__PURE__ */
|
|
1151
|
-
columns:
|
|
1152
|
-
dataSource:
|
|
1153
|
-
loading:
|
|
1151
|
+
}), /* @__PURE__ */ _(le, {
|
|
1152
|
+
columns: ln,
|
|
1153
|
+
dataSource: cn,
|
|
1154
|
+
loading: rn
|
|
1154
1155
|
})]
|
|
1155
1156
|
});
|
|
1156
1157
|
}
|
|
1157
|
-
function
|
|
1158
|
-
return /* @__PURE__ */
|
|
1158
|
+
function tr() {
|
|
1159
|
+
return /* @__PURE__ */ v("div", {
|
|
1159
1160
|
style: M,
|
|
1160
|
-
children: [/* @__PURE__ */
|
|
1161
|
+
children: [/* @__PURE__ */ _(h, {
|
|
1161
1162
|
component: "h2",
|
|
1162
1163
|
variant: "h3",
|
|
1163
1164
|
children: "Schema"
|
|
1164
|
-
}), /* @__PURE__ */
|
|
1165
|
-
style:
|
|
1165
|
+
}), /* @__PURE__ */ v("div", {
|
|
1166
|
+
style: _t,
|
|
1166
1167
|
children: [
|
|
1167
|
-
|
|
1168
|
-
disabled:
|
|
1168
|
+
nr("Form Schema", "schemaJson", /* @__PURE__ */ _(Ke, {
|
|
1169
|
+
disabled: H,
|
|
1169
1170
|
height: "360px",
|
|
1170
1171
|
name: "schemaJson",
|
|
1171
|
-
onChange:
|
|
1172
|
+
onChange: Mn,
|
|
1172
1173
|
placeholder: "輸入 Form Schema JSON",
|
|
1173
|
-
value:
|
|
1174
|
+
value: Ge
|
|
1174
1175
|
})),
|
|
1175
|
-
|
|
1176
|
-
disabled:
|
|
1176
|
+
nr("UI Schema", "uiSchemaJson", /* @__PURE__ */ _(Ke, {
|
|
1177
|
+
disabled: H,
|
|
1177
1178
|
height: "240px",
|
|
1178
1179
|
name: "uiSchemaJson",
|
|
1179
|
-
onChange:
|
|
1180
|
+
onChange: Nn,
|
|
1180
1181
|
placeholder: "輸入 UI Schema JSON",
|
|
1181
|
-
value:
|
|
1182
|
+
value: Mt
|
|
1182
1183
|
})),
|
|
1183
|
-
|
|
1184
|
+
Xt ? /* @__PURE__ */ _(h, {
|
|
1184
1185
|
color: "text-error",
|
|
1185
|
-
style:
|
|
1186
|
+
style: bt,
|
|
1186
1187
|
variant: "body",
|
|
1187
|
-
children:
|
|
1188
|
+
children: Xt
|
|
1188
1189
|
}) : null
|
|
1189
1190
|
]
|
|
1190
1191
|
})]
|
|
1191
1192
|
});
|
|
1192
1193
|
}
|
|
1193
|
-
function
|
|
1194
|
-
return /* @__PURE__ */
|
|
1195
|
-
style:
|
|
1196
|
-
children: /* @__PURE__ */
|
|
1197
|
-
style:
|
|
1198
|
-
children: /* @__PURE__ */
|
|
1199
|
-
disabled:
|
|
1194
|
+
function nr(e, t, n) {
|
|
1195
|
+
return /* @__PURE__ */ _("div", {
|
|
1196
|
+
style: vt,
|
|
1197
|
+
children: /* @__PURE__ */ _("div", {
|
|
1198
|
+
style: yt,
|
|
1199
|
+
children: /* @__PURE__ */ _(i, {
|
|
1200
|
+
disabled: H,
|
|
1200
1201
|
label: e,
|
|
1201
1202
|
name: t,
|
|
1202
1203
|
children: n
|
|
@@ -1205,71 +1206,71 @@ function F({ formId: ue }) {
|
|
|
1205
1206
|
});
|
|
1206
1207
|
}
|
|
1207
1208
|
}
|
|
1208
|
-
function
|
|
1209
|
-
return
|
|
1209
|
+
function Nt(e) {
|
|
1210
|
+
return qe.find((t) => t.type === e)?.label ?? e;
|
|
1210
1211
|
}
|
|
1211
|
-
function
|
|
1212
|
+
function Pt(e) {
|
|
1212
1213
|
return !!(e.visibleWhen || e.requiredWhen || e.readonlyWhen);
|
|
1213
1214
|
}
|
|
1214
|
-
function
|
|
1215
|
+
function Ft(e) {
|
|
1215
1216
|
return {
|
|
1216
1217
|
id: e.fieldKey,
|
|
1217
1218
|
name: e.label
|
|
1218
1219
|
};
|
|
1219
1220
|
}
|
|
1220
|
-
function
|
|
1221
|
+
function It(e) {
|
|
1221
1222
|
return e.type === "text" || e.type === "textarea";
|
|
1222
1223
|
}
|
|
1223
|
-
function
|
|
1224
|
+
function Lt(e) {
|
|
1224
1225
|
return typeof e == "string" ? e : "";
|
|
1225
1226
|
}
|
|
1226
|
-
function
|
|
1227
|
+
function Rt(e) {
|
|
1227
1228
|
let t = e.split(/[\n,]/u).map((e) => e.trim()).filter(Boolean);
|
|
1228
1229
|
return t.length ? t : void 0;
|
|
1229
1230
|
}
|
|
1230
|
-
function
|
|
1231
|
+
function zt(e) {
|
|
1231
1232
|
return e?.join("\n") ?? "";
|
|
1232
1233
|
}
|
|
1233
|
-
function
|
|
1234
|
+
function F(e) {
|
|
1234
1235
|
return JSON.stringify(e, null, 2);
|
|
1235
1236
|
}
|
|
1236
|
-
function
|
|
1237
|
+
function Bt(e, t, n) {
|
|
1237
1238
|
return e.map((e, r) => r === t ? {
|
|
1238
1239
|
...e,
|
|
1239
1240
|
...n
|
|
1240
1241
|
} : e);
|
|
1241
1242
|
}
|
|
1242
|
-
function
|
|
1243
|
+
function Vt(e) {
|
|
1243
1244
|
let t = e.length + 1;
|
|
1244
1245
|
return {
|
|
1245
1246
|
label: `選項 ${t}`,
|
|
1246
|
-
value:
|
|
1247
|
+
value: I(e, t)
|
|
1247
1248
|
};
|
|
1248
1249
|
}
|
|
1249
|
-
function
|
|
1250
|
+
function I(e, t) {
|
|
1250
1251
|
let n = `option_${t}`;
|
|
1251
|
-
return e.some((e) => e.value === n) ?
|
|
1252
|
+
return e.some((e) => e.value === n) ? I(e, t + 1) : n;
|
|
1252
1253
|
}
|
|
1253
|
-
function
|
|
1254
|
+
function Ht(e, t) {
|
|
1254
1255
|
return {
|
|
1255
|
-
schemaJson:
|
|
1256
|
-
uiSchemaJson:
|
|
1256
|
+
schemaJson: F(e),
|
|
1257
|
+
uiSchemaJson: F(t)
|
|
1257
1258
|
};
|
|
1258
1259
|
}
|
|
1259
|
-
function
|
|
1260
|
+
function Ut(e, t) {
|
|
1260
1261
|
return (t ? e.find((e) => e.id === t) : null) ?? e.find((e) => e.status === "PUBLISHED") ?? null;
|
|
1261
1262
|
}
|
|
1262
|
-
function
|
|
1263
|
-
return `${e ? "有未儲存修改" : "沒有未儲存修改"} · ${
|
|
1263
|
+
function Wt({ hasUnsavedChanges: e, latestPublishedVersion: n, openedContentPublished: r, openedVersion: i }) {
|
|
1264
|
+
return `${e ? "有未儲存修改" : "沒有未儲存修改"} · ${Gt({
|
|
1264
1265
|
hasUnsavedChanges: e,
|
|
1265
1266
|
openedContentPublished: r,
|
|
1266
1267
|
openedVersion: i
|
|
1267
1268
|
})} · ${n ? `目前發布 v${n.version}:${t(n.publishedAt)}` : "目前沒有已發布版本"}`;
|
|
1268
1269
|
}
|
|
1269
|
-
function
|
|
1270
|
+
function Gt({ hasUnsavedChanges: e, openedContentPublished: t, openedVersion: n }) {
|
|
1270
1271
|
return e ? n ? `修改尚未發布,來源 v${n.version}` : "修改尚未發布" : t && n ? `當前內容已發布 v${n.version}` : n ? `當前內容尚未發布 v${n.version}` : "當前內容尚未發布";
|
|
1271
1272
|
}
|
|
1272
|
-
function
|
|
1273
|
+
function Kt(e, t, n) {
|
|
1273
1274
|
let r = e[t];
|
|
1274
1275
|
if (!r || t === n) return [...e];
|
|
1275
1276
|
let i = e.filter((e, n) => n !== t);
|
|
@@ -1279,25 +1280,25 @@ function Wt(e, t, n) {
|
|
|
1279
1280
|
...i.slice(n)
|
|
1280
1281
|
];
|
|
1281
1282
|
}
|
|
1282
|
-
function
|
|
1283
|
-
return e === "PUBLISHED" ? /* @__PURE__ */
|
|
1283
|
+
function qt({ status: e }) {
|
|
1284
|
+
return e === "PUBLISHED" ? /* @__PURE__ */ _(u, {
|
|
1284
1285
|
size: "sub",
|
|
1285
1286
|
text: "已發布",
|
|
1286
1287
|
variant: "dot-success"
|
|
1287
|
-
}) : e === "ARCHIVED" ? /* @__PURE__ */
|
|
1288
|
+
}) : e === "ARCHIVED" ? /* @__PURE__ */ _(u, {
|
|
1288
1289
|
size: "sub",
|
|
1289
1290
|
text: "已封存",
|
|
1290
1291
|
variant: "dot-inactive"
|
|
1291
|
-
}) : /* @__PURE__ */
|
|
1292
|
+
}) : /* @__PURE__ */ _(u, {
|
|
1292
1293
|
size: "sub",
|
|
1293
1294
|
text: "草稿",
|
|
1294
1295
|
variant: "dot-warning"
|
|
1295
1296
|
});
|
|
1296
1297
|
}
|
|
1297
|
-
function
|
|
1298
|
+
function Jt(e) {
|
|
1298
1299
|
return e instanceof Error ? e.message : "發生未知錯誤";
|
|
1299
1300
|
}
|
|
1300
1301
|
//#endregion
|
|
1301
|
-
export {
|
|
1302
|
+
export { Mt as t };
|
|
1302
1303
|
|
|
1303
|
-
//# sourceMappingURL=builder-
|
|
1304
|
+
//# sourceMappingURL=builder-D950gct_.js.map
|