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