@getodk/xforms-engine 0.3.0 → 0.4.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/dist/client/BaseNode.d.ts +1 -2
- package/dist/client/EngineConfig.d.ts +0 -1
- package/dist/client/GroupNode.d.ts +2 -3
- package/dist/client/ModelValueNode.d.ts +1 -2
- package/dist/client/NodeAppearances.d.ts +1 -2
- package/dist/client/NoteNode.d.ts +2 -3
- package/dist/client/RootNode.d.ts +2 -3
- package/dist/client/SelectNode.d.ts +2 -3
- package/dist/client/StringNode.d.ts +2 -3
- package/dist/client/SubtreeNode.d.ts +1 -2
- package/dist/client/TextRange.d.ts +3 -4
- package/dist/client/TriggerNode.d.ts +25 -0
- package/dist/client/constants.d.ts +0 -1
- package/dist/client/hierarchy.d.ts +7 -3
- package/dist/client/index.d.ts +0 -1
- package/dist/client/node-types.d.ts +2 -1
- package/dist/client/repeat/BaseRepeatRangeNode.d.ts +1 -2
- package/dist/client/repeat/RepeatInstanceNode.d.ts +2 -3
- package/dist/client/repeat/RepeatRangeControlledNode.d.ts +1 -2
- package/dist/client/repeat/RepeatRangeUncontrolledNode.d.ts +1 -2
- package/dist/client/unsupported/RangeNode.d.ts +9 -0
- package/dist/client/unsupported/RankNode.d.ts +9 -0
- package/dist/client/unsupported/UnsupportedControlNode.d.ts +32 -0
- package/dist/client/unsupported/UploadNode.d.ts +9 -0
- package/dist/client/validation.d.ts +0 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.js +39029 -37441
- package/dist/index.js.map +1 -1
- package/dist/instance/Group.d.ts +0 -1
- package/dist/instance/ModelValue.d.ts +1 -2
- package/dist/instance/Note.d.ts +1 -2
- package/dist/instance/Root.d.ts +3 -4
- package/dist/instance/SelectField.d.ts +3 -4
- package/dist/instance/StringField.d.ts +2 -3
- package/dist/instance/Subtree.d.ts +0 -1
- package/dist/instance/TriggerControl.d.ts +40 -0
- package/dist/instance/abstract/DescendantNode.d.ts +4 -5
- package/dist/instance/abstract/InstanceNode.d.ts +1 -2
- package/dist/instance/abstract/UnsupportedControl.d.ts +46 -0
- package/dist/instance/children.d.ts +0 -1
- package/dist/instance/hierarchy.d.ts +9 -5
- package/dist/instance/index.d.ts +0 -1
- package/dist/instance/internal-api/EvaluationContext.d.ts +0 -1
- package/dist/instance/internal-api/InstanceConfig.d.ts +0 -1
- package/dist/instance/internal-api/SubscribableDependency.d.ts +0 -1
- package/dist/instance/internal-api/TranslationContext.d.ts +0 -1
- package/dist/instance/internal-api/ValidationContext.d.ts +11 -4
- package/dist/instance/internal-api/ValueContext.d.ts +3 -4
- package/dist/instance/repeat/BaseRepeatRange.d.ts +1 -2
- package/dist/instance/repeat/RepeatInstance.d.ts +0 -1
- package/dist/instance/repeat/RepeatRangeControlled.d.ts +1 -2
- package/dist/instance/repeat/RepeatRangeUncontrolled.d.ts +1 -2
- package/dist/instance/resource.d.ts +0 -1
- package/dist/instance/text/TextChunk.d.ts +0 -1
- package/dist/instance/text/TextRange.d.ts +0 -1
- package/dist/instance/unsupported/RangeControl.d.ts +4 -0
- package/dist/instance/unsupported/RankControl.d.ts +4 -0
- package/dist/instance/unsupported/UploadControl.d.ts +4 -0
- package/dist/lib/TokenListParser.d.ts +3 -3
- package/dist/lib/dom/query.d.ts +1 -2
- package/dist/lib/reactivity/createChildrenState.d.ts +0 -1
- package/dist/lib/reactivity/createComputedExpression.d.ts +1 -2
- package/dist/lib/reactivity/createNoteReadonlyThunk.d.ts +2 -3
- package/dist/lib/reactivity/createSelectItems.d.ts +0 -1
- package/dist/lib/reactivity/createValueState.d.ts +0 -1
- package/dist/lib/reactivity/materializeCurrentStateChildren.d.ts +0 -1
- package/dist/lib/reactivity/node-state/createClientState.d.ts +0 -1
- package/dist/lib/reactivity/node-state/createCurrentState.d.ts +0 -1
- package/dist/lib/reactivity/node-state/createEngineState.d.ts +0 -1
- package/dist/lib/reactivity/node-state/createSharedNodeState.d.ts +0 -1
- package/dist/lib/reactivity/node-state/createSpecifiedPropertyDescriptor.d.ts +0 -1
- package/dist/lib/reactivity/node-state/createSpecifiedState.d.ts +0 -1
- package/dist/lib/reactivity/node-state/representations.d.ts +0 -1
- package/dist/lib/reactivity/scope.d.ts +0 -1
- package/dist/lib/reactivity/text/createFieldHint.d.ts +1 -2
- package/dist/lib/reactivity/text/createNodeLabel.d.ts +1 -2
- package/dist/lib/reactivity/text/createNoteText.d.ts +1 -2
- package/dist/lib/reactivity/text/createTextRange.d.ts +0 -1
- package/dist/lib/reactivity/types.d.ts +0 -1
- package/dist/lib/reactivity/validation/createAggregatedViolations.d.ts +0 -1
- package/dist/lib/reactivity/validation/createValidation.d.ts +0 -1
- package/dist/{XFormDOM.d.ts → parse/XFormDOM.d.ts} +1 -2
- package/dist/{XFormDataType.d.ts → parse/XFormDataType.d.ts} +2 -4
- package/dist/{XFormDefinition.d.ts → parse/XFormDefinition.d.ts} +2 -3
- package/dist/{body → parse/body}/BodyDefinition.d.ts +15 -10
- package/dist/{body → parse/body}/BodyElementDefinition.d.ts +7 -7
- package/dist/{body → parse/body}/RepeatElementDefinition.d.ts +3 -4
- package/dist/{body → parse/body}/UnsupportedBodyElementDefinition.d.ts +0 -1
- package/dist/{body → parse/body}/appearance/inputAppearanceParser.d.ts +1 -2
- package/dist/{body → parse/body}/appearance/selectAppearanceParser.d.ts +1 -2
- package/dist/{body → parse/body}/appearance/structureElementAppearanceParser.d.ts +1 -2
- package/dist/parse/body/appearance/unknownAppearanceParser.d.ts +3 -0
- package/dist/{body → parse/body}/control/ControlDefinition.d.ts +3 -4
- package/dist/{body → parse/body}/control/InputDefinition.d.ts +1 -2
- package/dist/parse/body/control/RangeControlDefinition.d.ts +11 -0
- package/dist/parse/body/control/RankControlDefinition.d.ts +11 -0
- package/dist/parse/body/control/TriggerControlDefinition.d.ts +11 -0
- package/dist/parse/body/control/UploadControlDefinition.d.ts +11 -0
- package/dist/{body → parse/body}/control/select/ItemDefinition.d.ts +2 -3
- package/dist/{body → parse/body}/control/select/ItemsetDefinition.d.ts +4 -5
- package/dist/{body → parse/body}/control/select/ItemsetNodesetContext.d.ts +2 -3
- package/dist/{body → parse/body}/control/select/SelectDefinition.d.ts +3 -12
- package/dist/{body → parse/body}/group/BaseGroupDefinition.d.ts +3 -5
- package/dist/{body → parse/body}/group/LogicalGroupDefinition.d.ts +0 -1
- package/dist/{body → parse/body}/group/PresentationGroupDefinition.d.ts +1 -2
- package/dist/{body → parse/body}/group/StructuralGroupDefinition.d.ts +0 -1
- package/dist/{model/BindComputation.d.ts → parse/expression/BindComputationExpression.d.ts} +5 -6
- package/dist/{body/control/select → parse/expression}/ItemsetNodesetExpression.d.ts +2 -3
- package/dist/{body/control/select → parse/expression}/ItemsetValueExpression.d.ts +2 -3
- package/dist/parse/expression/RepeatCountControlExpression.d.ts +2 -3
- package/dist/parse/expression/TextLiteralExpression.d.ts +9 -0
- package/dist/parse/expression/TextOutputExpression.d.ts +7 -0
- package/dist/parse/expression/TextReferenceExpression.d.ts +7 -0
- package/dist/parse/expression/TextTranslationExpression.d.ts +8 -0
- package/dist/{expression → parse/expression/abstract}/DependencyContext.d.ts +0 -1
- package/dist/{expression → parse/expression/abstract}/DependentExpression.d.ts +2 -3
- package/dist/parse/expression/abstract/TextChunkExpression.d.ts +17 -0
- package/dist/parse/model/BindDefinition.d.ts +39 -0
- package/dist/{model → parse/model}/DescendentNodeDefinition.d.ts +0 -1
- package/dist/{model → parse/model}/LeafNodeDefinition.d.ts +1 -2
- package/dist/{model → parse/model}/ModelBindMap.d.ts +0 -1
- package/dist/{model → parse/model}/ModelDefinition.d.ts +1 -2
- package/dist/{model → parse/model}/NodeDefinition.d.ts +0 -1
- package/dist/parse/{NoteNodeDefinition.d.ts → model/NoteNodeDefinition.d.ts} +8 -9
- package/dist/{model → parse/model}/RepeatInstanceDefinition.d.ts +1 -2
- package/dist/{model → parse/model}/RepeatRangeDefinition.d.ts +2 -3
- package/dist/{model → parse/model}/RepeatTemplateDefinition.d.ts +2 -3
- package/dist/{model → parse/model}/RootDefinition.d.ts +2 -3
- package/dist/{model → parse/model}/SubtreeDefinition.d.ts +1 -2
- package/dist/parse/text/HintDefinition.d.ts +2 -3
- package/dist/parse/text/ItemLabelDefinition.d.ts +2 -3
- package/dist/parse/text/ItemsetLabelDefinition.d.ts +3 -4
- package/dist/parse/text/LabelDefinition.d.ts +5 -6
- package/dist/parse/text/MessageDefinition.d.ts +4 -5
- package/dist/parse/text/abstract/TextElementDefinition.d.ts +8 -9
- package/dist/parse/text/abstract/TextRangeDefinition.d.ts +5 -6
- package/dist/parse/xpath/path-resolution.d.ts +0 -1
- package/dist/parse/xpath/predicate-analysis.d.ts +0 -1
- package/dist/parse/xpath/reference-parsing.d.ts +0 -1
- package/dist/parse/xpath/semantic-analysis.d.ts +0 -1
- package/dist/parse/xpath/syntax-traversal.d.ts +0 -1
- package/dist/solid.js +6849 -5247
- package/dist/solid.js.map +1 -1
- package/package.json +11 -11
- package/src/client/BaseNode.ts +1 -1
- package/src/client/GroupNode.ts +2 -2
- package/src/client/ModelValueNode.ts +1 -1
- package/src/client/NodeAppearances.ts +1 -1
- package/src/client/NoteNode.ts +2 -2
- package/src/client/RootNode.ts +2 -2
- package/src/client/SelectNode.ts +2 -2
- package/src/client/StringNode.ts +2 -2
- package/src/client/SubtreeNode.ts +1 -1
- package/src/client/TextRange.ts +4 -5
- package/src/client/TriggerNode.ts +29 -0
- package/src/client/hierarchy.ts +13 -1
- package/src/client/node-types.ts +9 -1
- package/src/client/repeat/BaseRepeatRangeNode.ts +1 -1
- package/src/client/repeat/RepeatInstanceNode.ts +2 -2
- package/src/client/repeat/RepeatRangeControlledNode.ts +1 -1
- package/src/client/repeat/RepeatRangeUncontrolledNode.ts +1 -1
- package/src/client/unsupported/RangeNode.ts +14 -0
- package/src/client/unsupported/RankNode.ts +14 -0
- package/src/client/unsupported/UnsupportedControlNode.ts +40 -0
- package/src/client/unsupported/UploadNode.ts +14 -0
- package/src/index.ts +6 -1
- package/src/instance/ModelValue.ts +2 -2
- package/src/instance/Note.ts +2 -2
- package/src/instance/Root.ts +7 -3
- package/src/instance/SelectField.ts +6 -6
- package/src/instance/StringField.ts +3 -3
- package/src/instance/TriggerControl.ts +134 -0
- package/src/instance/abstract/DescendantNode.ts +4 -4
- package/src/instance/abstract/InstanceNode.ts +9 -1
- package/src/instance/abstract/UnsupportedControl.ts +151 -0
- package/src/instance/children.ts +75 -5
- package/src/instance/hierarchy.ts +22 -4
- package/src/instance/index.ts +1 -1
- package/src/instance/internal-api/EvaluationContext.ts +1 -1
- package/src/instance/internal-api/ValidationContext.ts +12 -3
- package/src/instance/internal-api/ValueContext.ts +3 -3
- package/src/instance/repeat/BaseRepeatRange.ts +1 -1
- package/src/instance/repeat/RepeatRangeControlled.ts +1 -1
- package/src/instance/repeat/RepeatRangeUncontrolled.ts +1 -1
- package/src/instance/unsupported/RangeControl.ts +5 -0
- package/src/instance/unsupported/RankControl.ts +5 -0
- package/src/instance/unsupported/UploadControl.ts +5 -0
- package/src/lib/TokenListParser.ts +11 -7
- package/src/lib/dom/query.ts +1 -1
- package/src/lib/reactivity/createComputedExpression.ts +3 -3
- package/src/lib/reactivity/createNoteReadonlyThunk.ts +2 -2
- package/src/lib/reactivity/createSelectItems.ts +3 -3
- package/src/lib/reactivity/createValueState.ts +3 -3
- package/src/lib/reactivity/node-state/createSpecifiedState.ts +1 -1
- package/src/lib/reactivity/text/createFieldHint.ts +1 -1
- package/src/lib/reactivity/text/createNodeLabel.ts +1 -1
- package/src/lib/reactivity/text/createNoteText.ts +1 -1
- package/src/lib/reactivity/text/createTextRange.ts +4 -4
- package/src/lib/reactivity/validation/createAggregatedViolations.ts +8 -3
- package/src/lib/reactivity/validation/createValidation.ts +1 -1
- package/src/{XFormDataType.ts → parse/XFormDataType.ts} +1 -3
- package/src/{XFormDefinition.ts → parse/XFormDefinition.ts} +2 -2
- package/src/{body → parse/body}/BodyDefinition.ts +44 -27
- package/src/{body → parse/body}/BodyElementDefinition.ts +12 -6
- package/src/{body → parse/body}/RepeatElementDefinition.ts +7 -5
- package/src/{body → parse/body}/appearance/inputAppearanceParser.ts +1 -1
- package/src/{body → parse/body}/appearance/selectAppearanceParser.ts +1 -1
- package/src/{body → parse/body}/appearance/structureElementAppearanceParser.ts +1 -1
- package/src/parse/body/appearance/unknownAppearanceParser.ts +5 -0
- package/src/{body → parse/body}/control/ControlDefinition.ts +4 -4
- package/src/parse/body/control/RangeControlDefinition.ts +26 -0
- package/src/parse/body/control/RankControlDefinition.ts +27 -0
- package/src/parse/body/control/TriggerControlDefinition.ts +26 -0
- package/src/parse/body/control/UploadControlDefinition.ts +26 -0
- package/src/{body → parse/body}/control/select/ItemDefinition.ts +2 -2
- package/src/{body → parse/body}/control/select/ItemsetDefinition.ts +5 -5
- package/src/{body → parse/body}/control/select/ItemsetNodesetContext.ts +2 -2
- package/src/{body → parse/body}/control/select/SelectDefinition.ts +3 -11
- package/src/{body → parse/body}/group/BaseGroupDefinition.ts +11 -22
- package/src/{body → parse/body}/group/PresentationGroupDefinition.ts +1 -1
- package/src/{model/BindComputation.ts → parse/expression/BindComputationExpression.ts} +8 -8
- package/src/{body/control/select → parse/expression}/ItemsetNodesetExpression.ts +2 -2
- package/src/{body/control/select → parse/expression}/ItemsetValueExpression.ts +2 -2
- package/src/parse/expression/RepeatCountControlExpression.ts +2 -2
- package/src/parse/expression/TextLiteralExpression.ts +19 -0
- package/src/parse/{text/OutputChunkDefinition.ts → expression/TextOutputExpression.ts} +4 -4
- package/src/parse/{text/ReferenceChunkDefinition.ts → expression/TextReferenceExpression.ts} +4 -4
- package/src/parse/{text/TranslationChunkDefinition.ts → expression/TextTranslationExpression.ts} +4 -4
- package/src/{expression → parse/expression/abstract}/DependentExpression.ts +4 -4
- package/src/parse/expression/abstract/TextChunkExpression.ts +38 -0
- package/src/{model → parse/model}/BindDefinition.ts +23 -22
- package/src/parse/{NoteNodeDefinition.ts → model/NoteNodeDefinition.ts} +9 -9
- package/src/{model → parse/model}/RepeatRangeDefinition.ts +1 -1
- package/src/{model → parse/model}/RootDefinition.ts +2 -2
- package/src/parse/text/HintDefinition.ts +2 -2
- package/src/parse/text/ItemLabelDefinition.ts +2 -2
- package/src/parse/text/ItemsetLabelDefinition.ts +7 -7
- package/src/parse/text/LabelDefinition.ts +5 -5
- package/src/parse/text/MessageDefinition.ts +7 -7
- package/src/parse/text/abstract/TextElementDefinition.ts +14 -14
- package/src/parse/text/abstract/TextRangeDefinition.ts +5 -5
- package/dist/model/BindDefinition.d.ts +0 -34
- package/dist/parse/text/OutputChunkDefinition.d.ts +0 -8
- package/dist/parse/text/ReferenceChunkDefinition.d.ts +0 -8
- package/dist/parse/text/StaticTextChunkDefinition.d.ts +0 -10
- package/dist/parse/text/TranslationChunkDefinition.d.ts +0 -9
- package/dist/parse/text/abstract/TextChunkDefinition.d.ts +0 -18
- package/src/parse/TODO.md +0 -3
- package/src/parse/text/StaticTextChunkDefinition.ts +0 -19
- package/src/parse/text/abstract/TextChunkDefinition.ts +0 -38
- package/dist/{model → parse/model}/BindElement.d.ts +0 -0
- package/src/{XFormDOM.ts → parse/XFormDOM.ts} +0 -0
- package/src/{body → parse/body}/UnsupportedBodyElementDefinition.ts +0 -0
- package/src/{body → parse/body}/control/InputDefinition.ts +1 -1
- /package/src/{body → parse/body}/group/LogicalGroupDefinition.ts +0 -0
- /package/src/{body → parse/body}/group/StructuralGroupDefinition.ts +0 -0
- /package/src/{expression → parse/expression/abstract}/DependencyContext.ts +0 -0
- /package/src/{model → parse/model}/BindElement.ts +0 -0
- /package/src/{model → parse/model}/DescendentNodeDefinition.ts +0 -0
- /package/src/{model → parse/model}/LeafNodeDefinition.ts +0 -0
- /package/src/{model → parse/model}/ModelBindMap.ts +0 -0
- /package/src/{model → parse/model}/ModelDefinition.ts +0 -0
- /package/src/{model → parse/model}/NodeDefinition.ts +0 -0
- /package/src/{model → parse/model}/RepeatInstanceDefinition.ts +0 -0
- /package/src/{model → parse/model}/RepeatTemplateDefinition.ts +0 -0
- /package/src/{model → parse/model}/SubtreeDefinition.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getodk/xforms-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "XForms engine for ODK Web Forms",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"README.md"
|
|
30
30
|
],
|
|
31
31
|
"engines": {
|
|
32
|
-
"node": "^18.20.4 || ^20.
|
|
32
|
+
"node": "^18.20.4 || ^20.17.0 || ^22.8.0",
|
|
33
33
|
"yarn": "1.22.22"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
@@ -54,22 +54,22 @@
|
|
|
54
54
|
"test:types": "tsc --project ./tsconfig.json --emitDeclarationOnly false --noEmit"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"solid-js": "^1.8.
|
|
57
|
+
"solid-js": "^1.8.22"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@babel/core": "^7.
|
|
60
|
+
"@babel/core": "^7.25.2",
|
|
61
61
|
"@getodk/tree-sitter-xpath": "0.1.2",
|
|
62
62
|
"@getodk/xpath": "0.2.0",
|
|
63
|
-
"@playwright/test": "^1.
|
|
64
|
-
"@vitest/browser": "^2.0.
|
|
63
|
+
"@playwright/test": "^1.46.1",
|
|
64
|
+
"@vitest/browser": "^2.0.5",
|
|
65
65
|
"babel-plugin-transform-jsbi-to-bigint": "^1.4.0",
|
|
66
66
|
"http-server": "^14.1.1",
|
|
67
|
-
"jsdom": "^
|
|
68
|
-
"typedoc": "^0.26.
|
|
69
|
-
"vite": "^5.
|
|
70
|
-
"vite-plugin-dts": "^
|
|
67
|
+
"jsdom": "^25.0.0",
|
|
68
|
+
"typedoc": "^0.26.6",
|
|
69
|
+
"vite": "^5.4.3",
|
|
70
|
+
"vite-plugin-dts": "^4.1.0",
|
|
71
71
|
"vite-plugin-no-bundle": "^4.0.0",
|
|
72
|
-
"vitest": "^2.0.
|
|
72
|
+
"vitest": "^2.0.5"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"solid-js": "^1.8.18"
|
package/src/client/BaseNode.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TokenListParser } from '../lib/TokenListParser.ts';
|
|
2
|
-
import type { AnyNodeDefinition } from '../model/NodeDefinition.ts';
|
|
2
|
+
import type { AnyNodeDefinition } from '../parse/model/NodeDefinition.ts';
|
|
3
3
|
import type { NodeAppearances } from './NodeAppearances.ts';
|
|
4
4
|
import type { OpaqueReactiveObjectFactory } from './OpaqueReactiveObjectFactory.ts';
|
|
5
5
|
import type { TextRange } from './TextRange.ts';
|
package/src/client/GroupNode.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnyGroupElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
|
-
import type { SubtreeDefinition } from '../model/SubtreeDefinition.ts';
|
|
1
|
+
import type { AnyGroupElementDefinition } from '../parse/body/BodyDefinition.ts';
|
|
2
|
+
import type { SubtreeDefinition } from '../parse/model/SubtreeDefinition.ts';
|
|
3
3
|
import type { BaseNode, BaseNodeState } from './BaseNode.ts';
|
|
4
4
|
import type { NodeAppearances } from './NodeAppearances.ts';
|
|
5
5
|
import type { RootNode } from './RootNode.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LeafNodeDefinition } from '../model/LeafNodeDefinition.ts';
|
|
1
|
+
import type { LeafNodeDefinition } from '../parse/model/LeafNodeDefinition.ts';
|
|
2
2
|
import type { BaseNode, BaseNodeState } from './BaseNode.ts';
|
|
3
3
|
import type { GeneralParentNode } from './hierarchy.ts';
|
|
4
4
|
import type { RootNode } from './RootNode.ts';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ParsedTokenList } from '../lib/TokenListParser.ts';
|
|
2
|
-
import type { NodeDefinition } from '../model/NodeDefinition.ts';
|
|
2
|
+
import type { NodeDefinition } from '../parse/model/NodeDefinition.ts';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* - Provides a means to distinguish between internal and client-facing names
|
package/src/client/NoteNode.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InputDefinition } from '../body/control/InputDefinition.ts';
|
|
2
|
-
import type { LeafNodeDefinition } from '../model/LeafNodeDefinition.ts';
|
|
1
|
+
import type { InputDefinition } from '../parse/body/control/InputDefinition.ts';
|
|
2
|
+
import type { LeafNodeDefinition } from '../parse/model/LeafNodeDefinition.ts';
|
|
3
3
|
import type { BaseNode, BaseNodeState } from './BaseNode.ts';
|
|
4
4
|
import type { GeneralParentNode } from './hierarchy.ts';
|
|
5
5
|
import type { NodeAppearances } from './NodeAppearances.ts';
|
package/src/client/RootNode.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BodyClassList } from '../body/BodyDefinition.ts';
|
|
2
|
-
import type { RootDefinition } from '../model/RootDefinition.ts';
|
|
1
|
+
import type { BodyClassList } from '../parse/body/BodyDefinition.ts';
|
|
2
|
+
import type { RootDefinition } from '../parse/model/RootDefinition.ts';
|
|
3
3
|
import type { BaseNode, BaseNodeState } from './BaseNode.ts';
|
|
4
4
|
import type { ActiveLanguage, FormLanguage, FormLanguages } from './FormLanguage.ts';
|
|
5
5
|
import type { GeneralChildNode } from './hierarchy.ts';
|
package/src/client/SelectNode.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnySelectDefinition } from '../body/control/select/SelectDefinition.ts';
|
|
2
|
-
import type { LeafNodeDefinition } from '../model/LeafNodeDefinition.ts';
|
|
1
|
+
import type { AnySelectDefinition } from '../parse/body/control/select/SelectDefinition.ts';
|
|
2
|
+
import type { LeafNodeDefinition } from '../parse/model/LeafNodeDefinition.ts';
|
|
3
3
|
import type { BaseNode, BaseNodeState } from './BaseNode.ts';
|
|
4
4
|
import type { NodeAppearances } from './NodeAppearances.ts';
|
|
5
5
|
import type { RootNode } from './RootNode.ts';
|
package/src/client/StringNode.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InputDefinition } from '../body/control/InputDefinition.ts';
|
|
2
|
-
import type { LeafNodeDefinition } from '../model/LeafNodeDefinition.ts';
|
|
1
|
+
import type { InputDefinition } from '../parse/body/control/InputDefinition.ts';
|
|
2
|
+
import type { LeafNodeDefinition } from '../parse/model/LeafNodeDefinition.ts';
|
|
3
3
|
import type { BaseNode, BaseNodeState } from './BaseNode.ts';
|
|
4
4
|
import type { NodeAppearances } from './NodeAppearances.ts';
|
|
5
5
|
import type { RootNode } from './RootNode.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SubtreeDefinition as BaseSubtreeDefinition } from '../model/SubtreeDefinition.ts';
|
|
1
|
+
import type { SubtreeDefinition as BaseSubtreeDefinition } from '../parse/model/SubtreeDefinition.ts';
|
|
2
2
|
import type { BaseNode, BaseNodeState } from './BaseNode.ts';
|
|
3
3
|
import type { RootNode } from './RootNode.ts';
|
|
4
4
|
import type { GeneralChildNode, GeneralParentNode } from './hierarchy.ts';
|
package/src/client/TextRange.ts
CHANGED
|
@@ -24,7 +24,7 @@ import type { RootNodeState } from './RootNode.ts';
|
|
|
24
24
|
* Here, `is-translation-expr()` is a fictional shorthand for checking
|
|
25
25
|
* that the attribute's value is a valid `jr:itext(...)` FunctionCall
|
|
26
26
|
* expression. Note that, per spec, these attributes **do not accept
|
|
27
|
-
* arbitrary XPath expressions**! The non-translation case is
|
|
27
|
+
* arbitrary XPath expressions**! The non-translation case is treated as
|
|
28
28
|
* static text, not parsed for e.g. an XPath [string] Literal expression.
|
|
29
29
|
* This is why we have introduced this 'translation' case, distinct from
|
|
30
30
|
* 'reference', which previously handled translated labels and hints.
|
|
@@ -34,7 +34,7 @@ import type { RootNodeState } from './RootNode.ts';
|
|
|
34
34
|
*
|
|
35
35
|
* - `h:body//label/@ref[is-translation-expr()]`
|
|
36
36
|
*
|
|
37
|
-
* - '
|
|
37
|
+
* - 'literal':
|
|
38
38
|
* - `h:head//bind/@jr:constraintMsg[not(is-translation-expr())]`
|
|
39
39
|
* - `h:head//bind/@jr:requiredMsg[not(is-translation-expr())]`
|
|
40
40
|
* - `h:body//label/text()`
|
|
@@ -60,11 +60,10 @@ import type { RootNodeState } from './RootNode.ts';
|
|
|
60
60
|
*/
|
|
61
61
|
// prettier-ignore
|
|
62
62
|
export type TextChunkSource =
|
|
63
|
-
|
|
63
|
+
| 'literal'
|
|
64
64
|
| 'output'
|
|
65
65
|
| 'reference'
|
|
66
|
-
| 'translation'
|
|
67
|
-
| 'static';
|
|
66
|
+
| 'translation';
|
|
68
67
|
|
|
69
68
|
/**
|
|
70
69
|
* @todo This (and everything else to do with {@link TextRange}s is for
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { UnknownAppearanceDefinition } from '../parse/body/appearance/unknownAppearanceParser.ts';
|
|
2
|
+
import type { TriggerControlDefinition } from '../parse/body/control/TriggerControlDefinition.ts';
|
|
3
|
+
import type { LeafNodeDefinition } from '../parse/model/LeafNodeDefinition.ts';
|
|
4
|
+
import type { BaseNode, BaseNodeState } from './BaseNode.ts';
|
|
5
|
+
import type { GeneralParentNode } from './hierarchy.ts';
|
|
6
|
+
import type { RootNode } from './RootNode.ts';
|
|
7
|
+
import type { LeafNodeValidationState } from './validation.ts';
|
|
8
|
+
|
|
9
|
+
export interface TriggerNodeState extends BaseNodeState {
|
|
10
|
+
get children(): null;
|
|
11
|
+
get valueOptions(): null;
|
|
12
|
+
get value(): boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface TriggerNodeDefinition extends LeafNodeDefinition {
|
|
16
|
+
readonly bodyElement: TriggerControlDefinition;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface TriggerNode extends BaseNode {
|
|
20
|
+
readonly nodeType: 'trigger';
|
|
21
|
+
readonly definition: TriggerNodeDefinition;
|
|
22
|
+
readonly appearances: UnknownAppearanceDefinition;
|
|
23
|
+
readonly root: RootNode;
|
|
24
|
+
readonly parent: GeneralParentNode;
|
|
25
|
+
readonly currentState: TriggerNodeState;
|
|
26
|
+
readonly validationState: LeafNodeValidationState;
|
|
27
|
+
|
|
28
|
+
setValue(value: boolean): RootNode;
|
|
29
|
+
}
|
package/src/client/hierarchy.ts
CHANGED
|
@@ -9,16 +9,28 @@ import type { RootNode } from './RootNode.ts';
|
|
|
9
9
|
import type { SelectNode } from './SelectNode.ts';
|
|
10
10
|
import type { StringNode } from './StringNode.ts';
|
|
11
11
|
import type { SubtreeNode } from './SubtreeNode.ts';
|
|
12
|
+
import type { TriggerNode } from './TriggerNode.ts';
|
|
13
|
+
import type { RangeNode } from './unsupported/RangeNode.ts';
|
|
14
|
+
import type { RankNode } from './unsupported/RankNode.ts';
|
|
15
|
+
import type { UploadNode } from './unsupported/UploadNode.ts';
|
|
16
|
+
|
|
17
|
+
// prettier-ignore
|
|
18
|
+
export type AnyUnsupportedControlNode =
|
|
19
|
+
| RangeNode
|
|
20
|
+
| RankNode
|
|
21
|
+
| UploadNode;
|
|
12
22
|
|
|
13
23
|
// prettier-ignore
|
|
14
24
|
export type AnyControlNode =
|
|
15
25
|
| NoteNode
|
|
16
26
|
| SelectNode
|
|
17
|
-
| StringNode
|
|
27
|
+
| StringNode
|
|
28
|
+
| TriggerNode;
|
|
18
29
|
|
|
19
30
|
// prettier-ignore
|
|
20
31
|
export type AnyLeafNode =
|
|
21
32
|
| AnyControlNode
|
|
33
|
+
| AnyUnsupportedControlNode
|
|
22
34
|
| ModelValueNode;
|
|
23
35
|
|
|
24
36
|
// prettier-ignore
|
package/src/client/node-types.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
// prettier-ignore
|
|
2
|
+
export type UnsupportedControlNodeType =
|
|
3
|
+
| 'range'
|
|
4
|
+
| 'rank'
|
|
5
|
+
| 'upload';
|
|
6
|
+
|
|
1
7
|
// prettier-ignore
|
|
2
8
|
export type RepeatRangeNodeType =
|
|
3
9
|
| 'repeat-range:controlled'
|
|
@@ -14,4 +20,6 @@ export type InstanceNodeType =
|
|
|
14
20
|
| 'model-value'
|
|
15
21
|
| 'note'
|
|
16
22
|
| 'select'
|
|
17
|
-
| 'string'
|
|
23
|
+
| 'string'
|
|
24
|
+
| 'trigger'
|
|
25
|
+
| UnsupportedControlNodeType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyRepeatRangeDefinition } from '../../model/RepeatRangeDefinition.ts';
|
|
1
|
+
import type { AnyRepeatRangeDefinition } from '../../parse/model/RepeatRangeDefinition.ts';
|
|
2
2
|
import type { BaseNode, BaseNodeState } from '../BaseNode.ts';
|
|
3
3
|
import type { NodeAppearances } from '../NodeAppearances.ts';
|
|
4
4
|
import type { RootNode } from '../RootNode.ts';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RepeatInstanceDefinition } from '../../model/RepeatInstanceDefinition.ts';
|
|
2
|
-
import type { RepeatTemplateDefinition } from '../../model/RepeatTemplateDefinition.ts';
|
|
1
|
+
import type { RepeatInstanceDefinition } from '../../parse/model/RepeatInstanceDefinition.ts';
|
|
2
|
+
import type { RepeatTemplateDefinition } from '../../parse/model/RepeatTemplateDefinition.ts';
|
|
3
3
|
import type { BaseNode, BaseNodeState } from '../BaseNode.ts';
|
|
4
4
|
import type { GeneralChildNode, RepeatRangeNode } from '../hierarchy.ts';
|
|
5
5
|
import type { NodeAppearances } from '../NodeAppearances.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ControlledRepeatRangeDefinition } from '../../model/RepeatRangeDefinition.ts';
|
|
1
|
+
import type { ControlledRepeatRangeDefinition } from '../../parse/model/RepeatRangeDefinition.ts';
|
|
2
2
|
import type { BaseRepeatRangeNode, BaseRepeatRangeNodeState } from './BaseRepeatRangeNode.ts';
|
|
3
3
|
import type { RepeatRangeUncontrolledNode } from './RepeatRangeUncontrolledNode.ts';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UncontrolledRepeatRangeDefinition } from '../../model/RepeatRangeDefinition.ts';
|
|
1
|
+
import type { UncontrolledRepeatRangeDefinition } from '../../parse/model/RepeatRangeDefinition.ts';
|
|
2
2
|
import type { RootNode } from '../RootNode.ts';
|
|
3
3
|
import type { BaseRepeatRangeNode, BaseRepeatRangeNodeState } from './BaseRepeatRangeNode.ts';
|
|
4
4
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RangeControlDefinition } from '../../parse/body/control/RangeControlDefinition.ts';
|
|
2
|
+
import type {
|
|
3
|
+
UnsupportedControlDefinition,
|
|
4
|
+
UnsupportedControlNode,
|
|
5
|
+
} from './UnsupportedControlNode.ts';
|
|
6
|
+
|
|
7
|
+
export interface RangeNodeDefinition extends UnsupportedControlDefinition {
|
|
8
|
+
readonly bodyElement: RangeControlDefinition;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface RangeNode extends UnsupportedControlNode {
|
|
12
|
+
readonly nodeType: 'range';
|
|
13
|
+
readonly definition: RangeNodeDefinition;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RankControlDefinition } from '../../parse/body/control/RankControlDefinition.ts';
|
|
2
|
+
import type {
|
|
3
|
+
UnsupportedControlDefinition,
|
|
4
|
+
UnsupportedControlNode,
|
|
5
|
+
} from './UnsupportedControlNode.ts';
|
|
6
|
+
|
|
7
|
+
export interface RankNodeDefinition extends UnsupportedControlDefinition {
|
|
8
|
+
readonly bodyElement: RankControlDefinition;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface RankNode extends UnsupportedControlNode {
|
|
12
|
+
readonly nodeType: 'rank';
|
|
13
|
+
readonly definition: RankNodeDefinition;
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { UnknownAppearanceDefinition } from '../../parse/body/appearance/unknownAppearanceParser.ts';
|
|
2
|
+
import type { RangeControlDefinition } from '../../parse/body/control/RangeControlDefinition.ts';
|
|
3
|
+
import type { RankControlDefinition } from '../../parse/body/control/RankControlDefinition.ts';
|
|
4
|
+
import type { UploadControlDefinition } from '../../parse/body/control/UploadControlDefinition.ts';
|
|
5
|
+
import type { LeafNodeDefinition } from '../../parse/model/LeafNodeDefinition.ts';
|
|
6
|
+
import type { BaseNode, BaseNodeState } from '../BaseNode.ts';
|
|
7
|
+
import type { RootNode } from '../RootNode.ts';
|
|
8
|
+
import type { GeneralParentNode } from '../hierarchy.ts';
|
|
9
|
+
import type { UnsupportedControlNodeType } from '../node-types.ts';
|
|
10
|
+
import type { LeafNodeValidationState } from '../validation.ts';
|
|
11
|
+
|
|
12
|
+
export interface UnsupportedControlNodeState extends BaseNodeState {
|
|
13
|
+
get children(): null;
|
|
14
|
+
get valueOptions(): unknown;
|
|
15
|
+
get value(): unknown;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type UnsupportedControlElementDefinition =
|
|
19
|
+
| RangeControlDefinition
|
|
20
|
+
| RankControlDefinition
|
|
21
|
+
| UploadControlDefinition;
|
|
22
|
+
|
|
23
|
+
export interface UnsupportedControlDefinition extends LeafNodeDefinition {
|
|
24
|
+
readonly bodyElement: UnsupportedControlElementDefinition;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Stub node, for form controls pending further engine support.
|
|
29
|
+
*/
|
|
30
|
+
export interface UnsupportedControlNode extends BaseNode {
|
|
31
|
+
readonly nodeType: UnsupportedControlNodeType;
|
|
32
|
+
readonly appearances: UnknownAppearanceDefinition;
|
|
33
|
+
readonly definition: UnsupportedControlDefinition;
|
|
34
|
+
readonly root: RootNode;
|
|
35
|
+
readonly parent: GeneralParentNode;
|
|
36
|
+
readonly currentState: UnsupportedControlNodeState;
|
|
37
|
+
readonly validationState: LeafNodeValidationState;
|
|
38
|
+
|
|
39
|
+
setValue?(value: never): never;
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { UploadControlDefinition } from '../../parse/body/control/UploadControlDefinition.ts';
|
|
2
|
+
import type {
|
|
3
|
+
UnsupportedControlDefinition,
|
|
4
|
+
UnsupportedControlNode,
|
|
5
|
+
} from './UnsupportedControlNode.ts';
|
|
6
|
+
|
|
7
|
+
export interface UploadNodeDefinition extends UnsupportedControlDefinition {
|
|
8
|
+
readonly bodyElement: UploadControlDefinition;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface UploadNode extends UnsupportedControlNode {
|
|
12
|
+
readonly nodeType: 'upload';
|
|
13
|
+
readonly definition: UploadNodeDefinition;
|
|
14
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export type {
|
|
|
13
13
|
AnyLeafNode,
|
|
14
14
|
AnyNode,
|
|
15
15
|
AnyParentNode,
|
|
16
|
+
AnyUnsupportedControlNode,
|
|
16
17
|
GeneralChildNode,
|
|
17
18
|
GeneralParentNode,
|
|
18
19
|
RepeatRangeNode,
|
|
@@ -29,6 +30,10 @@ export type * from './client/SelectNode.ts';
|
|
|
29
30
|
export type * from './client/StringNode.ts';
|
|
30
31
|
export type * from './client/SubtreeNode.ts';
|
|
31
32
|
export type * from './client/TextRange.ts';
|
|
33
|
+
export type * from './client/TriggerNode.ts';
|
|
34
|
+
export type * from './client/unsupported/RangeNode.ts';
|
|
35
|
+
export type * from './client/unsupported/RankNode.ts';
|
|
36
|
+
export type * from './client/unsupported/UploadNode.ts';
|
|
32
37
|
export type * from './client/validation.ts';
|
|
33
38
|
|
|
34
39
|
// TODO: notwithstanding potential conflicts with parallel work on `web-forms`
|
|
@@ -39,4 +44,4 @@ export type * from './client/validation.ts';
|
|
|
39
44
|
export type {
|
|
40
45
|
AnySelectDefinition,
|
|
41
46
|
SelectDefinition,
|
|
42
|
-
} from './body/control/select/SelectDefinition.ts';
|
|
47
|
+
} from './parse/body/control/select/SelectDefinition.ts';
|
|
@@ -9,7 +9,7 @@ import { createSharedNodeState } from '../lib/reactivity/node-state/createShared
|
|
|
9
9
|
import type { SimpleAtomicState } from '../lib/reactivity/types.ts';
|
|
10
10
|
import type { SharedValidationState } from '../lib/reactivity/validation/createValidation.ts';
|
|
11
11
|
import { createValidationState } from '../lib/reactivity/validation/createValidation.ts';
|
|
12
|
-
import type { LeafNodeDefinition } from '../model/LeafNodeDefinition.ts';
|
|
12
|
+
import type { LeafNodeDefinition } from '../parse/model/LeafNodeDefinition.ts';
|
|
13
13
|
import type { DescendantNodeStateSpec } from './abstract/DescendantNode.ts';
|
|
14
14
|
import { DescendantNode } from './abstract/DescendantNode.ts';
|
|
15
15
|
import type { GeneralParentNode } from './hierarchy.ts';
|
|
@@ -88,11 +88,11 @@ export class ModelValue
|
|
|
88
88
|
this.validation = createValidationState(this, sharedStateOptions);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
// ValidationContext
|
|
91
92
|
getViolation(): AnyViolation | null {
|
|
92
93
|
return this.validation.engineState.violation;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
// ValidationContext
|
|
96
96
|
isBlank(): boolean {
|
|
97
97
|
return this.engineState.value === '';
|
|
98
98
|
}
|
package/src/instance/Note.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { createNoteText, type ComputedNoteText } from '../lib/reactivity/text/cr
|
|
|
16
16
|
import type { SimpleAtomicState } from '../lib/reactivity/types.ts';
|
|
17
17
|
import type { SharedValidationState } from '../lib/reactivity/validation/createValidation.ts';
|
|
18
18
|
import { createValidationState } from '../lib/reactivity/validation/createValidation.ts';
|
|
19
|
-
import type { NoteNodeDefinition } from '../parse/NoteNodeDefinition.ts';
|
|
19
|
+
import type { NoteNodeDefinition } from '../parse/model/NoteNodeDefinition.ts';
|
|
20
20
|
import type { DescendantNodeStateSpec } from './abstract/DescendantNode.ts';
|
|
21
21
|
import { DescendantNode } from './abstract/DescendantNode.ts';
|
|
22
22
|
import type { GeneralParentNode } from './hierarchy.ts';
|
|
@@ -126,11 +126,11 @@ export class Note
|
|
|
126
126
|
this.validation = createValidationState(this, sharedStateOptions);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
// ValidationContext
|
|
129
130
|
getViolation(): AnyViolation | null {
|
|
130
131
|
return this.validation.engineState.violation;
|
|
131
132
|
}
|
|
132
133
|
|
|
133
|
-
// ValidationContext
|
|
134
134
|
isBlank(): boolean {
|
|
135
135
|
return this.engineState.value === '';
|
|
136
136
|
}
|
package/src/instance/Root.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { XFormsXPathEvaluator } from '@getodk/xpath';
|
|
2
2
|
import type { Accessor, Signal } from 'solid-js';
|
|
3
3
|
import { createSignal } from 'solid-js';
|
|
4
|
-
import type { XFormDOM } from '../XFormDOM.ts';
|
|
5
|
-
import type { BodyClassList } from '../body/BodyDefinition.ts';
|
|
6
4
|
import type { ActiveLanguage, FormLanguage, FormLanguages } from '../client/FormLanguage.ts';
|
|
7
5
|
import type { RootNode } from '../client/RootNode.ts';
|
|
8
6
|
import type { AncestorNodeValidationState } from '../client/validation.ts';
|
|
@@ -15,7 +13,9 @@ import type { EngineState } from '../lib/reactivity/node-state/createEngineState
|
|
|
15
13
|
import type { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
16
14
|
import { createSharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
17
15
|
import { createAggregatedViolations } from '../lib/reactivity/validation/createAggregatedViolations.ts';
|
|
18
|
-
import type {
|
|
16
|
+
import type { BodyClassList } from '../parse/body/BodyDefinition.ts';
|
|
17
|
+
import type { RootDefinition } from '../parse/model/RootDefinition.ts';
|
|
18
|
+
import type { XFormDOM } from '../parse/XFormDOM.ts';
|
|
19
19
|
import { InstanceNode } from './abstract/InstanceNode.ts';
|
|
20
20
|
import { buildChildren } from './children.ts';
|
|
21
21
|
import type { GeneralChildNode } from './hierarchy.ts';
|
|
@@ -221,6 +221,10 @@ export class Root
|
|
|
221
221
|
override subscribe(): void {
|
|
222
222
|
super.subscribe();
|
|
223
223
|
|
|
224
|
+
// TODO: typescript-eslint is right to object to this! We should _at least_
|
|
225
|
+
// make internal reactive reads obvious, i.e. function calls.
|
|
226
|
+
//
|
|
227
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- read == subscribe
|
|
224
228
|
this.engineState.activeLanguage;
|
|
225
229
|
}
|
|
226
230
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { xmlXPathWhitespaceSeparatedList } from '@getodk/common/lib/string/whitespace.ts';
|
|
2
2
|
import type { Accessor } from 'solid-js';
|
|
3
3
|
import { untrack } from 'solid-js';
|
|
4
|
-
import type { AnySelectDefinition } from '../body/control/select/SelectDefinition.ts';
|
|
5
4
|
import type { SelectItem, SelectNode, SelectNodeAppearances } from '../client/SelectNode.ts';
|
|
6
5
|
import type { TextRange } from '../client/TextRange.ts';
|
|
7
6
|
import type { AnyViolation, LeafNodeValidationState } from '../client/validation.ts';
|
|
@@ -16,7 +15,8 @@ import { createNodeLabel } from '../lib/reactivity/text/createNodeLabel.ts';
|
|
|
16
15
|
import type { SimpleAtomicState } from '../lib/reactivity/types.ts';
|
|
17
16
|
import type { SharedValidationState } from '../lib/reactivity/validation/createValidation.ts';
|
|
18
17
|
import { createValidationState } from '../lib/reactivity/validation/createValidation.ts';
|
|
19
|
-
import type {
|
|
18
|
+
import type { AnySelectDefinition } from '../parse/body/control/select/SelectDefinition.ts';
|
|
19
|
+
import type { LeafNodeDefinition } from '../parse/model/LeafNodeDefinition.ts';
|
|
20
20
|
import type { Root } from './Root.ts';
|
|
21
21
|
import type { DescendantNodeStateSpec } from './abstract/DescendantNode.ts';
|
|
22
22
|
import { DescendantNode } from './abstract/DescendantNode.ts';
|
|
@@ -127,10 +127,6 @@ export class SelectField
|
|
|
127
127
|
this.validation = createValidationState(this, sharedStateOptions);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
getViolation(): AnyViolation | null {
|
|
131
|
-
return this.validation.engineState.violation;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
130
|
protected getSelectItemsByValue(
|
|
135
131
|
valueOptions: readonly SelectItem[] = this.getValueOptions()
|
|
136
132
|
): ReadonlyMap<string, SelectItem> {
|
|
@@ -220,6 +216,10 @@ export class SelectField
|
|
|
220
216
|
}
|
|
221
217
|
|
|
222
218
|
// ValidationContext
|
|
219
|
+
getViolation(): AnyViolation | null {
|
|
220
|
+
return this.validation.engineState.violation;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
223
|
isBlank(): boolean {
|
|
224
224
|
return this.engineState.value.length === 0;
|
|
225
225
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { identity } from '@getodk/common/lib/identity.ts';
|
|
2
2
|
import type { Accessor } from 'solid-js';
|
|
3
|
-
import type { InputDefinition } from '../body/control/InputDefinition.ts';
|
|
4
3
|
import type { StringNode, StringNodeAppearances } from '../client/StringNode.ts';
|
|
5
4
|
import type { TextRange } from '../client/TextRange.ts';
|
|
6
5
|
import type { AnyViolation, LeafNodeValidationState } from '../client/validation.ts';
|
|
@@ -14,7 +13,8 @@ import { createNodeLabel } from '../lib/reactivity/text/createNodeLabel.ts';
|
|
|
14
13
|
import type { SimpleAtomicState } from '../lib/reactivity/types.ts';
|
|
15
14
|
import type { SharedValidationState } from '../lib/reactivity/validation/createValidation.ts';
|
|
16
15
|
import { createValidationState } from '../lib/reactivity/validation/createValidation.ts';
|
|
17
|
-
import type {
|
|
16
|
+
import type { InputDefinition } from '../parse/body/control/InputDefinition.ts';
|
|
17
|
+
import type { LeafNodeDefinition } from '../parse/model/LeafNodeDefinition.ts';
|
|
18
18
|
import type { Root } from './Root.ts';
|
|
19
19
|
import type { DescendantNodeStateSpec } from './abstract/DescendantNode.ts';
|
|
20
20
|
import { DescendantNode } from './abstract/DescendantNode.ts';
|
|
@@ -97,11 +97,11 @@ export class StringField
|
|
|
97
97
|
this.validation = createValidationState(this, sharedStateOptions);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
// ValidationContext
|
|
100
101
|
getViolation(): AnyViolation | null {
|
|
101
102
|
return this.validation.engineState.violation;
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
// ValidationContext
|
|
105
105
|
isBlank(): boolean {
|
|
106
106
|
return this.engineState.value === '';
|
|
107
107
|
}
|