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