@rytass/bpm-core-react 0.21.4 → 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.
Files changed (91) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/chunks/{FormBuilderView-DbfbLZCI.js → FormBuilderView-D_bN9gzT.js} +675 -614
  3. package/dist/chunks/FormBuilderView-D_bN9gzT.js.map +1 -0
  4. package/dist/chunks/FormBuilderView-bm8P55hp.cjs +4 -0
  5. package/dist/chunks/FormBuilderView-bm8P55hp.cjs.map +1 -0
  6. package/dist/chunks/FormRendererView-BlQgJOkI.cjs +6 -0
  7. package/dist/chunks/FormRendererView-BlQgJOkI.cjs.map +1 -0
  8. package/dist/chunks/{FormRendererView-CAyPXhPq.js → FormRendererView-CemHvfAT.js} +298 -290
  9. package/dist/chunks/FormRendererView-CemHvfAT.js.map +1 -0
  10. package/dist/chunks/compose-CdKVQfjB.cjs +2 -0
  11. package/dist/chunks/compose-CdKVQfjB.cjs.map +1 -0
  12. package/dist/chunks/{compose-U1zs3Yof.js → compose-N9657E5u.js} +161 -147
  13. package/dist/chunks/compose-N9657E5u.js.map +1 -0
  14. package/dist/chunks/{designer-DPG7R_WP.js → designer-CKwG_vM5.js} +1913 -1715
  15. package/dist/chunks/designer-CKwG_vM5.js.map +1 -0
  16. package/dist/chunks/designer-JPs7EijM.cjs +69 -0
  17. package/dist/chunks/designer-JPs7EijM.cjs.map +1 -0
  18. package/dist/chunks/detail-Dqu0K9QM.cjs +5 -0
  19. package/dist/chunks/detail-Dqu0K9QM.cjs.map +1 -0
  20. package/dist/chunks/{detail-CHZDNNM6.js → detail-fW0vJudE.js} +902 -895
  21. package/dist/chunks/detail-fW0vJudE.js.map +1 -0
  22. package/dist/chunks/instance-error-message-BKt07-Bo.js +270 -0
  23. package/dist/chunks/instance-error-message-BKt07-Bo.js.map +1 -0
  24. package/dist/chunks/instance-error-message-BL_X7Af8.cjs +2 -0
  25. package/dist/chunks/instance-error-message-BL_X7Af8.cjs.map +1 -0
  26. package/dist/pages/instances/detail/index.cjs +1 -1
  27. package/dist/pages/instances/detail/index.js +1 -1
  28. package/dist/pages/templates/compose/index.cjs +1 -1
  29. package/dist/pages/templates/compose/index.js +1 -1
  30. package/dist/pages/templates/designer/index.cjs +1 -1
  31. package/dist/pages/templates/designer/index.js +1 -1
  32. package/dist/views/forms/builder/index.cjs +1 -1
  33. package/dist/views/forms/builder/index.js +1 -1
  34. package/dist/views/forms/renderer/FormRendererView.d.cts +26 -1
  35. package/dist/views/forms/renderer/FormRendererView.d.ts +26 -1
  36. package/dist/views/forms/renderer/index.cjs +1 -1
  37. package/dist/views/forms/renderer/index.js +1 -1
  38. package/dist/views/inbox/index.cjs +1 -1
  39. package/dist/views/inbox/index.cjs.map +1 -1
  40. package/dist/views/inbox/index.js +185 -94
  41. package/dist/views/inbox/index.js.map +1 -1
  42. package/dist/views/instances/approver-filled-form.d.cts +56 -20
  43. package/dist/views/instances/approver-filled-form.d.ts +56 -20
  44. package/dist/views/instances/detail/index.cjs +1 -1
  45. package/dist/views/instances/detail/index.js +1 -1
  46. package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +7 -0
  47. package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +7 -0
  48. package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +1 -1
  49. package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +1 -1
  50. package/dist/views/instances/new/index.cjs +1 -1
  51. package/dist/views/instances/new/index.js +2 -2
  52. package/dist/views/templates/compose/index.cjs +1 -1
  53. package/dist/views/templates/compose/index.js +1 -1
  54. package/dist/views/templates/compose/steps/ComposeReviewStep.d.cts +3 -1
  55. package/dist/views/templates/compose/steps/ComposeReviewStep.d.ts +3 -1
  56. package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.cts +4 -1
  57. package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.ts +4 -1
  58. package/dist/views/templates/compose/use-template-compose-wizard.d.cts +3 -1
  59. package/dist/views/templates/compose/use-template-compose-wizard.d.ts +3 -1
  60. package/dist/views/templates/designer/TemplateDesignerView.d.cts +10 -1
  61. package/dist/views/templates/designer/TemplateDesignerView.d.ts +10 -1
  62. package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.cts +3 -1
  63. package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.ts +3 -1
  64. package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.cts +3 -2
  65. package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.ts +3 -2
  66. package/dist/views/templates/designer/index.cjs +1 -1
  67. package/dist/views/templates/designer/index.js +1 -1
  68. package/dist/views/templates/designer/launch-mode.d.cts +19 -0
  69. package/dist/views/templates/designer/launch-mode.d.ts +19 -0
  70. package/dist/views/templates/designer/publish-default-value-check.d.cts +36 -0
  71. package/dist/views/templates/designer/publish-default-value-check.d.ts +36 -0
  72. package/package.json +3 -3
  73. package/dist/chunks/FormBuilderView-Bok4Y59D.cjs +0 -4
  74. package/dist/chunks/FormBuilderView-Bok4Y59D.cjs.map +0 -1
  75. package/dist/chunks/FormBuilderView-DbfbLZCI.js.map +0 -1
  76. package/dist/chunks/FormRendererView-CAyPXhPq.js.map +0 -1
  77. package/dist/chunks/FormRendererView-iLlHFIUR.cjs +0 -6
  78. package/dist/chunks/FormRendererView-iLlHFIUR.cjs.map +0 -1
  79. package/dist/chunks/compose-DP1N4twA.cjs +0 -2
  80. package/dist/chunks/compose-DP1N4twA.cjs.map +0 -1
  81. package/dist/chunks/compose-U1zs3Yof.js.map +0 -1
  82. package/dist/chunks/designer-CWL-dCQ_.cjs +0 -69
  83. package/dist/chunks/designer-CWL-dCQ_.cjs.map +0 -1
  84. package/dist/chunks/designer-DPG7R_WP.js.map +0 -1
  85. package/dist/chunks/detail-BUfsSal0.cjs +0 -5
  86. package/dist/chunks/detail-BUfsSal0.cjs.map +0 -1
  87. package/dist/chunks/detail-CHZDNNM6.js.map +0 -1
  88. package/dist/chunks/instance-error-message-BEM4O_Kj.js +0 -208
  89. package/dist/chunks/instance-error-message-BEM4O_Kj.js.map +0 -1
  90. package/dist/chunks/instance-error-message-BpCLCOjp.cjs +0 -2
  91. package/dist/chunks/instance-error-message-BpCLCOjp.cjs.map +0 -1
