@rytass/bpm-core-react 0.22.0 → 0.23.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 +51 -0
- package/dist/chunks/{FormBuilderView-DbfbLZCI.js → FormBuilderView-D_bN9gzT.js} +675 -614
- package/dist/chunks/FormBuilderView-D_bN9gzT.js.map +1 -0
- package/dist/chunks/FormBuilderView-bm8P55hp.cjs +4 -0
- package/dist/chunks/FormBuilderView-bm8P55hp.cjs.map +1 -0
- package/dist/chunks/FormRendererView-BlQgJOkI.cjs +6 -0
- package/dist/chunks/FormRendererView-BlQgJOkI.cjs.map +1 -0
- package/dist/chunks/{FormRendererView-CAyPXhPq.js → FormRendererView-CemHvfAT.js} +298 -290
- package/dist/chunks/FormRendererView-CemHvfAT.js.map +1 -0
- package/dist/chunks/compose-CdKVQfjB.cjs +2 -0
- package/dist/chunks/compose-CdKVQfjB.cjs.map +1 -0
- package/dist/chunks/{compose-U1zs3Yof.js → compose-N9657E5u.js} +161 -147
- package/dist/chunks/compose-N9657E5u.js.map +1 -0
- package/dist/chunks/{designer-DPG7R_WP.js → designer-CKwG_vM5.js} +1913 -1715
- package/dist/chunks/designer-CKwG_vM5.js.map +1 -0
- package/dist/chunks/designer-JPs7EijM.cjs +69 -0
- package/dist/chunks/designer-JPs7EijM.cjs.map +1 -0
- package/dist/chunks/detail-Dqu0K9QM.cjs +5 -0
- package/dist/chunks/detail-Dqu0K9QM.cjs.map +1 -0
- package/dist/chunks/{detail-CHZDNNM6.js → detail-fW0vJudE.js} +902 -895
- package/dist/chunks/detail-fW0vJudE.js.map +1 -0
- package/dist/chunks/instance-error-message-BKt07-Bo.js +270 -0
- package/dist/chunks/instance-error-message-BKt07-Bo.js.map +1 -0
- package/dist/chunks/instance-error-message-BL_X7Af8.cjs +2 -0
- package/dist/chunks/instance-error-message-BL_X7Af8.cjs.map +1 -0
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.js +1 -1
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.js +1 -1
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/renderer/FormRendererView.d.cts +26 -1
- package/dist/views/forms/renderer/FormRendererView.d.ts +26 -1
- package/dist/views/forms/renderer/index.cjs +1 -1
- package/dist/views/forms/renderer/index.js +1 -1
- package/dist/views/instances/approver-filled-form.d.cts +56 -20
- package/dist/views/instances/approver-filled-form.d.ts +56 -20
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +7 -0
- package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +7 -0
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +1 -1
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +1 -1
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.js +2 -2
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.js +1 -1
- package/dist/views/templates/compose/steps/ComposeReviewStep.d.cts +3 -1
- package/dist/views/templates/compose/steps/ComposeReviewStep.d.ts +3 -1
- package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.cts +4 -1
- package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.ts +4 -1
- package/dist/views/templates/compose/use-template-compose-wizard.d.cts +3 -1
- package/dist/views/templates/compose/use-template-compose-wizard.d.ts +3 -1
- package/dist/views/templates/designer/TemplateDesignerView.d.cts +10 -1
- package/dist/views/templates/designer/TemplateDesignerView.d.ts +10 -1
- package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.cts +3 -1
- package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.ts +3 -1
- package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.cts +3 -2
- package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.ts +3 -2
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -1
- package/dist/views/templates/designer/launch-mode.d.cts +19 -0
- package/dist/views/templates/designer/launch-mode.d.ts +19 -0
- package/dist/views/templates/designer/publish-default-value-check.d.cts +36 -0
- package/dist/views/templates/designer/publish-default-value-check.d.ts +36 -0
- package/package.json +3 -3
- package/dist/chunks/FormBuilderView-Bok4Y59D.cjs +0 -4
- package/dist/chunks/FormBuilderView-Bok4Y59D.cjs.map +0 -1
- package/dist/chunks/FormBuilderView-DbfbLZCI.js.map +0 -1
- package/dist/chunks/FormRendererView-CAyPXhPq.js.map +0 -1
- package/dist/chunks/FormRendererView-iLlHFIUR.cjs +0 -6
- package/dist/chunks/FormRendererView-iLlHFIUR.cjs.map +0 -1
- package/dist/chunks/compose-DP1N4twA.cjs +0 -2
- package/dist/chunks/compose-DP1N4twA.cjs.map +0 -1
- package/dist/chunks/compose-U1zs3Yof.js.map +0 -1
- package/dist/chunks/designer-CWL-dCQ_.cjs +0 -69
- package/dist/chunks/designer-CWL-dCQ_.cjs.map +0 -1
- package/dist/chunks/designer-DPG7R_WP.js.map +0 -1
- package/dist/chunks/detail-BUfsSal0.cjs +0 -5
- package/dist/chunks/detail-BUfsSal0.cjs.map +0 -1
- package/dist/chunks/detail-CHZDNNM6.js.map +0 -1
- package/dist/chunks/instance-error-message-BEM4O_Kj.js +0 -208
- package/dist/chunks/instance-error-message-BEM4O_Kj.js.map +0 -1
- package/dist/chunks/instance-error-message-BpCLCOjp.cjs +0 -2
- package/dist/chunks/instance-error-message-BpCLCOjp.cjs.map +0 -1
|
@@ -4,6 +4,22 @@ import { FormRendererValues } from '@rytass/bpm-core-client/form';
|
|
|
4
4
|
import { ResolvedFieldAccess } from '@rytass/bpm-core-shared';
|
|
5
5
|
import { FormDataSourceFieldState, FormRendererDataSourceContext } from './form-data-source-field.js';
|
|
6
6
|
import { FileUploadFieldState, FormRendererAttachment } from './file-upload-field.js';
|
|
7
|
+
/**
|
|
8
|
+
* What a viewer may do inside one table field, for approver fill in column mode
|
|
9
|
+
* (ADR 27 §4(a)). Keyed by the table's `fieldKey` in `FormRendererProps.tableAccess`.
|
|
10
|
+
*/
|
|
11
|
+
export interface FormRendererTableAccess {
|
|
12
|
+
/**
|
|
13
|
+
* Column `fieldKey`s whose cells the viewer may edit. Every other column is
|
|
14
|
+
* read-only in that table.
|
|
15
|
+
*/
|
|
16
|
+
readonly editableColumns: readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* When true, the row actions and the add-row button are hidden, so the viewer
|
|
19
|
+
* cannot add, remove or reorder rows.
|
|
20
|
+
*/
|
|
21
|
+
readonly lockRows: boolean;
|
|
22
|
+
}
|
|
7
23
|
export interface FormRendererProps {
|
|
8
24
|
readonly dataSourceContext?: FormRendererDataSourceContext;
|
|
9
25
|
readonly dataSourceInitialValues?: FormRendererValues;
|
|
@@ -24,6 +40,15 @@ export interface FormRendererProps {
|
|
|
24
40
|
* map leaves out follows `readonly`; leaving the prop out changes nothing.
|
|
25
41
|
*/
|
|
26
42
|
readonly fieldAccess?: Readonly<Record<string, ResolvedFieldAccess>>;
|
|
43
|
+
/**
|
|
44
|
+
* Per table field, which columns this viewer may edit and whether it may add
|
|
45
|
+
* or remove rows (ADR 27 §4(a)). A table listed here takes its cell
|
|
46
|
+
* editability from this map instead of `fieldAccess`, so a column-only grant
|
|
47
|
+
* does not lock the whole table; `fieldAccess` still decides visibility. The
|
|
48
|
+
* form's `readonly` prop still locks every cell. Tables left out follow
|
|
49
|
+
* `fieldAccess` and `readonly` as before.
|
|
50
|
+
*/
|
|
51
|
+
readonly tableAccess?: Readonly<Record<string, FormRendererTableAccess>>;
|
|
27
52
|
/**
|
|
28
53
|
* Short text shown after a field's label (Mezzanine `labelOptionalMarker`),
|
|
29
54
|
* per top-level field — e.g. 「本關補填」 on the fields an approver fills.
|
|
@@ -58,5 +83,5 @@ export interface FormRendererProps {
|
|
|
58
83
|
readonly uiSchema: FormUiSchema;
|
|
59
84
|
readonly value?: FormRendererValues;
|
|
60
85
|
}
|
|
61
|
-
export declare function FormRenderer({ attachments, dataSourceContext, dataSourceInitialValues, emptyText, errors, fieldAccess, fieldLabelMarkers, maxWidth, onChange, onDataSourceStateChange, onDownloadAttachment, onFileUploadStateChange, onUploadAttachment, optionSnapshots, readonly, schema, singleColumn, uiSchema, value, }: FormRendererProps): ReactElement;
|
|
86
|
+
export declare function FormRenderer({ attachments, dataSourceContext, dataSourceInitialValues, emptyText, errors, fieldAccess, fieldLabelMarkers, maxWidth, onChange, onDataSourceStateChange, onDownloadAttachment, onFileUploadStateChange, onUploadAttachment, optionSnapshots, readonly, schema, singleColumn, tableAccess, uiSchema, value, }: FormRendererProps): ReactElement;
|
|
62
87
|
export { FormRenderer as FormRendererView };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/FormRendererView-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/FormRendererView-BlQgJOkI.cjs");exports.FormRenderer=e.t,exports.FormRendererView=e.t,exports.isFormDataSourceFieldSubmissionBlocked=e.s,exports.readFileUploadSubmissionBlockMessage=e.a,exports.readFormDataSourceFieldStatusMessage=e.c,exports.readFormDataSourceSubmissionBlockMessage=e.l,exports.useFormDataSourceField=e.u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as FormRenderer, t as FormRendererView, s as isFormDataSourceFieldSubmissionBlocked, a as readFileUploadSubmissionBlockMessage, c as readFormDataSourceFieldStatusMessage, l as readFormDataSourceSubmissionBlockMessage, u as useFormDataSourceField } from "../../../chunks/FormRendererView-
|
|
1
|
+
export { t as FormRenderer, t as FormRendererView, s as isFormDataSourceFieldSubmissionBlocked, a as readFileUploadSubmissionBlockMessage, c as readFormDataSourceFieldStatusMessage, l as readFormDataSourceSubmissionBlockMessage, u as useFormDataSourceField } from "../../../chunks/FormRendererView-CemHvfAT.js";
|
|
@@ -1,28 +1,53 @@
|
|
|
1
|
-
import { UserTaskNode, WorkflowDefinition } from '@rytass/bpm-core-shared';
|
|
1
|
+
import { FieldAccessFillUnit, UserTaskNode, WorkflowDefinition } from '@rytass/bpm-core-shared';
|
|
2
2
|
import { FormDefinitionSchema, FormDataIssue } from '@rytass/bpm-core-shared/form';
|
|
3
3
|
import { WorkflowFormData } from '@rytass/bpm-core-client/workflow';
|
|
4
|
+
/** A fill grant on one column: the open cell's fill. */
|
|
5
|
+
type ColumnFill = FieldAccessFillUnit['fill'];
|
|
4
6
|
/**
|
|
5
|
-
* The form as the applicant sees it: without the fields some approver fills in
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* The form as the applicant sees it: without the fields some approver fills in
|
|
8
|
+
* as a whole, and without the columns some approver fills per column. A table
|
|
9
|
+
* keeps its other columns, and is dropped when none remain. The server drops
|
|
10
|
+
* those keys from a submission, so rendering one would swallow what the
|
|
11
|
+
* applicant types, and a `minRows` or `required` on it would block a launch
|
|
12
|
+
* nobody can complete. Never mutates its input.
|
|
10
13
|
*/
|
|
11
14
|
export declare function readApplicantFormSchema(schema: FormDefinitionSchema, definition: WorkflowDefinition): FormDefinitionSchema;
|
|
12
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* The payload the applicant may send: `values` without the keys an approver
|
|
17
|
+
* fills as a whole, and without the open cells of the tables an approver fills
|
|
18
|
+
* per column. A table left with no applicant cell at all is omitted, so the
|
|
19
|
+
* server keeps the approver's cells as they are.
|
|
20
|
+
*
|
|
21
|
+
* Known limit: the schema is not passed in, so a table whose every column is
|
|
22
|
+
* approver-filled is recognised by its rows, not by its columns. A table that
|
|
23
|
+
* had no rows is omitted for the same reason.
|
|
24
|
+
*/
|
|
13
25
|
export declare function readApplicantSubmission(values: WorkflowFormData, definition: WorkflowDefinition): WorkflowFormData;
|
|
14
26
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
* Top-level fields this node lets its approver fill only per column (ADR 27
|
|
28
|
+
* §4(a)). A field the node also grants whole is not in this set.
|
|
29
|
+
*/
|
|
30
|
+
export declare function readFillColumnModeFieldKeys(node: UserTaskNode): ReadonlySet<string>;
|
|
31
|
+
/**
|
|
32
|
+
* The columns of `fieldKey` this node opens to its approver, each with its
|
|
33
|
+
* fill. Empty when the node opens none of them.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readFillOpenColumns(node: UserTaskNode, fieldKey: string): ReadonlyMap<string, ColumnFill>;
|
|
36
|
+
/**
|
|
37
|
+
* The form an approver's fill is validated against: only what `node` lets them
|
|
38
|
+
* fill in, each whole field required exactly when the node says `REQUIRED`,
|
|
39
|
+
* and each column-only table reduced to its open columns. A required table
|
|
40
|
+
* needs at least one row, the rule `validateFormRendererValues` already
|
|
41
|
+
* applies, so the result agrees with the server's fill check. Never mutates its
|
|
42
|
+
* input.
|
|
20
43
|
*/
|
|
21
44
|
export declare function readFillValidationSchema(schema: FormDefinitionSchema, node: UserTaskNode): FormDefinitionSchema;
|
|
22
45
|
/**
|
|
23
46
|
* The schema the fill node's approver sees: every field as the form defines
|
|
24
47
|
* it, except that the node's fillable fields are required exactly when the
|
|
25
|
-
* node says `REQUIRED`, so the asterisk matches what approving will check.
|
|
48
|
+
* node says `REQUIRED`, so the asterisk matches what approving will check. A
|
|
49
|
+
* column-only table keeps every column, so the closed ones still show; their
|
|
50
|
+
* requirement is cleared, and the open ones follow the node.
|
|
26
51
|
*/
|
|
27
52
|
export declare function readFillDisplaySchema(schema: FormDefinitionSchema, node: UserTaskNode): FormDefinitionSchema;
|
|
28
53
|
/**
|
|
@@ -35,17 +60,21 @@ export declare function readFillLabelMarkers(definition: WorkflowDefinition, vie
|
|
|
35
60
|
/**
|
|
36
61
|
* What approving sends as `fill.formData`: the keys of `values` that `node`
|
|
37
62
|
* lets its approver fill, and nothing else (the server refuses any other key).
|
|
38
|
-
* `values` is
|
|
39
|
-
* default the approver never touched (a table's empty rows,
|
|
40
|
-
* `false`) is not theirs to sign
|
|
63
|
+
* `values` is the fill changes from `readFillChanges`, not the rendered form:
|
|
64
|
+
* a renderer default the approver never touched (a table's empty rows, an
|
|
65
|
+
* OPTIONAL boolean's `false`) is not theirs to sign and stays out. A REQUIRED
|
|
66
|
+
* boolean is the exception; its shown value is sent, see `readFillChanges`.
|
|
41
67
|
*/
|
|
42
|
-
export declare function readFillPayload(values: WorkflowFormData, node: UserTaskNode): Readonly<Record<string, unknown>>;
|
|
68
|
+
export declare function readFillPayload(values: WorkflowFormData, node: UserTaskNode, stored?: WorkflowFormData): Readonly<Record<string, unknown>>;
|
|
43
69
|
/**
|
|
44
70
|
* What the approver's fill amounts to: the fields they changed (`draft`), plus
|
|
45
71
|
* each fill table the page seeds with `minRows` rows that the case does not
|
|
46
|
-
* store yet
|
|
47
|
-
*
|
|
48
|
-
*
|
|
72
|
+
* store yet, and each REQUIRED boolean fill field at the value the page shows.
|
|
73
|
+
* The page shows those rows and values and validates them, so they are sent
|
|
74
|
+
* too. Left out, the server would refuse the approval for a missing row, and
|
|
75
|
+
* for a missing `false` that the approver can see on screen: a boolean that
|
|
76
|
+
* is never sent reads as empty, while `false` is a value. Changed values
|
|
77
|
+
* override the displayed ones.
|
|
49
78
|
*/
|
|
50
79
|
export declare function readFillChanges({ draft, node, schema, stored, values, }: {
|
|
51
80
|
readonly draft: WorkflowFormData;
|
|
@@ -56,6 +85,12 @@ export declare function readFillChanges({ draft, node, schema, stored, values, }
|
|
|
56
85
|
}): WorkflowFormData;
|
|
57
86
|
/** The server message of a fill against form data someone else changed. */
|
|
58
87
|
export declare function isFillConflictMessage(message: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The stable code the server answers when an approver's fill adds, removes or
|
|
90
|
+
* reorders rows of a column-only table (ADR 27 §4(a)). Its message is English;
|
|
91
|
+
* callers show their own copy from this code.
|
|
92
|
+
*/
|
|
93
|
+
export declare const FILL_TABLE_ROWS_LOCKED_CODE = "FORM_FIELD_ACCESS_TABLE_ROWS_LOCKED";
|
|
59
94
|
/**
|
|
60
95
|
* Turns the server's fill validation refusal (docs/08 §8.5, error table 2)
|
|
61
96
|
* into field errors keyed the way `FormRenderer` addresses them, so a check
|
|
@@ -84,3 +119,4 @@ export declare function readFillOrgUnitIds(schema: FormDefinitionSchema, values:
|
|
|
84
119
|
* unit field names its unit from `orgUnitNames` and shows 「未知組織」 otherwise.
|
|
85
120
|
*/
|
|
86
121
|
export declare function readFillSummary(schema: FormDefinitionSchema, node: UserTaskNode, values: WorkflowFormData, memberNames?: ReadonlyMap<string, string>, orgUnitNames?: ReadonlyMap<string, string>): readonly FillSummaryItem[];
|
|
122
|
+
export {};
|
|
@@ -1,28 +1,53 @@
|
|
|
1
|
-
import { UserTaskNode, WorkflowDefinition } from '@rytass/bpm-core-shared';
|
|
1
|
+
import { FieldAccessFillUnit, UserTaskNode, WorkflowDefinition } from '@rytass/bpm-core-shared';
|
|
2
2
|
import { FormDefinitionSchema, FormDataIssue } from '@rytass/bpm-core-shared/form';
|
|
3
3
|
import { WorkflowFormData } from '@rytass/bpm-core-client/workflow';
|
|
4
|
+
/** A fill grant on one column: the open cell's fill. */
|
|
5
|
+
type ColumnFill = FieldAccessFillUnit['fill'];
|
|
4
6
|
/**
|
|
5
|
-
* The form as the applicant sees it: without the fields some approver fills in
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* The form as the applicant sees it: without the fields some approver fills in
|
|
8
|
+
* as a whole, and without the columns some approver fills per column. A table
|
|
9
|
+
* keeps its other columns, and is dropped when none remain. The server drops
|
|
10
|
+
* those keys from a submission, so rendering one would swallow what the
|
|
11
|
+
* applicant types, and a `minRows` or `required` on it would block a launch
|
|
12
|
+
* nobody can complete. Never mutates its input.
|
|
10
13
|
*/
|
|
11
14
|
export declare function readApplicantFormSchema(schema: FormDefinitionSchema, definition: WorkflowDefinition): FormDefinitionSchema;
|
|
12
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* The payload the applicant may send: `values` without the keys an approver
|
|
17
|
+
* fills as a whole, and without the open cells of the tables an approver fills
|
|
18
|
+
* per column. A table left with no applicant cell at all is omitted, so the
|
|
19
|
+
* server keeps the approver's cells as they are.
|
|
20
|
+
*
|
|
21
|
+
* Known limit: the schema is not passed in, so a table whose every column is
|
|
22
|
+
* approver-filled is recognised by its rows, not by its columns. A table that
|
|
23
|
+
* had no rows is omitted for the same reason.
|
|
24
|
+
*/
|
|
13
25
|
export declare function readApplicantSubmission(values: WorkflowFormData, definition: WorkflowDefinition): WorkflowFormData;
|
|
14
26
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
* Top-level fields this node lets its approver fill only per column (ADR 27
|
|
28
|
+
* §4(a)). A field the node also grants whole is not in this set.
|
|
29
|
+
*/
|
|
30
|
+
export declare function readFillColumnModeFieldKeys(node: UserTaskNode): ReadonlySet<string>;
|
|
31
|
+
/**
|
|
32
|
+
* The columns of `fieldKey` this node opens to its approver, each with its
|
|
33
|
+
* fill. Empty when the node opens none of them.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readFillOpenColumns(node: UserTaskNode, fieldKey: string): ReadonlyMap<string, ColumnFill>;
|
|
36
|
+
/**
|
|
37
|
+
* The form an approver's fill is validated against: only what `node` lets them
|
|
38
|
+
* fill in, each whole field required exactly when the node says `REQUIRED`,
|
|
39
|
+
* and each column-only table reduced to its open columns. A required table
|
|
40
|
+
* needs at least one row, the rule `validateFormRendererValues` already
|
|
41
|
+
* applies, so the result agrees with the server's fill check. Never mutates its
|
|
42
|
+
* input.
|
|
20
43
|
*/
|
|
21
44
|
export declare function readFillValidationSchema(schema: FormDefinitionSchema, node: UserTaskNode): FormDefinitionSchema;
|
|
22
45
|
/**
|
|
23
46
|
* The schema the fill node's approver sees: every field as the form defines
|
|
24
47
|
* it, except that the node's fillable fields are required exactly when the
|
|
25
|
-
* node says `REQUIRED`, so the asterisk matches what approving will check.
|
|
48
|
+
* node says `REQUIRED`, so the asterisk matches what approving will check. A
|
|
49
|
+
* column-only table keeps every column, so the closed ones still show; their
|
|
50
|
+
* requirement is cleared, and the open ones follow the node.
|
|
26
51
|
*/
|
|
27
52
|
export declare function readFillDisplaySchema(schema: FormDefinitionSchema, node: UserTaskNode): FormDefinitionSchema;
|
|
28
53
|
/**
|
|
@@ -35,17 +60,21 @@ export declare function readFillLabelMarkers(definition: WorkflowDefinition, vie
|
|
|
35
60
|
/**
|
|
36
61
|
* What approving sends as `fill.formData`: the keys of `values` that `node`
|
|
37
62
|
* lets its approver fill, and nothing else (the server refuses any other key).
|
|
38
|
-
* `values` is
|
|
39
|
-
* default the approver never touched (a table's empty rows,
|
|
40
|
-
* `false`) is not theirs to sign
|
|
63
|
+
* `values` is the fill changes from `readFillChanges`, not the rendered form:
|
|
64
|
+
* a renderer default the approver never touched (a table's empty rows, an
|
|
65
|
+
* OPTIONAL boolean's `false`) is not theirs to sign and stays out. A REQUIRED
|
|
66
|
+
* boolean is the exception; its shown value is sent, see `readFillChanges`.
|
|
41
67
|
*/
|
|
42
|
-
export declare function readFillPayload(values: WorkflowFormData, node: UserTaskNode): Readonly<Record<string, unknown>>;
|
|
68
|
+
export declare function readFillPayload(values: WorkflowFormData, node: UserTaskNode, stored?: WorkflowFormData): Readonly<Record<string, unknown>>;
|
|
43
69
|
/**
|
|
44
70
|
* What the approver's fill amounts to: the fields they changed (`draft`), plus
|
|
45
71
|
* each fill table the page seeds with `minRows` rows that the case does not
|
|
46
|
-
* store yet
|
|
47
|
-
*
|
|
48
|
-
*
|
|
72
|
+
* store yet, and each REQUIRED boolean fill field at the value the page shows.
|
|
73
|
+
* The page shows those rows and values and validates them, so they are sent
|
|
74
|
+
* too. Left out, the server would refuse the approval for a missing row, and
|
|
75
|
+
* for a missing `false` that the approver can see on screen: a boolean that
|
|
76
|
+
* is never sent reads as empty, while `false` is a value. Changed values
|
|
77
|
+
* override the displayed ones.
|
|
49
78
|
*/
|
|
50
79
|
export declare function readFillChanges({ draft, node, schema, stored, values, }: {
|
|
51
80
|
readonly draft: WorkflowFormData;
|
|
@@ -56,6 +85,12 @@ export declare function readFillChanges({ draft, node, schema, stored, values, }
|
|
|
56
85
|
}): WorkflowFormData;
|
|
57
86
|
/** The server message of a fill against form data someone else changed. */
|
|
58
87
|
export declare function isFillConflictMessage(message: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The stable code the server answers when an approver's fill adds, removes or
|
|
90
|
+
* reorders rows of a column-only table (ADR 27 §4(a)). Its message is English;
|
|
91
|
+
* callers show their own copy from this code.
|
|
92
|
+
*/
|
|
93
|
+
export declare const FILL_TABLE_ROWS_LOCKED_CODE = "FORM_FIELD_ACCESS_TABLE_ROWS_LOCKED";
|
|
59
94
|
/**
|
|
60
95
|
* Turns the server's fill validation refusal (docs/08 §8.5, error table 2)
|
|
61
96
|
* into field errors keyed the way `FormRenderer` addresses them, so a check
|
|
@@ -84,3 +119,4 @@ export declare function readFillOrgUnitIds(schema: FormDefinitionSchema, values:
|
|
|
84
119
|
* unit field names its unit from `orgUnitNames` and shows 「未知組織」 otherwise.
|
|
85
120
|
*/
|
|
86
121
|
export declare function readFillSummary(schema: FormDefinitionSchema, node: UserTaskNode, values: WorkflowFormData, memberNames?: ReadonlyMap<string, string>, orgUnitNames?: ReadonlyMap<string, string>): readonly FillSummaryItem[];
|
|
122
|
+
export {};
|
|
@@ -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-Dqu0K9QM.cjs");exports.InstanceAttachmentsSection=e.o,exports.InstanceDetailView=e.t,exports.InstanceFormSection=e.s,exports.InstanceHistorySection=e.r,exports.InstanceSignaturesSection=e.i,exports.InstanceTasksSection=e.a,exports.InstanceWebhookDeliveriesSection=e.n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { o as InstanceAttachmentsSection, t as InstanceDetailView, s as InstanceFormSection, r as InstanceHistorySection, i as InstanceSignaturesSection, a as InstanceTasksSection, n as InstanceWebhookDeliveriesSection } from "../../../chunks/detail-
|
|
1
|
+
export { o as InstanceAttachmentsSection, t as InstanceDetailView, s as InstanceFormSection, r as InstanceHistorySection, i as InstanceSignaturesSection, a as InstanceTasksSection, n as InstanceWebhookDeliveriesSection } from "../../../chunks/detail-fW0vJudE.js";
|
|
@@ -2,6 +2,7 @@ import { ReactElement } from 'react';
|
|
|
2
2
|
import { ResolvedFieldAccess } from '@rytass/bpm-core-shared';
|
|
3
3
|
import { FormDefinitionSchema, FormFieldDefinition } from '@rytass/bpm-core-shared/form';
|
|
4
4
|
import { ApprovalInstanceRecord, WorkflowFormData } from '@rytass/bpm-core-client/workflow';
|
|
5
|
+
import { FormRendererTableAccess } from '../../../forms/renderer/FormRendererView.cjs';
|
|
5
6
|
import { FormDataSourceFieldState } from '../../../forms/renderer/form-data-source-field.cjs';
|
|
6
7
|
import { FileUploadFieldState, FormRendererAttachment } from '../../../forms/renderer/file-upload-field.cjs';
|
|
7
8
|
/** The fill state of the viewer's own task at a node that fills in fields. */
|
|
@@ -16,6 +17,12 @@ export interface InstanceFormSectionFill {
|
|
|
16
17
|
readonly schema: FormDefinitionSchema;
|
|
17
18
|
/** The stored form data with the draft fill on top. */
|
|
18
19
|
readonly value: WorkflowFormData;
|
|
20
|
+
/**
|
|
21
|
+
* Per table the node opens only column by column: the open columns the
|
|
22
|
+
* approver may edit, with the rows locked. Absent when the node opens no
|
|
23
|
+
* column-only table.
|
|
24
|
+
*/
|
|
25
|
+
readonly tableAccess?: Readonly<Record<string, FormRendererTableAccess>>;
|
|
19
26
|
}
|
|
20
27
|
export interface InstanceFormSectionProps {
|
|
21
28
|
/**
|
|
@@ -2,6 +2,7 @@ import { ReactElement } from 'react';
|
|
|
2
2
|
import { ResolvedFieldAccess } from '@rytass/bpm-core-shared';
|
|
3
3
|
import { FormDefinitionSchema, FormFieldDefinition } from '@rytass/bpm-core-shared/form';
|
|
4
4
|
import { ApprovalInstanceRecord, WorkflowFormData } from '@rytass/bpm-core-client/workflow';
|
|
5
|
+
import { FormRendererTableAccess } from '../../../forms/renderer/FormRendererView.js';
|
|
5
6
|
import { FormDataSourceFieldState } from '../../../forms/renderer/form-data-source-field.js';
|
|
6
7
|
import { FileUploadFieldState, FormRendererAttachment } from '../../../forms/renderer/file-upload-field.js';
|
|
7
8
|
/** The fill state of the viewer's own task at a node that fills in fields. */
|
|
@@ -16,6 +17,12 @@ export interface InstanceFormSectionFill {
|
|
|
16
17
|
readonly schema: FormDefinitionSchema;
|
|
17
18
|
/** The stored form data with the draft fill on top. */
|
|
18
19
|
readonly value: WorkflowFormData;
|
|
20
|
+
/**
|
|
21
|
+
* Per table the node opens only column by column: the open columns the
|
|
22
|
+
* approver may edit, with the rows locked. Absent when the node opens no
|
|
23
|
+
* column-only table.
|
|
24
|
+
*/
|
|
25
|
+
readonly tableAccess?: Readonly<Record<string, FormRendererTableAccess>>;
|
|
19
26
|
}
|
|
20
27
|
export interface InstanceFormSectionProps {
|
|
21
28
|
/**
|
|
@@ -51,7 +51,7 @@ export interface InstanceTasksSectionProps {
|
|
|
51
51
|
* `true` means the container showed it (a conflict or field errors), so the
|
|
52
52
|
* dialog closes instead of repeating it.
|
|
53
53
|
*/
|
|
54
|
-
readonly onFillApproveError?: (message: string, formDataIssues?: readonly FormDataIssue[]) => boolean;
|
|
54
|
+
readonly onFillApproveError?: (message: string, formDataIssues?: readonly FormDataIssue[], code?: string | null) => boolean;
|
|
55
55
|
/** All tasks for this instance. */
|
|
56
56
|
readonly tasks: readonly TaskRecord[];
|
|
57
57
|
/** Ad-hoc directives recorded on this instance. */
|
|
@@ -51,7 +51,7 @@ export interface InstanceTasksSectionProps {
|
|
|
51
51
|
* `true` means the container showed it (a conflict or field errors), so the
|
|
52
52
|
* dialog closes instead of repeating it.
|
|
53
53
|
*/
|
|
54
|
-
readonly onFillApproveError?: (message: string, formDataIssues?: readonly FormDataIssue[]) => boolean;
|
|
54
|
+
readonly onFillApproveError?: (message: string, formDataIssues?: readonly FormDataIssue[], code?: string | null) => boolean;
|
|
55
55
|
/** All tasks for this instance. */
|
|
56
56
|
readonly tasks: readonly TaskRecord[];
|
|
57
57
|
/** Ad-hoc directives recorded on this instance. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/rolldown-runtime-BocRIvOZ.cjs"),t=require("../../../chunks/instance-error-message-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/rolldown-runtime-BocRIvOZ.cjs"),t=require("../../../chunks/instance-error-message-BL_X7Af8.cjs"),n=require("../../../chunks/format-date-time-D-cx5M8z.cjs"),r=require("../../../chunks/auth-provider-4BeCw7cI.cjs"),i=require("../../../chunks/router-adapter--gYs13E8.cjs"),a=require("../../../chunks/routes-config-C1j_vFKo.cjs"),o=require("../../../chunks/FormRendererView-BlQgJOkI.cjs");let s=require("react"),c=require("@mezzanine-ui/react"),l=require("react/jsx-runtime"),u=require("@rytass/bpm-core-client/workflow"),d=require("@mezzanine-ui/react/ContentHeader");d=e.t(d,1);let f=require("@rytass/bpm-core-client/form"),p=require("@mezzanine-ui/icons");var m={display:`grid`,gap:16};function h(e={}){return(0,l.jsx)(s.Suspense,{fallback:(0,l.jsx)(_,{}),children:(0,l.jsx)(g,{templateId:e.templateId??void 0})})}function g({templateId:e}){let h=i.r(),g=a.r(),{member:_}=r.n(),v=_?.memberId??null,y=e??null,[b,x]=(0,s.useState)(null),[S,C]=(0,s.useState)({}),[w,T]=(0,s.useState)([]),[E,D]=(0,s.useState)(null),[O,k]=(0,s.useState)({}),[A,j]=(0,s.useState)(!0),[M,N]=(0,s.useState)(!1),[P,F]=(0,s.useState)({}),I=o.o(),L=(0,s.useMemo)(()=>b?t.i(b.formVersion.schema,b.templateVersion.workflowDefinition):null,[b]),R=(0,s.useCallback)((e,t)=>{F(n=>{let r=n[e];return r?.hasValue===t.hasValue&&r.selectionExpired===(t.selectionExpired===!0)&&r.status===t.status?n:{...n,[e]:{hasValue:t.hasValue,selectionExpired:t.selectionExpired===!0,status:t.status}}})},[]);(0,s.useEffect)(()=>{y?U(y):H()},[y]);let z=(0,s.useMemo)(()=>w.map(e=>({...e,key:e.id,updatedAt:n.t(e.updatedAt),versionLabel:`v${e.version}`})),[w]),B=(0,s.useMemo)(()=>[{dataIndex:`name`,key:`name`,title:`模板名稱`,width:240},{dataIndex:`versionLabel`,key:`versionLabel`,title:`發布版本`,width:120},{dataIndex:`updatedAt`,key:`updatedAt`,title:`更新時間`,width:220}],[]),V=(0,s.useMemo)(()=>({render:e=>[{name:`發起`,onClick:()=>h.push(g.caseNew(e.id)),variant:`base-primary`}],variant:`base-secondary`,width:88}),[h]);async function H(){j(!0),D(null),x(null),F({});try{T(await(0,u.listLaunchableTemplates)())}catch(e){D(t.t(e))}finally{j(!1)}}async function U(e){j(!0),D(null),T([]),F({});try{x(await(0,u.readLaunchContext)(e))}catch(e){D(t.t(e))}finally{j(!1)}}async function W(){if(!b||!L||!v)return;N(!0),D(null),k({});let e=o.l(Object.values(P));if(e){D(e),N(!1);return}if(I.blockMessage){D(I.blockMessage),N(!1);return}let n=t.a((0,f.buildFormRendererValues)(L.fields,S),b.templateVersion.workflowDefinition);try{let e=await(0,f.validateFormRendererValuesInWorker)({schema:L,uiSchema:b.formVersion.uiSchema,values:n});if(!e.valid){k(e.errors),D(`請先修正表單中標示的欄位。`),e.firstInvalidFieldKey&&(0,f.focusFormRendererField)(e.firstInvalidFieldKey);return}let t=await(0,u.submitApprovalInstance)({formData:n,initiatorMemberId:v,templateId:b.template.id,title:(0,u.readFormDataCaseTitle)({fallbackTitle:b.template.name,formData:n,schema:L,uiSchema:b.formVersion.uiSchema})});h.push(g.caseDetail(t))}catch(e){D(t.t(e))}finally{N(!1)}}async function G(e,t){if(!v)throw Error(`尚未登入,無法上傳附件`);return{id:(await(0,u.uploadAttachment)({file:t,formFieldPath:`form.${e.fieldKey}`})).id}}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.PageHeader,{children:(0,l.jsx)(d.default,{description:b?`${b.template.name} · 表單 v${b.formVersion.version}`:`選擇可發起的已發布模板後填寫表單內容。`,title:`發起簽核`,children:b?(0,l.jsx)(c.Button,{disabled:A||M,icon:p.CheckedIcon,iconType:`leading`,onClick:W,variant:`base-primary`,children:`送出`}):null})}),(0,l.jsx)(c.SectionGroup,{children:(0,l.jsx)(c.Section,{children:(0,l.jsxs)(`div`,{style:m,children:[E?(0,l.jsx)(c.Typography,{color:`text-error`,variant:`body`,children:E}):null,A?(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`body`,children:`載入中...`}):null,b&&L?(0,l.jsx)(o.t,{dataSourceContext:{kind:`runtime`,templateId:b.template.id},errors:O,maxWidth:480,onChange:e=>{C(e),k({})},onDataSourceStateChange:R,onFileUploadStateChange:I.onFileUploadStateChange,onUploadAttachment:G,schema:L,singleColumn:!0,uiSchema:b.formVersion.uiSchema,value:S}):null,!y&&!A?z.length>0?(0,l.jsx)(c.Table,{actions:V,columns:B,dataSource:z,fullWidth:!0}):(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`body`,children:`目前沒有可發起的已發布模板。`}):null]})})})]})}function _(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.PageHeader,{children:(0,l.jsx)(d.default,{description:`選擇可發起的已發布模板後填寫表單內容。`,title:`發起簽核`})}),(0,l.jsx)(c.SectionGroup,{children:(0,l.jsx)(c.Section,{children:(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`body`,children:`載入中...`})})})]})}exports.InstanceNewView=h;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { a as e, i as t, t as n } from "../../../chunks/instance-error-message-BKt07-Bo.js";
|
|
3
3
|
import { t as r } from "../../../chunks/format-date-time-B0LdmWg4.js";
|
|
4
4
|
import { n as i } from "../../../chunks/auth-provider-C2b-5mGt.js";
|
|
5
5
|
import { r as a } from "../../../chunks/router-adapter-CkxCyzf5.js";
|
|
6
6
|
import { r as o } from "../../../chunks/routes-config-BcNaWJWJ.js";
|
|
7
|
-
import { l as s, o as c, t as l } from "../../../chunks/FormRendererView-
|
|
7
|
+
import { l as s, o as c, t as l } from "../../../chunks/FormRendererView-CemHvfAT.js";
|
|
8
8
|
import { Suspense as u, useCallback as d, useEffect as f, useMemo as p, useState as m } from "react";
|
|
9
9
|
import { Button as ee, PageHeader as h, Section as g, SectionGroup as _, Table as v, Typography as y } from "@mezzanine-ui/react";
|
|
10
10
|
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/compose-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/compose-CdKVQfjB.cjs");exports.EMPTY_COMPOSE_FORM_SCHEMA=e.n,exports.EMPTY_COMPOSE_FORM_UI_SCHEMA=e.r,exports.TemplateComposeWizardView=e.t,exports.useTemplateComposeWizard=e.i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as EMPTY_COMPOSE_FORM_SCHEMA, r as EMPTY_COMPOSE_FORM_UI_SCHEMA, t as TemplateComposeWizardView, i as useTemplateComposeWizard } from "../../../chunks/compose-
|
|
1
|
+
export { n as EMPTY_COMPOSE_FORM_SCHEMA, r as EMPTY_COMPOSE_FORM_UI_SCHEMA, t as TemplateComposeWizardView, i as useTemplateComposeWizard } from "../../../chunks/compose-N9657E5u.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { FormDefinitionSchema, FormUiSchema } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
import { ApprovalTemplateLaunchMode } from '@rytass/bpm-core-client/template';
|
|
3
4
|
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
5
|
export interface ComposeReviewStepProps {
|
|
5
6
|
readonly name: string;
|
|
@@ -7,6 +8,7 @@ export interface ComposeReviewStepProps {
|
|
|
7
8
|
readonly formUiSchema: FormUiSchema;
|
|
8
9
|
readonly workflowDefinition: WorkflowDefinition | null;
|
|
9
10
|
readonly initiatorPolicyCel: string | null;
|
|
11
|
+
readonly launchMode: ApprovalTemplateLaunchMode;
|
|
10
12
|
readonly publishError: string | null;
|
|
11
13
|
}
|
|
12
|
-
export declare function ComposeReviewStep({ formSchema, formUiSchema, initiatorPolicyCel, name, publishError, workflowDefinition, }: ComposeReviewStepProps): ReactElement;
|
|
14
|
+
export declare function ComposeReviewStep({ formSchema, formUiSchema, initiatorPolicyCel, launchMode, name, publishError, workflowDefinition, }: ComposeReviewStepProps): ReactElement;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { FormDefinitionSchema, FormUiSchema } from '@rytass/bpm-core-shared/form';
|
|
3
|
+
import { ApprovalTemplateLaunchMode } from '@rytass/bpm-core-client/template';
|
|
3
4
|
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
5
|
export interface ComposeReviewStepProps {
|
|
5
6
|
readonly name: string;
|
|
@@ -7,6 +8,7 @@ export interface ComposeReviewStepProps {
|
|
|
7
8
|
readonly formUiSchema: FormUiSchema;
|
|
8
9
|
readonly workflowDefinition: WorkflowDefinition | null;
|
|
9
10
|
readonly initiatorPolicyCel: string | null;
|
|
11
|
+
readonly launchMode: ApprovalTemplateLaunchMode;
|
|
10
12
|
readonly publishError: string | null;
|
|
11
13
|
}
|
|
12
|
-
export declare function ComposeReviewStep({ formSchema, formUiSchema, initiatorPolicyCel, name, publishError, workflowDefinition, }: ComposeReviewStepProps): ReactElement;
|
|
14
|
+
export declare function ComposeReviewStep({ formSchema, formUiSchema, initiatorPolicyCel, launchMode, name, publishError, workflowDefinition, }: ComposeReviewStepProps): ReactElement;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
|
|
3
3
|
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
import { ApprovalTemplateLaunchMode } from '@rytass/bpm-core-client/template';
|
|
4
5
|
export interface ComposeWorkflowStepProps {
|
|
5
6
|
readonly formSchema: FormDefinitionSchema;
|
|
6
7
|
readonly workflowDefinition: WorkflowDefinition | null;
|
|
7
8
|
readonly initiatorPolicyCel: string | null;
|
|
8
9
|
readonly onWorkflowChange: (definition: WorkflowDefinition) => void;
|
|
9
10
|
readonly onInitiatorPolicyChange: (cel: string | null) => void;
|
|
11
|
+
readonly launchMode: ApprovalTemplateLaunchMode;
|
|
12
|
+
readonly onLaunchModeChange: (launchMode: ApprovalTemplateLaunchMode) => void;
|
|
10
13
|
/**
|
|
11
14
|
* Show the AI assistant button inside the embedded designer's side panel.
|
|
12
15
|
* Follows the same opt-in contract as the standalone designer page; default
|
|
@@ -19,4 +22,4 @@ export interface ComposeWorkflowStepProps {
|
|
|
19
22
|
*/
|
|
20
23
|
readonly aiAssistantAvailable?: boolean;
|
|
21
24
|
}
|
|
22
|
-
export declare function ComposeWorkflowStep({ aiAssistantAvailable, formSchema, initiatorPolicyCel, onInitiatorPolicyChange, onWorkflowChange, showAiAssistant, workflowDefinition, }: ComposeWorkflowStepProps): ReactElement;
|
|
25
|
+
export declare function ComposeWorkflowStep({ aiAssistantAvailable, formSchema, initiatorPolicyCel, launchMode, onInitiatorPolicyChange, onLaunchModeChange, onWorkflowChange, showAiAssistant, workflowDefinition, }: ComposeWorkflowStepProps): ReactElement;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
|
|
3
3
|
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
import { ApprovalTemplateLaunchMode } from '@rytass/bpm-core-client/template';
|
|
4
5
|
export interface ComposeWorkflowStepProps {
|
|
5
6
|
readonly formSchema: FormDefinitionSchema;
|
|
6
7
|
readonly workflowDefinition: WorkflowDefinition | null;
|
|
7
8
|
readonly initiatorPolicyCel: string | null;
|
|
8
9
|
readonly onWorkflowChange: (definition: WorkflowDefinition) => void;
|
|
9
10
|
readonly onInitiatorPolicyChange: (cel: string | null) => void;
|
|
11
|
+
readonly launchMode: ApprovalTemplateLaunchMode;
|
|
12
|
+
readonly onLaunchModeChange: (launchMode: ApprovalTemplateLaunchMode) => void;
|
|
10
13
|
/**
|
|
11
14
|
* Show the AI assistant button inside the embedded designer's side panel.
|
|
12
15
|
* Follows the same opt-in contract as the standalone designer page; default
|
|
@@ -19,4 +22,4 @@ export interface ComposeWorkflowStepProps {
|
|
|
19
22
|
*/
|
|
20
23
|
readonly aiAssistantAvailable?: boolean;
|
|
21
24
|
}
|
|
22
|
-
export declare function ComposeWorkflowStep({ aiAssistantAvailable, formSchema, initiatorPolicyCel, onInitiatorPolicyChange, onWorkflowChange, showAiAssistant, workflowDefinition, }: ComposeWorkflowStepProps): ReactElement;
|
|
25
|
+
export declare function ComposeWorkflowStep({ aiAssistantAvailable, formSchema, initiatorPolicyCel, launchMode, onInitiatorPolicyChange, onLaunchModeChange, onWorkflowChange, showAiAssistant, workflowDefinition, }: ComposeWorkflowStepProps): ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FormDefinitionSchema, FormUiSchema } from '@rytass/bpm-core-shared/form';
|
|
2
2
|
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
3
|
-
import { ComposeApprovalTemplateWithFormResult } from '@rytass/bpm-core-client/template';
|
|
3
|
+
import { ApprovalTemplateLaunchMode, ComposeApprovalTemplateWithFormResult } from '@rytass/bpm-core-client/template';
|
|
4
4
|
export type ComposeWizardStep = 0 | 1 | 2;
|
|
5
5
|
export type ComposePublishPhase = 'error' | 'idle' | 'submitting' | 'success';
|
|
6
6
|
export declare const EMPTY_COMPOSE_FORM_SCHEMA: FormDefinitionSchema;
|
|
@@ -18,6 +18,7 @@ export interface TemplateComposeWizard {
|
|
|
18
18
|
readonly formUiSchema: FormUiSchema;
|
|
19
19
|
readonly workflowDefinition: WorkflowDefinition | null;
|
|
20
20
|
readonly initiatorPolicyCel: string | null;
|
|
21
|
+
readonly launchMode: ApprovalTemplateLaunchMode;
|
|
21
22
|
readonly publishPhase: ComposePublishPhase;
|
|
22
23
|
readonly publishError: string | null;
|
|
23
24
|
readonly canLeaveBasics: boolean;
|
|
@@ -32,6 +33,7 @@ export interface TemplateComposeWizard {
|
|
|
32
33
|
}) => void;
|
|
33
34
|
readonly setWorkflowDefinition: (definition: WorkflowDefinition) => void;
|
|
34
35
|
readonly setInitiatorPolicyCel: (cel: string | null) => void;
|
|
36
|
+
readonly setLaunchMode: (launchMode: ApprovalTemplateLaunchMode) => void;
|
|
35
37
|
readonly publish: () => Promise<ComposeApprovalTemplateWithFormResult | null>;
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FormDefinitionSchema, FormUiSchema } from '@rytass/bpm-core-shared/form';
|
|
2
2
|
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
3
|
-
import { ComposeApprovalTemplateWithFormResult } from '@rytass/bpm-core-client/template';
|
|
3
|
+
import { ApprovalTemplateLaunchMode, ComposeApprovalTemplateWithFormResult } from '@rytass/bpm-core-client/template';
|
|
4
4
|
export type ComposeWizardStep = 0 | 1 | 2;
|
|
5
5
|
export type ComposePublishPhase = 'error' | 'idle' | 'submitting' | 'success';
|
|
6
6
|
export declare const EMPTY_COMPOSE_FORM_SCHEMA: FormDefinitionSchema;
|
|
@@ -18,6 +18,7 @@ export interface TemplateComposeWizard {
|
|
|
18
18
|
readonly formUiSchema: FormUiSchema;
|
|
19
19
|
readonly workflowDefinition: WorkflowDefinition | null;
|
|
20
20
|
readonly initiatorPolicyCel: string | null;
|
|
21
|
+
readonly launchMode: ApprovalTemplateLaunchMode;
|
|
21
22
|
readonly publishPhase: ComposePublishPhase;
|
|
22
23
|
readonly publishError: string | null;
|
|
23
24
|
readonly canLeaveBasics: boolean;
|
|
@@ -32,6 +33,7 @@ export interface TemplateComposeWizard {
|
|
|
32
33
|
}) => void;
|
|
33
34
|
readonly setWorkflowDefinition: (definition: WorkflowDefinition) => void;
|
|
34
35
|
readonly setInitiatorPolicyCel: (cel: string | null) => void;
|
|
36
|
+
readonly setLaunchMode: (launchMode: ApprovalTemplateLaunchMode) => void;
|
|
35
37
|
readonly publish: () => Promise<ComposeApprovalTemplateWithFormResult | null>;
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
|
|
3
3
|
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
import { ApprovalTemplateLaunchMode } from '@rytass/bpm-core-client/template';
|
|
4
5
|
export interface TemplateDesignerViewProps {
|
|
5
6
|
/**
|
|
6
7
|
* Template id to load. Required in non-embedded mode; unused in embedded mode.
|
|
@@ -35,6 +36,14 @@ export interface TemplateDesignerViewProps {
|
|
|
35
36
|
* Falls back to `null` (no policy) when omitted.
|
|
36
37
|
*/
|
|
37
38
|
readonly initialInitiatorPolicyCel?: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* In embedded mode: the initial 發起方式. Falls back to `OPEN` when omitted.
|
|
41
|
+
*/
|
|
42
|
+
readonly initialLaunchMode?: ApprovalTemplateLaunchMode;
|
|
43
|
+
/**
|
|
44
|
+
* In embedded mode: called whenever the 發起方式 changes.
|
|
45
|
+
*/
|
|
46
|
+
readonly onLaunchModeChange?: (launchMode: ApprovalTemplateLaunchMode) => void;
|
|
38
47
|
/**
|
|
39
48
|
* In embedded mode: called whenever the workflow definition changes so the
|
|
40
49
|
* host can persist the current canvas state.
|
|
@@ -62,4 +71,4 @@ export interface TemplateDesignerViewProps {
|
|
|
62
71
|
*/
|
|
63
72
|
readonly aiAssistantAvailable?: boolean;
|
|
64
73
|
}
|
|
65
|
-
export declare function TemplateDesignerView({ aiAssistantAvailable, embedded, formSchemaOverride, initialInitiatorPolicyCel, initialWorkflowDefinition, onInitiatorPolicyChange, onWorkflowChange, showAiAssistant, showDryRun, templateId, }: TemplateDesignerViewProps): ReactElement;
|
|
74
|
+
export declare function TemplateDesignerView({ aiAssistantAvailable, embedded, formSchemaOverride, initialInitiatorPolicyCel, initialLaunchMode, initialWorkflowDefinition, onInitiatorPolicyChange, onLaunchModeChange, onWorkflowChange, showAiAssistant, showDryRun, templateId, }: TemplateDesignerViewProps): ReactElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
|
|
3
3
|
import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
|
|
4
|
+
import { ApprovalTemplateLaunchMode } from '@rytass/bpm-core-client/template';
|
|
4
5
|
export interface TemplateDesignerViewProps {
|
|
5
6
|
/**
|
|
6
7
|
* Template id to load. Required in non-embedded mode; unused in embedded mode.
|
|
@@ -35,6 +36,14 @@ export interface TemplateDesignerViewProps {
|
|
|
35
36
|
* Falls back to `null` (no policy) when omitted.
|
|
36
37
|
*/
|
|
37
38
|
readonly initialInitiatorPolicyCel?: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* In embedded mode: the initial 發起方式. Falls back to `OPEN` when omitted.
|
|
41
|
+
*/
|
|
42
|
+
readonly initialLaunchMode?: ApprovalTemplateLaunchMode;
|
|
43
|
+
/**
|
|
44
|
+
* In embedded mode: called whenever the 發起方式 changes.
|
|
45
|
+
*/
|
|
46
|
+
readonly onLaunchModeChange?: (launchMode: ApprovalTemplateLaunchMode) => void;
|
|
38
47
|
/**
|
|
39
48
|
* In embedded mode: called whenever the workflow definition changes so the
|
|
40
49
|
* host can persist the current canvas state.
|
|
@@ -62,4 +71,4 @@ export interface TemplateDesignerViewProps {
|
|
|
62
71
|
*/
|
|
63
72
|
readonly aiAssistantAvailable?: boolean;
|
|
64
73
|
}
|
|
65
|
-
export declare function TemplateDesignerView({ aiAssistantAvailable, embedded, formSchemaOverride, initialInitiatorPolicyCel, initialWorkflowDefinition, onInitiatorPolicyChange, onWorkflowChange, showAiAssistant, showDryRun, templateId, }: TemplateDesignerViewProps): ReactElement;
|
|
74
|
+
export declare function TemplateDesignerView({ aiAssistantAvailable, embedded, formSchemaOverride, initialInitiatorPolicyCel, initialLaunchMode, initialWorkflowDefinition, onInitiatorPolicyChange, onLaunchModeChange, onWorkflowChange, showAiAssistant, showDryRun, templateId, }: TemplateDesignerViewProps): ReactElement;
|