@rytass/bpm-core-react 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/dist/chunks/{FormBuilderView-BVKY1j_0.js → FormBuilderView-Djlm3y4S.js} +485 -481
- package/dist/chunks/FormBuilderView-Djlm3y4S.js.map +1 -0
- package/dist/chunks/FormBuilderView-G6uRSywl.cjs +3 -0
- package/dist/chunks/FormBuilderView-G6uRSywl.cjs.map +1 -0
- package/dist/chunks/{FormRendererView-BsTwZkqU.js → FormRendererView-DHfVgbo6.js} +511 -274
- package/dist/chunks/FormRendererView-DHfVgbo6.js.map +1 -0
- package/dist/chunks/FormRendererView-DwfFbaip.cjs +6 -0
- package/dist/chunks/FormRendererView-DwfFbaip.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/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-B1GlrZW9.js → compose-D6zBIc2Z.js} +131 -148
- package/dist/chunks/compose-D6zBIc2Z.js.map +1 -0
- package/dist/chunks/compose-NH6dsFXD.cjs +2 -0
- package/dist/chunks/compose-NH6dsFXD.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-Be9UI9Tg.cjs +65 -0
- package/dist/chunks/designer-Be9UI9Tg.cjs.map +1 -0
- package/dist/chunks/{designer-BCLrjb4H.js → designer-uhC_7m2i.js} +1791 -1407
- package/dist/chunks/designer-uhC_7m2i.js.map +1 -0
- package/dist/chunks/detail-6uw5dmTi.cjs +5 -0
- package/dist/chunks/detail-6uw5dmTi.cjs.map +1 -0
- package/dist/chunks/{detail-4F39ggBn.js → detail-_GeKqNC-.js} +1012 -972
- package/dist/chunks/detail-_GeKqNC-.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/{approver-filled-form-Dm3Iw7iw.cjs → instance-error-message-DTARGbGo.cjs} +2 -2
- package/dist/chunks/instance-error-message-DTARGbGo.cjs.map +1 -0
- package/dist/chunks/{approver-filled-form-ZEwpmsHJ.js → instance-error-message-q6gy5evy.js} +50 -38
- package/dist/chunks/instance-error-message-q6gy5evy.js.map +1 -0
- 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/FormRendererView.d.cts +24 -1
- package/dist/views/forms/renderer/FormRendererView.d.ts +24 -1
- package/dist/views/forms/renderer/file-upload-field.d.cts +84 -0
- package/dist/views/forms/renderer/file-upload-field.d.ts +84 -0
- package/dist/views/forms/renderer/form-value-readers.d.cts +7 -0
- package/dist/views/forms/renderer/form-value-readers.d.ts +7 -0
- package/dist/views/forms/renderer/index.cjs +1 -1
- package/dist/views/forms/renderer/index.d.cts +1 -0
- package/dist/views/forms/renderer/index.d.ts +1 -0
- package/dist/views/forms/renderer/index.js +1 -1
- package/dist/views/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/InstanceFormSection.d.cts +19 -2
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +19 -2
- 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 +3 -4
- package/dist/views/instances/detail/sections/shared.d.ts +3 -4
- package/dist/views/instances/instance-error-message.d.cts +5 -0
- package/dist/views/instances/instance-error-message.d.ts +5 -0
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.cjs.map +1 -1
- package/dist/views/instances/new/index.js +78 -77
- package/dist/views/instances/new/index.js.map +1 -1
- package/dist/views/login/index.cjs +1 -1
- package/dist/views/login/index.js +1 -1
- package/dist/views/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-BVKY1j_0.js.map +0 -1
- package/dist/chunks/FormBuilderView-SrGltzFT.cjs +0 -3
- package/dist/chunks/FormBuilderView-SrGltzFT.cjs.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-Dm3Iw7iw.cjs.map +0 -1
- package/dist/chunks/approver-filled-form-ZEwpmsHJ.js.map +0 -1
- package/dist/chunks/compose-B1GlrZW9.js.map +0 -1
- package/dist/chunks/compose-DZk-SfHT.cjs +0 -2
- package/dist/chunks/compose-DZk-SfHT.cjs.map +0 -1
- package/dist/chunks/designer-BCLrjb4H.js.map +0 -1
- package/dist/chunks/designer-BYYxEN9L.cjs +0 -65
- package/dist/chunks/designer-BYYxEN9L.cjs.map +0 -1
- package/dist/chunks/detail-4F39ggBn.js.map +0 -1
- package/dist/chunks/detail-BkMtA_0K.cjs +0 -2
- package/dist/chunks/detail-BkMtA_0K.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,18 +1,18 @@
|
|
|
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-DHfVgbo6.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
|
|
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
14
|
import { EditorView as N } from "@codemirror/view";
|
|
15
|
-
|
|
15
|
+
// src/views/forms/builder/json-code-editor.tsx
|
|
16
16
|
var P = {
|
|
17
17
|
alignItems: "center",
|
|
18
18
|
border: "1px solid var(--mzn-color-border-neutral)",
|
|
@@ -23,7 +23,7 @@ var P = {
|
|
|
23
23
|
padding: 12,
|
|
24
24
|
width: "100%"
|
|
25
25
|
}, F = [
|
|
26
|
-
|
|
26
|
+
ot(),
|
|
27
27
|
N.lineWrapping,
|
|
28
28
|
N.theme({
|
|
29
29
|
"&": {
|
|
@@ -41,15 +41,15 @@ var P = {
|
|
|
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
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,
|
|
@@ -74,9 +74,8 @@ function at({ disabled: e = !1, height: t, name: n, onChange: r, placeholder: i,
|
|
|
74
74
|
width: "100%"
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var ot = [
|
|
77
|
+
// src/views/forms/builder/FormBuilderView.tsx
|
|
78
|
+
var lt = [
|
|
80
79
|
{
|
|
81
80
|
description: "單行文字、姓名、編號",
|
|
82
81
|
icon: le,
|
|
@@ -121,13 +120,13 @@ var ot = [
|
|
|
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 ot = [
|
|
|
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 ot = [
|
|
|
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 an = {
|
|
|
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 an = {
|
|
|
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
|
-
Xe((e) =>
|
|
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
|
-
M !== "advanced" && (w(
|
|
420
|
+
M !== "advanced" && (w(B(b)), O(B(S)));
|
|
416
421
|
}, [
|
|
417
422
|
M,
|
|
418
423
|
b,
|
|
419
424
|
S
|
|
420
425
|
]);
|
|
421
|
-
let
|
|
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 gn({ 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" && M !== "advanced" && (w(
|
|
448
|
+
t === "advanced" && M !== "advanced" && (w(B(b)), O(B(S))), ot(t);
|
|
444
449
|
}
|
|
445
|
-
function
|
|
446
|
-
let t = b.fields.flatMap((t) =>
|
|
447
|
-
t.length > 0 ?
|
|
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] : []);
|
|
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,78 +463,78 @@ function gn({ 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
|
-
function
|
|
474
|
-
|
|
478
|
+
function q(e) {
|
|
479
|
+
J((t) => ({
|
|
475
480
|
...t,
|
|
476
481
|
...e
|
|
477
482
|
}));
|
|
478
483
|
}
|
|
479
|
-
function
|
|
480
|
-
if (!
|
|
481
|
-
let t =
|
|
484
|
+
function J(e) {
|
|
485
|
+
if (!K) return;
|
|
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
|
|
494
|
-
|
|
498
|
+
function $n(e) {
|
|
499
|
+
J(() => e);
|
|
495
500
|
}
|
|
496
|
-
function
|
|
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
|
-
function
|
|
507
|
+
function X(e, t, n) {
|
|
503
508
|
let r = e.columns[t]?.fieldKey;
|
|
504
|
-
|
|
509
|
+
Y(e.fieldKey, (e) => {
|
|
505
510
|
let i = {
|
|
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 =
|
|
514
|
-
|
|
517
|
+
function er(e) {
|
|
518
|
+
let t = be(e.columns, "text");
|
|
519
|
+
Y(e.fieldKey, (e) => ({
|
|
515
520
|
...e,
|
|
516
521
|
columns: [...e.columns, t]
|
|
517
|
-
})),
|
|
522
|
+
})), G(e.columns.length);
|
|
518
523
|
}
|
|
519
|
-
function
|
|
520
|
-
|
|
524
|
+
function tr(e, t) {
|
|
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
|
|
526
|
-
|
|
530
|
+
function nr(e, t, n) {
|
|
531
|
+
Y(e.fieldKey, (e) => ({
|
|
527
532
|
...e,
|
|
528
|
-
columns:
|
|
529
|
-
})),
|
|
533
|
+
columns: Wn(e.columns, t, n)
|
|
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,17 +542,17 @@ function gn({ onChange: le, value: y }) {
|
|
|
537
542
|
mode: t
|
|
538
543
|
}, "選擇模式變更可能轉換或捨棄既有預設值。");
|
|
539
544
|
}
|
|
540
|
-
function
|
|
541
|
-
JSON.stringify(e) !== JSON.stringify(t) &&
|
|
545
|
+
function ir(e, t, n = "此變更會替換目前選項來源;既有 options、dynamic reference 或 bindings 可能失效。") {
|
|
546
|
+
JSON.stringify(e) !== JSON.stringify(t) && W({
|
|
542
547
|
fieldKey: e.fieldKey,
|
|
543
548
|
impact: n,
|
|
544
549
|
kind: "replace-field",
|
|
545
550
|
nextField: t
|
|
546
551
|
});
|
|
547
552
|
}
|
|
548
|
-
function
|
|
553
|
+
function ar(e, t, n) {
|
|
549
554
|
if (!t) return;
|
|
550
|
-
if (t ===
|
|
555
|
+
if (t === un) {
|
|
551
556
|
if (!k(e)) return;
|
|
552
557
|
let { dataSource: t, defaultValue: r, ...i } = e;
|
|
553
558
|
n({
|
|
@@ -556,7 +561,7 @@ function gn({ 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
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));
|
|
@@ -580,84 +585,84 @@ function gn({ onChange: le, value: y }) {
|
|
|
580
585
|
}
|
|
581
586
|
});
|
|
582
587
|
}
|
|
583
|
-
function
|
|
584
|
-
|
|
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
|
-
|
|
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
|
|
632
|
+
function pr(e) {
|
|
628
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
|
|
652
|
+
function gr(e) {
|
|
648
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
664
|
activeKey: M,
|
|
660
|
-
onChange:
|
|
665
|
+
onChange: Yn,
|
|
661
666
|
size: "sub",
|
|
662
667
|
children: [
|
|
663
668
|
/* @__PURE__ */ _(ie, { children: "設計" }, "design"),
|
|
@@ -665,95 +670,95 @@ function gn({ onChange: le, value: y }) {
|
|
|
665
670
|
/* @__PURE__ */ _(ie, { children: "進階" }, "advanced")
|
|
666
671
|
]
|
|
667
672
|
}),
|
|
668
|
-
M === "design" ?
|
|
669
|
-
M === "preview" ?
|
|
670
|
-
M === "advanced" ?
|
|
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: "返回",
|
|
674
679
|
confirmText: "確認變更",
|
|
675
680
|
modalType: "standard",
|
|
676
|
-
onCancel: () =>
|
|
677
|
-
onClose: () =>
|
|
678
|
-
onConfirm:
|
|
681
|
+
onCancel: () => W(null),
|
|
682
|
+
onClose: () => W(null),
|
|
683
|
+
onConfirm: or,
|
|
679
684
|
open: !0,
|
|
680
685
|
showModalFooter: !0,
|
|
681
686
|
showModalHeader: !0,
|
|
682
|
-
title:
|
|
683
|
-
children:
|
|
684
|
-
style:
|
|
687
|
+
title: Dn(U),
|
|
688
|
+
children: U.kind === "remove-field" ? /* @__PURE__ */ v("div", {
|
|
689
|
+
style: Kt,
|
|
685
690
|
children: [/* @__PURE__ */ _(h, {
|
|
686
691
|
variant: "body",
|
|
687
692
|
children: "此欄位仍被下列 DataSource binding 使用;移除後請重新設定這些欄位。"
|
|
688
693
|
}), /* @__PURE__ */ _(h, {
|
|
689
694
|
color: "text-warning",
|
|
690
695
|
variant: "body",
|
|
691
|
-
children:
|
|
696
|
+
children: U.affectedFieldKeys.join("、")
|
|
692
697
|
})]
|
|
693
|
-
}) :
|
|
698
|
+
}) : U.kind === "remove-column" ? /* @__PURE__ */ v(h, {
|
|
694
699
|
variant: "body",
|
|
695
700
|
children: [
|
|
696
701
|
"移除欄「",
|
|
697
|
-
|
|
702
|
+
U.columnKey,
|
|
698
703
|
"」後,既有案件仍保留原本的表單版本,但新版本的這一欄資料將不再被填寫。"
|
|
699
704
|
]
|
|
700
705
|
}) : /* @__PURE__ */ _(h, {
|
|
701
706
|
variant: "body",
|
|
702
|
-
children:
|
|
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 gn({ 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 gn({ 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
|
-
}),
|
|
793
|
+
}), K ? vr(K) : /* @__PURE__ */ _(h, {
|
|
789
794
|
color: "text-neutral",
|
|
790
795
|
variant: "body",
|
|
791
796
|
children: "請先新增或選取欄位。"
|
|
@@ -794,118 +799,118 @@ function gn({ 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
|
}),
|
|
819
824
|
$("標題", "fieldLabel", /* @__PURE__ */ _(f, {
|
|
820
|
-
onChange: (e) =>
|
|
825
|
+
onChange: (e) => q({ label: e.target.value }),
|
|
821
826
|
placeholder: "例如:申請金額",
|
|
822
827
|
value: e.label,
|
|
823
828
|
variant: "base"
|
|
824
829
|
})),
|
|
825
830
|
$("欄位 Key", "fieldKey", /* @__PURE__ */ _(f, {
|
|
826
|
-
onChange: (e) =>
|
|
831
|
+
onChange: (e) => q({ fieldKey: e.target.value }),
|
|
827
832
|
placeholder: "例如:amount",
|
|
828
833
|
value: e.fieldKey,
|
|
829
834
|
variant: "base"
|
|
830
835
|
})),
|
|
831
|
-
|
|
832
|
-
onChange: (e) =>
|
|
836
|
+
j(e) ? null : $("提示文字", "fieldPlaceholder", /* @__PURE__ */ _(f, {
|
|
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) =>
|
|
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,
|
|
847
|
-
onChange: (e) =>
|
|
852
|
+
onChange: (e) => J((t) => e.target.checked ? {
|
|
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
|
-
$("最少列數", "fieldMinRows", Q(e.minRows, (t) =>
|
|
898
|
+
$("最少列數", "fieldMinRows", Q(e.minRows, (t) => Y(e.fieldKey, (e) => ({
|
|
894
899
|
...e,
|
|
895
900
|
minRows: t
|
|
896
901
|
})), "例如:1", {
|
|
897
902
|
max: t.maxRows,
|
|
898
903
|
min: 0
|
|
899
904
|
})),
|
|
900
|
-
$("最多列數", "fieldMaxRows", Q(e.maxRows, (t) =>
|
|
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, {
|
|
908
|
-
onChange: (t) =>
|
|
913
|
+
onChange: (t) => Y(e.fieldKey, (e) => ({
|
|
909
914
|
...e,
|
|
910
915
|
addRowLabel: t.target.value || void 0
|
|
911
916
|
})),
|
|
@@ -915,11 +920,11 @@ function gn({ 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 gn({ 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,
|
|
@@ -952,8 +957,8 @@ function gn({ onChange: le, value: y }) {
|
|
|
952
957
|
key: "label",
|
|
953
958
|
render: (t) => /* @__PURE__ */ _(f, {
|
|
954
959
|
fullWidth: !0,
|
|
955
|
-
onChange: (n) =>
|
|
956
|
-
...
|
|
960
|
+
onChange: (n) => X(e, t.index, {
|
|
961
|
+
...Or(e, t.index),
|
|
957
962
|
label: n.target.value
|
|
958
963
|
}),
|
|
959
964
|
placeholder: "例如:數量",
|
|
@@ -968,21 +973,21 @@ function gn({ 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
|
-
onChange: (n) =>
|
|
985
|
-
...
|
|
989
|
+
onChange: (n) => X(e, t.index, {
|
|
990
|
+
...Or(e, t.index),
|
|
986
991
|
required: n.target.checked
|
|
987
992
|
}),
|
|
988
993
|
size: "sub"
|
|
@@ -995,7 +1000,7 @@ function gn({ onChange: le, value: y }) {
|
|
|
995
1000
|
icon: he,
|
|
996
1001
|
iconType: "leading",
|
|
997
1002
|
name: "移除此欄",
|
|
998
|
-
onClick: () =>
|
|
1003
|
+
onClick: () => W({
|
|
999
1004
|
columnIndex: t.index,
|
|
1000
1005
|
columnKey: t.fieldKey,
|
|
1001
1006
|
fieldKey: e.fieldKey,
|
|
@@ -1004,19 +1009,19 @@ function gn({ 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) =>
|
|
1019
|
-
onExpand: (e, t) =>
|
|
1023
|
+
expandedRowRender: (t) => Tr(e, t.index),
|
|
1024
|
+
onExpand: (e, t) => G(e ? t.index : null)
|
|
1020
1025
|
},
|
|
1021
1026
|
fullWidth: !0,
|
|
1022
1027
|
rowHeightPreset: "roomy",
|
|
@@ -1024,13 +1029,13 @@ function gn({ 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
|
-
onChange: (r) =>
|
|
1038
|
+
onChange: (r) => X(e, t, {
|
|
1034
1039
|
...n,
|
|
1035
1040
|
fieldKey: r.target.value
|
|
1036
1041
|
}),
|
|
@@ -1039,7 +1044,7 @@ function gn({ onChange: le, value: y }) {
|
|
|
1039
1044
|
variant: "base"
|
|
1040
1045
|
})),
|
|
1041
1046
|
$("提示文字", "columnPlaceholder", /* @__PURE__ */ _(f, {
|
|
1042
|
-
onChange: (r) =>
|
|
1047
|
+
onChange: (r) => X(e, t, {
|
|
1043
1048
|
...n,
|
|
1044
1049
|
placeholder: r.target.value || void 0
|
|
1045
1050
|
}),
|
|
@@ -1047,38 +1052,38 @@ function gn({ 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 =
|
|
1062
|
-
o.length === 0 ? (
|
|
1066
|
+
let a = Pn(r, i), o = On(r);
|
|
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 gn({ 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({
|
|
@@ -1105,20 +1110,20 @@ function gn({ onChange: le, value: y }) {
|
|
|
1105
1110
|
maxLength: n
|
|
1106
1111
|
}), "例如:100", { min: 1 })),
|
|
1107
1112
|
$("格式(正規表示式)", "fieldPattern", /* @__PURE__ */ _(f, {
|
|
1108
|
-
onChange: (n) => t(
|
|
1113
|
+
onChange: (n) => t(An(e, n.target.value)),
|
|
1109
1114
|
placeholder: "例如:[0-9]{8}",
|
|
1110
1115
|
value: e.pattern ?? "",
|
|
1111
1116
|
variant: "base"
|
|
1112
|
-
}), !1,
|
|
1117
|
+
}), !1, Mn(e.pattern)),
|
|
1113
1118
|
e.pattern ? $("格式錯誤訊息", "fieldPatternErrorMessage", /* @__PURE__ */ _(f, {
|
|
1114
|
-
onChange: (n) => t(
|
|
1119
|
+
onChange: (n) => t(jn(e, n.target.value)),
|
|
1115
1120
|
placeholder: "例如:統一編號為 8 位數字。",
|
|
1116
1121
|
value: e.patternErrorMessage ?? "",
|
|
1117
1122
|
variant: "base"
|
|
1118
|
-
}), !1,
|
|
1123
|
+
}), !1, Nn(e.patternErrorMessage)) : null
|
|
1119
1124
|
] });
|
|
1120
1125
|
}
|
|
1121
|
-
function
|
|
1126
|
+
function Ar(e, t) {
|
|
1122
1127
|
return /* @__PURE__ */ v(g, { children: [
|
|
1123
1128
|
$("預設值", "fieldDefaultValue", Q(typeof e.defaultValue == "number" ? e.defaultValue : void 0, (n) => t({
|
|
1124
1129
|
...e,
|
|
@@ -1137,32 +1142,32 @@ function gn({ onChange: le, value: y }) {
|
|
|
1137
1142
|
}), "例如:999999"))
|
|
1138
1143
|
] });
|
|
1139
1144
|
}
|
|
1140
|
-
function
|
|
1141
|
-
return $("預設值", "fieldDefaultValue",
|
|
1145
|
+
function jr(e, t) {
|
|
1146
|
+
return $("預設值", "fieldDefaultValue", $r(e, zn(e.defaultValue), (n) => t({
|
|
1142
1147
|
...e,
|
|
1143
1148
|
defaultValue: n
|
|
1144
1149
|
})));
|
|
1145
1150
|
}
|
|
1146
|
-
function
|
|
1147
|
-
let i =
|
|
1151
|
+
function Mr(e, t, n, r) {
|
|
1152
|
+
let i = Me(e.type, F), a = {
|
|
1148
1153
|
commit: (e) => t(e),
|
|
1149
1154
|
rowColumns: r
|
|
1150
|
-
}, o = k(e) ?
|
|
1151
|
-
...
|
|
1152
|
-
...i.map(
|
|
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),
|
|
1153
1158
|
...k(e) && !c ? [{
|
|
1154
1159
|
id: o,
|
|
1155
1160
|
name: `${e.dataSource.key} v${e.dataSource.version}(目前不可用或不支援)`
|
|
1156
1161
|
}] : []
|
|
1157
|
-
], u =
|
|
1162
|
+
], u = nt(e);
|
|
1158
1163
|
return /* @__PURE__ */ v(g, { children: [
|
|
1159
1164
|
e.type === "select" || e.type === "autocomplete" ? $("選擇模式", "fieldSelectionMode", /* @__PURE__ */ _(p, {
|
|
1160
1165
|
clearable: !1,
|
|
1161
1166
|
onChange: (t) => {
|
|
1162
|
-
(t?.id === "single" || t?.id === "multiple") &&
|
|
1167
|
+
(t?.id === "single" || t?.id === "multiple") && rr(e, t.id, n);
|
|
1163
1168
|
},
|
|
1164
|
-
options: [...
|
|
1165
|
-
value: D(
|
|
1169
|
+
options: [...hn],
|
|
1170
|
+
value: D(hn, u)
|
|
1166
1171
|
})) : $("選擇模式", "fieldSelectionMode", /* @__PURE__ */ _(h, {
|
|
1167
1172
|
color: "text-neutral",
|
|
1168
1173
|
variant: "body",
|
|
@@ -1170,29 +1175,29 @@ function gn({ onChange: le, value: y }) {
|
|
|
1170
1175
|
})),
|
|
1171
1176
|
$("選項來源", "fieldOptionSource", /* @__PURE__ */ _(p, {
|
|
1172
1177
|
clearable: !1,
|
|
1173
|
-
disabled:
|
|
1174
|
-
onChange: (n) =>
|
|
1178
|
+
disabled: z === "loading" && !k(e),
|
|
1179
|
+
onChange: (n) => ar(e, n?.id, t),
|
|
1175
1180
|
options: l,
|
|
1176
1181
|
placeholder: "選擇選項來源",
|
|
1177
1182
|
value: D(l, o)
|
|
1178
1183
|
})),
|
|
1179
|
-
k(e) ?
|
|
1184
|
+
k(e) ? Nr(e, i, a) : Gr(e, t)
|
|
1180
1185
|
] });
|
|
1181
1186
|
}
|
|
1182
|
-
function
|
|
1183
|
-
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);
|
|
1184
1189
|
return /* @__PURE__ */ v("div", {
|
|
1185
|
-
style:
|
|
1190
|
+
style: Yt,
|
|
1186
1191
|
children: [
|
|
1187
|
-
|
|
1192
|
+
z === "loading" ? /* @__PURE__ */ _(h, {
|
|
1188
1193
|
color: "text-neutral",
|
|
1189
1194
|
variant: "body",
|
|
1190
1195
|
children: "正在載入可用的選項來源…"
|
|
1191
1196
|
}) : null,
|
|
1192
|
-
|
|
1197
|
+
R ? /* @__PURE__ */ _(h, {
|
|
1193
1198
|
color: "text-error",
|
|
1194
1199
|
variant: "body",
|
|
1195
|
-
children:
|
|
1200
|
+
children: R
|
|
1196
1201
|
}) : null,
|
|
1197
1202
|
r ? null : /* @__PURE__ */ _(h, {
|
|
1198
1203
|
color: "text-warning",
|
|
@@ -1204,28 +1209,28 @@ function gn({ onChange: le, value: y }) {
|
|
|
1204
1209
|
variant: "body",
|
|
1205
1210
|
children: "這個來源不支援目前的控制項,請改選其他來源。"
|
|
1206
1211
|
}) : null,
|
|
1207
|
-
r ?
|
|
1208
|
-
r && r.parameters.length > 0 ?
|
|
1209
|
-
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, {
|
|
1210
1215
|
color: "text-warning",
|
|
1211
1216
|
variant: "body",
|
|
1212
1217
|
children: "沒有支援目前控制項的已註冊來源。"
|
|
1213
1218
|
}) : null,
|
|
1214
1219
|
/* @__PURE__ */ _("div", {
|
|
1215
|
-
style:
|
|
1220
|
+
style: Qt,
|
|
1216
1221
|
children: /* @__PURE__ */ _(c, {
|
|
1217
|
-
disabled:
|
|
1218
|
-
loading:
|
|
1219
|
-
onClick: () => void
|
|
1222
|
+
disabled: Gn,
|
|
1223
|
+
loading: Gn,
|
|
1224
|
+
onClick: () => void cr(),
|
|
1220
1225
|
size: "sub",
|
|
1221
1226
|
type: "button",
|
|
1222
1227
|
variant: "base-secondary",
|
|
1223
1228
|
children: "檢查全部動態選項設定"
|
|
1224
1229
|
})
|
|
1225
1230
|
}),
|
|
1226
|
-
|
|
1227
|
-
style:
|
|
1228
|
-
children:
|
|
1231
|
+
V ? /* @__PURE__ */ _("div", {
|
|
1232
|
+
style: Xt,
|
|
1233
|
+
children: V.length > 0 ? V.map((e) => /* @__PURE__ */ _(h, {
|
|
1229
1234
|
color: "text-error",
|
|
1230
1235
|
variant: "caption",
|
|
1231
1236
|
children: e
|
|
@@ -1238,17 +1243,17 @@ function gn({ onChange: le, value: y }) {
|
|
|
1238
1243
|
]
|
|
1239
1244
|
});
|
|
1240
1245
|
}
|
|
1241
|
-
function
|
|
1246
|
+
function Pr(e) {
|
|
1242
1247
|
return /* @__PURE__ */ v("div", {
|
|
1243
|
-
style:
|
|
1248
|
+
style: en,
|
|
1244
1249
|
children: [
|
|
1245
1250
|
e.description ? /* @__PURE__ */ _(h, {
|
|
1246
1251
|
variant: "body",
|
|
1247
1252
|
children: e.description
|
|
1248
1253
|
}) : null,
|
|
1249
1254
|
/* @__PURE__ */ _("div", {
|
|
1250
|
-
style:
|
|
1251
|
-
children:
|
|
1255
|
+
style: $t,
|
|
1256
|
+
children: xn(e).map((e) => /* @__PURE__ */ _(oe, {
|
|
1252
1257
|
label: e,
|
|
1253
1258
|
readOnly: !0,
|
|
1254
1259
|
size: "minor"
|
|
@@ -1267,14 +1272,14 @@ function gn({ onChange: le, value: y }) {
|
|
|
1267
1272
|
]
|
|
1268
1273
|
});
|
|
1269
1274
|
}
|
|
1270
|
-
function
|
|
1275
|
+
function Fr(e, t, n) {
|
|
1271
1276
|
let r = t.parameters.map((e, t) => ({
|
|
1272
1277
|
key: e.key,
|
|
1273
1278
|
index: t,
|
|
1274
1279
|
parameter: e
|
|
1275
1280
|
}));
|
|
1276
1281
|
return /* @__PURE__ */ v("div", {
|
|
1277
|
-
style:
|
|
1282
|
+
style: Zt,
|
|
1278
1283
|
children: [/* @__PURE__ */ _(h, {
|
|
1279
1284
|
color: "text-neutral",
|
|
1280
1285
|
variant: "label-secondary",
|
|
@@ -1284,7 +1289,7 @@ function gn({ onChange: le, value: y }) {
|
|
|
1284
1289
|
{
|
|
1285
1290
|
key: "parameter",
|
|
1286
1291
|
render: (e) => /* @__PURE__ */ v("div", {
|
|
1287
|
-
style:
|
|
1292
|
+
style: an,
|
|
1288
1293
|
children: [/* @__PURE__ */ _(h, {
|
|
1289
1294
|
variant: "input",
|
|
1290
1295
|
children: e.parameter.label ?? e.parameter.key
|
|
@@ -1300,13 +1305,13 @@ function gn({ onChange: le, value: y }) {
|
|
|
1300
1305
|
{
|
|
1301
1306
|
key: "binding",
|
|
1302
1307
|
width: 268,
|
|
1303
|
-
render: (t) =>
|
|
1308
|
+
render: (t) => Lr(e, t.parameter, n),
|
|
1304
1309
|
title: "值從哪裡來"
|
|
1305
1310
|
},
|
|
1306
1311
|
{
|
|
1307
1312
|
key: "constant",
|
|
1308
1313
|
width: 140,
|
|
1309
|
-
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, {
|
|
1310
1315
|
color: "text-neutral",
|
|
1311
1316
|
variant: "caption",
|
|
1312
1317
|
children: "—"
|
|
@@ -1318,7 +1323,7 @@ function gn({ onChange: le, value: y }) {
|
|
|
1318
1323
|
render: (t) => /* @__PURE__ */ _(h, {
|
|
1319
1324
|
color: "text-neutral",
|
|
1320
1325
|
variant: "caption",
|
|
1321
|
-
children:
|
|
1326
|
+
children: zr(E(e, t.parameter.key), t.parameter, n, Ir(e, t.parameter, n))
|
|
1322
1327
|
}),
|
|
1323
1328
|
title: "填寫時的行為"
|
|
1324
1329
|
}
|
|
@@ -1330,28 +1335,28 @@ function gn({ onChange: le, value: y }) {
|
|
|
1330
1335
|
})]
|
|
1331
1336
|
});
|
|
1332
1337
|
}
|
|
1333
|
-
function
|
|
1334
|
-
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);
|
|
1335
1340
|
}
|
|
1336
|
-
function
|
|
1337
|
-
let r =
|
|
1338
|
-
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}`,
|
|
1339
1344
|
name: `同列:${e.name}`
|
|
1340
1345
|
})) : [], a = [
|
|
1341
1346
|
...t.required ? [] : [{
|
|
1342
|
-
id:
|
|
1347
|
+
id: pn,
|
|
1343
1348
|
name: "未綁定"
|
|
1344
1349
|
}],
|
|
1345
1350
|
...i,
|
|
1346
|
-
...
|
|
1351
|
+
...je(t.type, b.fields, e.fieldKey),
|
|
1347
1352
|
...t.type === "STRING_ARRAY" ? [] : [{
|
|
1348
|
-
id:
|
|
1353
|
+
id: dn,
|
|
1349
1354
|
name: "固定常數"
|
|
1350
1355
|
}]
|
|
1351
1356
|
];
|
|
1352
1357
|
return /* @__PURE__ */ _("div", {
|
|
1353
1358
|
"data-data-source-parameter": t.key,
|
|
1354
|
-
style:
|
|
1359
|
+
style: on,
|
|
1355
1360
|
children: /* @__PURE__ */ _(p, {
|
|
1356
1361
|
clearable: !1,
|
|
1357
1362
|
fullWidth: !0,
|
|
@@ -1359,7 +1364,7 @@ function gn({ onChange: le, value: y }) {
|
|
|
1359
1364
|
"aria-label": `${t.label ?? t.key} 的值來源`,
|
|
1360
1365
|
title: D(a, r)?.name ?? ""
|
|
1361
1366
|
},
|
|
1362
|
-
onChange: (r) =>
|
|
1367
|
+
onChange: (r) => Ur(e, t.key, t.type, r?.id, n),
|
|
1363
1368
|
options: a,
|
|
1364
1369
|
placeholder: "選擇欄位或常數",
|
|
1365
1370
|
size: "sub",
|
|
@@ -1367,14 +1372,14 @@ function gn({ onChange: le, value: y }) {
|
|
|
1367
1372
|
})
|
|
1368
1373
|
});
|
|
1369
1374
|
}
|
|
1370
|
-
function
|
|
1371
|
-
return
|
|
1375
|
+
function Rr(e) {
|
|
1376
|
+
return mt[e];
|
|
1372
1377
|
}
|
|
1373
|
-
function
|
|
1374
|
-
let i =
|
|
1375
|
-
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)}欄位,請改用固定值` : "未設定,不做這層篩選";
|
|
1376
1381
|
}
|
|
1377
|
-
function
|
|
1382
|
+
function Br(e, t) {
|
|
1378
1383
|
let n = e?.from;
|
|
1379
1384
|
if (n?.kind === "FIELD") {
|
|
1380
1385
|
let e = b.fields.find((e) => e.fieldKey === n.fieldKey);
|
|
@@ -1386,14 +1391,14 @@ function gn({ onChange: le, value: y }) {
|
|
|
1386
1391
|
}
|
|
1387
1392
|
return "";
|
|
1388
1393
|
}
|
|
1389
|
-
function
|
|
1394
|
+
function Vr(e, t, n, r, i) {
|
|
1390
1395
|
return /* @__PURE__ */ _("div", {
|
|
1391
1396
|
"data-data-source-constant": t,
|
|
1392
|
-
children:
|
|
1397
|
+
children: Hr(e, t, n, r, i)
|
|
1393
1398
|
});
|
|
1394
1399
|
}
|
|
1395
|
-
function
|
|
1396
|
-
let a =
|
|
1400
|
+
function Hr(e, t, n, r, i) {
|
|
1401
|
+
let a = Be(e, t);
|
|
1397
1402
|
if (n === "BOOLEAN") {
|
|
1398
1403
|
let n = [{
|
|
1399
1404
|
id: "true",
|
|
@@ -1405,7 +1410,7 @@ function gn({ onChange: le, value: y }) {
|
|
|
1405
1410
|
return /* @__PURE__ */ _(p, {
|
|
1406
1411
|
clearable: !1,
|
|
1407
1412
|
fullWidth: !0,
|
|
1408
|
-
onChange: (n) =>
|
|
1413
|
+
onChange: (n) => Wr(e, t, n?.id === "true", i),
|
|
1409
1414
|
options: n,
|
|
1410
1415
|
size: "sub",
|
|
1411
1416
|
value: D(n, a === !0 ? "true" : "false")
|
|
@@ -1416,17 +1421,17 @@ function gn({ onChange: le, value: y }) {
|
|
|
1416
1421
|
variant: "caption",
|
|
1417
1422
|
children: "這個條件要收多個值,請綁定一個複選欄位;不接受固定值。"
|
|
1418
1423
|
}) : /* @__PURE__ */ _(f, {
|
|
1419
|
-
onChange: (r) =>
|
|
1424
|
+
onChange: (r) => Wr(e, t, n === "NUMBER" ? Ae(r.target.value) ?? 0 : r.target.value, i),
|
|
1420
1425
|
placeholder: n === "NUMBER" ? "輸入數字" : "輸入固定值",
|
|
1421
|
-
value:
|
|
1426
|
+
value: Tn(r, n),
|
|
1422
1427
|
variant: "base"
|
|
1423
1428
|
});
|
|
1424
1429
|
}
|
|
1425
|
-
function
|
|
1426
|
-
i.commit(
|
|
1430
|
+
function Ur(e, t, n, r, i) {
|
|
1431
|
+
i.commit(qe(e, t, En(t, n, r)));
|
|
1427
1432
|
}
|
|
1428
|
-
function
|
|
1429
|
-
r.commit(
|
|
1433
|
+
function Wr(e, t, n, r) {
|
|
1434
|
+
r.commit(qe(e, t, {
|
|
1430
1435
|
from: {
|
|
1431
1436
|
kind: "CONSTANT",
|
|
1432
1437
|
value: n
|
|
@@ -1434,8 +1439,8 @@ function gn({ onChange: le, value: y }) {
|
|
|
1434
1439
|
parameter: t
|
|
1435
1440
|
}));
|
|
1436
1441
|
}
|
|
1437
|
-
function
|
|
1438
|
-
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));
|
|
1439
1444
|
return /* @__PURE__ */ v(g, { children: [$("預設值", "fieldDefaultValue", n === "multiple" ? /* @__PURE__ */ _(p, {
|
|
1440
1445
|
clearable: !0,
|
|
1441
1446
|
mode: "multiple",
|
|
@@ -1455,9 +1460,9 @@ function gn({ onChange: le, value: y }) {
|
|
|
1455
1460
|
options: i,
|
|
1456
1461
|
placeholder: "選擇預設選項",
|
|
1457
1462
|
value: typeof e.defaultValue == "string" ? D(i, e.defaultValue) : null
|
|
1458
|
-
})), $("選項", "fieldOptions",
|
|
1463
|
+
})), $("選項", "fieldOptions", ei(e, t), !0)] });
|
|
1459
1464
|
}
|
|
1460
|
-
function
|
|
1465
|
+
function Kr(e, t) {
|
|
1461
1466
|
let n = typeof e.defaultValue == "boolean" ? String(e.defaultValue) : "unset";
|
|
1462
1467
|
return $("預設值", "fieldDefaultValue", /* @__PURE__ */ _(p, {
|
|
1463
1468
|
clearable: !1,
|
|
@@ -1465,12 +1470,12 @@ function gn({ onChange: le, value: y }) {
|
|
|
1465
1470
|
...e,
|
|
1466
1471
|
defaultValue: n?.id === "true" || n?.id !== "false" && void 0
|
|
1467
1472
|
}),
|
|
1468
|
-
options: [...
|
|
1473
|
+
options: [...gn],
|
|
1469
1474
|
placeholder: "選擇預設狀態",
|
|
1470
|
-
value: D(
|
|
1475
|
+
value: D(gn, n)
|
|
1471
1476
|
}));
|
|
1472
1477
|
}
|
|
1473
|
-
function
|
|
1478
|
+
function qr(e, t) {
|
|
1474
1479
|
return $("可複選", "fieldMemberMultiple", /* @__PURE__ */ _(m, {
|
|
1475
1480
|
checked: e.multiple === !0,
|
|
1476
1481
|
label: e.multiple === !0 ? "可選多位" : "只能選一位",
|
|
@@ -1482,38 +1487,38 @@ function gn({ onChange: le, value: y }) {
|
|
|
1482
1487
|
size: "sub"
|
|
1483
1488
|
}));
|
|
1484
1489
|
}
|
|
1485
|
-
function
|
|
1490
|
+
function Jr(e, t) {
|
|
1486
1491
|
return /* @__PURE__ */ v(g, { children: [$("檔案數", "fieldMaxFiles", Q(e.maxFiles, (n) => t({
|
|
1487
1492
|
...e,
|
|
1488
1493
|
maxFiles: n
|
|
1489
|
-
}), "例如:1", { min: 1 })), $("MIME", "fieldAcceptedMimeTypes",
|
|
1494
|
+
}), "例如:1", { min: 1 })), $("MIME", "fieldAcceptedMimeTypes", Qr({
|
|
1490
1495
|
name: "fieldAcceptedMimeTypes",
|
|
1491
1496
|
onChange: (n) => t({
|
|
1492
1497
|
...e,
|
|
1493
|
-
acceptedMimeTypes:
|
|
1498
|
+
acceptedMimeTypes: Bn(n)
|
|
1494
1499
|
}),
|
|
1495
1500
|
placeholder: "每行一個 MIME type,例如:application/pdf",
|
|
1496
1501
|
rows: 3,
|
|
1497
|
-
value:
|
|
1502
|
+
value: Vn(e.acceptedMimeTypes)
|
|
1498
1503
|
}), !1)] });
|
|
1499
1504
|
}
|
|
1500
|
-
function
|
|
1501
|
-
let t = b.fields.filter((t) => t.fieldKey !== e.fieldKey && !$e(t));
|
|
1502
|
-
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, {
|
|
1503
1508
|
color: "text-neutral",
|
|
1504
|
-
style:
|
|
1509
|
+
style: Nt,
|
|
1505
1510
|
variant: "body",
|
|
1506
1511
|
children: "目前沒有其他欄位可作為條件來源。新增更多欄位後即可設定條件規則。"
|
|
1507
1512
|
});
|
|
1508
1513
|
}
|
|
1509
|
-
function
|
|
1510
|
-
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);
|
|
1511
1516
|
return $(t.label, t.name, /* @__PURE__ */ v("div", {
|
|
1512
|
-
style:
|
|
1517
|
+
style: Ht,
|
|
1513
1518
|
children: [/* @__PURE__ */ _(m, {
|
|
1514
1519
|
checked: d,
|
|
1515
1520
|
label: d ? "已啟用" : "不啟用",
|
|
1516
|
-
onChange: (e) =>
|
|
1521
|
+
onChange: (e) => Z(t.target, e.target.checked ? T(o, Le(o), Re(o)) : void 0),
|
|
1517
1522
|
size: "sub",
|
|
1518
1523
|
supportingText: t.supportingText
|
|
1519
1524
|
}), d ? f ? /* @__PURE__ */ _(h, {
|
|
@@ -1521,13 +1526,13 @@ function gn({ onChange: le, value: y }) {
|
|
|
1521
1526
|
variant: "body",
|
|
1522
1527
|
children: "這個規則不是目前 UI 支援的格式。重新選擇條件後會取代既有規則。"
|
|
1523
1528
|
}) : /* @__PURE__ */ v("div", {
|
|
1524
|
-
style:
|
|
1529
|
+
style: Ut,
|
|
1525
1530
|
children: [
|
|
1526
1531
|
/* @__PURE__ */ _(p, {
|
|
1527
1532
|
clearable: !1,
|
|
1528
1533
|
onChange: (e) => {
|
|
1529
1534
|
let r = n.find((t) => t.fieldKey === e?.id) ?? o;
|
|
1530
|
-
|
|
1535
|
+
Z(t.target, T(r, Le(r), Re(r)));
|
|
1531
1536
|
},
|
|
1532
1537
|
options: s,
|
|
1533
1538
|
placeholder: "選擇欄位",
|
|
@@ -1535,29 +1540,29 @@ function gn({ onChange: le, value: y }) {
|
|
|
1535
1540
|
}),
|
|
1536
1541
|
/* @__PURE__ */ _(p, {
|
|
1537
1542
|
clearable: !1,
|
|
1538
|
-
onChange: (e) =>
|
|
1543
|
+
onChange: (e) => Z(t.target, T(o, Pe(e?.id) ?? l, u)),
|
|
1539
1544
|
options: [...c],
|
|
1540
1545
|
placeholder: "判斷方式",
|
|
1541
1546
|
value: D(c, l)
|
|
1542
1547
|
}),
|
|
1543
|
-
|
|
1548
|
+
Zr(o, u, (e) => Z(t.target, T(o, l, e)))
|
|
1544
1549
|
]
|
|
1545
1550
|
}) : null]
|
|
1546
1551
|
}), !0);
|
|
1547
1552
|
}
|
|
1548
|
-
function
|
|
1549
|
-
|
|
1553
|
+
function Z(e, t) {
|
|
1554
|
+
q({ [e]: t });
|
|
1550
1555
|
}
|
|
1551
|
-
function
|
|
1556
|
+
function Zr(e, t, n) {
|
|
1552
1557
|
if (e.type === "boolean") return /* @__PURE__ */ _(p, {
|
|
1553
1558
|
clearable: !1,
|
|
1554
1559
|
onChange: (e) => n(e?.id ?? "true"),
|
|
1555
|
-
options: [...
|
|
1560
|
+
options: [..._n],
|
|
1556
1561
|
placeholder: "比較值",
|
|
1557
|
-
value: D(
|
|
1562
|
+
value: D(_n, t === "false" ? "false" : "true")
|
|
1558
1563
|
});
|
|
1559
|
-
if (
|
|
1560
|
-
let r = e.options.map(
|
|
1564
|
+
if (Ee(e)) {
|
|
1565
|
+
let r = e.options.map(ze);
|
|
1561
1566
|
return /* @__PURE__ */ _(p, {
|
|
1562
1567
|
clearable: !1,
|
|
1563
1568
|
onChange: (e) => n(e?.id ?? r[0]?.id ?? ""),
|
|
@@ -1566,22 +1571,22 @@ function gn({ onChange: le, value: y }) {
|
|
|
1566
1571
|
value: D(r, t)
|
|
1567
1572
|
});
|
|
1568
1573
|
}
|
|
1569
|
-
return
|
|
1574
|
+
return Te(e) ? Q(Ae(t), (e) => n(String(e ?? 0)), "比較值") : Ce(e) ? $r(e, t, (e) => n(e ?? "")) : /* @__PURE__ */ _(f, {
|
|
1570
1575
|
onChange: (e) => n(e.target.value),
|
|
1571
1576
|
placeholder: "比較值",
|
|
1572
1577
|
value: t,
|
|
1573
1578
|
variant: "base"
|
|
1574
1579
|
});
|
|
1575
1580
|
}
|
|
1576
|
-
function
|
|
1581
|
+
function Qr({ name: e, onChange: t, placeholder: n, rows: r, value: i }) {
|
|
1577
1582
|
return /* @__PURE__ */ _(se, {
|
|
1578
1583
|
"aria-label": e,
|
|
1579
1584
|
onChange: (e) => t(e.target.value),
|
|
1580
1585
|
placeholder: n,
|
|
1581
|
-
ref:
|
|
1586
|
+
ref: sn,
|
|
1582
1587
|
resize: "vertical",
|
|
1583
1588
|
rows: r,
|
|
1584
|
-
style:
|
|
1589
|
+
style: Lt,
|
|
1585
1590
|
value: i
|
|
1586
1591
|
});
|
|
1587
1592
|
}
|
|
@@ -1589,7 +1594,7 @@ function gn({ onChange: le, value: y }) {
|
|
|
1589
1594
|
return /* @__PURE__ */ _(f, {
|
|
1590
1595
|
max: r.max,
|
|
1591
1596
|
min: r.min,
|
|
1592
|
-
onChange: (e) => t(
|
|
1597
|
+
onChange: (e) => t(ve(Ae(e.target.value), r)),
|
|
1593
1598
|
placeholder: n,
|
|
1594
1599
|
showSpinner: !0,
|
|
1595
1600
|
step: r.step ?? 1,
|
|
@@ -1597,23 +1602,23 @@ function gn({ onChange: le, value: y }) {
|
|
|
1597
1602
|
variant: "measure"
|
|
1598
1603
|
});
|
|
1599
1604
|
}
|
|
1600
|
-
function
|
|
1605
|
+
function $r(e, t, n) {
|
|
1601
1606
|
return e.type === "datetime" ? /* @__PURE__ */ _(u, {
|
|
1602
1607
|
formatDate: "YYYY-MM-DD",
|
|
1603
1608
|
formatTime: "HH:mm",
|
|
1604
1609
|
hideSecond: !0,
|
|
1605
|
-
onChange: (e) => n(
|
|
1610
|
+
onChange: (e) => n(Se(e)),
|
|
1606
1611
|
placeholderLeft: "選擇日期",
|
|
1607
1612
|
placeholderRight: "選擇時間",
|
|
1608
|
-
value:
|
|
1613
|
+
value: Ie(t)
|
|
1609
1614
|
}) : /* @__PURE__ */ _(l, {
|
|
1610
1615
|
format: "YYYY-MM-DD",
|
|
1611
|
-
onChange: (e) => n(
|
|
1616
|
+
onChange: (e) => n(xe(e)),
|
|
1612
1617
|
placeholder: "選擇日期",
|
|
1613
|
-
value:
|
|
1618
|
+
value: Ie(t)
|
|
1614
1619
|
});
|
|
1615
1620
|
}
|
|
1616
|
-
function
|
|
1621
|
+
function ei(e, t) {
|
|
1617
1622
|
let n = e.options.map((t, n) => ({
|
|
1618
1623
|
index: n,
|
|
1619
1624
|
key: `${e.fieldKey}-${n}`,
|
|
@@ -1621,7 +1626,7 @@ function gn({ onChange: le, value: y }) {
|
|
|
1621
1626
|
value: t.value
|
|
1622
1627
|
}));
|
|
1623
1628
|
return /* @__PURE__ */ v("div", {
|
|
1624
|
-
style:
|
|
1629
|
+
style: Kt,
|
|
1625
1630
|
children: [/* @__PURE__ */ _(ae, {
|
|
1626
1631
|
actions: {
|
|
1627
1632
|
render: (n) => [{
|
|
@@ -1642,7 +1647,7 @@ function gn({ onChange: le, value: y }) {
|
|
|
1642
1647
|
render: (n) => /* @__PURE__ */ _(f, {
|
|
1643
1648
|
onChange: (r) => t({
|
|
1644
1649
|
...e,
|
|
1645
|
-
options:
|
|
1650
|
+
options: Hn(e.options, n.index, { label: r.target.value })
|
|
1646
1651
|
}),
|
|
1647
1652
|
placeholder: "例如:主管",
|
|
1648
1653
|
size: "sub",
|
|
@@ -1655,7 +1660,7 @@ function gn({ onChange: le, value: y }) {
|
|
|
1655
1660
|
render: (n) => /* @__PURE__ */ _(f, {
|
|
1656
1661
|
onChange: (r) => t({
|
|
1657
1662
|
...e,
|
|
1658
|
-
options:
|
|
1663
|
+
options: Hn(e.options, n.index, { value: r.target.value })
|
|
1659
1664
|
}),
|
|
1660
1665
|
placeholder: "例如:manager",
|
|
1661
1666
|
size: "sub",
|
|
@@ -1668,13 +1673,13 @@ function gn({ onChange: le, value: y }) {
|
|
|
1668
1673
|
showHeader: !0,
|
|
1669
1674
|
size: "sub"
|
|
1670
1675
|
}), /* @__PURE__ */ _("div", {
|
|
1671
|
-
style:
|
|
1676
|
+
style: qt,
|
|
1672
1677
|
children: /* @__PURE__ */ _(c, {
|
|
1673
1678
|
icon: me,
|
|
1674
1679
|
iconType: "leading",
|
|
1675
1680
|
onClick: () => t({
|
|
1676
1681
|
...e,
|
|
1677
|
-
options: [...e.options,
|
|
1682
|
+
options: [...e.options, Un(e.options)]
|
|
1678
1683
|
}),
|
|
1679
1684
|
variant: "base-secondary",
|
|
1680
1685
|
children: "新增選項"
|
|
@@ -1682,27 +1687,27 @@ function gn({ onChange: le, value: y }) {
|
|
|
1682
1687
|
})]
|
|
1683
1688
|
});
|
|
1684
1689
|
}
|
|
1685
|
-
function
|
|
1690
|
+
function ti(e, t, n) {
|
|
1686
1691
|
return /* @__PURE__ */ _("div", {
|
|
1687
1692
|
...t.draggableProps,
|
|
1688
1693
|
"data-form-builder-field-key": e.fieldKey,
|
|
1689
1694
|
ref: t.innerRef,
|
|
1690
1695
|
style: {
|
|
1691
|
-
...
|
|
1692
|
-
...n ?
|
|
1696
|
+
...wt,
|
|
1697
|
+
...n ? Tt : null,
|
|
1693
1698
|
...t.draggableProps.style
|
|
1694
1699
|
},
|
|
1695
1700
|
children: /* @__PURE__ */ _(s, {
|
|
1696
|
-
style: e.fieldKey ===
|
|
1697
|
-
children:
|
|
1701
|
+
style: e.fieldKey === K?.fieldKey ? Et : void 0,
|
|
1702
|
+
children: ni(e, t, n)
|
|
1698
1703
|
})
|
|
1699
1704
|
});
|
|
1700
1705
|
}
|
|
1701
1706
|
function $(t, n, r, i = !1, a) {
|
|
1702
1707
|
return /* @__PURE__ */ _("div", {
|
|
1703
|
-
style: i ?
|
|
1708
|
+
style: i ? Ft : Pt,
|
|
1704
1709
|
children: /* @__PURE__ */ _("div", {
|
|
1705
|
-
style:
|
|
1710
|
+
style: It,
|
|
1706
1711
|
children: /* @__PURE__ */ _(e, {
|
|
1707
1712
|
label: t,
|
|
1708
1713
|
layout: i ? ce.VERTICAL : ce.STRETCH,
|
|
@@ -1716,18 +1721,18 @@ function gn({ onChange: le, value: y }) {
|
|
|
1716
1721
|
})
|
|
1717
1722
|
});
|
|
1718
1723
|
}
|
|
1719
|
-
function
|
|
1724
|
+
function ni(e, t, n) {
|
|
1720
1725
|
return /* @__PURE__ */ v("div", {
|
|
1721
1726
|
...t.dragHandleProps ?? {},
|
|
1722
1727
|
"aria-label": "選取或拖曳排序欄位",
|
|
1723
|
-
onClick: () =>
|
|
1724
|
-
style:
|
|
1728
|
+
onClick: () => P(e.fieldKey),
|
|
1729
|
+
style: bt,
|
|
1725
1730
|
title: "點擊選取,拖曳排序",
|
|
1726
1731
|
children: [
|
|
1727
1732
|
/* @__PURE__ */ _("span", {
|
|
1728
1733
|
"aria-label": "拖曳排序",
|
|
1729
1734
|
role: "img",
|
|
1730
|
-
style:
|
|
1735
|
+
style: Wt,
|
|
1731
1736
|
title: "拖曳排序",
|
|
1732
1737
|
children: /* @__PURE__ */ _(d, {
|
|
1733
1738
|
icon: fe,
|
|
@@ -1735,14 +1740,14 @@ function gn({ onChange: le, value: y }) {
|
|
|
1735
1740
|
})
|
|
1736
1741
|
}),
|
|
1737
1742
|
/* @__PURE__ */ v("div", {
|
|
1738
|
-
style:
|
|
1743
|
+
style: xt,
|
|
1739
1744
|
children: [/* @__PURE__ */ v(h, {
|
|
1740
1745
|
component: "span",
|
|
1741
1746
|
ellipsis: !0,
|
|
1742
1747
|
variant: "label-primary",
|
|
1743
1748
|
children: [e.label, e.required ? /* @__PURE__ */ _("sup", {
|
|
1744
1749
|
"aria-label": "必填",
|
|
1745
|
-
style:
|
|
1750
|
+
style: Jt,
|
|
1746
1751
|
children: "*"
|
|
1747
1752
|
}) : null]
|
|
1748
1753
|
}), /* @__PURE__ */ v(h, {
|
|
@@ -1751,7 +1756,7 @@ function gn({ onChange: le, value: y }) {
|
|
|
1751
1756
|
ellipsis: !0,
|
|
1752
1757
|
variant: "caption",
|
|
1753
1758
|
children: [
|
|
1754
|
-
|
|
1759
|
+
yn(e.type),
|
|
1755
1760
|
" ·",
|
|
1756
1761
|
e.required ? " 必填" : " 選填",
|
|
1757
1762
|
" ·",
|
|
@@ -1762,20 +1767,20 @@ function gn({ onChange: le, value: y }) {
|
|
|
1762
1767
|
}),
|
|
1763
1768
|
/* @__PURE__ */ v("div", {
|
|
1764
1769
|
onClick: (e) => e.stopPropagation(),
|
|
1765
|
-
style:
|
|
1770
|
+
style: St,
|
|
1766
1771
|
children: [/* @__PURE__ */ _("div", {
|
|
1767
|
-
style:
|
|
1772
|
+
style: Ct,
|
|
1768
1773
|
children: /* @__PURE__ */ _(m, {
|
|
1769
1774
|
checked: !!e.required,
|
|
1770
1775
|
disabled: n || e.hidden === !0,
|
|
1771
1776
|
label: "必填",
|
|
1772
|
-
onChange: (t) =>
|
|
1777
|
+
onChange: (t) => mr(e.fieldKey, t.target.checked)
|
|
1773
1778
|
})
|
|
1774
1779
|
}), /* @__PURE__ */ _(c, {
|
|
1775
1780
|
disabled: n,
|
|
1776
1781
|
icon: he,
|
|
1777
1782
|
iconType: "icon-only",
|
|
1778
|
-
onClick: () =>
|
|
1783
|
+
onClick: () => Xn(e.fieldKey),
|
|
1779
1784
|
variant: "destructive-ghost",
|
|
1780
1785
|
children: "移除欄位"
|
|
1781
1786
|
})]
|
|
@@ -1783,61 +1788,61 @@ function gn({ onChange: le, value: y }) {
|
|
|
1783
1788
|
]
|
|
1784
1789
|
});
|
|
1785
1790
|
}
|
|
1786
|
-
function
|
|
1791
|
+
function ri() {
|
|
1787
1792
|
return /* @__PURE__ */ v("div", {
|
|
1788
|
-
style:
|
|
1793
|
+
style: L,
|
|
1789
1794
|
children: [/* @__PURE__ */ _(h, {
|
|
1790
1795
|
component: "h2",
|
|
1791
1796
|
variant: "h3",
|
|
1792
1797
|
children: "填寫預覽"
|
|
1793
1798
|
}), /* @__PURE__ */ _(t, {
|
|
1794
1799
|
dataSourceContext: { kind: "preview" },
|
|
1795
|
-
onChange:
|
|
1800
|
+
onChange: pr,
|
|
1796
1801
|
schema: b,
|
|
1797
1802
|
uiSchema: S,
|
|
1798
1803
|
value: Ye
|
|
1799
1804
|
})]
|
|
1800
1805
|
});
|
|
1801
1806
|
}
|
|
1802
|
-
function
|
|
1807
|
+
function ii() {
|
|
1803
1808
|
return /* @__PURE__ */ v("div", {
|
|
1804
|
-
style:
|
|
1809
|
+
style: L,
|
|
1805
1810
|
children: [/* @__PURE__ */ _(h, {
|
|
1806
1811
|
component: "h2",
|
|
1807
1812
|
variant: "h3",
|
|
1808
1813
|
children: "Schema"
|
|
1809
1814
|
}), /* @__PURE__ */ v("div", {
|
|
1810
|
-
style:
|
|
1815
|
+
style: Rt,
|
|
1811
1816
|
children: [
|
|
1812
|
-
|
|
1817
|
+
ai("Form Schema", "schemaJson", /* @__PURE__ */ _(ct, {
|
|
1813
1818
|
height: "360px",
|
|
1814
1819
|
name: "schemaJson",
|
|
1815
|
-
onChange:
|
|
1820
|
+
onChange: hr,
|
|
1816
1821
|
placeholder: "輸入 Form Schema JSON",
|
|
1817
1822
|
value: pe
|
|
1818
1823
|
})),
|
|
1819
|
-
|
|
1824
|
+
ai("UI Schema", "uiSchemaJson", /* @__PURE__ */ _(ct, {
|
|
1820
1825
|
height: "240px",
|
|
1821
1826
|
name: "uiSchemaJson",
|
|
1822
|
-
onChange:
|
|
1827
|
+
onChange: gr,
|
|
1823
1828
|
placeholder: "輸入 UI Schema JSON",
|
|
1824
|
-
value:
|
|
1829
|
+
value: ge
|
|
1825
1830
|
})),
|
|
1826
|
-
|
|
1831
|
+
Ze ? /* @__PURE__ */ _(h, {
|
|
1827
1832
|
color: "text-error",
|
|
1828
|
-
style:
|
|
1833
|
+
style: Vt,
|
|
1829
1834
|
variant: "body",
|
|
1830
|
-
children:
|
|
1835
|
+
children: Ze
|
|
1831
1836
|
}) : null
|
|
1832
1837
|
]
|
|
1833
1838
|
})]
|
|
1834
1839
|
});
|
|
1835
1840
|
}
|
|
1836
|
-
function
|
|
1841
|
+
function ai(t, n, r) {
|
|
1837
1842
|
return /* @__PURE__ */ _("div", {
|
|
1838
|
-
style:
|
|
1843
|
+
style: zt,
|
|
1839
1844
|
children: /* @__PURE__ */ _("div", {
|
|
1840
|
-
style:
|
|
1845
|
+
style: Bt,
|
|
1841
1846
|
children: /* @__PURE__ */ _(e, {
|
|
1842
1847
|
label: t,
|
|
1843
1848
|
name: n,
|
|
@@ -1847,29 +1852,29 @@ function gn({ onChange: le, value: y }) {
|
|
|
1847
1852
|
});
|
|
1848
1853
|
}
|
|
1849
1854
|
}
|
|
1850
|
-
function
|
|
1851
|
-
return
|
|
1855
|
+
function yn(e) {
|
|
1856
|
+
return lt.find((t) => t.type === e)?.label ?? e;
|
|
1852
1857
|
}
|
|
1853
|
-
function
|
|
1858
|
+
function bn(e) {
|
|
1854
1859
|
return `${e.key}@${e.version}`;
|
|
1855
1860
|
}
|
|
1856
|
-
function
|
|
1861
|
+
function xn(e) {
|
|
1857
1862
|
return [
|
|
1858
1863
|
e.supportsSearch ? `可輸入關鍵字搜尋${e.minimumSearchLength > 1 ? `(至少 ${e.minimumSearchLength} 字)` : ""}` : "不支援搜尋",
|
|
1859
1864
|
e.paginationMode === "CURSOR" ? `捲動載入更多(每次 ${e.pageSize} 筆)` : `一次載入完整清單(最多 ${e.maximumResultCount} 筆)`,
|
|
1860
1865
|
e.revalidationPolicy === "ALWAYS" ? "退回重送時一律重新確認" : "值與條件未變時沿用上次結果"
|
|
1861
1866
|
];
|
|
1862
1867
|
}
|
|
1863
|
-
function
|
|
1868
|
+
function Sn(e) {
|
|
1864
1869
|
return {
|
|
1865
|
-
id:
|
|
1870
|
+
id: bn(e),
|
|
1866
1871
|
name: e.label
|
|
1867
1872
|
};
|
|
1868
1873
|
}
|
|
1869
|
-
function
|
|
1870
|
-
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;
|
|
1871
1876
|
}
|
|
1872
|
-
function
|
|
1877
|
+
function wn(e) {
|
|
1873
1878
|
switch (e) {
|
|
1874
1879
|
case "BOOLEAN": return !1;
|
|
1875
1880
|
case "NUMBER": return 0;
|
|
@@ -1878,18 +1883,18 @@ function z(e) {
|
|
|
1878
1883
|
default: return "";
|
|
1879
1884
|
}
|
|
1880
1885
|
}
|
|
1881
|
-
function
|
|
1886
|
+
function Tn(e, t) {
|
|
1882
1887
|
let n = e?.from.kind === "CONSTANT" ? e.from.value : "";
|
|
1883
1888
|
return t === "NUMBER" ? typeof n == "number" ? String(n) : "" : typeof n == "string" ? n : "";
|
|
1884
1889
|
}
|
|
1885
|
-
function
|
|
1886
|
-
return !n || n ===
|
|
1890
|
+
function En(e, t, n) {
|
|
1891
|
+
return !n || n === pn ? null : n === dn ? {
|
|
1887
1892
|
from: {
|
|
1888
1893
|
kind: "CONSTANT",
|
|
1889
|
-
value:
|
|
1894
|
+
value: wn(t)
|
|
1890
1895
|
},
|
|
1891
1896
|
parameter: e
|
|
1892
|
-
} : n.startsWith(
|
|
1897
|
+
} : n.startsWith(fn) ? {
|
|
1893
1898
|
from: {
|
|
1894
1899
|
columnKey: n.slice(14),
|
|
1895
1900
|
kind: "ROW_FIELD"
|
|
@@ -1903,46 +1908,46 @@ function Cn(e, t, n) {
|
|
|
1903
1908
|
parameter: e
|
|
1904
1909
|
};
|
|
1905
1910
|
}
|
|
1906
|
-
function
|
|
1911
|
+
function Dn(e) {
|
|
1907
1912
|
return e.kind === "remove-field" ? "確認移除 dependency 欄位" : e.kind === "remove-column" ? "確認移除表格欄" : e.kind === "replace-column" ? "確認變更欄型別" : "確認變更選擇模式";
|
|
1908
1913
|
}
|
|
1909
|
-
var
|
|
1914
|
+
var z = [{
|
|
1910
1915
|
label: "選項 A",
|
|
1911
1916
|
value: "option_a"
|
|
1912
1917
|
}, {
|
|
1913
1918
|
label: "選項 B",
|
|
1914
1919
|
value: "option_b"
|
|
1915
1920
|
}];
|
|
1916
|
-
function
|
|
1921
|
+
function On(e) {
|
|
1917
1922
|
let t = [];
|
|
1918
|
-
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("格式"),
|
|
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;
|
|
1919
1924
|
}
|
|
1920
|
-
function
|
|
1921
|
-
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);
|
|
1922
1927
|
}
|
|
1923
|
-
function
|
|
1928
|
+
function An(e, t) {
|
|
1924
1929
|
return t ? {
|
|
1925
1930
|
...e,
|
|
1926
1931
|
pattern: t
|
|
1927
1932
|
} : Object.fromEntries(Object.entries(e).filter(([e]) => e !== "pattern" && e !== "patternErrorMessage"));
|
|
1928
1933
|
}
|
|
1929
|
-
function
|
|
1934
|
+
function jn(e, t) {
|
|
1930
1935
|
return t ? {
|
|
1931
1936
|
...e,
|
|
1932
1937
|
patternErrorMessage: t
|
|
1933
1938
|
} : Object.fromEntries(Object.entries(e).filter(([e]) => e !== "patternErrorMessage"));
|
|
1934
1939
|
}
|
|
1935
|
-
function
|
|
1940
|
+
function Mn(e) {
|
|
1936
1941
|
return e && !e.trim() ? {
|
|
1937
1942
|
severity: "error",
|
|
1938
1943
|
text: "格式不能只有空白,儲存時會被拒絕。"
|
|
1939
|
-
} : e && e.length >
|
|
1944
|
+
} : e && e.length > Ye ? {
|
|
1940
1945
|
severity: "error",
|
|
1941
|
-
text: `格式最多 ${
|
|
1942
|
-
} : e && !
|
|
1946
|
+
text: `格式最多 ${Ye} 個字元,儲存時會被拒絕。`
|
|
1947
|
+
} : e && !Xe(e) ? {
|
|
1943
1948
|
severity: "error",
|
|
1944
1949
|
text: "這不是有效的正規表示式,儲存時會被拒絕。格式以 u 模式檢查,多餘的跳脫(例如在方括號 [ ] 外寫 \\-)也算錯誤。"
|
|
1945
|
-
} : e &&
|
|
1950
|
+
} : e && Ze(e) ? {
|
|
1946
1951
|
severity: "error",
|
|
1947
1952
|
text: "格式裡的括號群組後面不能接重複次數(例如 (ab)+、(\\w|\\d)*、(ab){2}),填寫的內容可能讓系統卡住,儲存時會被拒絕。請把重複的部分直接寫出來,或改用 [ ] 字元集合加次數。"
|
|
1948
1953
|
} : {
|
|
@@ -1950,13 +1955,13 @@ function kn(e) {
|
|
|
1950
1955
|
text: "填寫的內容要整段符合格式才能送出;留空表示不檢查格式。"
|
|
1951
1956
|
};
|
|
1952
1957
|
}
|
|
1953
|
-
function
|
|
1954
|
-
return e && e.length >
|
|
1958
|
+
function Nn(e) {
|
|
1959
|
+
return e && e.length > O ? {
|
|
1955
1960
|
severity: "error",
|
|
1956
|
-
text: `錯誤訊息最多 ${
|
|
1961
|
+
text: `錯誤訊息最多 ${O} 個字元,儲存時會被拒絕。`
|
|
1957
1962
|
} : void 0;
|
|
1958
1963
|
}
|
|
1959
|
-
function
|
|
1964
|
+
function Pn(e, t) {
|
|
1960
1965
|
let n = {
|
|
1961
1966
|
fieldKey: e.fieldKey,
|
|
1962
1967
|
label: e.label,
|
|
@@ -1967,59 +1972,59 @@ function jn(e, t) {
|
|
|
1967
1972
|
return t === "select" || t === "autocomplete" ? {
|
|
1968
1973
|
...n,
|
|
1969
1974
|
mode: "single",
|
|
1970
|
-
options: [...
|
|
1975
|
+
options: [...z],
|
|
1971
1976
|
type: t
|
|
1972
1977
|
} : {
|
|
1973
1978
|
...n,
|
|
1974
1979
|
type: t
|
|
1975
1980
|
};
|
|
1976
1981
|
}
|
|
1977
|
-
function
|
|
1982
|
+
function Fn(e, t) {
|
|
1978
1983
|
return Object.fromEntries(Object.entries(e).filter(([e]) => e !== t));
|
|
1979
1984
|
}
|
|
1980
|
-
function
|
|
1985
|
+
function In(e) {
|
|
1981
1986
|
return !!(e.visibleWhen || e.requiredWhen || e.readonlyWhen);
|
|
1982
1987
|
}
|
|
1983
|
-
function
|
|
1988
|
+
function Ln(e) {
|
|
1984
1989
|
return {
|
|
1985
1990
|
id: e.fieldKey,
|
|
1986
1991
|
name: e.label
|
|
1987
1992
|
};
|
|
1988
1993
|
}
|
|
1989
|
-
function
|
|
1994
|
+
function Rn(e) {
|
|
1990
1995
|
return e.type === "text" || e.type === "textarea";
|
|
1991
1996
|
}
|
|
1992
|
-
function
|
|
1997
|
+
function zn(e) {
|
|
1993
1998
|
return typeof e == "string" ? e : "";
|
|
1994
1999
|
}
|
|
1995
|
-
function
|
|
2000
|
+
function Bn(e) {
|
|
1996
2001
|
let t = e.split(/[\n,]/u).map((e) => e.trim()).filter(Boolean);
|
|
1997
2002
|
return t.length ? t : void 0;
|
|
1998
2003
|
}
|
|
1999
|
-
function
|
|
2004
|
+
function Vn(e) {
|
|
2000
2005
|
return e?.join("\n") ?? "";
|
|
2001
2006
|
}
|
|
2002
|
-
function
|
|
2007
|
+
function B(e) {
|
|
2003
2008
|
return JSON.stringify(e, null, 2);
|
|
2004
2009
|
}
|
|
2005
|
-
function
|
|
2010
|
+
function Hn(e, t, n) {
|
|
2006
2011
|
return e.map((e, r) => r === t ? {
|
|
2007
2012
|
...e,
|
|
2008
2013
|
...n
|
|
2009
2014
|
} : e);
|
|
2010
2015
|
}
|
|
2011
|
-
function
|
|
2016
|
+
function Un(e) {
|
|
2012
2017
|
let t = e.length + 1;
|
|
2013
2018
|
return {
|
|
2014
2019
|
label: `選項 ${t}`,
|
|
2015
|
-
value:
|
|
2020
|
+
value: V(e, t)
|
|
2016
2021
|
};
|
|
2017
2022
|
}
|
|
2018
|
-
function
|
|
2023
|
+
function V(e, t) {
|
|
2019
2024
|
let n = `option_${t}`;
|
|
2020
|
-
return e.some((e) => e.value === n) ?
|
|
2025
|
+
return e.some((e) => e.value === n) ? V(e, t + 1) : n;
|
|
2021
2026
|
}
|
|
2022
|
-
function
|
|
2027
|
+
function Wn(e, t, n) {
|
|
2023
2028
|
let r = e[t];
|
|
2024
2029
|
if (!r || t === n) return [...e];
|
|
2025
2030
|
let i = e.filter((e, n) => n !== t);
|
|
@@ -2029,7 +2034,6 @@ function Vn(e, t, n) {
|
|
|
2029
2034
|
...i.slice(n)
|
|
2030
2035
|
];
|
|
2031
2036
|
}
|
|
2032
|
-
|
|
2033
|
-
export { gn as t };
|
|
2037
|
+
export { R as t };
|
|
2034
2038
|
|
|
2035
|
-
//# sourceMappingURL=FormBuilderView-
|
|
2039
|
+
//# sourceMappingURL=FormBuilderView-Djlm3y4S.js.map
|