ngx-t-forms-types 0.0.30 → 0.0.34

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 (68) hide show
  1. package/dist/interfaces/Form/formSubmissionHandleInterface.d.ts +6 -0
  2. package/dist/interfaces/FormBuilder/DefaultEelement.js +76 -0
  3. package/dist/interfaces/FormBuilder/DefaultInputConfigInterface.d.ts +13 -0
  4. package/dist/interfaces/FormBuilder/FormInputKeys.d.ts +6 -0
  5. package/dist/interfaces/FormBuilder/FormInputKeys.js +6 -0
  6. package/dist/interfaces/FormBuilder/inputConfig/ElementEditConfig.js +188 -3
  7. package/dist/interfaces/Import/ImportIdentity.d.ts +32 -0
  8. package/dist/interfaces/Import/ImportIdentity.js +1 -0
  9. package/dist/interfaces/Import/ImportProgress.d.ts +12 -1
  10. package/dist/interfaces/Import/ImportRowState.d.ts +52 -1
  11. package/dist/interfaces/Import/index.d.ts +2 -1
  12. package/dist/interfaces/formInput/APIDataFetchingConfigurationInterface.d.ts +34 -0
  13. package/dist/interfaces/formInput/BasicFormInputInterface.d.ts +1 -0
  14. package/dist/interfaces/formInput/BasicFormInputInterface.js +1 -0
  15. package/dist/interfaces/formInput/IMscoaAccount.d.ts +19 -3
  16. package/dist/interfaces/formInput/ISelectInputInterface.d.ts +12 -0
  17. package/dist/interfaces/formInput/MultipleInterface.d.ts +10 -0
  18. package/dist/interfaces/formInput/WorkflowDocumentPicker.d.ts +2 -0
  19. package/dist/schemas/FormInputSchema.js +41 -2
  20. package/dist/schemas/MatOptionsSchema.js +7 -0
  21. package/dist/schemas/MscoaConfigSchema.js +1 -0
  22. package/dist/schemas/index.d.ts +2 -1
  23. package/dist/schemas/index.js +2 -1
  24. package/dist/skillet/authoring-rules.d.ts +41 -0
  25. package/dist/skillet/authoring-rules.js +61 -0
  26. package/dist/skillet/extra-members.d.ts +143 -0
  27. package/dist/skillet/extra-members.js +79 -0
  28. package/dist/skillet/form.d.ts +170 -0
  29. package/dist/skillet/form.js +139 -0
  30. package/dist/skillet/index.d.ts +43 -0
  31. package/dist/skillet/index.js +46 -0
  32. package/dist/skillet/input-members.d.ts +375 -0
  33. package/dist/skillet/input-members.js +186 -0
  34. package/dist/skillet/internal/coupling.d.ts +63 -0
  35. package/dist/skillet/internal/coupling.js +69 -0
  36. package/dist/skillet/internal/editor-guidance.d.ts +64 -0
  37. package/dist/skillet/internal/editor-guidance.js +291 -0
  38. package/dist/skillet/members/calculated-field.d.ts +155 -0
  39. package/dist/skillet/members/calculated-field.js +105 -0
  40. package/dist/skillet/members/conditional.d.ts +69 -0
  41. package/dist/skillet/members/conditional.js +16 -0
  42. package/dist/skillet/members/document-picker.d.ts +182 -0
  43. package/dist/skillet/members/document-picker.js +111 -0
  44. package/dist/skillet/members/mat-options.d.ts +187 -0
  45. package/dist/skillet/members/mat-options.js +92 -0
  46. package/dist/skillet/members/mscoa.d.ts +182 -0
  47. package/dist/skillet/members/mscoa.js +129 -0
  48. package/dist/skillet/members/pagination.d.ts +59 -0
  49. package/dist/skillet/members/pagination.js +16 -0
  50. package/dist/skillet/members/table.d.ts +178 -0
  51. package/dist/skillet/members/table.js +105 -0
  52. package/dist/skillet/members/validators.d.ts +197 -0
  53. package/dist/skillet/members/validators.js +74 -0
  54. package/dist/skillet/members/value.d.ts +154 -0
  55. package/dist/skillet/members/value.js +97 -0
  56. package/dist/skillet/shared-types.d.ts +57 -0
  57. package/dist/skillet/shared-types.js +69 -0
  58. package/dist/skillet/tests/house-rules.spec.d.ts +1 -0
  59. package/dist/skillet/tests/house-rules.spec.js +162 -0
  60. package/dist/skillet/tests/skillet-coupling.spec.d.ts +1 -0
  61. package/dist/skillet/tests/skillet-coupling.spec.js +191 -0
  62. package/dist/skillet/tests/variant-assembly.spec.d.ts +1 -0
  63. package/dist/skillet/tests/variant-assembly.spec.js +643 -0
  64. package/dist/skillet/variants.d.ts +138 -0
  65. package/dist/skillet/variants.js +536 -0
  66. package/dist/skillet/workflow-context.d.ts +95 -0
  67. package/dist/skillet/workflow-context.js +128 -0
  68. package/package.json +78 -60
