@peripheries/renderer 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/README.md +90 -0
- package/dist/catalog.js +2 -2
- package/dist/chunks/forms-CCAE7sCu.js +342 -0
- package/dist/chunks/forms-CCAE7sCu.js.map +1 -0
- package/dist/chunks/{query-BPuCJC1C.js → query-LnTbQghF.js} +167 -7
- package/dist/chunks/query-LnTbQghF.js.map +1 -0
- package/dist/chunks/{structure-o9pYoDjD.js → structure-BrKSgzRJ.js} +2 -2
- package/dist/chunks/{structure-o9pYoDjD.js.map → structure-BrKSgzRJ.js.map} +1 -1
- package/dist/chunks/{validate-4LgH8QMJ.js → validate-B_g7719l.js} +21 -6
- package/dist/chunks/validate-B_g7719l.js.map +1 -0
- package/dist/core.js +134 -27
- package/dist/core.js.map +1 -1
- package/dist/forms.js +2 -0
- package/dist/react.js +353 -5
- package/dist/react.js.map +1 -1
- package/dist/testing.js +213 -2
- package/dist/testing.js.map +1 -1
- package/dist/types/core/data-context.d.ts +5 -0
- package/dist/types/core/diagnostics.d.ts +19 -3
- package/dist/types/core/graph.d.ts +17 -1
- package/dist/types/core/index.d.ts +4 -3
- package/dist/types/core/load-page.d.ts +71 -18
- package/dist/types/core/query.d.ts +18 -0
- package/dist/types/core/release.d.ts +21 -0
- package/dist/types/core/sources.d.ts +9 -3
- package/dist/types/core/types.d.ts +2 -0
- package/dist/types/forms/conditions.d.ts +55 -0
- package/dist/types/forms/index.d.ts +3 -0
- package/dist/types/forms/model.d.ts +134 -0
- package/dist/types/forms/port.d.ts +69 -0
- package/dist/types/react/cell-view.d.ts +2 -0
- package/dist/types/react/index.d.ts +1 -0
- package/dist/types/react/page-renderer.d.ts +5 -0
- package/dist/types/react/use-forms-runtime.d.ts +201 -0
- package/dist/types/testing/form-workbook.d.ts +106 -0
- package/dist/types/testing/index.d.ts +1 -0
- package/package.json +6 -2
- package/dist/chunks/query-BPuCJC1C.js.map +0 -1
- package/dist/chunks/validate-4LgH8QMJ.js.map +0 -1
package/README.md
CHANGED
|
@@ -69,6 +69,96 @@ bundle's `ThemeProvider` export.
|
|
|
69
69
|
|
|
70
70
|
## Versions
|
|
71
71
|
|
|
72
|
+
- **0.23.0** (graph-model G2 · DF M1, 2026-10-15): every
|
|
73
|
+
renderer and runtime contract change for G2–G4, in one minor.
|
|
74
|
+
- **Main only** (versions.md §4.6, G1 · DF M0): `prepareDocument` reads
|
|
75
|
+
main systems and placements only, adding `version: { is: NULL }` to
|
|
76
|
+
`systemCollection`, `graph_nodeCollection` and `graph_edgeCollection`
|
|
77
|
+
at any depth. New diagnostics: `SYSTEM_NOT_MAIN` (a warning: a page
|
|
78
|
+
names a system that isn't main, read as absent; `GraphSource.mainSystems`
|
|
79
|
+
says which are), `DESCRIPTOR_VERSION_FILTER` (a document filters on
|
|
80
|
+
`version` itself) and `DESCRIPTOR_STATE_UNSCOPED` (a document reads
|
|
81
|
+
states by node or unfiltered, so a branch's would be read too); both are
|
|
82
|
+
refused before a document is sent.
|
|
83
|
+
- **The version context:** `PageScope.version` (`VersionContext {
|
|
84
|
+
versionId, versionKind }`, from `@peripheries/runtime`) reaches every
|
|
85
|
+
`GraphSource` read as an optional trailing `ReadContext`, and
|
|
86
|
+
`@context.version` / `@context.versionKind` name it to a query. At main
|
|
87
|
+
the reads are 0.22's. The runtime freezes the read-side types
|
|
88
|
+
(`ResolvedVersionContext`, `StateAsOf`, `NodeStateView`, `Via`,
|
|
89
|
+
`ReleaseProblem`, `RecordedEmbed`).
|
|
90
|
+
- **Edits at a version:** a release or a channel refuses an edit before
|
|
91
|
+
it is sent (`VERSION_IS_RELEASE`); a branch's edit carries
|
|
92
|
+
`p_version_id`.
|
|
93
|
+
- **Embeds and print at a version:** `PageScope.recordedEmbeds` (a
|
|
94
|
+
release's `metadata.embeds`) makes an embed render the release its host
|
|
95
|
+
recorded, else the viewer's context; `PageRuntime.embedVersion` says
|
|
96
|
+
which (`recorded` | `context`), and `PageRuntime.readVersionIds` the
|
|
97
|
+
versions the states were read from, for print's and an embed's "Release
|
|
98
|
+
N". A state row may carry `versionId`, `unversioned` and `outOfScope`.
|
|
99
|
+
- **Render-time functions:** `RENDER_FUNCTIONS` adds G2's version reads
|
|
100
|
+
(`node_states_as_of`, `node_state_view`, `version_context_for`,
|
|
101
|
+
`version_scope_members`, `versions_for`, `version_diff`,
|
|
102
|
+
`auto_release_status`), each with the tables it reads for
|
|
103
|
+
invalidation.
|
|
104
|
+
- **Declared ahead:** `form_answers(p_structure_nodes: [UUID!]!)` (SCH
|
|
105
|
+
M3b) is a render function now, listed in `RENDER_FUNCTIONS_AHEAD`, so
|
|
106
|
+
G3's workbook snapshots need no renderer release. Its JSON is a leaf:
|
|
107
|
+
`result.path` reads into it and nothing in it is flattened. An alias on
|
|
108
|
+
a render function's JSON root is refused (`DESCRIPTOR_ALIAS_JSON_ROOT`),
|
|
109
|
+
since its JSON is decoded by field name.
|
|
110
|
+
- **Systems from the graph:** `GraphSource.graphSystems(processId)` (the
|
|
111
|
+
main, keyless systems on the process's graphs, with each graph's type
|
|
112
|
+
and layer's role) is how `resolveSystems` finds a page's systems;
|
|
113
|
+
`processSystems` is optional and read only without it, and
|
|
114
|
+
`metadata.pageProcess` is no longer read. A state name is `<tier>_<role>`
|
|
115
|
+
for any registered layer's role (`eng_answer`), not only the four;
|
|
116
|
+
whether the page's process has it is `STATE_UNKNOWN_SYSTEM` at load.
|
|
117
|
+
- **Releases:** `validateManifest(pages)` returns `ReleaseProblem[]`,
|
|
118
|
+
advisory before a release; `manifestPageFrom(graphNodeId, data)` reads a
|
|
119
|
+
page artifact's state data as a manifest page. The runtime adds `PageView` and
|
|
120
|
+
`SubmissionData` for G3.
|
|
121
|
+
- **The forms runtime** (`@peripheries/renderer/forms`): the steps
|
|
122
|
+
overlay, modes, navigation, saving, progress and deep links behind
|
|
123
|
+
`FormsPort { save, submit, visit, reopen }` (and, optional, `upload` and
|
|
124
|
+
`openFile` for file answers), with `useFormsRuntime` and `FormSlotProps`
|
|
125
|
+
in `/react`. Refusals are codes, never throws (`FormsRefusal`:
|
|
126
|
+
`CONFLICT`, `ANSWER_*`, `FORM_INCOMPLETE`, `FORM_NOT_OPEN`,
|
|
127
|
+
`FORM_COMPLETED`, `FORM_STEP_UNKNOWN`, `NO_CAPABILITY`, `NETWORK`).
|
|
128
|
+
`reopen` is the "Edit answers" slot on a submitted form. A phone opens
|
|
129
|
+
in question mode; the slot props carry the question shown (`question`,
|
|
130
|
+
its place and the next), `goToQuestion`, `progress.total` beside the
|
|
131
|
+
required count, a step's authored `label`, and stay one object while
|
|
132
|
+
what they show is unchanged. A step with only optional questions is
|
|
133
|
+
complete once seen. The slot props name every chapter, the submission's
|
|
134
|
+
`status`, `readOnly`, and the newest staff `review` (its note, status,
|
|
135
|
+
time and writer). The runtime adds `FileAnswer` and `AnswerValue`;
|
|
136
|
+
`SubmissionData` carries `reopens` and each note's `status`.
|
|
137
|
+
- **Form cells:** on a form page each cell gets, through
|
|
138
|
+
`RendererEnvironment.cellProps` (useFormsRuntime's `cellProps`), `form`
|
|
139
|
+
(the slot props), `answers` (its questions the conditions show, by key)
|
|
140
|
+
and, with one question, `answer`: a `FormAnswer { key, label, question,
|
|
141
|
+
value, change, readOnly, required, missing, refusal, inputId, upload?,
|
|
142
|
+
openFile? }`, in the slot props' words. `question` is the question's
|
|
143
|
+
definition (`FormQuestion.definition`); `inputId` is where
|
|
144
|
+
`goToQuestion` moves focus. In question mode `FormSlotProps.question`
|
|
145
|
+
carries the same `answer`.
|
|
146
|
+
- **For consumers** (nothing is required to keep 0.22's behaviour):
|
|
147
|
+
- a `GraphSource` adds `graphSystems(processId)` to find systems by
|
|
148
|
+
graph (else `processSystems` is read), `mainSystems(ids)` to read
|
|
149
|
+
main only (else every system is read), and takes the trailing
|
|
150
|
+
`ReadContext` to read at a version (else it reads main);
|
|
151
|
+
- a host passes `PageScope.version` (and `recordedEmbeds` at a release)
|
|
152
|
+
to read at a version, and refuses nothing else itself;
|
|
153
|
+
- a form host implements `FormsPort` (`upload` and `openFile` only if
|
|
154
|
+
it takes files) and passes `cellProps` from `useFormsRuntime` as
|
|
155
|
+
`RendererEnvironment.cellProps`; `review.by` is a display name or
|
|
156
|
+
null, never an email or a user id;
|
|
157
|
+
- a component reads `form`, `answers` and `answer` from its props on a
|
|
158
|
+
form page, and puts `answer.inputId` on its control.
|
|
159
|
+
- from G3, page ids (an embed's `page_id`, `PageScope`'s page) are
|
|
160
|
+
anchor ids; the renderer treats them as opaque, so nothing changes.
|
|
161
|
+
|
|
72
162
|
- **0.10.0** (data-render M2): actions run, documents edit, pages embed.
|
|
73
163
|
- Declared actions run through the environment's `runAction`; the runtime's
|
|
74
164
|
`ACTION_FIELDS` takes `subjects` and `audience` on `create`, `edit` and
|
package/dist/catalog.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as eachFormProblems, s as validatePage } from "./chunks/validate-
|
|
1
|
+
import { x as isEach } from "./chunks/query-LnTbQghF.js";
|
|
2
|
+
import { i as eachFormProblems, s as validatePage } from "./chunks/validate-B_g7719l.js";
|
|
3
3
|
import { KNOWLEDGE_BUDGETS, KNOWLEDGE_KEY } from "@peripheries/runtime";
|
|
4
4
|
import Ajv2020 from "ajv/dist/2020.js";
|
|
5
5
|
//#region packages/renderer/src/catalog/check.ts
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
//#region packages/renderer/src/forms/conditions.ts
|
|
2
|
+
var CONDITION_OPS = [
|
|
3
|
+
"eq",
|
|
4
|
+
"ne",
|
|
5
|
+
"in",
|
|
6
|
+
"not_in",
|
|
7
|
+
"gt",
|
|
8
|
+
"lt",
|
|
9
|
+
"gte",
|
|
10
|
+
"lte",
|
|
11
|
+
"contains",
|
|
12
|
+
"not_contains",
|
|
13
|
+
"empty",
|
|
14
|
+
"not_empty"
|
|
15
|
+
];
|
|
16
|
+
var OPS = new Set(CONDITION_OPS);
|
|
17
|
+
function isConditionOp(op) {
|
|
18
|
+
return typeof op === "string" && OPS.has(op);
|
|
19
|
+
}
|
|
20
|
+
function isBlank(value) {
|
|
21
|
+
if (value === null || value === void 0) return true;
|
|
22
|
+
if (typeof value === "string") return value.trim() === "";
|
|
23
|
+
if (Array.isArray(value)) return value.length === 0;
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
function asNumber(value) {
|
|
27
|
+
if (typeof value === "number") return value;
|
|
28
|
+
const n = Number.parseFloat(String(value));
|
|
29
|
+
return Number.isFinite(n) ? n : NaN;
|
|
30
|
+
}
|
|
31
|
+
function looseEquals(a, b) {
|
|
32
|
+
if (a === b) return true;
|
|
33
|
+
if (a === null || a === void 0 || b === null || b === void 0) return false;
|
|
34
|
+
return String(a) === String(b);
|
|
35
|
+
}
|
|
36
|
+
function anyOverlap(actual, expected) {
|
|
37
|
+
const list = Array.isArray(expected) ? expected : [expected];
|
|
38
|
+
if (Array.isArray(actual)) return actual.some((a) => list.some((e) => looseEquals(a, e)));
|
|
39
|
+
return list.some((e) => looseEquals(actual, e));
|
|
40
|
+
}
|
|
41
|
+
function contains(actual, expected) {
|
|
42
|
+
if (Array.isArray(actual)) return actual.some((a) => looseEquals(a, expected));
|
|
43
|
+
return typeof actual === "string" && actual.includes(String(expected));
|
|
44
|
+
}
|
|
45
|
+
function evaluateClause(clause, answers, onProblem) {
|
|
46
|
+
const actual = answers[clause.q];
|
|
47
|
+
const expected = clause.value;
|
|
48
|
+
switch (clause.op) {
|
|
49
|
+
case "eq": return looseEquals(actual, expected);
|
|
50
|
+
case "ne": return !looseEquals(actual, expected);
|
|
51
|
+
case "in": return anyOverlap(actual, expected);
|
|
52
|
+
case "not_in": return !anyOverlap(actual, expected);
|
|
53
|
+
case "gt": return asNumber(actual) > asNumber(expected);
|
|
54
|
+
case "lt": return asNumber(actual) < asNumber(expected);
|
|
55
|
+
case "gte": return asNumber(actual) >= asNumber(expected);
|
|
56
|
+
case "lte": return asNumber(actual) <= asNumber(expected);
|
|
57
|
+
case "contains": return contains(actual, expected);
|
|
58
|
+
case "not_contains": return !contains(actual, expected);
|
|
59
|
+
case "empty": return isBlank(actual);
|
|
60
|
+
case "not_empty": return !isBlank(actual);
|
|
61
|
+
default:
|
|
62
|
+
onProblem?.(`unknown operator "${String(clause.op)}" on "${String(clause.q)}": the target is shown`);
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function evaluateCondition(condition, answers, onProblem) {
|
|
67
|
+
if (!condition) return true;
|
|
68
|
+
const clauses = Array.isArray(condition.all) ? condition.all : [];
|
|
69
|
+
if (clauses.length === 0) return true;
|
|
70
|
+
let result;
|
|
71
|
+
try {
|
|
72
|
+
result = clauses.every((c) => evaluateClause(c, answers, onProblem));
|
|
73
|
+
} catch (error) {
|
|
74
|
+
onProblem?.(`evaluation failed, the target is shown: ${error instanceof Error ? error.message : String(error)}`);
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
return condition.not === true ? !result : result;
|
|
78
|
+
}
|
|
79
|
+
var LEGACY_OPS = {
|
|
80
|
+
eq: "eq",
|
|
81
|
+
equals: "eq",
|
|
82
|
+
equal: "eq",
|
|
83
|
+
ne: "ne",
|
|
84
|
+
neq: "ne",
|
|
85
|
+
notequals: "ne",
|
|
86
|
+
notequal: "ne",
|
|
87
|
+
in: "in",
|
|
88
|
+
notin: "not_in",
|
|
89
|
+
gt: "gt",
|
|
90
|
+
greaterthan: "gt",
|
|
91
|
+
lt: "lt",
|
|
92
|
+
lessthan: "lt",
|
|
93
|
+
gte: "gte",
|
|
94
|
+
greaterthanorequal: "gte",
|
|
95
|
+
greaterthanorequals: "gte",
|
|
96
|
+
greaterthanorequalto: "gte",
|
|
97
|
+
lte: "lte",
|
|
98
|
+
lessthanorequal: "lte",
|
|
99
|
+
lessthanorequals: "lte",
|
|
100
|
+
lessthanorequalto: "lte",
|
|
101
|
+
contains: "contains",
|
|
102
|
+
notcontains: "not_contains",
|
|
103
|
+
empty: "empty",
|
|
104
|
+
isempty: "empty",
|
|
105
|
+
notempty: "not_empty",
|
|
106
|
+
isnotempty: "not_empty"
|
|
107
|
+
};
|
|
108
|
+
function normalizeOperator(op) {
|
|
109
|
+
if (typeof op !== "string") return null;
|
|
110
|
+
return LEGACY_OPS[op.replace(/[_\-\s]/g, "").toLowerCase()] ?? null;
|
|
111
|
+
}
|
|
112
|
+
function toClause(raw, index, problems) {
|
|
113
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
114
|
+
problems.push(`clause ${index}: not an object, dropped`);
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
const r = raw;
|
|
118
|
+
const q = [
|
|
119
|
+
r.q,
|
|
120
|
+
r.questionId,
|
|
121
|
+
r.when
|
|
122
|
+
].find((k) => typeof k === "string" && k !== "");
|
|
123
|
+
if (!q) {
|
|
124
|
+
problems.push(`clause ${index}: no question key, dropped`);
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
const value = "value" in r ? r.value : r.is;
|
|
128
|
+
const rawOp = r.op ?? r.operator;
|
|
129
|
+
if (rawOp === void 0 || rawOp === null || rawOp === "") return {
|
|
130
|
+
q,
|
|
131
|
+
op: "eq",
|
|
132
|
+
value
|
|
133
|
+
};
|
|
134
|
+
const op = normalizeOperator(rawOp);
|
|
135
|
+
if (op) return {
|
|
136
|
+
q,
|
|
137
|
+
op,
|
|
138
|
+
value
|
|
139
|
+
};
|
|
140
|
+
problems.push(`clause ${index} on "${q}": unknown operator "${String(rawOp)}", the target is shown`);
|
|
141
|
+
return {
|
|
142
|
+
q,
|
|
143
|
+
op: String(rawOp),
|
|
144
|
+
value
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function normalizeCondition(legacy) {
|
|
148
|
+
const problems = [];
|
|
149
|
+
const none = () => ({
|
|
150
|
+
condition: null,
|
|
151
|
+
problems
|
|
152
|
+
});
|
|
153
|
+
if (legacy === null || legacy === void 0) return none();
|
|
154
|
+
let parsed = legacy;
|
|
155
|
+
if (typeof legacy === "string") {
|
|
156
|
+
const trimmed = legacy.trim();
|
|
157
|
+
if (trimmed === "") return none();
|
|
158
|
+
try {
|
|
159
|
+
parsed = JSON.parse(trimmed);
|
|
160
|
+
} catch {
|
|
161
|
+
problems.push("not JSON: ungated");
|
|
162
|
+
return none();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
let rawClauses;
|
|
166
|
+
let not = false;
|
|
167
|
+
if (Array.isArray(parsed)) rawClauses = parsed;
|
|
168
|
+
else if (parsed && typeof parsed === "object") {
|
|
169
|
+
const obj = parsed;
|
|
170
|
+
const list = Array.isArray(obj.all) ? obj.all : Array.isArray(obj.conditions) ? obj.conditions : null;
|
|
171
|
+
if (!list) {
|
|
172
|
+
problems.push("no clause list (`all` or `conditions`): ungated");
|
|
173
|
+
return none();
|
|
174
|
+
}
|
|
175
|
+
rawClauses = list;
|
|
176
|
+
not = obj.not === true;
|
|
177
|
+
} else {
|
|
178
|
+
problems.push(`unrecognised condition (${typeof parsed}): ungated`);
|
|
179
|
+
return none();
|
|
180
|
+
}
|
|
181
|
+
const all = rawClauses.map((c, i) => toClause(c, i, problems)).filter((c) => c !== null);
|
|
182
|
+
if (all.length === 0) return none();
|
|
183
|
+
return {
|
|
184
|
+
condition: {
|
|
185
|
+
all,
|
|
186
|
+
not
|
|
187
|
+
},
|
|
188
|
+
problems
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region packages/renderer/src/forms/model.ts
|
|
193
|
+
var answered = (v) => v !== void 0 && v !== null && !(typeof v === "string" && v.trim() === "") && !(Array.isArray(v) && v.length === 0);
|
|
194
|
+
function visibleSteps(model, values) {
|
|
195
|
+
const shows = (when) => evaluateCondition(when ?? null, values);
|
|
196
|
+
return model.steps.filter((s) => shows(s.when)).map((s) => ({
|
|
197
|
+
...s,
|
|
198
|
+
items: s.items.filter((i) => shows(i.when)).map((i) => ({
|
|
199
|
+
...i,
|
|
200
|
+
questions: i.questions.filter((q) => shows(q.when))
|
|
201
|
+
}))
|
|
202
|
+
})).filter((s) => s.items.length > 0);
|
|
203
|
+
}
|
|
204
|
+
var questionsOf = (step) => step.items.flatMap((i) => i.questions);
|
|
205
|
+
function stepKind(step, isLast) {
|
|
206
|
+
if (isLast && step.items.some((i) => i.kind === "review")) return "submit";
|
|
207
|
+
if (step.items.some((i) => i.kind === "upload")) return "upload";
|
|
208
|
+
if (questionsOf(step).length) return "answer";
|
|
209
|
+
if (step.items.some((i) => i.kind === "review")) return "review";
|
|
210
|
+
return "read";
|
|
211
|
+
}
|
|
212
|
+
function positionsOf(steps, mode) {
|
|
213
|
+
return steps.flatMap((s) => {
|
|
214
|
+
const qs = questionsOf(s);
|
|
215
|
+
return mode === "question" && qs.length ? qs.map((q) => ({
|
|
216
|
+
step: s.id,
|
|
217
|
+
question: q.key
|
|
218
|
+
})) : [{ step: s.id }];
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
var samePlace = (a, b) => a.step === b.step && (a.question ?? null) === (b.question ?? null);
|
|
222
|
+
function settle(steps, mode, at) {
|
|
223
|
+
const all = positionsOf(steps, mode);
|
|
224
|
+
if (!all.length) return null;
|
|
225
|
+
if (at) {
|
|
226
|
+
const exact = all.find((p) => samePlace(p, mode === "step" ? { step: at.step } : at));
|
|
227
|
+
if (exact) return exact;
|
|
228
|
+
const inStep = all.find((p) => p.step === at.step);
|
|
229
|
+
if (inStep) return inStep;
|
|
230
|
+
}
|
|
231
|
+
return all[0];
|
|
232
|
+
}
|
|
233
|
+
function move(steps, mode, at, by) {
|
|
234
|
+
const all = positionsOf(steps, mode);
|
|
235
|
+
return all[all.findIndex((p) => samePlace(p, at)) + by] ?? null;
|
|
236
|
+
}
|
|
237
|
+
function goTo(steps, mode, stepId, values) {
|
|
238
|
+
const step = steps.find((s) => s.id === stepId);
|
|
239
|
+
if (!step) return null;
|
|
240
|
+
if (mode === "step") return { step: step.id };
|
|
241
|
+
const qs = questionsOf(step);
|
|
242
|
+
if (!qs.length) return { step: step.id };
|
|
243
|
+
return {
|
|
244
|
+
step: step.id,
|
|
245
|
+
question: (qs.find((q) => !answered(values[q.key])) ?? qs[0]).key
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function goToQuestion(steps, mode, key) {
|
|
249
|
+
const step = steps.find((s) => questionsOf(s).some((q) => q.key === key));
|
|
250
|
+
if (!step) return null;
|
|
251
|
+
return mode === "question" ? {
|
|
252
|
+
step: step.id,
|
|
253
|
+
question: key
|
|
254
|
+
} : { step: step.id };
|
|
255
|
+
}
|
|
256
|
+
function enterAdvances(step, mode, question) {
|
|
257
|
+
const qs = questionsOf(step);
|
|
258
|
+
if (mode === "question") return !!question && !!qs.find((q) => q.key === question)?.singleLine;
|
|
259
|
+
return qs.length === 1 && qs[0].singleLine;
|
|
260
|
+
}
|
|
261
|
+
function missing(steps, values, stepId) {
|
|
262
|
+
return steps.filter((s) => !stepId || s.id === stepId).flatMap(questionsOf).filter((q) => q.required && !answered(values[q.key]));
|
|
263
|
+
}
|
|
264
|
+
function progress(steps, values, visited) {
|
|
265
|
+
const required = steps.flatMap(questionsOf).filter((q) => q.required);
|
|
266
|
+
const done = required.filter((q) => answered(values[q.key])).length;
|
|
267
|
+
const perStep = {};
|
|
268
|
+
steps.forEach((s, i) => {
|
|
269
|
+
const qs = questionsOf(s);
|
|
270
|
+
if (!qs.length) {
|
|
271
|
+
const seen = visited.has(s.id) ? 1 : 0;
|
|
272
|
+
perStep[s.id] = {
|
|
273
|
+
answered: seen,
|
|
274
|
+
total: 1,
|
|
275
|
+
complete: seen === 1 || stepKind(s, i === steps.length - 1) === "submit"
|
|
276
|
+
};
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const n = qs.filter((q) => answered(values[q.key])).length;
|
|
280
|
+
const required = qs.some((q) => q.required);
|
|
281
|
+
perStep[s.id] = {
|
|
282
|
+
answered: n,
|
|
283
|
+
total: qs.length,
|
|
284
|
+
complete: qs.every((q) => !q.required || answered(values[q.key])) && (required || n > 0 || visited.has(s.id))
|
|
285
|
+
};
|
|
286
|
+
});
|
|
287
|
+
const all = steps.flatMap(questionsOf);
|
|
288
|
+
const total = {
|
|
289
|
+
answered: all.filter((q) => answered(values[q.key])).length,
|
|
290
|
+
count: all.length
|
|
291
|
+
};
|
|
292
|
+
return {
|
|
293
|
+
answered: done,
|
|
294
|
+
required: required.length,
|
|
295
|
+
ratio: required.length ? done / required.length : 1,
|
|
296
|
+
total,
|
|
297
|
+
perStep
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
var isReadOnlyStatus = (status) => status === "submitted" || status === "completed";
|
|
301
|
+
var defaultMode = (phone) => phone ? "question" : "step";
|
|
302
|
+
function fromPageSteps(page, itemOf) {
|
|
303
|
+
const layout = page.layout ?? {};
|
|
304
|
+
const steps = Array.isArray(layout.steps) ? layout.steps : [];
|
|
305
|
+
const chapters = Array.isArray(layout.chapters) ? layout.chapters : [];
|
|
306
|
+
const submit = layout.submit ?? {};
|
|
307
|
+
return {
|
|
308
|
+
title: page.name ?? "",
|
|
309
|
+
chapters,
|
|
310
|
+
steps: steps.map((s) => ({
|
|
311
|
+
id: s.id,
|
|
312
|
+
title: s.title ?? s.id,
|
|
313
|
+
...s.chapter ? { chapter: s.chapter } : {},
|
|
314
|
+
...typeof s.label === "string" && s.label ? { label: s.label } : {},
|
|
315
|
+
...s.when ? { when: s.when } : {},
|
|
316
|
+
items: (s.cell_ids ?? []).map(itemOf).filter((i) => i !== null)
|
|
317
|
+
})),
|
|
318
|
+
submitRequired: submit.required === "block" ? "block" : "warn",
|
|
319
|
+
allowBack: layout.allow_back !== false
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
function positionFromLink(steps, mode, link) {
|
|
323
|
+
const step = link.section && steps.find((s) => s.id === link.section) || link.page && steps.find((s) => s.chapter === link.page) || steps[0];
|
|
324
|
+
if (!step) return null;
|
|
325
|
+
return settle(steps, mode, {
|
|
326
|
+
step: step.id,
|
|
327
|
+
...link.question && link.section === step.id ? { question: link.question } : {}
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
function linkTo(steps, mode, at) {
|
|
331
|
+
const step = steps.find((s) => s.id === at.step);
|
|
332
|
+
return {
|
|
333
|
+
...mode === "question" ? { mode: "question" } : {},
|
|
334
|
+
...step?.chapter ? { page: step.chapter } : {},
|
|
335
|
+
section: at.step,
|
|
336
|
+
...at.question ? { question: at.question } : {}
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
//#endregion
|
|
340
|
+
export { CONDITION_OPS as _, goToQuestion as a, normalizeCondition as b, missing as c, positionsOf as d, progress as f, visibleSteps as g, stepKind as h, goTo as i, move as l, settle as m, enterAdvances as n, isReadOnlyStatus as o, questionsOf as p, fromPageSteps as r, linkTo as s, defaultMode as t, positionFromLink as u, evaluateCondition as v, normalizeOperator as x, isConditionOp as y };
|
|
341
|
+
|
|
342
|
+
//# sourceMappingURL=forms-CCAE7sCu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forms-CCAE7sCu.js","names":[],"sources":["../../src/forms/conditions.ts","../../src/forms/model.ts"],"mappings":";AAkBA,IAAa,gBAAgB;CAAC;CAAM;CAAM;CAAM;CAAU;CAAM;CAAM;CAAO;CAAO;CAAY;CAAgB;CAAS;AAAW;AAiBpI,IAAM,MAAM,IAAI,IAAY,aAAa;AAEzC,SAAgB,cAAc,IAAgC;CAC5D,OAAO,OAAO,OAAO,YAAY,IAAI,IAAI,EAAE;AAC7C;AAIA,SAAS,QAAQ,OAAyB;CACxC,IAAI,UAAU,QAAQ,UAAU,KAAA,GAAW,OAAO;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO,MAAM,KAAK,MAAM;CACvD,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,WAAW;CAClD,OAAO;AACT;AAEA,SAAS,SAAS,OAAwB;CACxC,IAAI,OAAO,UAAU,UAAU,OAAO;C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