@@ -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
- * The server drops those keys from a submission, so rendering one would swallow
7
- * what the applicant types, and a `minRows` or `required` on it would block a
8
- * launch nobody can complete. Returns an equal schema when nothing is
9
- * approver-filled; never mutates its input.
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
- /** The payload the applicant may send: `values` without approver-filled keys. */
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
- * The form an approver's fill is validated against: only the fields `node`
16
- * lets them fill in, each required exactly when the node says `REQUIRED`. A
17
- * required table needs at least one row, the rule `validateFormRendererValues`
18
- * already applies, so the result agrees with the server's fill check. Never
19
- * mutates its input.
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 what the approver changed, not the rendered form — a renderer
39
- * default the approver never touched (a table's empty rows, a boolean's
40
- * `false`) is not theirs to sign, and would otherwise show up as filled in.
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. The page shows those rows and validates them, so they are sent
47
- * too — left out, the server would refuse the approval for missing rows the
48
- * approver can see on screen.
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
- * The server drops those keys from a submission, so rendering one would swallow
7
- * what the applicant types, and a `minRows` or `required` on it would block a
8
- * launch nobody can complete. Returns an equal schema when nothing is
9
- * approver-filled; never mutates its input.
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
- /** The payload the applicant may send: `values` without approver-filled keys. */
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
- * The form an approver's fill is validated against: only the fields `node`
16
- * lets them fill in, each required exactly when the node says `REQUIRED`. A
17
- * required table needs at least one row, the rule `validateFormRendererValues`
18
- * already applies, so the result agrees with the server's fill check. Never
19
- * mutates its input.
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 what the approver changed, not the rendered form — a renderer
39
- * default the approver never touched (a table's empty rows, a boolean's
40
- * `false`) is not theirs to sign, and would otherwise show up as filled in.
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. The page shows those rows and validates them, so they are sent
47
- * too — left out, the server would refuse the approval for missing rows the
48
- * approver can see on screen.
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-BUfsSal0.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
+ 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-CHZDNNM6.js";
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-BpCLCOjp.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-iLlHFIUR.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.r(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.i((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;
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 { i as e, r as t, t as n } from "../../../chunks/instance-error-message-BEM4O_Kj.js";
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-CAyPXhPq.js";
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-DP1N4twA.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
+ 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-U1zs3Yof.js";
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;
@@ -1,5 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
- import { FieldAccessChoice, FieldAccessMatrixEntry } from '@rytass/bpm-core-shared';
2
+ import { FieldAccessChoice, FieldAccessFill, FieldAccessMatrixEntry } from '@rytass/bpm-core-shared';
3
3
  import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
4
4
  import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
5
5
  import { BPMLanguage } from '../../../../lib/language-provider.cjs';
@@ -23,6 +23,8 @@ export interface FieldAccessMatrixDrawerProps {
23
23
  }
24
24
  /** Sets one cell of the draft; `DEFAULT` removes its entry. */
25
25
  export declare function updateFieldAccessDraft(entries: readonly FieldAccessMatrixEntry[], nodeId: string, fieldKey: string, choice: FieldAccessChoice): readonly FieldAccessMatrixEntry[];
26
+ /** Sets one table column's fill in column mode; `NONE` takes that column out. */
27
+ export declare function updateFieldAccessColumnDraft(entries: readonly FieldAccessMatrixEntry[], nodeId: string, fieldKey: string, columnKey: string, fill: FieldAccessFill): readonly FieldAccessMatrixEntry[];
26
28
  /**
27
29
  * The cells edited in the drawer (`draft` against `initial`), laid onto the
28
30
  * entries the flow holds now. An undo or an assistant edit made while the
@@ -1,5 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
- import { FieldAccessChoice, FieldAccessMatrixEntry } from '@rytass/bpm-core-shared';
2
+ import { FieldAccessChoice, FieldAccessFill, FieldAccessMatrixEntry } from '@rytass/bpm-core-shared';
3
3
  import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
4
4
  import { WorkflowDefinition } from '@rytass/bpm-core-shared/workflow';
5
5
  import { BPMLanguage } from '../../../../lib/language-provider.js';
@@ -23,6 +23,8 @@ export interface FieldAccessMatrixDrawerProps {
23
23
  }
24
24
  /** Sets one cell of the draft; `DEFAULT` removes its entry. */
25
25
  export declare function updateFieldAccessDraft(entries: readonly FieldAccessMatrixEntry[], nodeId: string, fieldKey: string, choice: FieldAccessChoice): readonly FieldAccessMatrixEntry[];
26
+ /** Sets one table column's fill in column mode; `NONE` takes that column out. */
27
+ export declare function updateFieldAccessColumnDraft(entries: readonly FieldAccessMatrixEntry[], nodeId: string, fieldKey: string, columnKey: string, fill: FieldAccessFill): readonly FieldAccessMatrixEntry[];
26
28
  /**
27
29
  * The cells edited in the drawer (`draft` against `initial`), laid onto the
28
30
  * entries the flow holds now. An undo or an assistant edit made while the
@@ -1,6 +1,8 @@
1
- import { FieldAccessChoice, FieldAccessEffective, FieldAccessIssue, FieldAccessIssueCode, FieldAccessMatrixColumn } from '@rytass/bpm-core-shared';
1
+ import { FieldAccessChoice, FieldAccessEffective, FieldAccessFill, FieldAccessIssue, FieldAccessIssueCode, FieldAccessMatrixColumn } from '@rytass/bpm-core-shared';
2
2
  import { UserTaskNode } from '@rytass/bpm-core-shared/workflow';
3
3
  export declare const FIELD_ACCESS_CHOICE_LABELS: Readonly<Record<FieldAccessChoice, string>>;
4
+ /** The per-column fill choices under a table row in column mode. */
5
+ export declare const FIELD_ACCESS_COLUMN_FILL_LABELS: Readonly<Record<FieldAccessFill, string>>;
4
6
  export declare const FIELD_ACCESS_EFFECTIVE_LABELS: Readonly<Record<FieldAccessEffective, string>>;
5
7
  /**
6
8
  * Why the form will not let an approver fill a field in, short enough for the
@@ -8,7 +10,6 @@ export declare const FIELD_ACCESS_EFFECTIVE_LABELS: Readonly<Record<FieldAccessE
8
10
  * actually set to be filled in.
9
11
  */
10
12
  export declare const FIELD_ACCESS_FILL_BLOCKER_LABELS: Readonly<Partial<Record<FieldAccessIssueCode, string>>>;
11
- export declare const FIELD_ACCESS_BOOLEAN_REQUIRED_NOTE = "\u958B\u95DC\u6B04\u4F4D\u53EA\u80FD\u9078\u586B\u88DC\u586B\uFF1A\u958B\u95DC\u95DC\u8457\u4E5F\u662F\u7B54\u6848\uFF0C\u4E0D\u80FD\u8981\u6C42\u5FC5\u586B\u3002";
12
13
  export declare const FIELD_ACCESS_HIDE_NOTE = "\u300C\u96B1\u85CF\u300D\u53EA\u5F71\u97FF\u9019\u4E00\u95DC\u7684\u756B\u9762\uFF0C\u4E0D\u662F\u6B0A\u9650\uFF1A\u8CC7\u6599\u67E5\u8A62\u4ECD\u62FF\u5F97\u5230\u503C\uFF0C\u4E0D\u80FD\u7528\u4F86\u4FDD\u5BC6\u3002";
13
14
  export declare function readFieldAccessStageLabel(column: Pick<FieldAccessMatrixColumn, 'stage'>): string;
14
15
  export interface FieldAccessNodeCounts {