@@ -0,0 +1,95 @@
1
+ /**
2
+ * The form inside the workflow.
3
+ *
4
+ * A form built with this package is never filled in on its own: it is the form
5
+ * of one STEP of a workflow, opened on a transaction that already carries the
6
+ * answers of earlier steps, and judged by what the engine does with its answers
7
+ * afterwards. The Form Creation Guide (`doc/guides/form-creation-guide.md`,
8
+ * "The form inside the workflow") sets out the rules that follow from that,
9
+ * and this module carries the two of them a model cannot honour unless the
10
+ * caller tells it something only the caller knows.
11
+ *
12
+ * ## Why this is hand-maintained
13
+ *
14
+ * Everything else in `src/skillet` is derived from this package — enums, Joi,
15
+ * the editor config — so it cannot fall behind. The facts here come from
16
+ * OUTSIDE it: the transaction document's own fields live in the workflow
17
+ * engine and its shared schema, and the system inputs are injected by the
18
+ * consuming application. Nothing in these typings declares them, so they are
19
+ * restated here with their source named, and the guide is the place to check
20
+ * them against. When the guide's reserved-names table changes, this list
21
+ * changes with it.
22
+ */
23
+ /**
24
+ * Control names a form must never use.
25
+ *
26
+ * The engine merges every step's answers into one flat record keyed by control
27
+ * name and stores that record on the transaction document beside the
28
+ * document's own fields. A control named like one of those fields is
29
+ * overwritten, shadowed in lists, or misread as the payload envelope
30
+ * (`data`, `validations`). The `SYSTEM_*` and financial-cycle names are
31
+ * injected by the application as read-only system inputs and would collide
32
+ * the same way.
33
+ *
34
+ * Source: the guide's reserved-names table, read on 2026-09-03 from the
35
+ * transaction schema in iserve-shared-types (`schemas/FormVal`), the engine's
36
+ * document shape in ngx-t-workflow-typings (`WorkFlowDocument.interface.ts`)
37
+ * and the consuming application's system inputs
38
+ * (`app-configs/ngx-t-forms-config.service.ts`).
39
+ */
40
+ export declare const RESERVED_CONTROL_NAMES: readonly ["_id", "reference", "status", "createdAt", "updatedAt", "previousDocRef", "originDocId", "workflowId", "docId", "data", "validations", "archive", "seal", "sealed", "checkedOut", "checkedOutDocId", "busy", "users", "activeWorkflow", "systemReference", "SYSTEM_TAGS", "SYSTEM_BY_USER", "SYSTEM_OVERDUE", "SYSTEM_STEP_MEMBERS", "failed", "failReason", "nextRunAt", "lastRunAt", ...string[]];
41
+ /**
42
+ * The user-step types that carry a form. Decision gates, end steps, email
43
+ * steps and public portals carry none; they read answers already captured.
44
+ */
45
+ export type WorkflowStepType = 'initiate' | 'append' | 'review' | 'adjudication';
46
+ /** A control name a later step of the workflow reads. */
47
+ export interface ExpectedControl {
48
+ /** The control name exactly as the reading step spells it. */
49
+ name: string;
50
+ /**
51
+ * What reads it and what that makes it, in a few words:
52
+ * "decision gate compares it against 30000, so a number", or
53
+ * "list column shown as currency". Sharpens the choice of element and type.
54
+ */
55
+ purpose?: string;
56
+ }
57
+ /**
58
+ * What the caller knows about the step this form is for.
59
+ *
60
+ * None of it is knowable from a prompt: the step type dictates what the form
61
+ * must contain, the step's control name is chosen by the workflow designer,
62
+ * and the names later steps read or earlier steps already answered exist only
63
+ * in the workflow. Supplied, they become the sentences a model needs in order
64
+ * to produce a form the engine can route.
65
+ */
66
+ export interface WorkflowStepContext {
67
+ /** Which kind of step the form serves. */
68
+ type: WorkflowStepType;
69
+ /**
70
+ * The control name the step itself names: for a review step the toggle the
71
+ * engine routes on, for an adjudication step the adjudication output.
72
+ */
73
+ controlName?: string;
74
+ /**
75
+ * Control names later steps read — gate operands, list columns, the end
76
+ * step's schedule date, an email step's keys. Each must exist on this form,
77
+ * spelled exactly, typed as its purpose demands, required and never hidden.
78
+ */
79
+ expectedControls?: readonly ExpectedControl[];
80
+ /**
81
+ * Control names answered on an earlier step that this form should open with.
82
+ * The engine prefills by name, so the same name is how an earlier answer is
83
+ * carried forward; any other name starts a new field.
84
+ */
85
+ prefilledControlNames?: readonly string[];
86
+ }
87
+ /**
88
+ * Renders the step context as the prose appended to the form's description.
89
+ *
90
+ * Written once, at form level, rather than repeated on every column: the rules
91
+ * are about which fields the form must contain and how they are named, and a
92
+ * column has no way to see the others. The form description is the one place
93
+ * the model reads before it writes any of them.
94
+ */
95
+ export declare function describeWorkflowStep(step: WorkflowStepContext): string;
@@ -0,0 +1,128 @@
1
+ /**
2
+ * The form inside the workflow.
3
+ *
4
+ * A form built with this package is never filled in on its own: it is the form
5
+ * of one STEP of a workflow, opened on a transaction that already carries the
6
+ * answers of earlier steps, and judged by what the engine does with its answers
7
+ * afterwards. The Form Creation Guide (`doc/guides/form-creation-guide.md`,
8
+ * "The form inside the workflow") sets out the rules that follow from that,
9
+ * and this module carries the two of them a model cannot honour unless the
10
+ * caller tells it something only the caller knows.
11
+ *
12
+ * ## Why this is hand-maintained
13
+ *
14
+ * Everything else in `src/skillet` is derived from this package — enums, Joi,
15
+ * the editor config — so it cannot fall behind. The facts here come from
16
+ * OUTSIDE it: the transaction document's own fields live in the workflow
17
+ * engine and its shared schema, and the system inputs are injected by the
18
+ * consuming application. Nothing in these typings declares them, so they are
19
+ * restated here with their source named, and the guide is the place to check
20
+ * them against. When the guide's reserved-names table changes, this list
21
+ * changes with it.
22
+ */
23
+ /**
24
+ * Control names a form must never use.
25
+ *
26
+ * The engine merges every step's answers into one flat record keyed by control
27
+ * name and stores that record on the transaction document beside the
28
+ * document's own fields. A control named like one of those fields is
29
+ * overwritten, shadowed in lists, or misread as the payload envelope
30
+ * (`data`, `validations`). The `SYSTEM_*` and financial-cycle names are
31
+ * injected by the application as read-only system inputs and would collide
32
+ * the same way.
33
+ *
34
+ * Source: the guide's reserved-names table, read on 2026-09-03 from the
35
+ * transaction schema in iserve-shared-types (`schemas/FormVal`), the engine's
36
+ * document shape in ngx-t-workflow-typings (`WorkFlowDocument.interface.ts`)
37
+ * and the consuming application's system inputs
38
+ * (`app-configs/ngx-t-forms-config.service.ts`).
39
+ */
40
+ export const RESERVED_CONTROL_NAMES = [
41
+ '_id',
42
+ 'reference',
43
+ 'status',
44
+ 'createdAt',
45
+ 'updatedAt',
46
+ 'previousDocRef',
47
+ 'originDocId',
48
+ 'workflowId',
49
+ 'docId',
50
+ 'data',
51
+ 'validations',
52
+ 'archive',
53
+ 'seal',
54
+ 'sealed',
55
+ 'checkedOut',
56
+ 'checkedOutDocId',
57
+ 'busy',
58
+ 'users',
59
+ 'activeWorkflow',
60
+ 'systemReference',
61
+ 'SYSTEM_TAGS',
62
+ 'SYSTEM_BY_USER',
63
+ 'SYSTEM_OVERDUE',
64
+ 'SYSTEM_STEP_MEMBERS',
65
+ 'failed',
66
+ 'failReason',
67
+ 'nextRunAt',
68
+ 'lastRunAt',
69
+ ...['CURRENT', 'NEXT', 'PREVIOUS'].flatMap((cycle) => [
70
+ `${cycle}_FINANCIAL_CYCLE`,
71
+ `${cycle}_FINANCIAL_CYCLE_START_DATE`,
72
+ `${cycle}_FINANCIAL_CYCLE_END_DATE`,
73
+ `${cycle}_SPRINT_START_DATE`,
74
+ `${cycle}_SPRINT_END_DATE`,
75
+ ]),
76
+ ];
77
+ const quote = (name) => `'${name}'`;
78
+ /**
79
+ * The step-type sentences, one per type. Marked in the guide as engine rules
80
+ * (what the engine does) and house rules (what the builder's author requires);
81
+ * both are restated here rather than paraphrased so they cannot drift apart.
82
+ */
83
+ function describeStepType(step) {
84
+ switch (step.type) {
85
+ case 'initiate':
86
+ return 'It is the first capture of a new transaction. The transaction reference number is generated by the engine from the step, so never ask the user for it.';
87
+ case 'append':
88
+ return 'It adds to a transaction that already carries earlier answers. Reuse an earlier control name only to show that answer and let this step correct it, read-only and on the first slide; otherwise every name must be new.';
89
+ case 'review': {
90
+ const name = step.controlName
91
+ ? `exactly ${quote(step.controlName)}`
92
+ : "exactly the step's control name, which the request must state";
93
+ return `Its one requirement is a toggle whose formControlName is ${name}: required, never conditionally hidden, with trueLabel and falseLabel naming the two outcomes such as 'Approve' and 'Reject'. The engine approves when that value is true and rejects when it is false. Add a signature. Reviewers read the whole transaction beside this form, so do not repeat earlier answers; at most add a comment shown only when the toggle is off.`;
94
+ }
95
+ case 'adjudication': {
96
+ const name = step.controlName
97
+ ? ` under the formControlName ${quote(step.controlName)}`
98
+ : '';
99
+ return `It must contain a workflowAdjudication element${name} whose adjudicationStep matches the stage the workflow step adjudicates; the engine does nothing further with it.`;
100
+ }
101
+ }
102
+ }
103
+ /**
104
+ * Renders the step context as the prose appended to the form's description.
105
+ *
106
+ * Written once, at form level, rather than repeated on every column: the rules
107
+ * are about which fields the form must contain and how they are named, and a
108
+ * column has no way to see the others. The form description is the one place
109
+ * the model reads before it writes any of them.
110
+ */
111
+ export function describeWorkflowStep(step) {
112
+ const parts = [
113
+ `This form serves the ${step.type} step of a workflow. Every step's answers merge into one record keyed by control name, so a control name is new unless it is deliberately carrying an earlier answer forward.`,
114
+ describeStepType(step),
115
+ ];
116
+ const expected = step.expectedControls ?? [];
117
+ if (expected.length) {
118
+ const list = expected
119
+ .map((c) => (c.purpose ? `${quote(c.name)} (${c.purpose})` : quote(c.name)))
120
+ .join('; ');
121
+ parts.push(`Later steps read these control names, so each must exist on this form spelled exactly as given, be required, and never be conditionally hidden: ${list}. A value a decision gate compares must be stored as a number, a real boolean, or a single-word option value.`);
122
+ }
123
+ const prefilled = step.prefilledControlNames ?? [];
124
+ if (prefilled.length) {
125
+ parts.push(`These were answered on an earlier step; use exactly the same control name so the field opens prefilled, and mark it readonly unless this step may correct it: ${prefilled.map(quote).join(', ')}.`);
126
+ }
127
+ return parts.join(' ');
128
+ }
package/package.json CHANGED
@@ -1,60 +1,78 @@
1
- {
2
- "name": "ngx-t-forms-types",
3
- "version": "0.0.30",
4
- "description": "Typings and interfaces for the ngx-t-forms library for dynamic forms.",
5
- "keywords": [
6
- "typings",
7
- "typescript"
8
- ],
9
- "homepage": "https://github.com/mashegoTerrence/ngx-t-forms-typings#readme",
10
- "bugs": {
11
- "url": "https://github.com/mashegoTerrence/ngx-t-forms-typings/issues"
12
- },
13
- "publishConfig": {
14
- "access": "public"
15
- },
16
- "repository": {
17
- "type": "git",
18
- "url": "git+https://github.com/mashegoTerrence/ngx-t-forms-typings.git"
19
- },
20
- "license": "ISC",
21
- "author": "mashegoterrence@gmail.com",
22
- "type": "module",
23
- "main": "dist/index.js",
24
- "types": "dist/index.d.ts",
25
- "files": [
26
- "dist"
27
- ],
28
- "scripts": {
29
- "test": "karma start karma.conf.cjs",
30
- "clean": "rimraf dist",
31
- "typecheck": "tsc --noEmit",
32
- "build": "npm run clean && tsc && node scripts/add-js-extensions.mjs",
33
- "build:prod": "npm run clean && tsc -p tsconfig.prod.json",
34
- "prepublishOnly": "npm run build",
35
- "dev": "npm run build --watch"
36
- },
37
- "dependencies": {
38
- "joi": "^18.2.1"
39
- },
40
- "peerDependencies": {
41
- "moment": ">=2.30.1",
42
- "rxjs": ">=7.8.0"
43
- },
44
- "devDependencies": {
45
- "@types/jasmine": "^5.1.7",
46
- "@types/node": "^22.13.9",
47
- "jasmine-core": "^5.6.0",
48
- "karma": "^6.4.4",
49
- "karma-chrome-launcher": "^3.2.0",
50
- "karma-jasmine": "^5.1.0",
51
- "karma-webpack": "^5.0.1",
52
- "moment": "^2.30.1",
53
- "rimraf": "^6.0.1",
54
- "rxjs": "~7.8.0",
55
- "ts-loader": "^9.5.2",
56
- "typescript": "~5.9.2",
57
- "webpack": "^5.98.0",
58
- "webpack-dev-server": "^5.2.0"
59
- }
60
- }
1
+ {
2
+ "name": "ngx-t-forms-types",
3
+ "version": "0.0.34",
4
+ "description": "Typings and interfaces for the ngx-t-forms library for dynamic forms.",
5
+ "keywords": [
6
+ "typings",
7
+ "typescript"
8
+ ],
9
+ "homepage": "https://github.com/mashegoTerrence/ngx-t-forms-typings#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/mashegoTerrence/ngx-t-forms-typings/issues"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/mashegoTerrence/ngx-t-forms-typings.git"
19
+ },
20
+ "license": "ISC",
21
+ "author": "mashegoterrence@gmail.com",
22
+ "type": "module",
23
+ "main": "dist/index.js",
24
+ "types": "dist/index.d.ts",
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "scripts": {
29
+ "test": "karma start karma.conf.cjs",
30
+ "clean": "rimraf dist",
31
+ "typecheck": "tsc --noEmit",
32
+ "build": "npm run clean && tsc && node scripts/add-js-extensions.mjs",
33
+ "build:prod": "npm run clean && tsc -p tsconfig.prod.json",
34
+ "prepublishOnly": "npm run build",
35
+ "dev": "npm run build --watch"
36
+ },
37
+ "dependencies": {
38
+ "joi": "^18.2.1"
39
+ },
40
+ "peerDependencies": {
41
+ "moment": ">=2.30.1",
42
+ "rxjs": ">=7.8.0",
43
+ "@hashbrownai/core": ">=0.5.0"
44
+ },
45
+ "devDependencies": {
46
+ "@hashbrownai/core": "^0.5.0",
47
+ "@types/jasmine": "^5.1.7",
48
+ "@types/node": "^22.13.9",
49
+ "jasmine-core": "^5.6.0",
50
+ "karma": "^6.4.4",
51
+ "karma-chrome-launcher": "^3.2.0",
52
+ "karma-jasmine": "^5.1.0",
53
+ "karma-webpack": "^5.0.1",
54
+ "moment": "^2.30.1",
55
+ "rimraf": "^6.0.1",
56
+ "rxjs": "~7.8.0",
57
+ "ts-loader": "^9.5.2",
58
+ "typescript": "~5.9.2",
59
+ "webpack": "^5.98.0",
60
+ "webpack-dev-server": "^5.2.0"
61
+ },
62
+ "exports": {
63
+ ".": {
64
+ "types": "./dist/index.d.ts",
65
+ "default": "./dist/index.js"
66
+ },
67
+ "./skillet": {
68
+ "types": "./dist/skillet/index.d.ts",
69
+ "default": "./dist/skillet/index.js"
70
+ },
71
+ "./package.json": "./package.json"
72
+ },
73
+ "peerDependenciesMeta": {
74
+ "@hashbrownai/core": {
75
+ "optional": true
76
+ }
77
+ }
78
+ }