@rytass/bpm-core-react 0.18.0 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/chunks/FormBuilderView-CHaAQL5v.cjs +3 -0
- package/dist/chunks/FormBuilderView-CHaAQL5v.cjs.map +1 -0
- package/dist/chunks/{FormBuilderView-BVKY1j_0.js → FormBuilderView-vQfVc08Z.js} +485 -481
- package/dist/chunks/FormBuilderView-vQfVc08Z.js.map +1 -0
- package/dist/chunks/{FormRendererView-BsTwZkqU.js → FormRendererView-CTLlG13b.js} +300 -189
- package/dist/chunks/FormRendererView-CTLlG13b.js.map +1 -0
- package/dist/chunks/FormRendererView-ChmM_4Yc.cjs +4 -0
- package/dist/chunks/FormRendererView-ChmM_4Yc.cjs.map +1 -0
- package/dist/chunks/admin-pickers-BjbkBpSJ.cjs +2 -0
- package/dist/chunks/admin-pickers-BjbkBpSJ.cjs.map +1 -0
- package/dist/chunks/{admin-pickers-Djq3h-UR.js → admin-pickers-DfGxsjpp.js} +42 -42
- package/dist/chunks/admin-pickers-DfGxsjpp.js.map +1 -0
- package/dist/chunks/{approval-instance-list-page-CPXMP3PL.js → approval-instance-list-page-BnI4t5mD.js} +7 -8
- package/dist/chunks/{approval-instance-list-page-CPXMP3PL.js.map → approval-instance-list-page-BnI4t5mD.js.map} +1 -1
- package/dist/chunks/{approval-instance-list-page-ax0pm8bt.cjs → approval-instance-list-page-fqvmkBlg.cjs} +2 -2
- package/dist/chunks/{approval-instance-list-page-ax0pm8bt.cjs.map → approval-instance-list-page-fqvmkBlg.cjs.map} +1 -1
- package/dist/chunks/{approver-filled-form-Dm3Iw7iw.cjs → approver-filled-form-B4zPg9kz.cjs} +2 -2
- package/dist/chunks/approver-filled-form-B4zPg9kz.cjs.map +1 -0
- package/dist/chunks/{approver-filled-form-ZEwpmsHJ.js → approver-filled-form-Bgazhbvd.js} +40 -36
- package/dist/chunks/approver-filled-form-Bgazhbvd.js.map +1 -0
- package/dist/chunks/auth-provider-4BeCw7cI.cjs.map +1 -1
- package/dist/chunks/{auth-provider-B5oPmvk2.js → auth-provider-C2b-5mGt.js} +2 -3
- package/dist/chunks/{auth-provider-B5oPmvk2.js.map → auth-provider-C2b-5mGt.js.map} +1 -1
- package/dist/chunks/{bpm-form-field-Cao0rMol.js → bpm-form-field-9B-Det0u.js} +2 -3
- package/dist/chunks/{bpm-form-field-Cao0rMol.js.map → bpm-form-field-9B-Det0u.js.map} +1 -1
- package/dist/chunks/bpm-form-field-Bc6k4ZEO.cjs.map +1 -1
- package/dist/chunks/{categories-riC33J_j.js → categories-BAdxjNSA.js} +14 -15
- package/dist/chunks/{categories-riC33J_j.js.map → categories-BAdxjNSA.js.map} +1 -1
- package/dist/chunks/{categories-AxxhqjLZ.cjs → categories-DQUtVEiV.cjs} +2 -2
- package/dist/chunks/{categories-AxxhqjLZ.cjs.map → categories-DQUtVEiV.cjs.map} +1 -1
- package/dist/chunks/{compose-B1GlrZW9.js → compose-D9ipJpF_.js} +131 -148
- package/dist/chunks/compose-D9ipJpF_.js.map +1 -0
- package/dist/chunks/compose-DtfX8DQ9.cjs +2 -0
- package/dist/chunks/compose-DtfX8DQ9.cjs.map +1 -0
- package/dist/chunks/{dashboard-page-DdBvV6YI.js → dashboard-page-BoqNhjT_.js} +5 -6
- package/dist/chunks/{dashboard-page-DdBvV6YI.js.map → dashboard-page-BoqNhjT_.js.map} +1 -1
- package/dist/chunks/{dashboard-page-BWQBSGDq.cjs → dashboard-page-D7YJ3udk.cjs} +2 -2
- package/dist/chunks/{dashboard-page-BWQBSGDq.cjs.map → dashboard-page-D7YJ3udk.cjs.map} +1 -1
- package/dist/chunks/{delegations-MxF3uJGW.js → delegations-BfhCDz5e.js} +15 -16
- package/dist/chunks/{delegations-MxF3uJGW.js.map → delegations-BfhCDz5e.js.map} +1 -1
- package/dist/chunks/{delegations-Ckf03icM.cjs → delegations-BmFGcuhA.cjs} +2 -2
- package/dist/chunks/{delegations-Ckf03icM.cjs.map → delegations-BmFGcuhA.cjs.map} +1 -1
- package/dist/chunks/{delegations-V9HIe3_P.cjs → delegations-CcS0SHbf.cjs} +2 -2
- package/dist/chunks/{delegations-V9HIe3_P.cjs.map → delegations-CcS0SHbf.cjs.map} +1 -1
- package/dist/chunks/{delegations-xUt1tj8d.js → delegations-DBh5TT6G.js} +16 -17
- package/dist/chunks/{delegations-xUt1tj8d.js.map → delegations-DBh5TT6G.js.map} +1 -1
- package/dist/chunks/designer-Df79YzUn.cjs +65 -0
- package/dist/chunks/designer-Df79YzUn.cjs.map +1 -0
- package/dist/chunks/{designer-BCLrjb4H.js → designer-ubnZbP-A.js} +1791 -1407
- package/dist/chunks/designer-ubnZbP-A.js.map +1 -0
- package/dist/chunks/detail-BBC9kqXd.cjs +5 -0
- package/dist/chunks/detail-BBC9kqXd.cjs.map +1 -0
- package/dist/chunks/{detail-4F39ggBn.js → detail-C6XKZjlF.js} +1033 -1005
- package/dist/chunks/detail-C6XKZjlF.js.map +1 -0
- package/dist/chunks/{format-date-time-CB-LxzqT.js → format-date-time-B0LdmWg4.js} +2 -3
- package/dist/chunks/{format-date-time-CB-LxzqT.js.map → format-date-time-B0LdmWg4.js.map} +1 -1
- package/dist/chunks/format-date-time-D-cx5M8z.cjs.map +1 -1
- package/dist/chunks/{format-member-label-DudVI55w.js → format-member-label-C73FuP-d.js} +2 -3
- package/dist/chunks/{format-member-label-DudVI55w.js.map → format-member-label-C73FuP-d.js.map} +1 -1
- package/dist/chunks/format-member-label-t7ANTF62.cjs.map +1 -1
- package/dist/chunks/language-provider-Bdnx3Gxl.cjs.map +1 -1
- package/dist/chunks/{language-provider-B3cEbLe4.js → language-provider-phkWOapf.js} +2 -3
- package/dist/chunks/{language-provider-B3cEbLe4.js.map → language-provider-phkWOapf.js.map} +1 -1
- package/dist/chunks/{login-C6qlTC6F.js → login-D6cc3bo7.js} +4 -5
- package/dist/chunks/{login-C6qlTC6F.js.map → login-D6cc3bo7.js.map} +1 -1
- package/dist/chunks/{login-AtVxZBsC.cjs → login-uvVcltrS.cjs} +2 -2
- package/dist/chunks/{login-AtVxZBsC.cjs.map → login-uvVcltrS.cjs.map} +1 -1
- package/dist/chunks/notifications-Bc4mgSds.cjs.map +1 -1
- package/dist/chunks/{notifications-DJ5wzCye.js → notifications-Cvme5Qbl.js} +2 -3
- package/dist/chunks/{notifications-DJ5wzCye.js.map → notifications-Cvme5Qbl.js.map} +1 -1
- package/dist/chunks/orgs-B_2J2tLX.cjs +2 -0
- package/dist/chunks/{orgs-BeeDDWL1.cjs.map → orgs-B_2J2tLX.cjs.map} +1 -1
- package/dist/chunks/{orgs-8hje_l2n.js → orgs-DqxMds26.js} +48 -49
- package/dist/chunks/{orgs-8hje_l2n.js.map → orgs-DqxMds26.js.map} +1 -1
- package/dist/chunks/{providers-B_d5tbCL.js → providers-BbCs23sk.js} +21 -25
- package/dist/chunks/{providers-B_d5tbCL.js.map → providers-BbCs23sk.js.map} +1 -1
- package/dist/chunks/{providers-chuJvMgv.cjs → providers-D_KAgOOu.cjs} +2 -2
- package/dist/chunks/{providers-chuJvMgv.cjs.map → providers-D_KAgOOu.cjs.map} +1 -1
- package/dist/chunks/router-adapter--gYs13E8.cjs.map +1 -1
- package/dist/chunks/{router-adapter-DftlFTOd.js → router-adapter-CkxCyzf5.js} +2 -3
- package/dist/chunks/{router-adapter-DftlFTOd.js.map → router-adapter-CkxCyzf5.js.map} +1 -1
- package/dist/chunks/{routes-config-yZbESPlw.js → routes-config-BcNaWJWJ.js} +2 -3
- package/dist/chunks/{routes-config-yZbESPlw.js.map → routes-config-BcNaWJWJ.js.map} +1 -1
- package/dist/chunks/routes-config-C1j_vFKo.cjs.map +1 -1
- package/dist/chunks/task-decision-3d17ZvZE.js +29 -0
- package/dist/chunks/task-decision-3d17ZvZE.js.map +1 -0
- package/dist/chunks/task-decision-CqZ4WQOC.cjs +2 -0
- package/dist/chunks/task-decision-CqZ4WQOC.cjs.map +1 -0
- package/dist/chunks/{use-bpm-member-D57LKe_u.js → use-bpm-member-BPzcNU1g.js} +3 -4
- package/dist/chunks/{use-bpm-member-D57LKe_u.js.map → use-bpm-member-BPzcNU1g.js.map} +1 -1
- package/dist/chunks/use-bpm-member-DpNAQtNC.cjs.map +1 -1
- package/dist/chunks/{users-Pl6hY5Y5.js → users-BBtiZ9QQ.js} +22 -25
- package/dist/chunks/{users-Pl6hY5Y5.js.map → users-BBtiZ9QQ.js.map} +1 -1
- package/dist/chunks/{users-O2L_M3BK.cjs → users-EqSzDhuj.cjs} +2 -2
- package/dist/chunks/{users-O2L_M3BK.cjs.map → users-EqSzDhuj.cjs.map} +1 -1
- package/dist/components/admin-picker-options.d.cts +11 -0
- package/dist/components/admin-picker-options.d.ts +11 -0
- package/dist/components/admin-pickers.d.cts +2 -11
- package/dist/components/admin-pickers.d.ts +2 -11
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -19
- package/dist/index.js.map +1 -1
- package/dist/lib/task-decision.d.cts +16 -0
- package/dist/lib/task-decision.d.ts +16 -0
- package/dist/lib/use-org-unit-names.d.cts +10 -0
- package/dist/lib/use-org-unit-names.d.ts +10 -0
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +7 -8
- package/dist/next/index.js.map +1 -1
- package/dist/next/workflow-chat-route.cjs +19 -1
- package/dist/next/workflow-chat-route.cjs.map +1 -1
- package/dist/next/workflow-chat-route.js +2 -3
- package/dist/next/workflow-chat-route.js.map +1 -1
- package/dist/pages/admin/delegations/index.cjs +1 -1
- package/dist/pages/admin/delegations/index.cjs.map +1 -1
- package/dist/pages/admin/delegations/index.js +2 -3
- package/dist/pages/admin/orgs/index.cjs +1 -1
- package/dist/pages/admin/orgs/index.cjs.map +1 -1
- package/dist/pages/admin/orgs/index.js +2 -3
- package/dist/pages/admin/users/index.cjs +1 -1
- package/dist/pages/admin/users/index.cjs.map +1 -1
- package/dist/pages/admin/users/index.js +2 -3
- package/dist/pages/admin/webhook-endpoints/index.cjs.map +1 -1
- package/dist/pages/admin/webhook-endpoints/index.js +1 -2
- package/dist/pages/cc/index.cjs.map +1 -1
- package/dist/pages/cc/index.js +1 -2
- package/dist/pages/dashboard/index.cjs.map +1 -1
- package/dist/pages/dashboard/index.js +1 -2
- package/dist/pages/delegations/index.cjs +1 -1
- package/dist/pages/delegations/index.cjs.map +1 -1
- package/dist/pages/delegations/index.js +2 -3
- package/dist/pages/inbox/index.cjs.map +1 -1
- package/dist/pages/inbox/index.js +1 -2
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.cjs.map +1 -1
- package/dist/pages/instances/detail/index.js +2 -3
- package/dist/pages/instances/new/index.cjs.map +1 -1
- package/dist/pages/instances/new/index.js +1 -2
- package/dist/pages/login/index.cjs +1 -1
- package/dist/pages/login/index.cjs.map +1 -1
- package/dist/pages/login/index.js +2 -3
- package/dist/pages/root/index.cjs.map +1 -1
- package/dist/pages/root/index.js +1 -2
- package/dist/pages/search/index.cjs.map +1 -1
- package/dist/pages/search/index.js +1 -2
- package/dist/pages/sent/index.cjs.map +1 -1
- package/dist/pages/sent/index.js +1 -2
- package/dist/pages/settings/notifications/index.cjs.map +1 -1
- package/dist/pages/settings/notifications/index.js +2 -3
- package/dist/pages/templates/categories/index.cjs +1 -1
- package/dist/pages/templates/categories/index.cjs.map +1 -1
- package/dist/pages/templates/categories/index.js +2 -3
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.cjs.map +1 -1
- package/dist/pages/templates/compose/index.js +2 -3
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.cjs.map +1 -1
- package/dist/pages/templates/designer/index.js +2 -3
- package/dist/pages/templates/index.cjs.map +1 -1
- package/dist/pages/templates/index.js +1 -2
- package/dist/pages/templates/versions/index.cjs.map +1 -1
- package/dist/pages/templates/versions/index.js +1 -2
- package/dist/views/admin/delegations/index.cjs +1 -1
- package/dist/views/admin/delegations/index.js +1 -1
- package/dist/views/admin/index.cjs +1 -1
- package/dist/views/admin/index.js +3 -3
- package/dist/views/admin/orgs/index.cjs +1 -1
- package/dist/views/admin/orgs/index.js +1 -1
- package/dist/views/admin/users/index.cjs +1 -1
- package/dist/views/admin/users/index.js +1 -1
- package/dist/views/admin/webhook-endpoints/index.cjs +1 -1
- package/dist/views/admin/webhook-endpoints/index.cjs.map +1 -1
- package/dist/views/admin/webhook-endpoints/index.js +52 -53
- package/dist/views/admin/webhook-endpoints/index.js.map +1 -1
- package/dist/views/cc/index.cjs +1 -1
- package/dist/views/cc/index.cjs.map +1 -1
- package/dist/views/cc/index.js +2 -3
- package/dist/views/dashboard/index.cjs +1 -1
- package/dist/views/dashboard/index.cjs.map +1 -1
- package/dist/views/dashboard/index.js +2 -3
- package/dist/views/delegations/index.cjs +1 -1
- package/dist/views/delegations/index.js +1 -1
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/renderer/index.cjs +1 -1
- package/dist/views/forms/renderer/index.js +1 -1
- package/dist/views/forms/renderer/org-unit-field-options.d.cts +44 -0
- package/dist/views/forms/renderer/org-unit-field-options.d.ts +44 -0
- package/dist/views/forms/renderer/org-unit-field.d.cts +23 -0
- package/dist/views/forms/renderer/org-unit-field.d.ts +23 -0
- package/dist/views/inbox/index.cjs +1 -1
- package/dist/views/inbox/index.cjs.map +1 -1
- package/dist/views/inbox/index.js +133 -137
- package/dist/views/inbox/index.js.map +1 -1
- package/dist/views/instances/approver-filled-form.d.cts +9 -2
- package/dist/views/instances/approver-filled-form.d.ts +9 -2
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/instances/detail/sections/InstanceHistorySection.d.cts +8 -1
- package/dist/views/instances/detail/sections/InstanceHistorySection.d.ts +8 -1
- package/dist/views/instances/detail/sections/container-helpers.d.cts +0 -1
- package/dist/views/instances/detail/sections/container-helpers.d.ts +0 -1
- package/dist/views/instances/detail/sections/shared.d.cts +2 -2
- package/dist/views/instances/detail/sections/shared.d.ts +2 -2
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.cjs.map +1 -1
- package/dist/views/instances/new/index.js +14 -15
- 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,15 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "./bpm-form-field-
|
|
3
|
-
import { t } from "./format-member-label-
|
|
2
|
+
import { t as e } from "./bpm-form-field-9B-Det0u.js";
|
|
3
|
+
import { t } from "./format-member-label-C73FuP-d.js";
|
|
4
4
|
import { useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
5
5
|
import { AutoComplete as s, Button as c, CheckboxGroup as l, DatePicker as u, DateTimePicker as d, Input as f, RadioGroup as p, Select as m, Table as h, Textarea as g, Toggle as _, Typography as v, Upload as y } from "@mezzanine-ui/react";
|
|
6
6
|
import { resolveMembers as b, searchMembers as x } from "@rytass/bpm-core-client";
|
|
7
7
|
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
8
8
|
import { PlusIcon as w, TrashIcon as T } from "@mezzanine-ui/icons";
|
|
9
|
-
import { buildFormRendererValues as E, clampOptionalNumber as D, createFormTableRow as ee, formatDatePickerValue as O, formatDateTimePickerValue as k, isFormRendererFieldReadonly as A, isFormRendererFieldRequired as j, mergeFormDataSourceOptions as M, parseOptionalNumberInput as N, previewFormFieldOptions as te, previewResolveFormFieldOptions as ne, readDatePickerValue as
|
|
10
|
-
import { isFormDataSourceFieldDefinition as
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
import { buildFormRendererValues as E, clampOptionalNumber as D, createFormTableRow as ee, formatDatePickerValue as O, formatDateTimePickerValue as k, isFormRendererFieldReadonly as A, isFormRendererFieldRequired as j, mergeFormDataSourceOptions as M, parseOptionalNumberInput as N, previewFormFieldOptions as te, previewResolveFormFieldOptions as ne, readDatePickerValue as P, readFieldOptionAsSelectOption as F, readFormDataSourceErrorCode as re, readFormDataSourceErrorMessage as ie, readFormDataSourceSelectedValues as ae, readFormDataSourceValueSignature as I, readFormFieldOptions as oe, readFormTableCellPath as L, readFormTableRowBounds as se, readFormTableRows as R, readMissingFormDataSourceDependencies as ce, readMissingFormDataSourceOptionValues as z, readSelectOption as B, readSelectedFormDataSourceOptions as le, readVisibleFormRendererFields as ue, resolveFormFieldOptions as de } from "@rytass/bpm-core-client/form";
|
|
10
|
+
import { isFormDataSourceFieldDefinition as fe, isFormStaticOptionFieldDefinition as pe, isFormTableCellValue as V, isTableFieldDefinition as me, readFormFieldSelectionMode as H, readFormMemberIds as U } from "@rytass/bpm-core-shared/form";
|
|
11
|
+
import { resolveOrgUnitOptions as W, searchOrgUnitOptions as G } from "@rytass/bpm-core-client/organization";
|
|
12
|
+
// src/views/forms/renderer/form-data-source-field.ts
|
|
13
|
+
var he = {
|
|
13
14
|
canRetry: !1,
|
|
14
15
|
error: null,
|
|
15
16
|
hasValue: !1,
|
|
@@ -20,13 +21,13 @@ var me = {
|
|
|
20
21
|
options: [],
|
|
21
22
|
retry: () => void 0,
|
|
22
23
|
status: "IDLE"
|
|
23
|
-
},
|
|
24
|
-
function
|
|
25
|
-
let t =
|
|
24
|
+
}, K = [], ge = 10, _e = ["FORM_DATA_SOURCE_SEARCH_NOT_SUPPORTED", "FORM_DATA_SOURCE_SEARCH_TOO_SHORT"];
|
|
25
|
+
function q(e) {
|
|
26
|
+
let t = fe(e.field) ? e.field : null, s = e.fieldPath ?? t?.fieldKey ?? "", c = t ? e.optionSnapshots?.[e.snapshotKey ?? t.fieldKey] : void 0, l = t ? JSON.stringify({
|
|
26
27
|
dataSource: t.dataSource,
|
|
27
28
|
fieldKey: t.fieldKey,
|
|
28
29
|
type: t.type
|
|
29
|
-
}) : "", u = JSON.stringify(c ?? null), d = i(() => c?.options ?? [], [u]), f = JSON.stringify(e.formData), p = JSON.stringify(e.initialFormData ?? {}), m = JSON.stringify(e.schema), h = JSON.stringify(e.uiSchema), g = e.context?.kind, _ = e.context?.kind === "runtime" ? e.context.instanceId : void 0, v = e.context?.kind === "runtime" ? e.context.templateId : void 0, y = JSON.stringify(e.row?.values ?? null), b = JSON.stringify(e.row?.initialValues ?? null), x = t ? e.row ? e.row.values[t.fieldKey] : e.formData[t.fieldKey] : void 0, S =
|
|
30
|
+
}) : "", u = JSON.stringify(c ?? null), d = i(() => c?.options ?? [], [u]), f = JSON.stringify(e.formData), p = JSON.stringify(e.initialFormData ?? {}), m = JSON.stringify(e.schema), h = JSON.stringify(e.uiSchema), g = e.context?.kind, _ = e.context?.kind === "runtime" ? e.context.instanceId : void 0, v = e.context?.kind === "runtime" ? e.context.templateId : void 0, y = JSON.stringify(e.row?.values ?? null), b = JSON.stringify(e.row?.initialValues ?? null), x = t ? e.row ? e.row.values[t.fieldKey] : e.formData[t.fieldKey] : void 0, S = I(x), C = i(() => ae(x), [S]), w = C.length > 0, T = t ? JSON.stringify({
|
|
30
31
|
bindings: t.dataSource.bindings.map((t) => t.from.kind === "FIELD" ? {
|
|
31
32
|
fieldKey: t.from.fieldKey,
|
|
32
33
|
value: e.formData[t.from.fieldKey]
|
|
@@ -47,28 +48,28 @@ function K(e) {
|
|
|
47
48
|
g,
|
|
48
49
|
v,
|
|
49
50
|
e.readonly
|
|
50
|
-
]), D = t ? (e.initialFormData !== void 0 || e.initialValue !== void 0) &&
|
|
51
|
+
]), D = t ? (e.initialFormData !== void 0 || e.initialValue !== void 0) && I(e.initialValue) !== S : !1, ee = t ? e.initialFormData !== void 0 && t.dataSource.bindings.some((t) => t.from.kind === "FIELD" ? I(e.initialFormData?.[t.from.fieldKey]) !== I(e.formData[t.from.fieldKey]) : t.from.kind === "ROW_FIELD" && e.row?.initialValues ? I(e.row.initialValues[t.from.columnKey]) !== I(e.row.values[t.from.columnKey]) : !1) : !1, O = !(!c && !w || !D && !ee), k = !!(t && E && O && w), A = ye({
|
|
51
52
|
hasSnapshot: !!c,
|
|
52
53
|
hasValue: w,
|
|
53
54
|
isStale: O,
|
|
54
55
|
readonly: e.readonly
|
|
55
|
-
}), j = !!(t && E && t.type !== "autocomplete"), N = be(O, j && t !== null &&
|
|
56
|
+
}), j = !!(t && E && t.type !== "autocomplete"), N = be(O, j && t !== null && ce(t, e.formData, e.row?.values).length > 0), [P, F] = o([]), [L, se] = o(""), [R, z] = o(null), [B, ue] = o(null), [pe, V] = o(() => t ? j ? N : A : "IDLE"), [me, H] = o(null), U = a(0), W = a(0), G = a(0), K = a(null), q = a(null), J = a({
|
|
56
57
|
cursor: null,
|
|
57
58
|
searchText: ""
|
|
58
|
-
}), Y = i(() => we(e.formData), [f]), X = i(() => e.row ? we(e.row.values) : void 0, [y]), Te = i(() => M(d,
|
|
59
|
+
}), Y = i(() => we(e.formData), [f]), X = i(() => e.row ? we(e.row.values) : void 0, [y]), Te = i(() => M(d, P), [P, d]), Ee = B && B.signature === T ? B : null, De = k && !Ee, Oe = ve({
|
|
59
60
|
options: Te,
|
|
60
61
|
resolution: Ee,
|
|
61
62
|
resolvePending: De,
|
|
62
63
|
value: x
|
|
63
64
|
}), Z = n((n, r) => {
|
|
64
65
|
if (!t || !E) return;
|
|
65
|
-
let i =
|
|
66
|
-
|
|
66
|
+
let i = W.current + 1;
|
|
67
|
+
W.current = i, J.current = {
|
|
67
68
|
cursor: r,
|
|
68
69
|
searchText: n
|
|
69
|
-
},
|
|
70
|
+
}, K.current?.abort();
|
|
70
71
|
let a = new AbortController();
|
|
71
|
-
|
|
72
|
+
K.current = a, V(N), H(null), (E.kind === "preview" ? te({
|
|
72
73
|
cursor: r,
|
|
73
74
|
fieldKey: s,
|
|
74
75
|
formData: Y,
|
|
@@ -77,7 +78,7 @@ function K(e) {
|
|
|
77
78
|
searchText: n,
|
|
78
79
|
signal: a.signal,
|
|
79
80
|
uiSchema: e.uiSchema
|
|
80
|
-
}) :
|
|
81
|
+
}) : oe({
|
|
81
82
|
cursor: r,
|
|
82
83
|
fieldKey: s,
|
|
83
84
|
formData: Y,
|
|
@@ -87,14 +88,14 @@ function K(e) {
|
|
|
87
88
|
signal: a.signal,
|
|
88
89
|
templateId: E.templateId ?? null
|
|
89
90
|
})).then((e) => {
|
|
90
|
-
Ce(a,
|
|
91
|
-
let n =
|
|
91
|
+
Ce(a, W, i) || (F((t) => {
|
|
92
|
+
let n = le(x, t);
|
|
92
93
|
return M(n, r ? t : [], e.options);
|
|
93
|
-
}),
|
|
94
|
+
}), z(e.nextCursor), H(null), U.current = r ? U.current + e.options.length : e.options.length, e.nextCursor && e.options.length > 0 && U.current < ge && ke.current(n, e.nextCursor), V(e.waitingForFieldKeys.length ? "WAITING_FOR_DEPENDENCIES" : "VALID"));
|
|
94
95
|
}).catch((e) => {
|
|
95
|
-
if (Ce(a,
|
|
96
|
-
let t =
|
|
97
|
-
|
|
96
|
+
if (Ce(a, W, i)) return;
|
|
97
|
+
let t = ie(e) ?? "選項來源暫時無法使用。", n = re(e);
|
|
98
|
+
H(t), V(xe(!!(n && _e.includes(n)), w));
|
|
98
99
|
});
|
|
99
100
|
}, [
|
|
100
101
|
S,
|
|
@@ -107,14 +108,14 @@ function K(e) {
|
|
|
107
108
|
X,
|
|
108
109
|
m,
|
|
109
110
|
h
|
|
110
|
-
]),
|
|
111
|
-
|
|
112
|
-
let
|
|
111
|
+
]), ke = a(Z);
|
|
112
|
+
ke.current = Z;
|
|
113
|
+
let Ae = n(() => {
|
|
113
114
|
if (!t || !E || C.length === 0) return;
|
|
114
|
-
let n = T, r =
|
|
115
|
-
|
|
115
|
+
let n = T, r = G.current + 1;
|
|
116
|
+
G.current = r, q.current?.abort();
|
|
116
117
|
let i = new AbortController();
|
|
117
|
-
|
|
118
|
+
q.current = i, H(null), (E.kind === "preview" ? ne({
|
|
118
119
|
fieldKey: s,
|
|
119
120
|
formData: Y,
|
|
120
121
|
rowValues: X,
|
|
@@ -131,12 +132,12 @@ function K(e) {
|
|
|
131
132
|
templateId: E.templateId ?? null,
|
|
132
133
|
values: C
|
|
133
134
|
})).then((e) => {
|
|
134
|
-
Ce(i,
|
|
135
|
+
Ce(i, G, r) || (e.waitingForFieldKeys.length ? V("WAITING_FOR_DEPENDENCIES") : (F((t) => M(t, e.options)), ue({
|
|
135
136
|
signature: n,
|
|
136
137
|
unresolvedValues: e.unresolvedValues
|
|
137
|
-
}),
|
|
138
|
+
}), V("VALID")));
|
|
138
139
|
}).catch((e) => {
|
|
139
|
-
Ce(i,
|
|
140
|
+
Ce(i, G, r) || (V("UNAVAILABLE"), H(ie(e) ?? "選項來源暫時無法使用。"));
|
|
140
141
|
});
|
|
141
142
|
}, [
|
|
142
143
|
T,
|
|
@@ -148,9 +149,9 @@ function K(e) {
|
|
|
148
149
|
m,
|
|
149
150
|
C,
|
|
150
151
|
h
|
|
151
|
-
]),
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
]), Q = a(Ae);
|
|
153
|
+
Q.current = Ae, r(() => {
|
|
154
|
+
W.current += 1, K.current?.abort(), F((e) => le(x, e)), z((e) => e === null ? e : null), se((e) => e && ""), H((e) => e && null), t ? j ? ke.current("", null) : V(A) : V("IDLE");
|
|
154
155
|
}, [
|
|
155
156
|
j,
|
|
156
157
|
l,
|
|
@@ -163,24 +164,24 @@ function K(e) {
|
|
|
163
164
|
A,
|
|
164
165
|
u
|
|
165
166
|
]), r(() => {
|
|
166
|
-
k &&
|
|
167
|
+
k && Q.current();
|
|
167
168
|
}, [
|
|
168
169
|
T,
|
|
169
170
|
E,
|
|
170
171
|
k
|
|
171
172
|
]), r(() => () => {
|
|
172
|
-
|
|
173
|
+
K.current?.abort(), q.current?.abort();
|
|
173
174
|
}, []);
|
|
174
175
|
let je = n((e) => {
|
|
175
|
-
|
|
176
|
+
se(e), F((e) => le(x, e)), z(null), Z(e, null);
|
|
176
177
|
}, [Z]), Me = n(() => {
|
|
177
|
-
|
|
178
|
+
R && Z(L, R);
|
|
178
179
|
}, [
|
|
179
180
|
Z,
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
R,
|
|
182
|
+
L
|
|
182
183
|
]), Ne = n(() => {
|
|
183
|
-
E && (Z(
|
|
184
|
+
E && (Z(J.current.searchText, J.current.cursor), k && Q.current());
|
|
184
185
|
}, [
|
|
185
186
|
E,
|
|
186
187
|
Z,
|
|
@@ -188,9 +189,9 @@ function K(e) {
|
|
|
188
189
|
]);
|
|
189
190
|
return t ? {
|
|
190
191
|
canRetry: !!E,
|
|
191
|
-
error:
|
|
192
|
+
error: me,
|
|
192
193
|
hasValue: w,
|
|
193
|
-
hasNextPage: !!
|
|
194
|
+
hasNextPage: !!R,
|
|
194
195
|
invalidValues: Oe,
|
|
195
196
|
onReachBottom: Me,
|
|
196
197
|
onSearch: je,
|
|
@@ -199,11 +200,11 @@ function K(e) {
|
|
|
199
200
|
status: Se({
|
|
200
201
|
invalidValues: Oe,
|
|
201
202
|
resolvePending: De,
|
|
202
|
-
status:
|
|
203
|
+
status: pe
|
|
203
204
|
})
|
|
204
|
-
} :
|
|
205
|
+
} : he;
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
+
function J(e) {
|
|
207
208
|
switch (e.status) {
|
|
208
209
|
case "WAITING_FOR_DEPENDENCIES": return "請先填寫相依欄位。";
|
|
209
210
|
case "STALE": return "選項需要重新載入或驗證。";
|
|
@@ -213,15 +214,15 @@ function q(e) {
|
|
|
213
214
|
default: return e.error;
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
|
-
function
|
|
217
|
+
function Y(e) {
|
|
217
218
|
return e.hasValue && e.status !== "VALID";
|
|
218
219
|
}
|
|
219
|
-
function
|
|
220
|
-
let t = e.filter(
|
|
220
|
+
function X(e) {
|
|
221
|
+
let t = e.filter(Y);
|
|
221
222
|
return t.length === 0 ? null : t.every((e) => e.status === "LOADING" || e.status === "STALE") ? "選項驗證中,請稍候再送出。" : "請先完成動態選項驗證。";
|
|
222
223
|
}
|
|
223
224
|
function ve(e) {
|
|
224
|
-
return e.resolution ? e.resolution.unresolvedValues : e.resolvePending ?
|
|
225
|
+
return e.resolution ? e.resolution.unresolvedValues : e.resolvePending ? K : z(e.value, e.options);
|
|
225
226
|
}
|
|
226
227
|
function ye(e) {
|
|
227
228
|
return e.isStale ? "STALE" : e.hasSnapshot ? "VALID" : e.readonly && e.hasValue ? "UNAVAILABLE" : "IDLE";
|
|
@@ -244,35 +245,34 @@ function we(e) {
|
|
|
244
245
|
[t]: n
|
|
245
246
|
}, {});
|
|
246
247
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
function X(e) {
|
|
248
|
+
// src/views/forms/renderer/form-field-link.ts
|
|
249
|
+
var Te = /\s/u;
|
|
250
|
+
function Ee(e) {
|
|
251
251
|
return [...e].some((e) => {
|
|
252
252
|
let t = e.codePointAt(0) ?? 0;
|
|
253
|
-
return t <= 32 || t >= 127 && t <= 160 ||
|
|
253
|
+
return t <= 32 || t >= 127 && t <= 160 || Te.test(e);
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
var
|
|
257
|
-
function
|
|
258
|
-
return typeof e != "string" || !e || e.includes("\\") ||
|
|
256
|
+
var De = /^https?:\/\//iu;
|
|
257
|
+
function Oe(e) {
|
|
258
|
+
return typeof e != "string" || !e || e.includes("\\") || Ee(e) ? null : e.startsWith("/") ? !e.startsWith("//") && ke(e) ? {
|
|
259
259
|
external: !1,
|
|
260
260
|
href: e
|
|
261
|
-
} : null :
|
|
261
|
+
} : null : De.test(e) && Ae(e) ? {
|
|
262
262
|
external: !0,
|
|
263
263
|
href: e
|
|
264
264
|
} : null;
|
|
265
265
|
}
|
|
266
|
-
var
|
|
267
|
-
function
|
|
266
|
+
var Z = "http://placeholder.invalid";
|
|
267
|
+
function ke(e) {
|
|
268
268
|
try {
|
|
269
|
-
let t = new URL(e,
|
|
270
|
-
return t.origin ===
|
|
269
|
+
let t = new URL(e, Z);
|
|
270
|
+
return t.origin === Z && !t.pathname.startsWith("//");
|
|
271
271
|
} catch {
|
|
272
272
|
return !1;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function Ae(e) {
|
|
276
276
|
try {
|
|
277
277
|
let t = new URL(e);
|
|
278
278
|
return (t.protocol === "http:" || t.protocol === "https:") && !!t.hostname && !t.username && !t.password;
|
|
@@ -295,17 +295,17 @@ async function Q(e, t, n = {}) {
|
|
|
295
295
|
skippedIds: []
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
|
-
let a = e.slice(0, r), o = await
|
|
298
|
+
let a = e.slice(0, r), o = await Me(a, i, (e) => t([e]));
|
|
299
299
|
return {
|
|
300
300
|
failedIds: a.filter((e, t) => o[t].status === "rejected"),
|
|
301
301
|
profiles: o.flatMap((e) => e.status === "fulfilled" ? e.value : []),
|
|
302
302
|
skippedIds: e.slice(r)
|
|
303
303
|
};
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function je(e, t) {
|
|
306
306
|
return e.filter((e) => !t.has(e));
|
|
307
307
|
}
|
|
308
|
-
async function
|
|
308
|
+
async function Me(e, t, n) {
|
|
309
309
|
let r = [], i = 0;
|
|
310
310
|
async function a() {
|
|
311
311
|
for (; i < e.length;) {
|
|
@@ -321,46 +321,44 @@ async function Ae(e, t, n) {
|
|
|
321
321
|
}
|
|
322
322
|
return await Promise.all(Array.from({ length: Math.min(t, e.length) }, a)), r;
|
|
323
323
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
function Me(e) {
|
|
324
|
+
// src/views/forms/renderer/member-field-options.ts
|
|
325
|
+
var Ne = "未知會員";
|
|
326
|
+
function Pe(e) {
|
|
328
327
|
return {
|
|
329
328
|
id: e.memberId,
|
|
330
329
|
name: t(e.name, e.email)
|
|
331
330
|
};
|
|
332
331
|
}
|
|
333
|
-
function
|
|
332
|
+
function Fe(e) {
|
|
334
333
|
return {
|
|
335
334
|
id: e,
|
|
336
|
-
name:
|
|
335
|
+
name: Ne,
|
|
337
336
|
unresolved: !0
|
|
338
337
|
};
|
|
339
338
|
}
|
|
340
|
-
function
|
|
339
|
+
function Ie(e, t) {
|
|
341
340
|
let n = new Map(t.filter((e) => !e.unresolved).map((e) => [e.id, e])), r = new Set(e.map((e) => e.id)), i = t.filter((e, n) => !r.has(e.id) && t.findIndex((t) => t.id === e.id) === n), a = e.map((e) => (e.unresolved ? n.get(e.id) : void 0) ?? e);
|
|
342
341
|
return i.length > 0 || a.some((t, n) => t !== e[n]) ? [...a, ...i] : e;
|
|
343
342
|
}
|
|
344
|
-
function
|
|
343
|
+
function Le(e, t) {
|
|
345
344
|
let n = new Set(t.filter((e) => !e.unresolved).map((e) => e.id));
|
|
346
|
-
return
|
|
345
|
+
return U(e).filter((e) => !n.has(e));
|
|
347
346
|
}
|
|
348
|
-
function
|
|
349
|
-
return
|
|
347
|
+
function Re(e, t) {
|
|
348
|
+
return U(e).map((e) => t.find((t) => t.id === e) ?? Fe(e));
|
|
350
349
|
}
|
|
351
|
-
function
|
|
350
|
+
function ze(e, t) {
|
|
352
351
|
if (e.length !== 0) return t ? e.map((e) => e.id) : e[0]?.id;
|
|
353
352
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
let [d, f] = o([]), [p, m] = o([]), [h, g] = o(!1), _ = a(0), v = a(/* @__PURE__ */ new Set()), y = Fe(u, d).join("\n");
|
|
353
|
+
// src/views/forms/renderer/member-field.tsx
|
|
354
|
+
function Be({ multiple: e, name: t, onChange: n, placeholder: i, readonly: c, size: l, value: u }) {
|
|
355
|
+
let [d, f] = o([]), [p, m] = o([]), [h, g] = o(!1), _ = a(0), v = a(/* @__PURE__ */ new Set()), y = Le(u, d).join("\n");
|
|
358
356
|
r(() => {
|
|
359
|
-
let e =
|
|
357
|
+
let e = je(y ? y.split("\n") : [], v.current), t = !1;
|
|
360
358
|
return e.length === 0 ? () => void 0 : (Q(e, b).then(({ profiles: n, skippedIds: r }) => {
|
|
361
359
|
if (t) return;
|
|
362
|
-
let i = n.map(
|
|
363
|
-
a.filter((e) => !r.includes(e.id)).forEach((e) => v.current.add(e.id)), f((e) =>
|
|
360
|
+
let i = n.map(Pe), a = e.filter((e) => !i.some((t) => t.id === e)).map(Fe);
|
|
361
|
+
a.filter((e) => !r.includes(e.id)).forEach((e) => v.current.add(e.id)), f((e) => Ie(e, [...i, ...a]));
|
|
364
362
|
}), () => {
|
|
365
363
|
t = !0;
|
|
366
364
|
});
|
|
@@ -369,15 +367,15 @@ function Re({ multiple: e, name: t, onChange: n, placeholder: i, readonly: c, si
|
|
|
369
367
|
let t = _.current + 1;
|
|
370
368
|
_.current = t, g(!0);
|
|
371
369
|
try {
|
|
372
|
-
let n = (await x(e)).map(
|
|
373
|
-
_.current === t && (m(n), f((e) =>
|
|
370
|
+
let n = (await x(e)).map(Pe);
|
|
371
|
+
_.current === t && (m(n), f((e) => Ie(e, n)));
|
|
374
372
|
} catch {
|
|
375
373
|
_.current === t && m([]);
|
|
376
374
|
} finally {
|
|
377
375
|
_.current === t && g(!1);
|
|
378
376
|
}
|
|
379
377
|
}
|
|
380
|
-
let w =
|
|
378
|
+
let w = Re(u, d), T = [...Ie(w, p)], E = {
|
|
381
379
|
asyncData: !0,
|
|
382
380
|
clearSearchText: !0,
|
|
383
381
|
disabled: c,
|
|
@@ -405,40 +403,146 @@ function Re({ multiple: e, name: t, onChange: n, placeholder: i, readonly: c, si
|
|
|
405
403
|
return e ? /* @__PURE__ */ S(s, {
|
|
406
404
|
...E,
|
|
407
405
|
mode: "multiple",
|
|
408
|
-
onChange: (e) => n(
|
|
406
|
+
onChange: (e) => n(ze(e, !0)),
|
|
409
407
|
value: [...w]
|
|
410
408
|
}) : /* @__PURE__ */ S(s, {
|
|
411
409
|
...E,
|
|
412
410
|
mode: "single",
|
|
413
|
-
onChange: (e) => n(
|
|
411
|
+
onChange: (e) => n(ze(e ? [e] : [], !1)),
|
|
414
412
|
value: w[0] ?? null
|
|
415
413
|
});
|
|
416
414
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
415
|
+
// src/views/forms/renderer/org-unit-field-options.ts
|
|
416
|
+
var Ve = "未知組織", He = "(已刪除)";
|
|
417
|
+
function Ue(e) {
|
|
418
|
+
return {
|
|
419
|
+
id: e.id,
|
|
420
|
+
name: e.deleted ? `${e.name}${He}` : e.name
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
function We(e) {
|
|
424
|
+
return {
|
|
425
|
+
id: e,
|
|
426
|
+
name: e,
|
|
427
|
+
unresolved: !0
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
function Ge(e) {
|
|
431
|
+
return {
|
|
432
|
+
id: e,
|
|
433
|
+
name: Ve,
|
|
434
|
+
unresolved: !0
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
function Ke(e) {
|
|
438
|
+
return typeof e == "string" && e.trim() ? e : null;
|
|
439
|
+
}
|
|
440
|
+
function $(e) {
|
|
441
|
+
return e.toLowerCase();
|
|
442
|
+
}
|
|
443
|
+
function qe(e, t) {
|
|
444
|
+
return $(e) === $(t);
|
|
445
|
+
}
|
|
446
|
+
function Je(e, t) {
|
|
447
|
+
let n = Ke(e);
|
|
448
|
+
return n === null ? null : t.find((e) => qe(e.id, n)) ?? We(n);
|
|
449
|
+
}
|
|
450
|
+
function Ye(e, t) {
|
|
451
|
+
let n = Ke(e);
|
|
452
|
+
return n !== null && !t.some((e) => qe(e.id, n)) ? n : null;
|
|
453
|
+
}
|
|
454
|
+
function Xe(e, t) {
|
|
455
|
+
let n = new Map(t.filter((e) => !e.unresolved).map((e) => [$(e.id), e])), r = new Set(e.map((e) => $(e.id))), i = t.filter((e, n) => !r.has($(e.id)) && t.findIndex((t) => qe(t.id, e.id)) === n), a = e.map((e) => (e.unresolved ? n.get($(e.id)) : void 0) ?? e);
|
|
456
|
+
return i.length > 0 || a.some((t, n) => t !== e[n]) ? [...a, ...i] : e;
|
|
457
|
+
}
|
|
458
|
+
function Ze(e) {
|
|
459
|
+
return e ? e.id : void 0;
|
|
460
|
+
}
|
|
461
|
+
// src/views/forms/renderer/org-unit-field.tsx
|
|
462
|
+
var Qe = "搜尋組織失敗,請稍後再試。";
|
|
463
|
+
function $e({ name: e, onChange: t, placeholder: n, readonly: i, size: c, value: l }) {
|
|
464
|
+
let [u, d] = o([]), [f, p] = o([]), [m, h] = o(!1), [g, _] = o(!1), y = a(0), b = Ye(l, u);
|
|
465
|
+
r(() => {
|
|
466
|
+
let e = !1;
|
|
467
|
+
return b === null ? () => void 0 : (W([b]).then((e) => {
|
|
468
|
+
let t = e.map(Ue);
|
|
469
|
+
return t.some((e) => e.id.toLowerCase() === b.toLowerCase()) ? t : [...t, Ge(b)];
|
|
470
|
+
}).catch(() => [Ge(b)]).then((t) => {
|
|
471
|
+
e || d((e) => Xe(e, t));
|
|
472
|
+
}), () => {
|
|
473
|
+
e = !0;
|
|
474
|
+
});
|
|
475
|
+
}, [b]);
|
|
476
|
+
async function x(e) {
|
|
477
|
+
let t = y.current + 1;
|
|
478
|
+
y.current = t, h(!0);
|
|
479
|
+
try {
|
|
480
|
+
let n = (await G(e)).map(Ue);
|
|
481
|
+
y.current === t && (p(n), _(!1), d((e) => Xe(e, n)));
|
|
482
|
+
} catch {
|
|
483
|
+
y.current === t && (p([]), _(!0));
|
|
484
|
+
} finally {
|
|
485
|
+
y.current === t && h(!1);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
let w = Je(l, u), T = [...Xe(w ? [w] : [], f)];
|
|
489
|
+
return /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S(s, {
|
|
490
|
+
asyncData: !0,
|
|
491
|
+
clearSearchText: !0,
|
|
492
|
+
disabled: i,
|
|
493
|
+
disabledOptionsFilter: !0,
|
|
494
|
+
emptyText: "沒有符合的組織",
|
|
495
|
+
globalPortal: !0,
|
|
496
|
+
inputProps: {
|
|
497
|
+
autoCapitalize: "none",
|
|
498
|
+
autoCorrect: "off",
|
|
499
|
+
name: e,
|
|
500
|
+
spellCheck: !1
|
|
501
|
+
},
|
|
502
|
+
loading: m,
|
|
503
|
+
loadingText: "搜尋組織中...",
|
|
504
|
+
mode: "single",
|
|
505
|
+
onChange: (e) => t(Ze(e ?? null)),
|
|
506
|
+
onSearch: x,
|
|
507
|
+
onVisibilityChange: (e) => {
|
|
508
|
+
e && (p([]), x(""));
|
|
509
|
+
},
|
|
510
|
+
options: T,
|
|
511
|
+
placeholder: n ?? "搜尋組織名稱",
|
|
512
|
+
readOnly: i,
|
|
513
|
+
searchDebounceTime: 300,
|
|
514
|
+
size: c,
|
|
515
|
+
value: w
|
|
516
|
+
}), g ? /* @__PURE__ */ S(v, {
|
|
517
|
+
color: "text-error",
|
|
518
|
+
variant: "caption",
|
|
519
|
+
children: Qe
|
|
520
|
+
}) : null] });
|
|
521
|
+
}
|
|
522
|
+
// src/views/forms/renderer/FormRendererView.tsx
|
|
523
|
+
var et = {
|
|
420
524
|
alignItems: "start",
|
|
421
525
|
display: "grid",
|
|
422
526
|
gap: 12,
|
|
423
527
|
gridTemplateColumns: "repeat(12, minmax(0, 1fr))"
|
|
424
|
-
},
|
|
528
|
+
}, tt = { gridColumn: "1 / -1" }, nt = {
|
|
425
529
|
alignItems: "start",
|
|
426
530
|
display: "grid",
|
|
427
531
|
gap: 8,
|
|
428
532
|
minWidth: 0
|
|
429
|
-
},
|
|
533
|
+
}, rt = {
|
|
430
534
|
minWidth: "100%",
|
|
431
535
|
width: "100%"
|
|
432
536
|
};
|
|
433
|
-
function
|
|
537
|
+
function it(e) {
|
|
434
538
|
e && (e.style.width = "100%");
|
|
435
539
|
}
|
|
436
|
-
function
|
|
540
|
+
function at({ dataSourceContext: e, dataSourceInitialValues: t, emptyText: n = "尚未建立欄位。", errors: s = {}, fieldAccess: c, fieldLabelMarkers: l, maxWidth: u, onChange: d, onDataSourceStateChange: f, onUploadAttachment: p, optionSnapshots: m, readonly: h = !1, schema: g, singleColumn: _ = !1, uiSchema: y, value: b }) {
|
|
437
541
|
let [x, C] = o(() => E(g.fields, b ?? {})), w = i(() => E(g.fields, b ?? x), [
|
|
438
542
|
x,
|
|
439
543
|
g.fields,
|
|
440
544
|
b
|
|
441
|
-
]), T = a(w), D = i(() => ue(g, y, w).filter((e) =>
|
|
545
|
+
]), T = a(w), D = i(() => ue(g, y, w).filter((e) => ot(c, e.fieldKey)?.visible !== !1), [
|
|
442
546
|
c,
|
|
443
547
|
g,
|
|
444
548
|
y,
|
|
@@ -458,10 +562,10 @@ function We({ dataSourceContext: e, dataSourceInitialValues: t, emptyText: n = "
|
|
|
458
562
|
}
|
|
459
563
|
return D.length ? /* @__PURE__ */ S("div", {
|
|
460
564
|
style: {
|
|
461
|
-
...
|
|
565
|
+
...et,
|
|
462
566
|
..._ ? { width: "100%" } : {}
|
|
463
567
|
},
|
|
464
|
-
children: D.map((n) => /* @__PURE__ */ S(
|
|
568
|
+
children: D.map((n) => /* @__PURE__ */ S(ct, {
|
|
465
569
|
dataSourceContext: e,
|
|
466
570
|
dataSourceInitialValues: t,
|
|
467
571
|
field: n,
|
|
@@ -473,35 +577,35 @@ function We({ dataSourceContext: e, dataSourceInitialValues: t, emptyText: n = "
|
|
|
473
577
|
onDataSourceStateChange: f,
|
|
474
578
|
onUploadAttachment: p,
|
|
475
579
|
optionSnapshots: m,
|
|
476
|
-
readonly:
|
|
580
|
+
readonly: st(ot(c, n.fieldKey), h),
|
|
477
581
|
schema: g,
|
|
478
582
|
style: {
|
|
479
|
-
...
|
|
480
|
-
gridColumn: `span ${_ ? 12 :
|
|
481
|
-
..._ && !
|
|
583
|
+
...nt,
|
|
584
|
+
gridColumn: `span ${_ ? 12 : Ot(n, y)}`,
|
|
585
|
+
..._ && !me(n) ? { maxWidth: u } : {}
|
|
482
586
|
},
|
|
483
587
|
value: w[n.fieldKey],
|
|
484
588
|
values: w,
|
|
485
589
|
uiSchema: y
|
|
486
590
|
}, n.fieldKey))
|
|
487
591
|
}) : /* @__PURE__ */ S("div", {
|
|
488
|
-
style:
|
|
592
|
+
style: et,
|
|
489
593
|
children: /* @__PURE__ */ S(v, {
|
|
490
594
|
color: "text-neutral",
|
|
491
|
-
style:
|
|
595
|
+
style: tt,
|
|
492
596
|
variant: "body",
|
|
493
597
|
children: g.fields.length > 0 ? "目前條件下沒有可填寫欄位。" : n
|
|
494
598
|
})
|
|
495
599
|
});
|
|
496
600
|
}
|
|
497
|
-
function
|
|
601
|
+
function ot(e, t) {
|
|
498
602
|
return e !== void 0 && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
499
603
|
}
|
|
500
|
-
function
|
|
604
|
+
function st(e, t) {
|
|
501
605
|
return e === void 0 ? t : !e.editable;
|
|
502
606
|
}
|
|
503
|
-
function
|
|
504
|
-
let x = j(o, s, y), w = m || A(o, s, y), T =
|
|
607
|
+
function ct({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors: a, field: o, fields: s, labelMarker: l, onChange: u, onDataSourceStateChange: d, onUploadAttachment: f, optionSnapshots: p, readonly: m, schema: h, style: g, value: _, values: y, uiSchema: b }) {
|
|
608
|
+
let x = j(o, s, y), w = m || A(o, s, y), T = q({
|
|
505
609
|
context: t,
|
|
506
610
|
field: o,
|
|
507
611
|
formData: y,
|
|
@@ -511,13 +615,13 @@ function qe({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
|
|
|
511
615
|
readonly: w,
|
|
512
616
|
schema: h,
|
|
513
617
|
uiSchema: b
|
|
514
|
-
}), E =
|
|
618
|
+
}), E = J(T), D = JSON.stringify({
|
|
515
619
|
hasValue: T.hasValue,
|
|
516
620
|
invalidValues: T.invalidValues,
|
|
517
621
|
status: T.status
|
|
518
622
|
});
|
|
519
623
|
return r(() => {
|
|
520
|
-
|
|
624
|
+
fe(o) && d?.(o.fieldKey, {
|
|
521
625
|
hasValue: T.hasValue,
|
|
522
626
|
invalidValues: T.invalidValues,
|
|
523
627
|
status: T.status
|
|
@@ -535,7 +639,7 @@ function qe({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
|
|
|
535
639
|
...l ? { labelOptionalMarker: l } : {},
|
|
536
640
|
name: o.fieldKey,
|
|
537
641
|
required: x,
|
|
538
|
-
children:
|
|
642
|
+
children: me(o) ? /* @__PURE__ */ S(yt, {
|
|
539
643
|
dataSourceContext: t,
|
|
540
644
|
dataSourceInitialValues: n,
|
|
541
645
|
errors: a,
|
|
@@ -548,7 +652,7 @@ function qe({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
|
|
|
548
652
|
uiSchema: b,
|
|
549
653
|
value: _,
|
|
550
654
|
values: y
|
|
551
|
-
}) :
|
|
655
|
+
}) : Tt(o, _, w, u, f, t, T)
|
|
552
656
|
}),
|
|
553
657
|
i ? /* @__PURE__ */ S(v, {
|
|
554
658
|
color: "text-error",
|
|
@@ -556,7 +660,7 @@ function qe({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
|
|
|
556
660
|
children: i
|
|
557
661
|
}) : null,
|
|
558
662
|
E ? /* @__PURE__ */ C("div", {
|
|
559
|
-
style:
|
|
663
|
+
style: ft,
|
|
560
664
|
children: [/* @__PURE__ */ S(v, {
|
|
561
665
|
color: T.status === "INVALID" || T.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
|
|
562
666
|
variant: "caption",
|
|
@@ -572,46 +676,46 @@ function qe({ dataSourceContext: t, dataSourceInitialValues: n, error: i, errors
|
|
|
572
676
|
]
|
|
573
677
|
});
|
|
574
678
|
}
|
|
575
|
-
var
|
|
679
|
+
var lt = "(另開新分頁)", ut = "另開新分頁", dt = {
|
|
576
680
|
color: "inherit",
|
|
577
681
|
textDecoration: "underline",
|
|
578
682
|
wordBreak: "break-all"
|
|
579
|
-
},
|
|
683
|
+
}, ft = {
|
|
580
684
|
alignItems: "center",
|
|
581
685
|
display: "flex",
|
|
582
686
|
gap: 8
|
|
583
|
-
},
|
|
687
|
+
}, pt = {
|
|
584
688
|
display: "grid",
|
|
585
689
|
gap: 8,
|
|
586
690
|
minWidth: 0,
|
|
587
691
|
width: "100%"
|
|
588
|
-
},
|
|
692
|
+
}, mt = {
|
|
589
693
|
display: "flex",
|
|
590
694
|
justifyContent: "flex-start"
|
|
591
|
-
},
|
|
695
|
+
}, ht = {
|
|
592
696
|
maxWidth: "100%",
|
|
593
697
|
overflowX: "auto"
|
|
594
|
-
},
|
|
698
|
+
}, gt = 160, _t = 56, vt = {
|
|
595
699
|
display: "grid",
|
|
596
700
|
gap: 4,
|
|
597
701
|
minWidth: 0
|
|
598
702
|
};
|
|
599
|
-
function
|
|
600
|
-
let _ =
|
|
703
|
+
function yt({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field: i, onChange: s, onDataSourceStateChange: l, optionSnapshots: u, readonly: d, schema: f, uiSchema: p, value: m, values: g }) {
|
|
704
|
+
let _ = R(m), v = se(i), y = a(0), [b, x] = o(() => _.map(() => St(y)));
|
|
601
705
|
r(() => {
|
|
602
|
-
b.length !== _.length && x(_.map(() =>
|
|
706
|
+
b.length !== _.length && x(_.map(() => St(y)));
|
|
603
707
|
}, [b.length, _.length]);
|
|
604
708
|
function E(e) {
|
|
605
709
|
s(i.fieldKey, e);
|
|
606
710
|
}
|
|
607
711
|
function D() {
|
|
608
|
-
x([...b,
|
|
712
|
+
x([...b, St(y)]), E([..._, ee(i.columns)]);
|
|
609
713
|
}
|
|
610
714
|
function O(e) {
|
|
611
715
|
x(b.filter((t, n) => n !== e)), E(_.filter((t, n) => n !== e));
|
|
612
716
|
}
|
|
613
717
|
function k(e, t, n) {
|
|
614
|
-
E(_.map((r, i) => i === e ?
|
|
718
|
+
E(_.map((r, i) => i === e ? Ct(r, t, n) : r));
|
|
615
719
|
}
|
|
616
720
|
let A = _.map((e, t) => ({
|
|
617
721
|
...e,
|
|
@@ -619,18 +723,18 @@ function it({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field
|
|
|
619
723
|
key: b[t] ?? `row-${t}`
|
|
620
724
|
})), j = i.columns.map((r) => ({
|
|
621
725
|
key: r.fieldKey,
|
|
622
|
-
render: (a) => /* @__PURE__ */ S(
|
|
726
|
+
render: (a) => /* @__PURE__ */ S(bt, {
|
|
623
727
|
column: r,
|
|
624
728
|
dataSourceContext: e,
|
|
625
|
-
error: n[
|
|
729
|
+
error: n[L(i.fieldKey, a.index, r.fieldKey)] ?? null,
|
|
626
730
|
fieldPath: `${i.fieldKey}.${r.fieldKey}`,
|
|
627
731
|
formData: g,
|
|
628
732
|
initialFormData: t,
|
|
629
|
-
initialRowValues:
|
|
733
|
+
initialRowValues: xt(t?.[i.fieldKey], a.index),
|
|
630
734
|
onChange: (e) => k(a.index, r.fieldKey, e),
|
|
631
735
|
onDataSourceStateChange: l,
|
|
632
736
|
optionSnapshots: u,
|
|
633
|
-
path:
|
|
737
|
+
path: L(i.fieldKey, a.index, r.fieldKey),
|
|
634
738
|
readonly: d,
|
|
635
739
|
rowValues: _[a.index] ?? {},
|
|
636
740
|
schema: f,
|
|
@@ -649,11 +753,11 @@ function it({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field
|
|
|
649
753
|
width: 56
|
|
650
754
|
};
|
|
651
755
|
return /* @__PURE__ */ C("div", {
|
|
652
|
-
style:
|
|
756
|
+
style: pt,
|
|
653
757
|
children: [/* @__PURE__ */ S("div", {
|
|
654
|
-
style:
|
|
758
|
+
style: ht,
|
|
655
759
|
children: /* @__PURE__ */ S("div", {
|
|
656
|
-
style: { minWidth: i.columns.length *
|
|
760
|
+
style: { minWidth: i.columns.length * gt + (M ? _t : 0) },
|
|
657
761
|
children: /* @__PURE__ */ S(h, {
|
|
658
762
|
...M ? { actions: M } : {},
|
|
659
763
|
columns: j,
|
|
@@ -664,7 +768,7 @@ function it({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field
|
|
|
664
768
|
})
|
|
665
769
|
})
|
|
666
770
|
}), d ? null : /* @__PURE__ */ S("div", {
|
|
667
|
-
style:
|
|
771
|
+
style: mt,
|
|
668
772
|
children: /* @__PURE__ */ S(c, {
|
|
669
773
|
disabled: _.length >= v.maxRows,
|
|
670
774
|
icon: w,
|
|
@@ -678,14 +782,14 @@ function it({ dataSourceContext: e, dataSourceInitialValues: t, errors: n, field
|
|
|
678
782
|
})]
|
|
679
783
|
});
|
|
680
784
|
}
|
|
681
|
-
function
|
|
682
|
-
let _ =
|
|
785
|
+
function bt({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData: a, initialFormData: o, initialRowValues: s, onChange: l, onDataSourceStateChange: u, optionSnapshots: d, path: f, readonly: p, rowValues: m, schema: h, uiSchema: g }) {
|
|
786
|
+
let _ = wt(m, e.fieldKey), y = q({
|
|
683
787
|
context: t,
|
|
684
788
|
field: e,
|
|
685
789
|
fieldPath: i,
|
|
686
790
|
formData: a,
|
|
687
791
|
initialFormData: o,
|
|
688
|
-
initialValue: s ?
|
|
792
|
+
initialValue: s ? wt(s, e.fieldKey) : void 0,
|
|
689
793
|
optionSnapshots: d,
|
|
690
794
|
readonly: p,
|
|
691
795
|
row: {
|
|
@@ -695,13 +799,13 @@ function at({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData:
|
|
|
695
799
|
schema: h,
|
|
696
800
|
snapshotKey: f,
|
|
697
801
|
uiSchema: g
|
|
698
|
-
}), b =
|
|
802
|
+
}), b = J(y), x = JSON.stringify({
|
|
699
803
|
hasValue: y.hasValue,
|
|
700
804
|
invalidValues: y.invalidValues,
|
|
701
805
|
status: y.status
|
|
702
806
|
});
|
|
703
807
|
return r(() => {
|
|
704
|
-
if (
|
|
808
|
+
if (fe(e)) return u?.(f, {
|
|
705
809
|
hasValue: y.hasValue,
|
|
706
810
|
invalidValues: y.invalidValues,
|
|
707
811
|
status: y.status
|
|
@@ -718,16 +822,16 @@ function at({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData:
|
|
|
718
822
|
x
|
|
719
823
|
]), /* @__PURE__ */ C("div", {
|
|
720
824
|
"data-form-field-key": f,
|
|
721
|
-
style:
|
|
825
|
+
style: vt,
|
|
722
826
|
children: [
|
|
723
|
-
|
|
827
|
+
Tt(e, _, p, (e, t) => l(t), void 0, t, y, "sub"),
|
|
724
828
|
n ? /* @__PURE__ */ S(v, {
|
|
725
829
|
color: "text-error",
|
|
726
830
|
variant: "caption",
|
|
727
831
|
children: n
|
|
728
832
|
}) : null,
|
|
729
833
|
b ? /* @__PURE__ */ C("div", {
|
|
730
|
-
style:
|
|
834
|
+
style: ft,
|
|
731
835
|
children: [/* @__PURE__ */ S(v, {
|
|
732
836
|
color: y.status === "INVALID" || y.status === "UNAVAILABLE" ? "text-error" : "text-neutral",
|
|
733
837
|
variant: "caption",
|
|
@@ -743,38 +847,38 @@ function at({ column: e, dataSourceContext: t, error: n, fieldPath: i, formData:
|
|
|
743
847
|
]
|
|
744
848
|
});
|
|
745
849
|
}
|
|
746
|
-
function
|
|
747
|
-
return
|
|
850
|
+
function xt(e, t) {
|
|
851
|
+
return R(e)[t];
|
|
748
852
|
}
|
|
749
|
-
function
|
|
853
|
+
function St(e) {
|
|
750
854
|
return e.current += 1, `table-row-${e.current}`;
|
|
751
855
|
}
|
|
752
|
-
function
|
|
753
|
-
return n === void 0 || !
|
|
856
|
+
function Ct(e, t, n) {
|
|
857
|
+
return n === void 0 || !V(n) ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)) : {
|
|
754
858
|
...e,
|
|
755
859
|
[t]: n
|
|
756
860
|
};
|
|
757
861
|
}
|
|
758
|
-
function
|
|
862
|
+
function wt(e, t) {
|
|
759
863
|
if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
760
864
|
}
|
|
761
|
-
function
|
|
762
|
-
return
|
|
865
|
+
function Tt(e, t, n, r, i, a, o, s = "main") {
|
|
866
|
+
return fe(e) ? Dt(e, t, n, r, a, o, s) : Et(e, t, n, r, i, s);
|
|
763
867
|
}
|
|
764
|
-
function
|
|
765
|
-
let o = n && (e.type === "text" || e.type === "textarea") && e.displayAs === "link" ?
|
|
868
|
+
function Et(e, t, n, r, i, a = "main") {
|
|
869
|
+
let o = n && (e.type === "text" || e.type === "textarea") && e.displayAs === "link" ? Oe(t) : null;
|
|
766
870
|
if (o) return /* @__PURE__ */ S(v, {
|
|
767
871
|
color: "text-brand",
|
|
768
872
|
component: "span",
|
|
769
873
|
variant: "body",
|
|
770
874
|
children: /* @__PURE__ */ S("a", {
|
|
771
875
|
href: o.href,
|
|
772
|
-
style:
|
|
876
|
+
style: dt,
|
|
773
877
|
...o.external ? {
|
|
774
|
-
"aria-label": `${o.href}${
|
|
878
|
+
"aria-label": `${o.href}${lt}`,
|
|
775
879
|
rel: "noopener noreferrer",
|
|
776
880
|
target: "_blank",
|
|
777
|
-
title:
|
|
881
|
+
title: ut
|
|
778
882
|
} : {},
|
|
779
883
|
children: o.href
|
|
780
884
|
})
|
|
@@ -783,10 +887,10 @@ function dt(e, t, n, r, i, a = "main") {
|
|
|
783
887
|
onChange: (t) => r(e.fieldKey, t.target.value),
|
|
784
888
|
placeholder: e.placeholder ?? "請輸入多行文字",
|
|
785
889
|
readOnly: n,
|
|
786
|
-
ref:
|
|
890
|
+
ref: it,
|
|
787
891
|
rows: 3,
|
|
788
|
-
style:
|
|
789
|
-
value:
|
|
892
|
+
style: rt,
|
|
893
|
+
value: kt(t)
|
|
790
894
|
});
|
|
791
895
|
if (e.type === "boolean") return /* @__PURE__ */ S(_, {
|
|
792
896
|
checked: t === !0,
|
|
@@ -795,8 +899,8 @@ function dt(e, t, n, r, i, a = "main") {
|
|
|
795
899
|
onChange: (t) => r(e.fieldKey, t.target.checked),
|
|
796
900
|
size: a
|
|
797
901
|
});
|
|
798
|
-
if (
|
|
799
|
-
let i = e.options.map(
|
|
902
|
+
if (pe(e) && e.type === "checkbox") {
|
|
903
|
+
let i = e.options.map(F);
|
|
800
904
|
return /* @__PURE__ */ S(m, {
|
|
801
905
|
mode: "multiple",
|
|
802
906
|
onChange: (t) => r(e.fieldKey, t?.length ? t.map((e) => e.id) : void 0),
|
|
@@ -804,21 +908,21 @@ function dt(e, t, n, r, i, a = "main") {
|
|
|
804
908
|
placeholder: e.placeholder ?? "請選擇一或多個選項",
|
|
805
909
|
readOnly: n,
|
|
806
910
|
size: a,
|
|
807
|
-
value: i.filter((e) =>
|
|
911
|
+
value: i.filter((e) => At(t).includes(e.id))
|
|
808
912
|
});
|
|
809
913
|
}
|
|
810
|
-
if (
|
|
811
|
-
let i = e.options.map(
|
|
914
|
+
if (pe(e)) {
|
|
915
|
+
let i = e.options.map(F);
|
|
812
916
|
return /* @__PURE__ */ S(m, {
|
|
813
917
|
onChange: (t) => r(e.fieldKey, t?.id ?? void 0),
|
|
814
918
|
options: i,
|
|
815
919
|
placeholder: e.placeholder ?? "請選擇",
|
|
816
920
|
readOnly: n,
|
|
817
921
|
size: a,
|
|
818
|
-
value:
|
|
922
|
+
value: B(i, kt(t))
|
|
819
923
|
});
|
|
820
924
|
}
|
|
821
|
-
return e.type === "member" ? /* @__PURE__ */ S(
|
|
925
|
+
return e.type === "member" ? /* @__PURE__ */ S(Be, {
|
|
822
926
|
multiple: e.multiple === !0,
|
|
823
927
|
name: e.fieldKey,
|
|
824
928
|
onChange: (t) => r(e.fieldKey, t),
|
|
@@ -826,6 +930,13 @@ function dt(e, t, n, r, i, a = "main") {
|
|
|
826
930
|
readonly: n,
|
|
827
931
|
size: a,
|
|
828
932
|
value: t
|
|
933
|
+
}) : e.type === "org_unit" ? /* @__PURE__ */ S($e, {
|
|
934
|
+
name: e.fieldKey,
|
|
935
|
+
onChange: (t) => r(e.fieldKey, t),
|
|
936
|
+
placeholder: e.placeholder ?? Mt(e.type),
|
|
937
|
+
readonly: n,
|
|
938
|
+
size: a,
|
|
939
|
+
value: t
|
|
829
940
|
}) : e.type === "file_upload" ? /* @__PURE__ */ S(y, {
|
|
830
941
|
accept: e.acceptedMimeTypes?.join(","),
|
|
831
942
|
disabled: n,
|
|
@@ -844,9 +955,9 @@ function dt(e, t, n, r, i, a = "main") {
|
|
|
844
955
|
format: "YYYY-MM-DD",
|
|
845
956
|
fullWidth: !0,
|
|
846
957
|
onChange: (t) => r(e.fieldKey, O(t)),
|
|
847
|
-
placeholder: e.placeholder ??
|
|
958
|
+
placeholder: e.placeholder ?? Mt(e.type),
|
|
848
959
|
readOnly: n,
|
|
849
|
-
value:
|
|
960
|
+
value: P(t)
|
|
850
961
|
}) : e.type === "datetime" ? /* @__PURE__ */ S(d, {
|
|
851
962
|
formatDate: "YYYY-MM-DD",
|
|
852
963
|
formatTime: "HH:mm",
|
|
@@ -856,7 +967,7 @@ function dt(e, t, n, r, i, a = "main") {
|
|
|
856
967
|
placeholderLeft: "選擇日期",
|
|
857
968
|
placeholderRight: "選擇時間",
|
|
858
969
|
readOnly: n,
|
|
859
|
-
value:
|
|
970
|
+
value: P(t)
|
|
860
971
|
}) : e.type === "number" || e.type === "money" ? /* @__PURE__ */ S(f, {
|
|
861
972
|
fullWidth: !0,
|
|
862
973
|
max: e.maximum,
|
|
@@ -866,24 +977,24 @@ function dt(e, t, n, r, i, a = "main") {
|
|
|
866
977
|
max: e.maximum,
|
|
867
978
|
min: e.minimum
|
|
868
979
|
})),
|
|
869
|
-
placeholder: e.placeholder ??
|
|
980
|
+
placeholder: e.placeholder ?? Mt(e.type),
|
|
870
981
|
...n ? { readonly: !0 } : {},
|
|
871
982
|
showSpinner: !0,
|
|
872
|
-
value:
|
|
983
|
+
value: jt(t),
|
|
873
984
|
variant: "measure"
|
|
874
985
|
}) : /* @__PURE__ */ S(f, {
|
|
875
986
|
fullWidth: !0,
|
|
876
987
|
onChange: (t) => r(e.fieldKey, t.target.value),
|
|
877
|
-
placeholder: e.placeholder ??
|
|
988
|
+
placeholder: e.placeholder ?? Mt(e.type),
|
|
878
989
|
...n ? { readonly: !0 } : {},
|
|
879
990
|
size: a,
|
|
880
|
-
value:
|
|
991
|
+
value: kt(t),
|
|
881
992
|
variant: "base"
|
|
882
993
|
});
|
|
883
994
|
}
|
|
884
|
-
function
|
|
885
|
-
let c = a.options.map(
|
|
886
|
-
return e.type === "autocomplete" ?
|
|
995
|
+
function Dt(e, t, n, r, i, a, o = "main") {
|
|
996
|
+
let c = a.options.map(F), u = le(t, a.options).map(F), d = a.status === "LOADING", f = a.status === "WAITING_FOR_DEPENDENCIES", h = !!i && !n, g = n || f, _ = n;
|
|
997
|
+
return e.type === "autocomplete" ? H(e) === "multiple" ? /* @__PURE__ */ S(s, {
|
|
887
998
|
asyncData: h,
|
|
888
999
|
clearSearchText: !0,
|
|
889
1000
|
disabled: _,
|
|
@@ -922,7 +1033,7 @@ function ft(e, t, n, r, i, a, o = "main") {
|
|
|
922
1033
|
name: e.fieldKey,
|
|
923
1034
|
onChange: (t) => r(e.fieldKey, t.target.value || void 0),
|
|
924
1035
|
options: c,
|
|
925
|
-
value:
|
|
1036
|
+
value: kt(t)
|
|
926
1037
|
}) : e.type === "checkbox" ? /* @__PURE__ */ S(l, {
|
|
927
1038
|
disabled: g,
|
|
928
1039
|
name: e.fieldKey,
|
|
@@ -931,8 +1042,8 @@ function ft(e, t, n, r, i, a, o = "main") {
|
|
|
931
1042
|
label: e.name,
|
|
932
1043
|
value: e.id
|
|
933
1044
|
})),
|
|
934
|
-
value: [...
|
|
935
|
-
}) :
|
|
1045
|
+
value: [...At(t)]
|
|
1046
|
+
}) : H(e) === "multiple" ? /* @__PURE__ */ S(m, {
|
|
936
1047
|
disabled: g,
|
|
937
1048
|
loading: d,
|
|
938
1049
|
mode: "multiple",
|
|
@@ -955,23 +1066,23 @@ function ft(e, t, n, r, i, a, o = "main") {
|
|
|
955
1066
|
value: u[0] ?? null
|
|
956
1067
|
});
|
|
957
1068
|
}
|
|
958
|
-
function
|
|
1069
|
+
function Ot(e, t) {
|
|
959
1070
|
return {
|
|
960
1071
|
FULL: 12,
|
|
961
1072
|
HALF: 6,
|
|
962
1073
|
THIRD: 4
|
|
963
1074
|
}[t.layout.find((t) => t.fieldKey === e.fieldKey)?.width ?? "FULL"];
|
|
964
1075
|
}
|
|
965
|
-
function
|
|
1076
|
+
function kt(e) {
|
|
966
1077
|
return typeof e == "string" ? e : "";
|
|
967
1078
|
}
|
|
968
|
-
function
|
|
1079
|
+
function At(e) {
|
|
969
1080
|
return Array.isArray(e) && e.every((e) => typeof e == "string") ? e : [];
|
|
970
1081
|
}
|
|
971
|
-
function
|
|
1082
|
+
function jt(e) {
|
|
972
1083
|
return typeof e == "number" ? String(e) : "";
|
|
973
1084
|
}
|
|
974
|
-
function
|
|
1085
|
+
function Mt(e) {
|
|
975
1086
|
return {
|
|
976
1087
|
boolean: "",
|
|
977
1088
|
autocomplete: "請輸入或選擇",
|
|
@@ -982,6 +1093,7 @@ function gt(e) {
|
|
|
982
1093
|
member: "搜尋姓名或信箱",
|
|
983
1094
|
money: "請輸入金額",
|
|
984
1095
|
number: "請輸入數字",
|
|
1096
|
+
org_unit: "搜尋組織名稱",
|
|
985
1097
|
radio: "請選擇一個選項",
|
|
986
1098
|
select: "請選擇一個選項",
|
|
987
1099
|
table: "",
|
|
@@ -989,7 +1101,6 @@ function gt(e) {
|
|
|
989
1101
|
textarea: "請輸入多行文字"
|
|
990
1102
|
}[e];
|
|
991
1103
|
}
|
|
992
|
-
|
|
993
|
-
export { q as a, J as i, ke as n, _e as o, Q as r, K as s, We as t };
|
|
1104
|
+
export { Y as a, q as c, Q as i, Ue as n, J as o, je as r, X as s, at as t };
|
|
994
1105
|
|
|
995
|
-
//# sourceMappingURL=FormRendererView-
|
|
1106
|
+
//# sourceMappingURL=FormRendererView-CTLlG13b.js.map
|