@rytass/bpm-core-react 0.4.0 → 0.5.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 +110 -0
- package/dist/chunks/FormBuilderView-B_KGPjlp.cjs +3 -0
- package/dist/chunks/FormBuilderView-B_KGPjlp.cjs.map +1 -0
- package/dist/chunks/FormBuilderView-D8DrQOXD.js +1090 -0
- package/dist/chunks/FormBuilderView-D8DrQOXD.js.map +1 -0
- package/dist/chunks/{approval-instance-list-page-UNIIgUZy.cjs → approval-instance-list-page-BMUKxzcz.cjs} +2 -2
- package/dist/chunks/{approval-instance-list-page-UNIIgUZy.cjs.map → approval-instance-list-page-BMUKxzcz.cjs.map} +1 -1
- package/dist/chunks/{approval-instance-list-page-BtEc8Cs3.js → approval-instance-list-page-YZcGGDD8.js} +3 -3
- package/dist/chunks/{approval-instance-list-page-BtEc8Cs3.js.map → approval-instance-list-page-YZcGGDD8.js.map} +1 -1
- package/dist/chunks/{auth-provider-D2P-qWmY.cjs → auth-provider-4BeCw7cI.cjs} +2 -2
- package/dist/chunks/{auth-provider-D2P-qWmY.cjs.map → auth-provider-4BeCw7cI.cjs.map} +1 -1
- package/dist/chunks/{auth-provider-TTO9eNZV.js → auth-provider-B5oPmvk2.js} +2 -2
- package/dist/chunks/{auth-provider-TTO9eNZV.js.map → auth-provider-B5oPmvk2.js.map} +1 -1
- package/dist/chunks/compose-PMrmi-LE.js +451 -0
- package/dist/chunks/compose-PMrmi-LE.js.map +1 -0
- package/dist/chunks/compose-ziVbRYdo.cjs +2 -0
- package/dist/chunks/compose-ziVbRYdo.cjs.map +1 -0
- package/dist/chunks/{dashboard-page-CQRBJxze.js → dashboard-page-DJ9vOPga.js} +4 -4
- package/dist/chunks/{dashboard-page-CQRBJxze.js.map → dashboard-page-DJ9vOPga.js.map} +1 -1
- package/dist/chunks/{dashboard-page-DrDChhg1.cjs → dashboard-page-DwHQY6Ki.cjs} +2 -2
- package/dist/chunks/{dashboard-page-DrDChhg1.cjs.map → dashboard-page-DwHQY6Ki.cjs.map} +1 -1
- package/dist/chunks/{delegations-CFXaJrdX.cjs → delegations-C2wLWsDQ.cjs} +2 -2
- package/dist/chunks/{delegations-CFXaJrdX.cjs.map → delegations-C2wLWsDQ.cjs.map} +1 -1
- package/dist/chunks/{delegations-DwbYkNUg.cjs → delegations-DDEk-WI6.cjs} +2 -2
- package/dist/chunks/{delegations-DwbYkNUg.cjs.map → delegations-DDEk-WI6.cjs.map} +1 -1
- package/dist/chunks/{delegations-FTLaWo1Y.js → delegations-ZNtodFaD.js} +2 -2
- package/dist/chunks/{delegations-FTLaWo1Y.js.map → delegations-ZNtodFaD.js.map} +1 -1
- package/dist/chunks/{delegations-D5pPEWsP.js → delegations-iVnRi3QE.js} +2 -2
- package/dist/chunks/{delegations-D5pPEWsP.js.map → delegations-iVnRi3QE.js.map} +1 -1
- package/dist/chunks/designer-DCn6_v4b.cjs +65 -0
- package/dist/chunks/designer-DCn6_v4b.cjs.map +1 -0
- package/dist/chunks/designer-mOMxJ0Py.js +2576 -0
- package/dist/chunks/designer-mOMxJ0Py.js.map +1 -0
- package/dist/chunks/detail-Bml-vXHX.js +1622 -0
- package/dist/chunks/detail-Bml-vXHX.js.map +1 -0
- package/dist/chunks/detail-CWeCrmtC.cjs +2 -0
- package/dist/chunks/detail-CWeCrmtC.cjs.map +1 -0
- package/dist/chunks/{login-BfmfCclF.cjs → login-9bCXyjbX.cjs} +2 -2
- package/dist/chunks/{login-BfmfCclF.cjs.map → login-9bCXyjbX.cjs.map} +1 -1
- package/dist/chunks/{login-xgI4wLHe.js → login-BKxpLibd.js} +3 -3
- package/dist/chunks/{login-xgI4wLHe.js.map → login-BKxpLibd.js.map} +1 -1
- package/dist/chunks/{notifications-a-FCxV02.cjs → notifications-BKs4--96.cjs} +2 -2
- package/dist/chunks/{notifications-a-FCxV02.cjs.map → notifications-BKs4--96.cjs.map} +1 -1
- package/dist/chunks/{notifications-BoNa1BXD.js → notifications-CSulztkU.js} +2 -2
- package/dist/chunks/{notifications-BoNa1BXD.js.map → notifications-CSulztkU.js.map} +1 -1
- package/dist/chunks/router-adapter--gYs13E8.cjs +2 -0
- package/dist/chunks/{router-adapter-BybHrCNP.cjs.map → router-adapter--gYs13E8.cjs.map} +1 -1
- package/dist/chunks/{router-adapter-BdHZXLS3.js → router-adapter-DftlFTOd.js} +2 -2
- package/dist/chunks/{router-adapter-BdHZXLS3.js.map → router-adapter-DftlFTOd.js.map} +1 -1
- package/dist/chunks/{routes-config-dxahImVe.js → routes-config-RBYQtUd0.js} +2 -3
- package/dist/chunks/routes-config-RBYQtUd0.js.map +1 -0
- package/dist/chunks/routes-config-fDVHmvXi.cjs +2 -0
- package/dist/chunks/routes-config-fDVHmvXi.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +270 -130
- package/dist/index.js.map +1 -1
- package/dist/lib/routes-config.d.ts +6 -4
- package/dist/next/BPMNextProviders.d.ts +1 -1
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +14 -24
- package/dist/next/index.js.map +1 -1
- package/dist/next/workflow-chat-route.cjs +19 -0
- package/dist/next/workflow-chat-route.cjs.map +1 -0
- package/dist/next/workflow-chat-route.d.ts +17 -0
- package/dist/next/workflow-chat-route.js +31 -0
- package/dist/next/workflow-chat-route.js.map +1 -0
- package/dist/pages/admin/delegations/index.cjs +1 -1
- package/dist/pages/admin/delegations/index.js +1 -1
- package/dist/pages/delegations/index.cjs +1 -1
- package/dist/pages/delegations/index.js +1 -1
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/login/index.cjs +1 -1
- package/dist/pages/login/index.js +1 -1
- package/dist/pages/settings/notifications/index.cjs +1 -1
- package/dist/pages/settings/notifications/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +2 -0
- package/dist/pages/templates/compose/index.cjs.map +1 -0
- package/dist/pages/templates/compose/index.d.ts +13 -0
- package/dist/pages/templates/compose/index.js +14 -0
- package/dist/pages/templates/compose/index.js.map +1 -0
- 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 +7 -2
- package/dist/pages/templates/designer/index.js.map +1 -1
- package/dist/pages/templates/index.cjs +1 -1
- package/dist/pages/templates/index.cjs.map +1 -1
- package/dist/pages/templates/index.js +3 -3
- package/dist/pages/templates/index.js.map +1 -1
- package/dist/views/admin/delegations/index.cjs +1 -1
- package/dist/views/admin/delegations/index.js +1 -1
- package/dist/views/admin/index.cjs +1 -1
- package/dist/views/admin/index.js +1 -1
- package/dist/views/cc/index.cjs +1 -1
- package/dist/views/cc/index.js +1 -1
- package/dist/views/dashboard/index.cjs +1 -1
- package/dist/views/dashboard/index.js +1 -1
- package/dist/views/delegations/index.cjs +1 -1
- package/dist/views/delegations/index.js +1 -1
- package/dist/views/forms/builder/FormBuilderView.d.ts +13 -4
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/builder/json-code-editor.d.ts +1 -1
- package/dist/views/inbox/index.cjs +1 -1
- package/dist/views/inbox/index.js +3 -3
- package/dist/views/instances/detail/InstanceDetailView.d.ts +11 -1
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.d.ts +5 -0
- package/dist/views/instances/detail/index.js +2 -2
- package/dist/views/instances/detail/sections/InstanceAttachmentsSection.d.ts +15 -0
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +33 -0
- package/dist/views/instances/detail/sections/InstanceHistorySection.d.ts +29 -0
- package/dist/views/instances/detail/sections/InstanceSignaturesSection.d.ts +14 -0
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +44 -0
- package/dist/views/instances/detail/sections/container-helpers.d.ts +8 -0
- package/dist/views/instances/detail/sections/shared.d.ts +103 -0
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.js +3 -3
- 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.js +1 -1
- package/dist/views/sent/index.cjs +1 -1
- package/dist/views/sent/index.js +1 -1
- package/dist/views/settings/index.cjs +1 -1
- package/dist/views/settings/index.js +1 -1
- package/dist/views/settings/notifications/index.cjs +1 -1
- package/dist/views/settings/notifications/index.js +1 -1
- package/dist/views/templates/TemplatesView.d.ts +5 -0
- package/dist/views/templates/compose/TemplateComposeWizardView.d.ts +8 -0
- package/dist/views/templates/compose/index.cjs +1 -0
- package/dist/views/templates/compose/index.d.ts +2 -0
- package/dist/views/templates/compose/index.js +2 -0
- package/dist/views/templates/compose/steps/ComposeFormStep.d.ts +15 -0
- package/dist/views/templates/compose/steps/ComposeReviewStep.d.ts +12 -0
- package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.ts +11 -0
- package/dist/views/templates/compose/use-template-compose-wizard.d.ts +46 -0
- package/dist/views/templates/designer/TemplateDesignerView.d.ts +60 -2
- package/dist/views/templates/designer/chrome-workflow-chat.d.ts +12 -0
- package/dist/views/templates/designer/index.cjs +1 -51
- package/dist/views/templates/designer/index.js +2 -2272
- package/dist/views/templates/designer/use-workflow-chat.d.ts +21 -0
- package/dist/views/templates/designer/use-workflow-designer-controller.d.ts +41 -0
- package/dist/views/templates/designer/workflow-chat-drawer.d.ts +16 -0
- package/dist/views/templates/index.cjs +2 -1
- package/dist/views/templates/index.cjs.map +1 -0
- package/dist/views/templates/index.js +265 -4
- package/dist/views/templates/index.js.map +1 -0
- 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 +39 -43
- package/dist/views/templates/versions/index.js.map +1 -1
- package/package.json +22 -19
- package/dist/chunks/builder-C3E-8OJu.js +0 -1300
- package/dist/chunks/builder-C3E-8OJu.js.map +0 -1
- package/dist/chunks/builder-f-Q_0NUs.cjs +0 -3
- package/dist/chunks/builder-f-Q_0NUs.cjs.map +0 -1
- package/dist/chunks/detail-B9JkYNHc.cjs +0 -2
- package/dist/chunks/detail-B9JkYNHc.cjs.map +0 -1
- package/dist/chunks/detail-CSxI04gB.js +0 -1518
- package/dist/chunks/detail-CSxI04gB.js.map +0 -1
- package/dist/chunks/form-name-modal-C3OEvkCV.js +0 -64
- package/dist/chunks/form-name-modal-C3OEvkCV.js.map +0 -1
- package/dist/chunks/form-name-modal-uZCHbtRH.cjs +0 -2
- package/dist/chunks/form-name-modal-uZCHbtRH.cjs.map +0 -1
- package/dist/chunks/router-adapter-BybHrCNP.cjs +0 -2
- package/dist/chunks/routes-config-2aKbWq2H.cjs +0 -2
- package/dist/chunks/routes-config-2aKbWq2H.cjs.map +0 -1
- package/dist/chunks/routes-config-dxahImVe.js.map +0 -1
- package/dist/chunks/templates-CL8bPvgn.cjs +0 -2
- package/dist/chunks/templates-CL8bPvgn.cjs.map +0 -1
- package/dist/chunks/templates-DNfDOPGm.js +0 -380
- package/dist/chunks/templates-DNfDOPGm.js.map +0 -1
- package/dist/pages/forms/builder/index.cjs +0 -2
- package/dist/pages/forms/builder/index.cjs.map +0 -1
- package/dist/pages/forms/builder/index.d.ts +0 -21
- package/dist/pages/forms/builder/index.js +0 -15
- package/dist/pages/forms/builder/index.js.map +0 -1
- package/dist/pages/forms/index.cjs +0 -2
- package/dist/pages/forms/index.cjs.map +0 -1
- package/dist/pages/forms/index.d.ts +0 -17
- package/dist/pages/forms/index.js +0 -14
- package/dist/pages/forms/index.js.map +0 -1
- package/dist/views/forms/FormsView.d.ts +0 -2
- package/dist/views/forms/form-name-modal.d.ts +0 -12
- package/dist/views/forms/index.cjs +0 -2
- package/dist/views/forms/index.cjs.map +0 -1
- package/dist/views/forms/index.d.ts +0 -2
- package/dist/views/forms/index.js +0 -186
- package/dist/views/forms/index.js.map +0 -1
- package/dist/views/templates/designer/index.cjs.map +0 -1
- package/dist/views/templates/designer/index.js.map +0 -1
- package/dist/views/templates/template-name-modal.d.ts +0 -22
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as e } from "../../../chunks/designer-mOMxJ0Py.js";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
//#region src/pages/templates/designer/index.tsx
|
|
4
4
|
var n = {
|
|
@@ -7,7 +7,12 @@ var n = {
|
|
|
7
7
|
};
|
|
8
8
|
async function r({ params: n }) {
|
|
9
9
|
let { id: r } = await n;
|
|
10
|
-
return /* @__PURE__ */ t(e, {
|
|
10
|
+
return /* @__PURE__ */ t(e, {
|
|
11
|
+
aiAssistantAvailable: !!process.env.OPENAI_API_KEY,
|
|
12
|
+
showAiAssistant: process.env.BPM_AI_ASSISTANT_ENABLED === "true",
|
|
13
|
+
showDryRun: process.env.BPM_TEMPLATE_DRY_RUN_ENABLED !== "false",
|
|
14
|
+
templateId: r
|
|
15
|
+
});
|
|
11
16
|
}
|
|
12
17
|
//#endregion
|
|
13
18
|
export { r as default, n as metadata };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/pages/templates/designer/index.tsx"],"sourcesContent":["import type { Metadata } from 'next';\nimport type { ReactElement } from 'react';\nimport { TemplateDesignerView } from '../../../views/templates/designer';\n\nexport const metadata: Metadata = {\n title: '流程設計器 | BPM Admin',\n description: '以視覺化設計器編輯 BPM 簽核流程節點、條件與發佈版本。',\n};\n\nexport default async function TemplateDesignerPage({\n params,\n}: {\n readonly params: Promise<{ readonly id: string }>;\n}): Promise<ReactElement> {\n const { id } = await params;\n return <TemplateDesignerView templateId={id}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/pages/templates/designer/index.tsx"],"sourcesContent":["import type { Metadata } from 'next';\nimport type { ReactElement } from 'react';\nimport { TemplateDesignerView } from '../../../views/templates/designer';\n\nexport const metadata: Metadata = {\n title: '流程設計器 | BPM Admin',\n description: '以視覺化設計器編輯 BPM 簽核流程節點、條件與發佈版本。',\n};\n\nexport default async function TemplateDesignerPage({\n params,\n}: {\n readonly params: Promise<{ readonly id: string }>;\n}): Promise<ReactElement> {\n const { id } = await params;\n\n // AI assistant is opt-in per deployment. `BPM_AI_ASSISTANT_ENABLED` shows the\n // feature; `OPENAI_API_KEY` decides whether it's usable (else a disabled\n // placeholder). Both are server-only env on the Next.js host.\n //\n // The dry-run button shows by default; set `BPM_TEMPLATE_DRY_RUN_ENABLED` to\n // `'false'` to hide it for a deployment.\n return (\n <TemplateDesignerView\n aiAssistantAvailable={Boolean(process.env.OPENAI_API_KEY)}\n showAiAssistant={process.env.BPM_AI_ASSISTANT_ENABLED === 'true'}\n showDryRun={process.env.BPM_TEMPLATE_DRY_RUN_ENABLED !== 'false'}\n templateId={id}\n />\n );\n}\n"],"mappings":";;;AAIA,IAAa,IAAqB;CAChC,OAAO;CACP,aAAa;AACf;AAEA,eAA8B,EAAqB,EACjD,aAGwB;CACxB,IAAM,EAAE,UAAO,MAAM;CAQrB,OACE,kBAAC,GAAD;EACE,sBAAsB,EAAQ,QAAQ,IAAI;EAC1C,iBAAiB,QAAQ,IAAI,6BAA6B;EAC1D,YAAY,QAAQ,IAAI,iCAAiC;EACzD,YAAY;CACb,CAAA;AAEL"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../views/templates/index.cjs");let t=require("react/jsx-runtime");var n={title:`簽核模板 | BPM Admin`,description:`設計簽核表單與流程,建立、編輯與發佈簽核模板。`};function r(){return(0,t.jsx)(e.TemplatesView,{})}exports.default=r,exports.metadata=n;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../../src/pages/templates/index.tsx"],"sourcesContent":["import type { Metadata } from 'next';\nimport type { ReactElement } from 'react';\nimport { TemplatesView } from '../../views/templates';\n\nexport const metadata: Metadata = {\n title: '
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../../src/pages/templates/index.tsx"],"sourcesContent":["import type { Metadata } from 'next';\nimport type { ReactElement } from 'react';\nimport { TemplatesView } from '../../views/templates';\n\nexport const metadata: Metadata = {\n title: '簽核模板 | BPM Admin',\n description: '設計簽核表單與流程,建立、編輯與發佈簽核模板。',\n};\n\nexport default function TemplatesPage(): ReactElement {\n return <TemplatesView />;\n}\n"],"mappings":"qLAIA,IAAa,EAAqB,CAChC,MAAO,mBACP,YAAa,yBACf,EAEA,SAAwB,GAA8B,CACpD,OAAO,EAAA,EAAA,KAAC,EAAA,cAAD,CAAgB,CAAA,CACzB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TemplatesView as e } from "../../views/templates/index.js";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
//#region src/pages/templates/index.tsx
|
|
4
4
|
var n = {
|
|
5
|
-
title: "
|
|
6
|
-
description: "
|
|
5
|
+
title: "簽核模板 | BPM Admin",
|
|
6
|
+
description: "設計簽核表單與流程,建立、編輯與發佈簽核模板。"
|
|
7
7
|
};
|
|
8
8
|
function r() {
|
|
9
9
|
return /* @__PURE__ */ t(e, {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/pages/templates/index.tsx"],"sourcesContent":["import type { Metadata } from 'next';\nimport type { ReactElement } from 'react';\nimport { TemplatesView } from '../../views/templates';\n\nexport const metadata: Metadata = {\n title: '
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/pages/templates/index.tsx"],"sourcesContent":["import type { Metadata } from 'next';\nimport type { ReactElement } from 'react';\nimport { TemplatesView } from '../../views/templates';\n\nexport const metadata: Metadata = {\n title: '簽核模板 | BPM Admin',\n description: '設計簽核表單與流程,建立、編輯與發佈簽核模板。',\n};\n\nexport default function TemplatesPage(): ReactElement {\n return <TemplatesView />;\n}\n"],"mappings":";;;AAIA,IAAa,IAAqB;CAChC,OAAO;CACP,aAAa;AACf;AAEA,SAAwB,IAA8B;CACpD,OAAO,kBAAC,GAAD,CAAgB,CAAA;AACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/delegations-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/delegations-DDEk-WI6.cjs");exports.AdminDelegationsView=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../../chunks/delegations-
|
|
1
|
+
import { t as e } from "../../../chunks/delegations-iVnRi3QE.js";
|
|
2
2
|
export { e as AdminDelegationsView };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/users-qghSMtLn.cjs"),t=require("../../chunks/orgs-BIiqzHvb.cjs"),n=require("../../chunks/delegations-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/users-qghSMtLn.cjs"),t=require("../../chunks/orgs-BIiqzHvb.cjs"),n=require("../../chunks/delegations-DDEk-WI6.cjs");exports.AdminDelegationsView=n.t,exports.AdminOrgsView=t.t,exports.AdminUsersView=e.t;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { t as e } from "../../chunks/users-CUY139DF.js";
|
|
2
2
|
import { t } from "../../chunks/orgs-Cc18umVt.js";
|
|
3
|
-
import { t as n } from "../../chunks/delegations-
|
|
3
|
+
import { t as n } from "../../chunks/delegations-iVnRi3QE.js";
|
|
4
4
|
export { n as AdminDelegationsView, t as AdminOrgsView, e as AdminUsersView };
|
package/dist/views/cc/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-BMUKxzcz.cjs");let t=require("react/jsx-runtime");function n(){return(0,t.jsx)(e.t,{defaultState:null,description:`查看抄送給你的簽核案件。`,emptyMessage:`目前沒有抄送給你的簽核案件。`,searchPlaceholder:`關鍵字:搜尋案件、發起人、模板或狀態`,title:`抄送給我`,view:`CC`})}exports.CcView=n;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/views/cc/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../../chunks/approval-instance-list-page-
|
|
2
|
+
import { t as e } from "../../chunks/approval-instance-list-page-YZcGGDD8.js";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
//#region src/views/cc/CcView.tsx
|
|
5
5
|
function n() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/dashboard-page-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/dashboard-page-DwHQY6Ki.cjs");let t=require("react/jsx-runtime");function n(){return(0,t.jsx)(e.t,{})}exports.DashboardView=n;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/delegations-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/delegations-C2wLWsDQ.cjs");exports.DelegationsView=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/delegations-
|
|
1
|
+
import { t as e } from "../../chunks/delegations-ZNtodFaD.js";
|
|
2
2
|
export { e as DelegationsView };
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
+
import { FormDefinitionSchema, FormUiSchema } from '@rytass/bpm-core-shared/form';
|
|
2
3
|
export interface FormBuilderViewProps {
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
5
|
+
* Initial (or controlled) schema value.
|
|
6
|
+
* If omitted, the builder starts with empty schema / uiSchema.
|
|
6
7
|
*/
|
|
7
|
-
readonly
|
|
8
|
+
readonly value?: {
|
|
9
|
+
readonly schema: FormDefinitionSchema;
|
|
10
|
+
readonly uiSchema: FormUiSchema;
|
|
11
|
+
};
|
|
12
|
+
/** Called whenever the schema or uiSchema changes. */
|
|
13
|
+
readonly onChange?: (next: {
|
|
14
|
+
readonly schema: FormDefinitionSchema;
|
|
15
|
+
readonly uiSchema: FormUiSchema;
|
|
16
|
+
}) => void;
|
|
8
17
|
}
|
|
9
|
-
export declare function FormBuilderView({
|
|
18
|
+
export declare function FormBuilderView({ onChange, value, }: FormBuilderViewProps): ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/FormBuilderView-B_KGPjlp.cjs");exports.FormBuilderView=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../../chunks/
|
|
1
|
+
import { t as e } from "../../../chunks/FormBuilderView-D8DrQOXD.js";
|
|
2
2
|
export { e as FormBuilderView };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/chunk-CMqjfN_6.cjs"),t=require("../../chunks/router-adapter
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/chunk-CMqjfN_6.cjs"),t=require("../../chunks/router-adapter--gYs13E8.cjs"),n=require("../../chunks/auth-provider-4BeCw7cI.cjs"),r=require("../../chunks/format-date-time-XxBzF0F5.cjs"),i=require("../../chunks/routes-config-fDVHmvXi.cjs");let a=require("react"),o=require("@mezzanine-ui/react"),s=require("react/jsx-runtime"),c=require("@rytass/bpm-core-client/workflow"),l=require("@mezzanine-ui/react/ContentHeader");l=e.t(l,1);let u=require("@mezzanine-ui/icons");function d(){let e=t.r(),d=i.r(),{member:m}=n.n(),h=m?.memberId??null,[g,_]=(0,a.useState)(`pending`),[v,b]=(0,a.useState)(null),[S,w]=(0,a.useState)([]),[T,E]=(0,a.useState)(!0),[D,k]=(0,a.useState)([]);(0,a.useEffect)(()=>{h&&I()},[h]);let A=(0,a.useMemo)(()=>[{dataIndex:`caseTitle`,key:`caseTitle`,title:`案件`,width:280},{dataIndex:`nodeId`,key:`nodeId`,title:`節點`,width:180},{dataIndex:`statusLabel`,key:`statusLabel`,title:`狀態`,width:120},{key:`slaDueAt`,render:e=>(0,s.jsx)(o.Typography,{color:e.slaStatusColor,component:`span`,variant:`body`,children:e.slaStatusText}),title:`SLA`,width:180},{key:`createdAt`,render:e=>(0,s.jsx)(o.Typography,{component:`span`,variant:`body`,children:r.t(e.createdAt)}),title:`建立時間`,width:220}],[]),j=(0,a.useMemo)(()=>({render:t=>[{name:`處理`,onClick:()=>e.push(d.caseDetail(t.instanceId))}],variant:`base-secondary`,width:88}),[e,d]),M=(0,a.useMemo)(()=>[{dataIndex:`caseTitle`,key:`caseTitle`,title:`案件`,width:280},{dataIndex:`nodeId`,key:`nodeId`,title:`節點`,width:180},{key:`decisionLabel`,render:e=>(0,s.jsx)(o.Typography,{color:y(e.decisionAction),component:`span`,variant:`body`,children:e.decisionLabel}),title:`決議`,width:120},{key:`decisionComment`,render:e=>(0,s.jsx)(o.Typography,{component:`span`,variant:`body`,children:e.decisionCommentText}),title:`意見`,width:240},{key:`instanceStateLabel`,render:e=>(0,s.jsx)(o.Typography,{color:x(e.instanceState),component:`span`,variant:`body`,children:e.instanceStateLabel}),title:`流程狀態`,width:140},{key:`decidedAt`,render:e=>(0,s.jsx)(o.Typography,{component:`span`,variant:`body`,children:C(e.decidedAt)}),title:`簽核時間`,width:220}],[]),N=(0,a.useMemo)(()=>({render:t=>[{name:`查看`,onClick:()=>e.push(d.caseDetail(t.instanceId))}],variant:`base-secondary`,width:88}),[e,d]),P=(0,a.useMemo)(()=>S.filter(e=>e.instanceState===`RUNNING`),[S]);function F(e){if(e===`history`||e===`pending`||e===`tracking`){_(e);return}_(`pending`)}async function I(){E(!0),b(null);try{if(!h){k([]),w([]);return}let[e,t]=await Promise.all([(0,c.listInboxTasks)(h),(0,c.listApprovalHistoryTasks)(h)]),[n,r]=await Promise.all([f(e),p(t)]);k(n),w(r)}catch(e){b(O(e))}finally{E(!1)}}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.PageHeader,{children:(0,s.jsx)(l.default,{description:`目前以 ${m?.name??h??`目前登入會員`} 查詢待處理與歷史簽核任務。`,title:`我的待簽`,children:(0,s.jsx)(o.Button,{icon:u.PlusIcon,iconType:`leading`,onClick:()=>e.push(d.caseNew()),variant:`base-primary`,children:`發起簽核`})})}),(0,s.jsx)(o.SectionGroup,{children:(0,s.jsxs)(o.Section,{children:[v?(0,s.jsx)(o.Typography,{color:`text-error`,variant:`body`,children:v}):null,(0,s.jsxs)(o.Tab,{activeKey:g,onChange:F,size:`sub`,children:[(0,s.jsx)(o.TabItem,{badgeCount:T?void 0:D.length,children:`待簽核`},`pending`),(0,s.jsx)(o.TabItem,{badgeCount:T?void 0:P.length,children:`已處理未結束`},`tracking`),(0,s.jsx)(o.TabItem,{children:`歷史簽核記錄`},`history`)]}),g===`pending`?(0,s.jsx)(o.Table,{actions:j,columns:A,dataSource:D,fullWidth:!0,loading:T}):null,g===`tracking`?(0,s.jsx)(o.Table,{actions:N,columns:M,dataSource:P,fullWidth:!0,loading:T}):null,g===`history`?(0,s.jsx)(o.Table,{actions:N,columns:M,dataSource:S,fullWidth:!0,loading:T}):null]})})]})}async function f(e){let t=await m(e);return e.map((e,n)=>({...e,caseTitle:h(e,t[n]??null),key:e.id,slaStatusColor:T(e.slaDueAt),slaStatusText:w(e.slaDueAt),statusLabel:D(e.status)}))}async function p(e){let[t,n]=await Promise.all([Promise.all(e.map(e=>(0,c.listTaskDecisions)(e.id))),m(e)]);return e.map((e,r)=>{let i=g(t[r]??[]),a=n[r]??null;return{...e,caseTitle:h(e,a),decisionAction:i?.action??null,decisionComment:i?.comment??null,decisionCommentText:S(i?.comment??null),decisionLabel:v(i?.action??null),decidedAt:i?.decidedAt??e.completedAt,instanceState:a?.state??null,instanceStateLabel:b(a?.state??null),key:e.id}})}async function m(e){return Promise.all(e.map(async e=>{try{return(await(0,c.readApprovalInstance)(e.instanceId)).instance}catch{return null}}))}function h(e,t){return t?(0,c.readApprovalInstanceCaseTitle)(t):e.instanceId}function g(e){return[...e].sort(_)[0]??null}function _(e,t){return new Date(t.decidedAt).getTime()-new Date(e.decidedAt).getTime()}function v(e){return e===`APPROVED`?`同意`:e===`REJECTED`?`拒絕`:e===`RETURNED`?`退回`:e===`TRANSFERRED`?`轉派`:`未記錄`}function y(e){return e===`APPROVED`?`text-success`:e===`REJECTED`||e===`RETURNED`?`text-error`:`text-neutral`}function b(e){return e===`RUNNING`?`進行中`:e===`APPROVED`?`已通過`:e===`REJECTED`?`已拒絕`:e===`RETURNED`?`已退回`:e===`CANCELLED`?`已取消`:e===`EXPIRED`?`已逾期`:e===`DRAFT`?`草稿`:`-`}function x(e){return e===`APPROVED`?`text-success`:e===`REJECTED`||e===`CANCELLED`||e===`EXPIRED`?`text-error`:`text-neutral`}function S(e){return(e?.trim()??``)||`-`}function C(e){return r.t(e)}function w(e){if(!e)return`-`;let t=new Date(e).getTime(),n=Date.now(),r=E(Math.abs(t-n));return t<n?`已逾期 ${r}`:`剩餘 ${r}`}function T(e){return e?new Date(e).getTime()<Date.now()?`text-error`:`text-success`:`text-neutral`}function E(e){let t=Math.max(1,Math.ceil(e/6e4)),n=Math.floor(t/1440),r=Math.floor(t%1440/60),i=t%60;return n>0?`${n}天 ${r}小時`:r>0?`${r}小時 ${i}分鐘`:`${i}分鐘`}function D(e){return e===`PENDING`?`待處理`:e===`IN_PROGRESS`?`處理中`:e===`COMPLETED`?`已完成`:e===`TRANSFERRED`?`已轉派`:e===`CANCELLED`?`已取消`:e}function O(e){return e instanceof Error?e.message:`發生未知錯誤`}exports.InboxView=d;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { r as e } from "../../chunks/router-adapter-
|
|
3
|
-
import { n as t } from "../../chunks/auth-provider-
|
|
2
|
+
import { r as e } from "../../chunks/router-adapter-DftlFTOd.js";
|
|
3
|
+
import { n as t } from "../../chunks/auth-provider-B5oPmvk2.js";
|
|
4
4
|
import { t as n } from "../../chunks/format-date-time-CB-LxzqT.js";
|
|
5
|
-
import { r } from "../../chunks/routes-config-
|
|
5
|
+
import { r } from "../../chunks/routes-config-RBYQtUd0.js";
|
|
6
6
|
import { useEffect as i, useMemo as a, useState as o } from "react";
|
|
7
7
|
import { Button as s, PageHeader as c, Section as l, SectionGroup as u, Tab as d, TabItem as f, Table as p, Typography as m } from "@mezzanine-ui/react";
|
|
8
8
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
@@ -2,6 +2,16 @@ import { ReactElement } from 'react';
|
|
|
2
2
|
export interface InstanceDetailViewProps {
|
|
3
3
|
/** Approval instance id (Next.js `params.id` resolved by the page shim). */
|
|
4
4
|
readonly instanceId: string;
|
|
5
|
+
/** Show the form snapshot section (default: true). */
|
|
6
|
+
readonly showForm?: boolean;
|
|
7
|
+
/** Show the attachments section (default: true). */
|
|
8
|
+
readonly showAttachments?: boolean;
|
|
9
|
+
/** Show the tasks section (default: true). */
|
|
10
|
+
readonly showTasks?: boolean;
|
|
11
|
+
/** Show the signatures section (default: true). */
|
|
12
|
+
readonly showSignatures?: boolean;
|
|
13
|
+
/** Show the history section (default: true). */
|
|
14
|
+
readonly showHistory?: boolean;
|
|
5
15
|
}
|
|
6
16
|
/**
|
|
7
17
|
* Framework-agnostic view for the BPM approval instance detail page.
|
|
@@ -9,4 +19,4 @@ export interface InstanceDetailViewProps {
|
|
|
9
19
|
* `instanceId` is provided by the host page wrapper (typically resolved
|
|
10
20
|
* from `params.id` in the Next.js Server Component shim).
|
|
11
21
|
*/
|
|
12
|
-
export declare function InstanceDetailView({ instanceId, }: InstanceDetailViewProps): ReactElement;
|
|
22
|
+
export declare function InstanceDetailView({ instanceId, showAttachments, showForm, showHistory, showSignatures, showTasks, }: InstanceDetailViewProps): ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/detail-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/detail-CWeCrmtC.cjs");exports.InstanceAttachmentsSection=e.a,exports.InstanceDetailView=e.t,exports.InstanceFormSection=e.o,exports.InstanceHistorySection=e.n,exports.InstanceSignaturesSection=e.r,exports.InstanceTasksSection=e.i;
|
|
@@ -1 +1,6 @@
|
|
|
1
1
|
export * from './InstanceDetailView';
|
|
2
|
+
export * from './sections/InstanceFormSection';
|
|
3
|
+
export * from './sections/InstanceAttachmentsSection';
|
|
4
|
+
export * from './sections/InstanceTasksSection';
|
|
5
|
+
export * from './sections/InstanceSignaturesSection';
|
|
6
|
+
export * from './sections/InstanceHistorySection';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { e as InstanceDetailView };
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "../../../chunks/detail-Bml-vXHX.js";
|
|
2
|
+
export { e as InstanceAttachmentsSection, a as InstanceDetailView, r as InstanceFormSection, n as InstanceHistorySection, i as InstanceSignaturesSection, t as InstanceTasksSection };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { AttachmentRecord } from '@rytass/bpm-core-client/workflow';
|
|
3
|
+
export interface InstanceAttachmentsSectionProps {
|
|
4
|
+
/** The list of attachments for this instance. */
|
|
5
|
+
readonly attachments: readonly AttachmentRecord[];
|
|
6
|
+
/** Called when the user clicks the download action for an attachment. */
|
|
7
|
+
readonly onDownload: (attachment: AttachmentRecord) => void;
|
|
8
|
+
/** Called when the user clicks the preview action for a PDF attachment. */
|
|
9
|
+
readonly onPreview: (attachment: AttachmentRecord) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Renders the attachments section of the approval instance detail page.
|
|
13
|
+
* Shows a table of attachments with download and (for PDFs) preview actions.
|
|
14
|
+
*/
|
|
15
|
+
export declare function InstanceAttachmentsSection({ attachments, onDownload, onPreview, }: InstanceAttachmentsSectionProps): ReactElement;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { FormFieldDefinition } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
import { ApprovalInstanceRecord, WorkflowFormData } from '@rytass/bpm-core-client/workflow';
|
|
4
|
+
export interface InstanceFormSectionProps {
|
|
5
|
+
/** The loaded approval instance, or null while loading. */
|
|
6
|
+
readonly instance: ApprovalInstanceRecord | null;
|
|
7
|
+
/** Whether the instance is in a loading state. */
|
|
8
|
+
readonly loading: boolean;
|
|
9
|
+
/** Error message to display, if any. */
|
|
10
|
+
readonly error: string | null;
|
|
11
|
+
/** Whether the current user can resubmit (edit + resubmit the returned form). */
|
|
12
|
+
readonly canResubmitInstance: boolean;
|
|
13
|
+
/** Current form data for the resubmit flow. */
|
|
14
|
+
readonly resubmitFormData: WorkflowFormData;
|
|
15
|
+
/** Validation error map for the resubmit form. */
|
|
16
|
+
readonly resubmitFormErrors: Readonly<Record<string, string>>;
|
|
17
|
+
/** Whether a decision/submit action is in progress. */
|
|
18
|
+
readonly deciding: boolean;
|
|
19
|
+
/** Called when the form data changes in the resubmit flow. */
|
|
20
|
+
readonly onResubmitFormChange: (values: WorkflowFormData) => void;
|
|
21
|
+
/** Called when the user clicks "重新送出". */
|
|
22
|
+
readonly onResubmitInstance: () => void;
|
|
23
|
+
/** Called when an attachment upload is requested via the form field. */
|
|
24
|
+
readonly onUploadAttachment: (field: FormFieldDefinition, file: File) => Promise<{
|
|
25
|
+
readonly id: string;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Renders the form snapshot section of the approval instance detail page.
|
|
30
|
+
* Displays the form in read-only mode normally, or editable mode when the
|
|
31
|
+
* instance has been returned and the current member can resubmit it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function InstanceFormSection({ canResubmitInstance, deciding, error, instance, loading, onResubmitFormChange, onResubmitInstance, onUploadAttachment, resubmitFormData, resubmitFormErrors, }: InstanceFormSectionProps): ReactElement;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ActivityLogRecord, ApprovalInstanceRecord, MemberProfileRecord, SignatureRecord, SignatureVerificationRecord, TaskDecisionRecord, TaskRecord, WorkflowTokenRecord } from '@rytass/bpm-core-client/workflow';
|
|
3
|
+
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
export interface InstanceHistorySectionProps {
|
|
5
|
+
/** Activity log records for this instance. */
|
|
6
|
+
readonly activityLogs: readonly ActivityLogRecord[];
|
|
7
|
+
/** All tasks for this instance (used to compute pending/future steps). */
|
|
8
|
+
readonly tasks: readonly TaskRecord[];
|
|
9
|
+
/** All workflow tokens for this instance. */
|
|
10
|
+
readonly workflowTokens: readonly WorkflowTokenRecord[];
|
|
11
|
+
/** The workflow definition snapshot, or null if not yet loaded. */
|
|
12
|
+
readonly workflowSnapshot: WorkflowDefinition | null;
|
|
13
|
+
/** The current state of the instance. */
|
|
14
|
+
readonly instanceState: ApprovalInstanceRecord['state'];
|
|
15
|
+
/** Member profiles indexed by memberId. */
|
|
16
|
+
readonly memberProfilesById: ReadonlyMap<string, MemberProfileRecord>;
|
|
17
|
+
/** Task decisions indexed by taskId (latest per task). */
|
|
18
|
+
readonly taskDecisionsByTaskId: ReadonlyMap<string, TaskDecisionRecord>;
|
|
19
|
+
/** Signatures indexed by id. */
|
|
20
|
+
readonly signaturesById: ReadonlyMap<string, SignatureRecord>;
|
|
21
|
+
/** Signature chain verification result, or null. */
|
|
22
|
+
readonly signatureVerification: SignatureVerificationRecord | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Renders the activity history section of the approval instance detail page.
|
|
26
|
+
* Computes the step records from the provided data and renders them as a
|
|
27
|
+
* vertical dot stepper.
|
|
28
|
+
*/
|
|
29
|
+
export declare function InstanceHistorySection({ activityLogs, instanceState, memberProfilesById, signatureVerification, signaturesById, taskDecisionsByTaskId, tasks, workflowSnapshot, workflowTokens, }: InstanceHistorySectionProps): ReactElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { SignatureRecord, SignatureVerificationRecord } from '@rytass/bpm-core-client/workflow';
|
|
3
|
+
export interface InstanceSignaturesSectionProps {
|
|
4
|
+
/** The list of signatures for this instance. */
|
|
5
|
+
readonly signatures: readonly SignatureRecord[];
|
|
6
|
+
/** The signature chain verification result, or null if not yet loaded. */
|
|
7
|
+
readonly signatureVerification: SignatureVerificationRecord | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Renders the signatures section of the approval instance detail page.
|
|
11
|
+
* Shows the signature chain verification status and a table of individual
|
|
12
|
+
* signature records.
|
|
13
|
+
*/
|
|
14
|
+
export declare function InstanceSignaturesSection({ signatureVerification, signatures, }: InstanceSignaturesSectionProps): ReactElement;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ApprovalInstanceRecord, MemberProfileRecord, TaskRecord } from '@rytass/bpm-core-client/workflow';
|
|
2
|
+
/**
|
|
3
|
+
* Imperative handle exposed by InstanceTasksSection via ref.
|
|
4
|
+
* The container uses these to wire PageHeader action buttons to the
|
|
5
|
+
* section's internal modal state without lifting state up.
|
|
6
|
+
*/
|
|
7
|
+
export interface InstanceTasksSectionHandle {
|
|
8
|
+
/** Whether a task action (decision) is currently in flight. */
|
|
9
|
+
readonly deciding: boolean;
|
|
10
|
+
/** Whether the current user has an actionable pending task. */
|
|
11
|
+
readonly hasCurrentTask: boolean;
|
|
12
|
+
/** Whether the current task's node allows a return action. */
|
|
13
|
+
readonly canReturnCurrentTask: boolean;
|
|
14
|
+
/** Opens the reject-reason modal. */
|
|
15
|
+
openRejectModal(): void;
|
|
16
|
+
/** Opens the return modal. */
|
|
17
|
+
openReturnModal(): void;
|
|
18
|
+
/** Opens the transfer modal. */
|
|
19
|
+
openTransferModal(): void;
|
|
20
|
+
/** Submits an APPROVED decision immediately (no modal needed). */
|
|
21
|
+
handleApprove(): void;
|
|
22
|
+
}
|
|
23
|
+
export interface InstanceTasksSectionProps {
|
|
24
|
+
/** All tasks for this instance. */
|
|
25
|
+
readonly tasks: readonly TaskRecord[];
|
|
26
|
+
/** The loaded approval instance (used to read workflowSnapshot node labels). */
|
|
27
|
+
readonly instance: ApprovalInstanceRecord | null;
|
|
28
|
+
/** Member profiles indexed by memberId, for displaying assignee labels. */
|
|
29
|
+
readonly memberProfilesById: ReadonlyMap<string, MemberProfileRecord>;
|
|
30
|
+
/** The currently authenticated member's id. */
|
|
31
|
+
readonly currentMemberId: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Called after any task decision action (approve / reject / return /
|
|
34
|
+
* transfer) completes successfully. The container should refresh data.
|
|
35
|
+
*/
|
|
36
|
+
readonly onChanged: () => void | Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Renders the tasks section of the approval instance detail page.
|
|
40
|
+
* Contains the task table plus all decision action modals
|
|
41
|
+
* (reject, return, transfer). Approve is also handled here via the
|
|
42
|
+
* imperative handle exposed through the forwarded ref.
|
|
43
|
+
*/
|
|
44
|
+
export declare const InstanceTasksSection: import('react').ForwardRefExoticComponent<InstanceTasksSectionProps & import('react').RefAttributes<InstanceTasksSectionHandle>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActivityLogRecord, MemberProfileRecord, TaskDecisionRecord, TaskRecord } from '@rytass/bpm-core-client/workflow';
|
|
2
|
+
export { canMemberActOnTask, readErrorMessage, readInstanceStateLabel, readNodeRuntimeState, } from './shared';
|
|
3
|
+
export declare function readMemberProfilesForTimeline({ activityLogs, tasks, }: {
|
|
4
|
+
readonly activityLogs: readonly ActivityLogRecord[];
|
|
5
|
+
readonly tasks: readonly TaskRecord[];
|
|
6
|
+
}): Promise<readonly MemberProfileRecord[]>;
|
|
7
|
+
export declare function readTaskDecisionsForTasks(tasks: readonly TaskRecord[]): Promise<readonly TaskDecisionRecord[]>;
|
|
8
|
+
export declare function readLatestTaskDecisionsByTaskId(taskDecisions: readonly TaskDecisionRecord[]): ReadonlyMap<string, TaskDecisionRecord>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { ActivityLogRecord, ApprovalInstanceRecord, AttachmentRecord, MemberProfileRecord, SignatureRecord, SignatureVerificationRecord, TaskDecisionRecord, TaskRecord, WorkflowTokenRecord } from '@rytass/bpm-core-client/workflow';
|
|
2
|
+
import { WorkflowDefinition, WorkflowNode } from '@rytass/bpm-core-shared/workflow';
|
|
3
|
+
export type TaskRow = Readonly<Record<string, unknown> & TaskRecord & {
|
|
4
|
+
assigneeLabel: string;
|
|
5
|
+
key: string;
|
|
6
|
+
nodeLabel: string;
|
|
7
|
+
statusLabel: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type AttachmentRow = Readonly<Record<string, unknown> & {
|
|
10
|
+
attachment: AttachmentRecord;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
filename: string;
|
|
13
|
+
id: string;
|
|
14
|
+
key: string;
|
|
15
|
+
mimeType: string;
|
|
16
|
+
sizeLabel: string;
|
|
17
|
+
}>;
|
|
18
|
+
export type SignatureRow = Readonly<Record<string, unknown> & {
|
|
19
|
+
algorithm: string;
|
|
20
|
+
hashLabel: string;
|
|
21
|
+
key: string;
|
|
22
|
+
keyVersion: number;
|
|
23
|
+
signedAtLabel: string;
|
|
24
|
+
signerMemberId: string;
|
|
25
|
+
}>;
|
|
26
|
+
export type MemberOption = Readonly<{
|
|
27
|
+
email: string | null;
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}>;
|
|
31
|
+
export type ActivityStepDescriptionPart = Readonly<{
|
|
32
|
+
text: string;
|
|
33
|
+
type: 'text';
|
|
34
|
+
}> | Readonly<{
|
|
35
|
+
text: string;
|
|
36
|
+
type: 'dangerText';
|
|
37
|
+
}> | Readonly<{
|
|
38
|
+
email: string | null;
|
|
39
|
+
label: string;
|
|
40
|
+
memberId: string | null;
|
|
41
|
+
prefix: string;
|
|
42
|
+
type: 'member';
|
|
43
|
+
}>;
|
|
44
|
+
export interface ActivityStepRecord {
|
|
45
|
+
readonly descriptionParts: readonly ActivityStepDescriptionPart[];
|
|
46
|
+
readonly error: boolean;
|
|
47
|
+
readonly forcePending?: boolean;
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly title: string;
|
|
50
|
+
}
|
|
51
|
+
interface DelegationChainStep {
|
|
52
|
+
readonly from: string;
|
|
53
|
+
readonly reason: string;
|
|
54
|
+
readonly ruleId: string | null;
|
|
55
|
+
readonly to: string;
|
|
56
|
+
}
|
|
57
|
+
export declare function readDelegationChain(value: string): readonly DelegationChainStep[];
|
|
58
|
+
export declare function readStringField(record: Readonly<Record<string, unknown>>, key: string): string | null;
|
|
59
|
+
export declare function readStringArrayField(record: Readonly<Record<string, unknown>>, key: string): readonly string[];
|
|
60
|
+
export declare function readNumberField(record: Readonly<Record<string, unknown>>, key: string): number | null;
|
|
61
|
+
export declare function isPresentText(value: string | null): value is string;
|
|
62
|
+
export declare function isRecord(value: unknown): value is Readonly<Record<string, unknown>>;
|
|
63
|
+
export declare function isPendingTask(task: TaskRecord): boolean;
|
|
64
|
+
export declare function readErrorMessage(error: unknown): string;
|
|
65
|
+
export declare function formatFileSize(sizeBytes: number): string;
|
|
66
|
+
export declare function readShortHash(hash: string): string;
|
|
67
|
+
export declare function readInstanceStateLabel(state: string): string;
|
|
68
|
+
export declare function readTaskStatusLabel(status: TaskRecord['status']): string;
|
|
69
|
+
export declare function readTaskDecisionActionLabel(action: string): string;
|
|
70
|
+
export declare function readNodeKindLabel(type: WorkflowNode['type']): string;
|
|
71
|
+
export declare function readNodeDisplayLabel(nodeId: string, workflow: WorkflowDefinition | null): string;
|
|
72
|
+
export declare function readMemberDisplayText(memberId: string | null, memberProfilesById: ReadonlyMap<string, MemberProfileRecord>): string;
|
|
73
|
+
export declare function readTaskAssigneeLabel(task: TaskRecord, memberProfilesById?: ReadonlyMap<string, MemberProfileRecord>): string;
|
|
74
|
+
export declare function canMemberActOnTask(task: TaskRecord, memberId: string | null): boolean;
|
|
75
|
+
export declare function readReturnTargetOptions(workflow: WorkflowDefinition, node: WorkflowNode): readonly {
|
|
76
|
+
readonly id: string;
|
|
77
|
+
readonly name: string;
|
|
78
|
+
}[];
|
|
79
|
+
export declare function readMemberOption(profile: MemberProfileRecord): MemberOption;
|
|
80
|
+
export declare function readMemberOptionFromValue(value: unknown): MemberOption | null;
|
|
81
|
+
export declare function readUniqueMemberOption(searchText: string, options: readonly MemberOption[]): MemberOption | null;
|
|
82
|
+
export declare function readTextDescriptionPart(text: string | null): ActivityStepDescriptionPart | null;
|
|
83
|
+
export declare function readDangerTextDescriptionPart(text: string | null): ActivityStepDescriptionPart | null;
|
|
84
|
+
export declare function readMemberDescriptionPart(prefix: string, memberId: string | null, memberProfilesById: ReadonlyMap<string, MemberProfileRecord>, fallbackLabel: string): ActivityStepDescriptionPart;
|
|
85
|
+
export declare function isActivityDescriptionPart(part: ActivityStepDescriptionPart | null): part is ActivityStepDescriptionPart;
|
|
86
|
+
export declare function readCurrentActivityStep(activitySteps: readonly ActivityStepRecord[]): number;
|
|
87
|
+
export declare function isUserMeaningfulActivity(activityLog: ActivityLogRecord): boolean;
|
|
88
|
+
export declare function readActivityEventLabel(eventType: string, payload: Readonly<Record<string, unknown>>): string;
|
|
89
|
+
export declare function readActivityPayload(activityLog: ActivityLogRecord): Readonly<Record<string, unknown>>;
|
|
90
|
+
export declare function isActivityError(activityLog: ActivityLogRecord, payload: Readonly<Record<string, unknown>>): boolean;
|
|
91
|
+
export declare function formatActivityDateTime(value: string): string;
|
|
92
|
+
export declare function readActivityDetailParts(activityLog: ActivityLogRecord, payload: Readonly<Record<string, unknown>>, workflow: WorkflowDefinition | null, taskDecisionsByTaskId: ReadonlyMap<string, TaskDecisionRecord>, signaturesById: ReadonlyMap<string, SignatureRecord>, signatureVerification: SignatureVerificationRecord | null, memberProfilesById: ReadonlyMap<string, MemberProfileRecord>): readonly ActivityStepDescriptionPart[];
|
|
93
|
+
export declare function isFutureTimelineNode(node: WorkflowNode, tasks: readonly TaskRecord[], tokens: readonly WorkflowTokenRecord[], instanceState: ApprovalInstanceRecord['state'], representedNodeIds: ReadonlySet<string>): boolean;
|
|
94
|
+
export declare function readFutureTimelineNodes(workflow: WorkflowDefinition, tasks: readonly TaskRecord[], tokens: readonly WorkflowTokenRecord[], instanceState: ApprovalInstanceRecord['state'], representedNodeIds: ReadonlySet<string>): readonly WorkflowNode[];
|
|
95
|
+
export declare function readFutureNodeStepTitle(node: WorkflowNode): string;
|
|
96
|
+
export declare function readActivityStepRecords(activityLogs: readonly ActivityLogRecord[], tasks: readonly TaskRecord[], tokens: readonly WorkflowTokenRecord[], workflow: WorkflowDefinition | null, instanceState: ApprovalInstanceRecord['state'], memberProfilesById: ReadonlyMap<string, MemberProfileRecord>, taskDecisionsByTaskId: ReadonlyMap<string, TaskDecisionRecord>, signaturesById: ReadonlyMap<string, SignatureRecord>, signatureVerification: SignatureVerificationRecord | null): ActivityStepRecord[];
|
|
97
|
+
type RuntimeTone = 'cancelled' | 'completed' | 'current' | 'neutral' | 'waiting';
|
|
98
|
+
export declare function readNodeRuntimeState(node: WorkflowNode, tasks: readonly TaskRecord[], tokens: readonly WorkflowTokenRecord[], instanceState: string): Readonly<{
|
|
99
|
+
secondaryLabel: string;
|
|
100
|
+
statusLabel: string;
|
|
101
|
+
tone: RuntimeTone;
|
|
102
|
+
}>;
|
|
103
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/chunk-CMqjfN_6.cjs"),t=require("../../../chunks/router-adapter
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/chunk-CMqjfN_6.cjs"),t=require("../../../chunks/router-adapter--gYs13E8.cjs"),n=require("../../../chunks/auth-provider-4BeCw7cI.cjs"),r=require("../../../chunks/format-date-time-XxBzF0F5.cjs"),i=require("../../../chunks/routes-config-fDVHmvXi.cjs"),a=require("../../../chunks/FormRendererView-BwVsH2eX.cjs");let o=require("react"),s=require("@mezzanine-ui/react"),c=require("react/jsx-runtime"),l=require("@rytass/bpm-core-client/workflow"),u=require("@mezzanine-ui/react/ContentHeader");u=e.t(u,1);let d=require("@mezzanine-ui/icons"),f=require("@rytass/bpm-core-client/form");var p={display:`grid`,gap:16};function m(e={}){return(0,c.jsx)(o.Suspense,{fallback:(0,c.jsx)(g,{}),children:(0,c.jsx)(h,{templateId:e.templateId??void 0})})}function h({templateId:e}){let m=t.r(),h=i.r(),{member:g}=n.n(),v=g?.memberId??null,y=e??null,[b,x]=(0,o.useState)(null),[S,C]=(0,o.useState)({}),[w,T]=(0,o.useState)([]),[E,D]=(0,o.useState)(null),[O,k]=(0,o.useState)({}),[A,j]=(0,o.useState)(!0),[M,N]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(!y){L();return}R(y)},[y]);let P=(0,o.useMemo)(()=>w.map(e=>({...e,key:e.id,updatedAt:r.t(e.updatedAt),versionLabel:`v${e.version}`})),[w]),F=(0,o.useMemo)(()=>[{dataIndex:`name`,key:`name`,title:`模板名稱`,width:240},{dataIndex:`versionLabel`,key:`versionLabel`,title:`發布版本`,width:120},{dataIndex:`updatedAt`,key:`updatedAt`,title:`更新時間`,width:220}],[]),I=(0,o.useMemo)(()=>({render:e=>[{name:`發起`,onClick:()=>m.push(h.caseNew(e.id)),variant:`base-primary`}],variant:`base-secondary`,width:88}),[m]);async function L(){j(!0),D(null),x(null);try{T(await(0,l.listLaunchableTemplates)())}catch(e){D(_(e))}finally{j(!1)}}async function R(e){j(!0),D(null),T([]);try{x(await(0,l.readLaunchContext)(e))}catch(e){D(_(e))}finally{j(!1)}}async function z(){if(!b||!v)return;N(!0),D(null),k({});let e=(0,f.validateFormRendererValues)({schema:b.formVersion.schema,uiSchema:b.formVersion.uiSchema,values:S});if(!e.valid){k(e.errors),D(`請先補齊必填欄位。`),e.firstInvalidFieldKey&&(0,f.focusFormRendererField)(e.firstInvalidFieldKey),N(!1);return}try{let e=await(0,l.submitApprovalInstance)({formData:S,initiatorMemberId:v,templateId:b.template.id,title:(0,l.readFormDataCaseTitle)({fallbackTitle:b.template.name,formData:S,schema:b.formVersion.schema,uiSchema:b.formVersion.uiSchema})});m.push(h.caseDetail(e))}catch(e){D(_(e))}finally{N(!1)}}async function B(e,t){if(!v)throw Error(`尚未登入,無法上傳附件`);return{id:(await(0,l.uploadAttachment)({file:t,formFieldPath:`form.${e.fieldKey}`})).id}}return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.PageHeader,{children:(0,c.jsx)(u.default,{description:b?`${b.template.name} · 表單 v${b.formVersion.version}`:`選擇可發起的已發布模板後填寫表單內容。`,title:`發起簽核`,children:b?(0,c.jsx)(s.Button,{disabled:A||M,icon:d.CheckedIcon,iconType:`leading`,onClick:z,variant:`base-primary`,children:`送出`}):null})}),(0,c.jsx)(s.SectionGroup,{children:(0,c.jsx)(s.Section,{children:(0,c.jsxs)(`div`,{style:p,children:[E?(0,c.jsx)(s.Typography,{color:`text-error`,variant:`body`,children:E}):null,A?(0,c.jsx)(s.Typography,{color:`text-neutral`,variant:`body`,children:`載入中...`}):null,b?(0,c.jsx)(a.t,{errors:O,maxWidth:480,onChange:e=>{C(e),k({})},onUploadAttachment:B,schema:b.formVersion.schema,singleColumn:!0,uiSchema:b.formVersion.uiSchema,value:S}):null,!y&&!A?P.length>0?(0,c.jsx)(s.Table,{actions:I,columns:F,dataSource:P,fullWidth:!0}):(0,c.jsx)(s.Typography,{color:`text-neutral`,variant:`body`,children:`目前沒有可發起的已發布模板。`}):null]})})})]})}function g(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.PageHeader,{children:(0,c.jsx)(u.default,{description:`選擇可發起的已發布模板後填寫表單內容。`,title:`發起簽核`})}),(0,c.jsx)(s.SectionGroup,{children:(0,c.jsx)(s.Section,{children:(0,c.jsx)(s.Typography,{color:`text-neutral`,variant:`body`,children:`載入中...`})})})]})}function _(e){return e instanceof Error?e.message:`發生未知錯誤`}exports.InstanceNewView=m;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { r as e } from "../../../chunks/router-adapter-
|
|
3
|
-
import { n as t } from "../../../chunks/auth-provider-
|
|
2
|
+
import { r as e } from "../../../chunks/router-adapter-DftlFTOd.js";
|
|
3
|
+
import { n as t } from "../../../chunks/auth-provider-B5oPmvk2.js";
|
|
4
4
|
import { t as n } from "../../../chunks/format-date-time-CB-LxzqT.js";
|
|
5
|
-
import { r } from "../../../chunks/routes-config-
|
|
5
|
+
import { r } from "../../../chunks/routes-config-RBYQtUd0.js";
|
|
6
6
|
import { t as i } from "../../../chunks/FormRendererView-DrHsuSVo.js";
|
|
7
7
|
import { Suspense as a, useEffect as o, useMemo as s, useState as c } from "react";
|
|
8
8
|
import { Button as l, PageHeader as u, Section as d, SectionGroup as f, Table as p, Typography as m } from "@mezzanine-ui/react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/login-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/login-9bCXyjbX.cjs");exports.LoginView=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/login-
|
|
1
|
+
import { t as e } from "../../chunks/login-BKxpLibd.js";
|
|
2
2
|
export { e as LoginView };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-BMUKxzcz.cjs");let t=require("react/jsx-runtime");function n(){return(0,t.jsx)(e.t,{defaultState:null,description:`以關鍵字與狀態查詢你有權限查看的簽核案件。`,emptyMessage:`沒有符合條件的簽核案件。`,searchPlaceholder:`關鍵字:搜尋案件、發起人、模板或狀態`,title:`案件搜尋`,view:`ALL`})}exports.SearchView=n;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../../chunks/approval-instance-list-page-
|
|
2
|
+
import { t as e } from "../../chunks/approval-instance-list-page-YZcGGDD8.js";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
//#region src/views/search/SearchView.tsx
|
|
5
5
|
function n() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-BMUKxzcz.cjs");let t=require("react/jsx-runtime");function n(){return(0,t.jsx)(e.t,{defaultState:null,description:`查看由你發起的簽核案件與目前流程狀態。`,emptyMessage:`目前沒有由你發起的簽核案件。`,searchPlaceholder:`關鍵字:搜尋案件、發起人、模板或狀態`,title:`我發起的`,view:`SENT`})}exports.SentView=n;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/views/sent/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../../chunks/approval-instance-list-page-
|
|
2
|
+
import { t as e } from "../../chunks/approval-instance-list-page-YZcGGDD8.js";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
//#region src/views/sent/SentView.tsx
|
|
5
5
|
function n() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/notifications-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/notifications-BKs4--96.cjs");exports.SettingsNotificationsView=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/notifications-
|
|
1
|
+
import { t as e } from "../../chunks/notifications-CSulztkU.js";
|
|
2
2
|
export { e as SettingsNotificationsView };
|