@getodk/xforms-engine 0.2.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 +69 -4
- package/dist/client/EngineConfig.d.ts +0 -1
- package/dist/client/GroupNode.d.ts +4 -3
- package/dist/client/ModelValueNode.d.ts +36 -0
- package/dist/client/NodeAppearances.d.ts +1 -2
- package/dist/client/NoteNode.d.ts +52 -0
- package/dist/client/RootNode.d.ts +4 -3
- package/dist/client/SelectNode.d.ts +6 -5
- package/dist/client/StringNode.d.ts +6 -5
- package/dist/client/SubtreeNode.d.ts +3 -2
- package/dist/client/TextRange.d.ts +85 -3
- package/dist/client/TriggerNode.d.ts +25 -0
- package/dist/client/constants.d.ts +8 -0
- package/dist/client/hierarchy.d.ts +19 -10
- package/dist/client/index.d.ts +0 -1
- package/dist/client/node-types.d.ts +3 -1
- package/dist/client/{RepeatRangeNode.d.ts → repeat/BaseRepeatRangeNode.d.ts} +18 -18
- package/dist/client/{RepeatInstanceNode.d.ts → repeat/RepeatInstanceNode.d.ts} +9 -9
- package/dist/client/repeat/RepeatRangeControlledNode.d.ts +18 -0
- package/dist/client/repeat/RepeatRangeUncontrolledNode.d.ts +19 -0
- 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 +162 -0
- package/dist/index.d.ts +14 -6
- package/dist/index.js +39696 -36151
- package/dist/index.js.map +1 -1
- package/dist/instance/Group.d.ts +3 -2
- package/dist/instance/ModelValue.d.ts +39 -0
- package/dist/instance/Note.d.ts +41 -0
- package/dist/instance/Root.d.ts +5 -4
- package/dist/instance/SelectField.d.ts +11 -6
- package/dist/instance/StringField.d.ts +12 -7
- package/dist/instance/Subtree.d.ts +2 -1
- package/dist/instance/TriggerControl.d.ts +40 -0
- package/dist/instance/abstract/DescendantNode.d.ts +8 -10
- package/dist/instance/abstract/InstanceNode.d.ts +3 -2
- package/dist/instance/abstract/UnsupportedControl.d.ts +46 -0
- package/dist/instance/children.d.ts +0 -1
- package/dist/instance/hierarchy.d.ts +15 -6
- 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 +28 -0
- package/dist/instance/internal-api/ValueContext.d.ts +3 -4
- package/dist/instance/{RepeatRange.d.ts → repeat/BaseRepeatRange.d.ts} +46 -46
- package/dist/instance/{RepeatInstance.d.ts → repeat/RepeatInstance.d.ts} +13 -13
- package/dist/instance/repeat/RepeatRangeControlled.d.ts +15 -0
- package/dist/instance/repeat/RepeatRangeUncontrolled.d.ts +34 -0
- package/dist/instance/resource.d.ts +0 -1
- package/dist/instance/text/TextChunk.d.ts +0 -1
- package/dist/instance/text/TextRange.d.ts +4 -5
- 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 +7 -3
- package/dist/lib/reactivity/createNoteReadonlyThunk.d.ts +4 -0
- 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 +1 -2
- package/dist/lib/reactivity/node-state/createSpecifiedPropertyDescriptor.d.ts +0 -1
- package/dist/lib/reactivity/node-state/createSpecifiedState.d.ts +1 -2
- 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 +3 -4
- package/dist/lib/reactivity/text/createNodeLabel.d.ts +3 -4
- package/dist/lib/reactivity/text/createNoteText.d.ts +24 -0
- package/dist/lib/reactivity/text/createTextRange.d.ts +5 -8
- package/dist/lib/reactivity/types.d.ts +0 -1
- package/dist/lib/reactivity/validation/createAggregatedViolations.d.ts +8 -0
- package/dist/lib/reactivity/validation/createValidation.d.ts +17 -0
- 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 +8 -7
- package/dist/{body → parse/body}/RepeatElementDefinition.d.ts +4 -5
- 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 +3 -4
- package/dist/{body → parse/body}/control/select/ItemsetDefinition.d.ts +7 -7
- 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 +18 -0
- 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 +13 -10
- package/dist/parse/expression/abstract/TextChunkExpression.d.ts +17 -0
- package/dist/parse/model/BindDefinition.d.ts +39 -0
- package/dist/{model → parse/model}/BindElement.d.ts +1 -0
- package/dist/{model → parse/model}/DescendentNodeDefinition.d.ts +0 -1
- package/dist/{model/ValueNodeDefinition.d.ts → parse/model/LeafNodeDefinition.d.ts} +3 -4
- 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 +8 -9
- package/dist/parse/model/NoteNodeDefinition.d.ts +30 -0
- package/dist/{model → parse/model}/RepeatInstanceDefinition.d.ts +3 -4
- package/dist/{model → parse/model}/RepeatRangeDefinition.d.ts +14 -5
- 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 +8 -0
- package/dist/parse/text/ItemLabelDefinition.d.ts +8 -0
- package/dist/parse/text/ItemsetLabelDefinition.d.ts +12 -0
- package/dist/parse/text/LabelDefinition.d.ts +14 -0
- package/dist/parse/text/MessageDefinition.d.ts +14 -0
- package/dist/parse/text/abstract/TextElementDefinition.d.ts +22 -0
- package/dist/parse/text/abstract/TextRangeDefinition.d.ts +34 -0
- package/dist/parse/xpath/dependency-analysis.d.ts +40 -0
- package/dist/parse/xpath/path-resolution.d.ts +69 -0
- package/dist/parse/xpath/predicate-analysis.d.ts +29 -0
- package/dist/parse/xpath/reference-parsing.d.ts +17 -0
- package/dist/parse/xpath/semantic-analysis.d.ts +97 -0
- package/dist/parse/xpath/syntax-traversal.d.ts +68 -0
- package/dist/solid.js +8745 -5186
- package/dist/solid.js.map +1 -1
- package/package.json +15 -16
- package/src/client/BaseNode.ts +74 -8
- package/src/client/GroupNode.ts +4 -2
- package/src/client/ModelValueNode.ts +40 -0
- package/src/client/NodeAppearances.ts +1 -1
- package/src/client/NoteNode.ts +74 -0
- package/src/client/README.md +1 -0
- package/src/client/RootNode.ts +4 -2
- package/src/client/SelectNode.ts +6 -4
- package/src/client/StringNode.ts +6 -4
- package/src/client/SubtreeNode.ts +3 -1
- package/src/client/TextRange.ts +98 -2
- package/src/client/TriggerNode.ts +29 -0
- package/src/client/constants.ts +10 -0
- package/src/client/hierarchy.ts +43 -15
- package/src/client/node-types.ts +17 -2
- package/src/client/{RepeatRangeNode.ts → repeat/BaseRepeatRangeNode.ts} +18 -19
- package/src/client/{RepeatInstanceNode.ts → repeat/RepeatInstanceNode.ts} +10 -8
- package/src/client/repeat/RepeatRangeControlledNode.ts +20 -0
- package/src/client/repeat/RepeatRangeUncontrolledNode.ts +21 -0
- 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/client/validation.ts +199 -0
- package/src/index.ts +21 -9
- package/src/instance/Group.ts +10 -4
- package/src/instance/ModelValue.ts +104 -0
- package/src/instance/Note.ts +142 -0
- package/src/instance/Root.ts +16 -6
- package/src/instance/SelectField.ts +29 -7
- package/src/instance/StringField.ts +36 -10
- package/src/instance/Subtree.ts +9 -3
- package/src/instance/TriggerControl.ts +134 -0
- package/src/instance/abstract/DescendantNode.ts +9 -10
- package/src/instance/abstract/InstanceNode.ts +29 -7
- package/src/instance/abstract/UnsupportedControl.ts +151 -0
- package/src/instance/children.ts +113 -16
- package/src/instance/hierarchy.ts +42 -5
- package/src/instance/index.ts +1 -1
- package/src/instance/internal-api/EvaluationContext.ts +1 -1
- package/src/instance/internal-api/ValidationContext.ts +32 -0
- package/src/instance/internal-api/ValueContext.ts +3 -3
- package/src/instance/{RepeatRange.ts → repeat/BaseRepeatRange.ts} +114 -99
- package/src/instance/{RepeatInstance.ts → repeat/RepeatInstance.ts} +27 -22
- package/src/instance/repeat/RepeatRangeControlled.ts +82 -0
- package/src/instance/repeat/RepeatRangeUncontrolled.ts +67 -0
- package/src/instance/text/TextRange.ts +10 -4
- 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 +25 -27
- package/src/lib/reactivity/createNoteReadonlyThunk.ts +33 -0
- package/src/lib/reactivity/createSelectItems.ts +23 -16
- package/src/lib/reactivity/createValueState.ts +3 -3
- package/src/lib/reactivity/node-state/createSharedNodeState.ts +1 -1
- package/src/lib/reactivity/node-state/createSpecifiedState.ts +1 -1
- package/src/lib/reactivity/text/createFieldHint.ts +9 -7
- package/src/lib/reactivity/text/createNodeLabel.ts +8 -6
- package/src/lib/reactivity/text/createNoteText.ts +72 -0
- package/src/lib/reactivity/text/createTextRange.ts +17 -90
- package/src/lib/reactivity/validation/createAggregatedViolations.ts +75 -0
- package/src/lib/reactivity/validation/createValidation.ts +196 -0
- 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 +13 -6
- package/src/{body → parse/body}/RepeatElementDefinition.ts +10 -20
- 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 +5 -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 +4 -4
- package/src/parse/body/control/select/ItemsetDefinition.ts +53 -0
- 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 -21
- package/src/{body → parse/body}/group/PresentationGroupDefinition.ts +1 -1
- package/src/{model/BindComputation.ts → parse/expression/BindComputationExpression.ts} +8 -12
- package/src/parse/expression/ItemsetNodesetExpression.ts +8 -0
- package/src/{body/control/select → parse/expression}/ItemsetValueExpression.ts +2 -2
- package/src/parse/expression/RepeatCountControlExpression.ts +44 -0
- package/src/parse/expression/TextLiteralExpression.ts +19 -0
- package/src/parse/expression/TextOutputExpression.ts +25 -0
- package/src/parse/expression/TextReferenceExpression.ts +14 -0
- package/src/parse/expression/TextTranslationExpression.ts +38 -0
- package/src/{expression → parse/expression/abstract}/DependentExpression.ts +46 -28
- package/src/parse/expression/abstract/TextChunkExpression.ts +38 -0
- package/src/{model → parse/model}/BindDefinition.ts +30 -27
- package/src/{model → parse/model}/BindElement.ts +1 -0
- package/src/{model/ValueNodeDefinition.ts → parse/model/LeafNodeDefinition.ts} +4 -4
- package/src/{model → parse/model}/ModelBindMap.ts +4 -0
- package/src/{model → parse/model}/NodeDefinition.ts +12 -12
- package/src/parse/model/NoteNodeDefinition.ts +70 -0
- package/src/{model → parse/model}/RepeatInstanceDefinition.ts +2 -2
- package/src/parse/model/RepeatRangeDefinition.ts +94 -0
- package/src/{model → parse/model}/RootDefinition.ts +8 -4
- package/src/parse/text/HintDefinition.ts +25 -0
- package/src/parse/text/ItemLabelDefinition.ts +25 -0
- package/src/parse/text/ItemsetLabelDefinition.ts +44 -0
- package/src/parse/text/LabelDefinition.ts +61 -0
- package/src/parse/text/MessageDefinition.ts +49 -0
- package/src/parse/text/abstract/TextElementDefinition.ts +71 -0
- package/src/parse/text/abstract/TextRangeDefinition.ts +70 -0
- package/src/parse/xpath/dependency-analysis.ts +105 -0
- package/src/parse/xpath/path-resolution.ts +475 -0
- package/src/parse/xpath/predicate-analysis.ts +61 -0
- package/src/parse/xpath/reference-parsing.ts +90 -0
- package/src/parse/xpath/semantic-analysis.ts +466 -0
- package/src/parse/xpath/syntax-traversal.ts +129 -0
- package/dist/body/text/HintDefinition.d.ts +0 -11
- package/dist/body/text/LabelDefinition.d.ts +0 -22
- package/dist/body/text/TextElementDefinition.d.ts +0 -33
- package/dist/body/text/TextElementOutputPart.d.ts +0 -13
- package/dist/body/text/TextElementPart.d.ts +0 -13
- package/dist/body/text/TextElementReferencePart.d.ts +0 -7
- package/dist/body/text/TextElementStaticPart.d.ts +0 -7
- package/dist/lib/xpath/analysis.d.ts +0 -23
- package/dist/model/BindDefinition.d.ts +0 -32
- package/src/body/control/select/ItemsetDefinition.ts +0 -36
- package/src/body/control/select/ItemsetNodesetExpression.ts +0 -8
- package/src/body/text/HintDefinition.ts +0 -26
- package/src/body/text/LabelDefinition.ts +0 -68
- package/src/body/text/TextElementDefinition.ts +0 -97
- package/src/body/text/TextElementOutputPart.ts +0 -27
- package/src/body/text/TextElementPart.ts +0 -31
- package/src/body/text/TextElementReferencePart.ts +0 -21
- package/src/body/text/TextElementStaticPart.ts +0 -26
- package/src/lib/xpath/analysis.ts +0 -241
- package/src/model/RepeatRangeDefinition.ts +0 -53
- 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}/DescendentNodeDefinition.ts +0 -0
- /package/src/{model → parse/model}/ModelDefinition.ts +0 -0
- /package/src/{model → parse/model}/RepeatTemplateDefinition.ts +0 -0
- /package/src/{model → parse/model}/SubtreeDefinition.ts +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Accessor } from 'solid-js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
2
|
+
import { NodeAppearances } from '../../client/NodeAppearances.ts';
|
|
3
|
+
import { BaseRepeatRangeNode } from '../../client/repeat/BaseRepeatRangeNode.ts';
|
|
4
|
+
import { TextRange } from '../../client/TextRange.ts';
|
|
5
|
+
import { AncestorNodeValidationState } from '../../client/validation.ts';
|
|
6
|
+
import { ChildrenState } from '../../lib/reactivity/createChildrenState.ts';
|
|
7
|
+
import { MaterializedChildren } from '../../lib/reactivity/materializeCurrentStateChildren.ts';
|
|
8
|
+
import { CurrentState } from '../../lib/reactivity/node-state/createCurrentState.ts';
|
|
9
|
+
import { EngineState } from '../../lib/reactivity/node-state/createEngineState.ts';
|
|
10
|
+
import { SharedNodeState } from '../../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
11
|
+
import { AnyRepeatRangeDefinition, ControlledRepeatRangeDefinition } from '../../parse/model/RepeatRangeDefinition.ts';
|
|
12
|
+
import { DescendantNodeParent, DescendantNodeSharedStateSpec, DescendantNode } from '../abstract/DescendantNode.ts';
|
|
13
|
+
import { NodeID } from '../identity.ts';
|
|
14
|
+
import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
|
|
15
|
+
import { SubscribableDependency } from '../internal-api/SubscribableDependency.ts';
|
|
16
|
+
import { RepeatInstance, RepeatDefinition } from './RepeatInstance.ts';
|
|
17
17
|
interface RepeatRangeStateSpec extends DescendantNodeSharedStateSpec {
|
|
18
18
|
readonly hint: null;
|
|
19
19
|
readonly label: Accessor<TextRange<'label'> | null>;
|
|
@@ -21,7 +21,8 @@ interface RepeatRangeStateSpec extends DescendantNodeSharedStateSpec {
|
|
|
21
21
|
readonly valueOptions: null;
|
|
22
22
|
readonly value: null;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
type BaseRepeatRangeNodeType<Definition extends AnyRepeatRangeDefinition> = Definition extends ControlledRepeatRangeDefinition ? 'repeat-range:controlled' : 'repeat-range:uncontrolled';
|
|
25
|
+
export declare abstract class BaseRepeatRange<Definition extends AnyRepeatRangeDefinition> extends DescendantNode<Definition, RepeatRangeStateSpec, RepeatInstance> implements BaseRepeatRangeNode, EvaluationContext, SubscribableDependency {
|
|
25
26
|
/**
|
|
26
27
|
* A repeat range doesn't have a corresponding primary instance element of its
|
|
27
28
|
* own, and its instances are appended to the range's parent element. During
|
|
@@ -44,8 +45,27 @@ export declare class RepeatRange extends DescendantNode<RepeatRangeDefinition, R
|
|
|
44
45
|
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Range | DOM Range}
|
|
45
46
|
* instead?
|
|
46
47
|
*/
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
protected readonly anchorNode: Comment;
|
|
49
|
+
protected readonly childrenState: ChildrenState<RepeatInstance>;
|
|
50
|
+
/**
|
|
51
|
+
* Provides an {@link EvaluationContext} from which to evaluate expressions
|
|
52
|
+
* where some LocationPath sub-expressions may be **relative to the repeat
|
|
53
|
+
* range itself**. This is useful for evaluation of expressions where:
|
|
54
|
+
*
|
|
55
|
+
* - the expression is typically contextualized to any of its
|
|
56
|
+
* {@link RepeatInstance} children, but it presently has none (i.e.
|
|
57
|
+
* `relevant`)
|
|
58
|
+
*
|
|
59
|
+
* - the expression is conceptually intended to be evaluated in the context of
|
|
60
|
+
* the repeat range itself (i.e. `jr:count`)
|
|
61
|
+
*/
|
|
62
|
+
protected readonly selfEvaluationContext: EvaluationContext & {
|
|
63
|
+
readonly contextNode: Comment;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* @see {@link isSelfRelevant}
|
|
67
|
+
*/
|
|
68
|
+
protected readonly isEmptyRangeSelfRelevant: Accessor<boolean>;
|
|
49
69
|
protected readonly state: SharedNodeState<RepeatRangeStateSpec>;
|
|
50
70
|
protected engineState: EngineState<RepeatRangeStateSpec>;
|
|
51
71
|
/**
|
|
@@ -55,11 +75,6 @@ export declare class RepeatRange extends DescendantNode<RepeatRangeDefinition, R
|
|
|
55
75
|
* @see {@link isSelfRelevant}
|
|
56
76
|
*/
|
|
57
77
|
isSelfReadonly: Accessor<boolean>;
|
|
58
|
-
private readonly emptyRangeEvaluationContext;
|
|
59
|
-
/**
|
|
60
|
-
* @see {@link isSelfRelevant}
|
|
61
|
-
*/
|
|
62
|
-
private readonly isEmptyRangeSelfRelevant;
|
|
63
78
|
/**
|
|
64
79
|
* A repeat range does not exist in the primary instance tree. A `relevant`
|
|
65
80
|
* expression applies to each {@link RepeatInstance} child of the repeat
|
|
@@ -94,7 +109,7 @@ export declare class RepeatRange extends DescendantNode<RepeatRangeDefinition, R
|
|
|
94
109
|
* theory it could vary depending on form structure and runtime state).
|
|
95
110
|
*/
|
|
96
111
|
readonly isSelfRelevant: Accessor<boolean>;
|
|
97
|
-
readonly nodeType
|
|
112
|
+
abstract readonly nodeType: BaseRepeatRangeNodeType<Definition>;
|
|
98
113
|
/**
|
|
99
114
|
* @todo RepeatRange*, RepeatInstance* (and RepeatTemplate*) all share the
|
|
100
115
|
* same body element, and thus all share the same definition `bodyElement`. As
|
|
@@ -128,31 +143,16 @@ export declare class RepeatRange extends DescendantNode<RepeatRangeDefinition, R
|
|
|
128
143
|
* All of the above creates considerable ambiguity about where "repeat
|
|
129
144
|
* appearances" should apply, under which circumstances.
|
|
130
145
|
*/
|
|
131
|
-
readonly appearances:
|
|
146
|
+
abstract readonly appearances: NodeAppearances<Definition>;
|
|
132
147
|
readonly currentState: MaterializedChildren<CurrentState<RepeatRangeStateSpec>, RepeatInstance>;
|
|
133
|
-
|
|
134
|
-
|
|
148
|
+
abstract readonly validationState: AncestorNodeValidationState;
|
|
149
|
+
constructor(parent: DescendantNodeParent<Definition>, definition: Definition);
|
|
150
|
+
protected getLastIndex(): number;
|
|
135
151
|
protected initializeContextNode(parentContextNode: Element): Element;
|
|
136
152
|
getInstanceIndex(instance: RepeatInstance): number;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
* indexes, and then removes those repeat instances from the repeat range's
|
|
141
|
-
* own children state in that order:
|
|
142
|
-
*
|
|
143
|
-
* 1. Identify the set of {@link RepeatInstance}s to be removed.
|
|
144
|
-
*
|
|
145
|
-
* 2. For each {@link RepeatInstance} pending removal, perform that node's
|
|
146
|
-
* removal logic. @see {@link RepeatInstance.remove} for more detail.
|
|
147
|
-
*
|
|
148
|
-
* 3. Finalize update to the repeat range's own {@link childrenState},
|
|
149
|
-
* omitting those {@link RepeatInstance}s which were removed.
|
|
150
|
-
*
|
|
151
|
-
* This ordering ensures a consistent representation of state is established
|
|
152
|
-
* prior to any downstream reactive updates, and ensures that removed nodes'
|
|
153
|
-
* reactivity is cleaned up.
|
|
154
|
-
*/
|
|
155
|
-
removeInstances(startIndex: number, count?: number): Root;
|
|
153
|
+
private createChildren;
|
|
154
|
+
protected addChildren(afterIndex: number, definitions: readonly RepeatDefinition[]): readonly RepeatInstance[];
|
|
155
|
+
protected removeChildren(startIndex: number, count: number): readonly RepeatInstance[];
|
|
156
156
|
subscribe(): void;
|
|
157
157
|
getChildren(): readonly RepeatInstance[];
|
|
158
158
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { Accessor } from 'solid-js';
|
|
2
|
-
import { RepeatDefinition, RepeatInstanceNode, RepeatInstanceNodeAppearances } from '
|
|
3
|
-
import { TextRange } from '
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { DescendantNodeSharedStateSpec, DescendantNode } from '
|
|
10
|
-
import { AnyChildNode, GeneralChildNode } from '
|
|
11
|
-
import { NodeID } from '
|
|
12
|
-
import { EvaluationContext } from '
|
|
13
|
-
import { SubscribableDependency } from '
|
|
14
|
-
|
|
2
|
+
import { RepeatDefinition, RepeatInstanceNode, RepeatInstanceNodeAppearances } from '../../client/repeat/RepeatInstanceNode.ts';
|
|
3
|
+
import { TextRange } from '../../client/TextRange.ts';
|
|
4
|
+
import { AncestorNodeValidationState } from '../../client/validation.ts';
|
|
5
|
+
import { MaterializedChildren } from '../../lib/reactivity/materializeCurrentStateChildren.ts';
|
|
6
|
+
import { CurrentState } from '../../lib/reactivity/node-state/createCurrentState.ts';
|
|
7
|
+
import { EngineState } from '../../lib/reactivity/node-state/createEngineState.ts';
|
|
8
|
+
import { SharedNodeState } from '../../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
9
|
+
import { DescendantNodeSharedStateSpec, DescendantNode } from '../abstract/DescendantNode.ts';
|
|
10
|
+
import { AnyChildNode, GeneralChildNode, RepeatRange } from '../hierarchy.ts';
|
|
11
|
+
import { NodeID } from '../identity.ts';
|
|
12
|
+
import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
|
|
13
|
+
import { SubscribableDependency } from '../internal-api/SubscribableDependency.ts';
|
|
15
14
|
export type { RepeatDefinition };
|
|
16
15
|
interface RepeatInstanceStateSpec extends DescendantNodeSharedStateSpec {
|
|
17
16
|
readonly label: Accessor<TextRange<'label'> | null>;
|
|
@@ -57,6 +56,7 @@ export declare class RepeatInstance extends DescendantNode<RepeatDefinition, Rep
|
|
|
57
56
|
*/
|
|
58
57
|
readonly appearances: RepeatInstanceNodeAppearances;
|
|
59
58
|
readonly currentState: MaterializedChildren<CurrentState<RepeatInstanceStateSpec>, GeneralChildNode>;
|
|
59
|
+
readonly validationState: AncestorNodeValidationState;
|
|
60
60
|
constructor(parent: RepeatRange, definition: RepeatDefinition, options: RepeatInstanceOptions);
|
|
61
61
|
protected initializeContextNode(parentContextNode: Element, nodeName: string): Element;
|
|
62
62
|
subscribe(): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RepeatRangeNodeAppearances } from '../../client/repeat/BaseRepeatRangeNode.ts';
|
|
2
|
+
import { RepeatRangeControlledNode } from '../../client/repeat/RepeatRangeControlledNode.ts';
|
|
3
|
+
import { AncestorNodeValidationState } from '../../client/validation.ts';
|
|
4
|
+
import { ControlledRepeatRangeDefinition } from '../../parse/model/RepeatRangeDefinition.ts';
|
|
5
|
+
import { GeneralParentNode } from '../hierarchy.ts';
|
|
6
|
+
import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
|
|
7
|
+
import { SubscribableDependency } from '../internal-api/SubscribableDependency.ts';
|
|
8
|
+
import { BaseRepeatRange } from './BaseRepeatRange.ts';
|
|
9
|
+
export declare class RepeatRangeControlled extends BaseRepeatRange<ControlledRepeatRangeDefinition> implements RepeatRangeControlledNode, EvaluationContext, SubscribableDependency {
|
|
10
|
+
readonly nodeType = "repeat-range:controlled";
|
|
11
|
+
readonly appearances: RepeatRangeNodeAppearances;
|
|
12
|
+
readonly validationState: AncestorNodeValidationState;
|
|
13
|
+
constructor(parent: GeneralParentNode, definition: ControlledRepeatRangeDefinition);
|
|
14
|
+
private initializeControlledChildrenState;
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { RepeatRangeNodeAppearances } from '../../client/repeat/BaseRepeatRangeNode.ts';
|
|
2
|
+
import { RepeatRangeUncontrolledNode } from '../../client/repeat/RepeatRangeUncontrolledNode.ts';
|
|
3
|
+
import { AncestorNodeValidationState } from '../../client/validation.ts';
|
|
4
|
+
import { UncontrolledRepeatRangeDefinition } from '../../parse/model/RepeatRangeDefinition.ts';
|
|
5
|
+
import { GeneralParentNode } from '../hierarchy.ts';
|
|
6
|
+
import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
|
|
7
|
+
import { SubscribableDependency } from '../internal-api/SubscribableDependency.ts';
|
|
8
|
+
import { Root } from '../Root.ts';
|
|
9
|
+
import { BaseRepeatRange } from './BaseRepeatRange.ts';
|
|
10
|
+
export declare class RepeatRangeUncontrolled extends BaseRepeatRange<UncontrolledRepeatRangeDefinition> implements RepeatRangeUncontrolledNode, EvaluationContext, SubscribableDependency {
|
|
11
|
+
readonly nodeType = "repeat-range:uncontrolled";
|
|
12
|
+
readonly appearances: RepeatRangeNodeAppearances;
|
|
13
|
+
readonly validationState: AncestorNodeValidationState;
|
|
14
|
+
constructor(parent: GeneralParentNode, definition: UncontrolledRepeatRangeDefinition);
|
|
15
|
+
addInstances(afterIndex?: number, count?: number): Root;
|
|
16
|
+
/**
|
|
17
|
+
* Removes the {@link RepeatInstance}s corresponding to the specified range of
|
|
18
|
+
* indexes, and then removes those repeat instances from the repeat range's
|
|
19
|
+
* own children state in that order:
|
|
20
|
+
*
|
|
21
|
+
* 1. Identify the set of {@link RepeatInstance}s to be removed.
|
|
22
|
+
*
|
|
23
|
+
* 2. For each {@link RepeatInstance} pending removal, perform that node's
|
|
24
|
+
* removal logic. @see {@link RepeatInstance.remove} for more detail.
|
|
25
|
+
*
|
|
26
|
+
* 3. Finalize update to the repeat range's own {@link childrenState},
|
|
27
|
+
* omitting those {@link RepeatInstance}s which were removed.
|
|
28
|
+
*
|
|
29
|
+
* This ordering ensures a consistent representation of state is established
|
|
30
|
+
* prior to any downstream reactive updates, and ensures that removed nodes'
|
|
31
|
+
* reactivity is cleaned up.
|
|
32
|
+
*/
|
|
33
|
+
removeInstances(startIndex: number, count?: number): Root;
|
|
34
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FetchResource, FetchResourceResponse } from '../client/EngineConfig.ts';
|
|
2
2
|
import { FormResource } from '../client/index.ts';
|
|
3
|
-
|
|
4
3
|
export type { FetchResource, FetchResourceResponse, FormResource };
|
|
5
4
|
export interface ResourceOptions {
|
|
6
5
|
readonly fetchResource: FetchResource;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ActiveLanguage } from '../../client/FormLanguage.ts';
|
|
2
2
|
import { TextChunk as ClientTextChunk, TextChunkSource } from '../../client/TextRange.ts';
|
|
3
3
|
import { TranslationContext } from '../internal-api/TranslationContext.ts';
|
|
4
|
-
|
|
5
4
|
export declare class TextChunk implements ClientTextChunk {
|
|
6
5
|
readonly context: TranslationContext;
|
|
7
6
|
readonly source: TextChunkSource;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { TextRange as ClientTextRange, TextChunk } from '../../client/TextRange.ts';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare class TextRange<Role extends TextRole> implements ClientTextRange<Role> {
|
|
1
|
+
import { TextRange as ClientTextRange, TextChunk, TextOrigin, TextRole } from '../../client/TextRange.ts';
|
|
2
|
+
export declare class TextRange<Role extends TextRole, Origin extends TextOrigin> implements ClientTextRange<Role, Origin> {
|
|
3
|
+
readonly origin: Origin;
|
|
5
4
|
readonly role: Role;
|
|
6
5
|
protected readonly chunks: readonly TextChunk[];
|
|
7
6
|
[Symbol.iterator](): Generator<TextChunk, void, undefined>;
|
|
8
7
|
get formatted(): Record<PropertyKey, unknown>;
|
|
9
8
|
get asString(): string;
|
|
10
|
-
constructor(role: Role, chunks: readonly TextChunk[]);
|
|
9
|
+
constructor(origin: Origin, role: Role, chunks: readonly TextChunk[]);
|
|
11
10
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { PartiallyKnownString } from '../../../common/types/string/PartiallyKnownString.ts';
|
|
2
|
-
|
|
3
2
|
type SymbolIterator = typeof Symbol.iterator;
|
|
4
3
|
type TokenListKey<CanonicalToken extends string> = PartiallyKnownString<CanonicalToken> | SymbolIterator;
|
|
5
4
|
type TokenListIterator<CanonicalToken extends string> = IterableIterator<PartiallyKnownString<CanonicalToken>>;
|
|
5
|
+
type PassthroughTokenList = Readonly<Record<string, boolean>>;
|
|
6
6
|
/**
|
|
7
7
|
* @see {@link TokenListParser}
|
|
8
8
|
*/
|
|
9
|
-
export type TokenList<CanonicalToken extends string = string> = {
|
|
9
|
+
export type TokenList<CanonicalToken extends string = string> = PassthroughTokenList & {
|
|
10
10
|
readonly [Key in TokenListKey<CanonicalToken>]: Key extends SymbolIterator ? () => TokenListIterator<CanonicalToken> : boolean;
|
|
11
11
|
};
|
|
12
12
|
interface TokenListAlias<CanonicalToken extends string> {
|
|
@@ -77,7 +77,7 @@ type TokenListAttributeName = PartiallyKnownString<'appearance' | 'class'>;
|
|
|
77
77
|
export declare class TokenListParser<CanonicalToken extends string, TokenAlias extends CanonicalToken = CanonicalToken> {
|
|
78
78
|
readonly canonicalTokens: readonly CanonicalToken[];
|
|
79
79
|
private readonly aliases;
|
|
80
|
-
constructor(canonicalTokens
|
|
80
|
+
constructor(canonicalTokens?: readonly CanonicalToken[], options?: TokenListParserOptions<TokenAlias>);
|
|
81
81
|
parseFrom(element: Element, attributeName: TokenListAttributeName): TokenList<CanonicalToken>;
|
|
82
82
|
}
|
|
83
83
|
export type ParsedTokenList<Parser extends TokenListParser<any>> = Parser extends TokenListParser<infer CanonicalToken> ? TokenList<CanonicalToken> : never;
|
package/dist/lib/dom/query.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { KnownAttributeLocalNamedElement, LocalNamedElement } from '../../../../common/types/dom.ts';
|
|
2
|
-
import { SelectElement } from '../../body/control/select/SelectDefinition';
|
|
3
|
-
|
|
2
|
+
import { SelectElement } from '../../parse/body/control/select/SelectDefinition';
|
|
4
3
|
export interface HintElement extends LocalNamedElement<'hint'> {
|
|
5
4
|
}
|
|
6
5
|
export interface ItemElement extends LocalNamedElement<'item'> {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Accessor, Setter, Signal } from 'solid-js';
|
|
2
2
|
import { AnyChildNode, AnyParentNode } from '../../instance/hierarchy.ts';
|
|
3
3
|
import { NodeID } from '../../instance/identity.ts';
|
|
4
|
-
|
|
5
4
|
export interface ChildrenState<Child extends AnyChildNode> {
|
|
6
5
|
readonly children: Signal<readonly Child[]>;
|
|
7
6
|
readonly getChildren: Accessor<readonly Child[]>;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { Accessor } from 'solid-js';
|
|
2
|
-
import { DependentExpression, DependentExpressionResultType } from '../../expression/DependentExpression.ts';
|
|
3
2
|
import { EvaluationContext } from '../../instance/internal-api/EvaluationContext.ts';
|
|
4
|
-
|
|
3
|
+
import { SubscribableDependency } from '../../instance/internal-api/SubscribableDependency.ts';
|
|
4
|
+
import { DependentExpression, DependentExpressionResultType } from '../../parse/expression/abstract/DependentExpression.ts';
|
|
5
5
|
interface ComputedExpressionResults {
|
|
6
6
|
readonly boolean: boolean;
|
|
7
7
|
readonly nodes: Node[];
|
|
8
|
+
readonly number: number;
|
|
8
9
|
readonly string: string;
|
|
9
10
|
}
|
|
10
11
|
type EvaluatedExpression<Type extends DependentExpressionResultType> = ComputedExpressionResults[Type];
|
|
11
12
|
type ComputedExpression<Type extends DependentExpressionResultType> = Accessor<EvaluatedExpression<Type>>;
|
|
12
|
-
|
|
13
|
+
interface CreateComputedExpressionOptions {
|
|
14
|
+
readonly arbitraryDependencies?: readonly SubscribableDependency[];
|
|
15
|
+
}
|
|
16
|
+
export declare const createComputedExpression: <Type extends DependentExpressionResultType>(context: EvaluationContext, dependentExpression: DependentExpression<Type>, options?: CreateComputedExpressionOptions) => ComputedExpression<Type>;
|
|
13
17
|
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { EvaluationContext } from '../../instance/internal-api/EvaluationContext.ts';
|
|
3
|
+
import { BindComputationExpression } from '../../parse/expression/BindComputationExpression.ts';
|
|
4
|
+
export declare const createNoteReadonlyThunk: (context: EvaluationContext, readonlyDefinition: BindComputationExpression<"readonly">) => Accessor<true>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Accessor } from 'solid-js';
|
|
2
2
|
import { SelectItem } from '../../index.ts';
|
|
3
3
|
import { SelectField } from '../../instance/SelectField.ts';
|
|
4
|
-
|
|
5
4
|
/**
|
|
6
5
|
* Creates a reactive computation of a {@link SelectField}'s
|
|
7
6
|
* {@link SelectItem}s, in support of the field's `valueOptions`.
|
|
@@ -2,7 +2,6 @@ import { AnyChildNode } from '../../instance/hierarchy.ts';
|
|
|
2
2
|
import { NodeID } from '../../instance/identity.ts';
|
|
3
3
|
import { ChildrenState } from './createChildrenState.ts';
|
|
4
4
|
import { ReactiveScope } from './scope.ts';
|
|
5
|
-
|
|
6
5
|
export interface EncodedParentState {
|
|
7
6
|
readonly children: readonly NodeID[];
|
|
8
7
|
}
|
|
@@ -4,7 +4,6 @@ import { ReactiveScope } from '../scope.ts';
|
|
|
4
4
|
import { EngineState } from './createEngineState.ts';
|
|
5
5
|
import { SpecifiedState, StateSpec } from './createSpecifiedState.ts';
|
|
6
6
|
import { InternalClientRepresentation } from './representations.ts';
|
|
7
|
-
|
|
8
7
|
export type SpecifiedClientStateFactory<Factory extends OpaqueReactiveObjectFactory, Spec extends StateSpec> = ShallowMutable<SpecifiedState<Spec>> extends Parameters<Factory>[0] ? Factory : never;
|
|
9
8
|
export type ClientState<Spec extends StateSpec> = InternalClientRepresentation<SpecifiedState<Spec>>;
|
|
10
9
|
export declare const createClientState: <Factory extends OpaqueReactiveObjectFactory, Spec extends StateSpec>(scope: ReactiveScope, engineState: EngineState<Spec>, clientStateFactory: SpecifiedClientStateFactory<Factory, Spec>) => ClientState<Spec>;
|
|
@@ -2,6 +2,5 @@ import { ReactiveScope } from '../scope.ts';
|
|
|
2
2
|
import { ClientState } from './createClientState.ts';
|
|
3
3
|
import { SpecifiedState, StateSpec } from './createSpecifiedState.ts';
|
|
4
4
|
import { ReadonlyClientRepresentation } from './representations.ts';
|
|
5
|
-
|
|
6
5
|
export type CurrentState<Spec extends StateSpec> = ReadonlyClientRepresentation<SpecifiedState<Spec>>;
|
|
7
6
|
export declare const createCurrentState: <Spec extends StateSpec>(scope: ReactiveScope, clientState: ClientState<Spec>) => CurrentState<Spec>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactiveScope } from '../scope.ts';
|
|
2
2
|
import { SpecifiedState, StateSpec } from './createSpecifiedState.ts';
|
|
3
3
|
import { EngineRepresentation } from './representations.ts';
|
|
4
|
-
|
|
5
4
|
export type EngineState<Spec extends StateSpec> = EngineRepresentation<SpecifiedState<Spec>>;
|
|
6
5
|
export declare const createEngineState: <Spec extends StateSpec>(scope: ReactiveScope, spec: Spec) => EngineState<Spec>;
|
|
@@ -4,7 +4,6 @@ import { ClientState, SpecifiedClientStateFactory } from './createClientState.ts
|
|
|
4
4
|
import { CurrentState } from './createCurrentState.ts';
|
|
5
5
|
import { EngineState } from './createEngineState.ts';
|
|
6
6
|
import { MutablePropertySpec, SpecifiedState, StateSpec } from './createSpecifiedState.ts';
|
|
7
|
-
|
|
8
7
|
type MutableKeyOf<Spec extends StateSpec> = {
|
|
9
8
|
[K in string & keyof Spec]: Spec[K] extends MutablePropertySpec<any> ? K : never;
|
|
10
9
|
}[string & keyof Spec];
|
|
@@ -16,7 +15,7 @@ export interface SharedNodeState<Spec extends StateSpec> {
|
|
|
16
15
|
readonly currentState: CurrentState<Spec>;
|
|
17
16
|
readonly setProperty: SetEnginePropertyState<Spec>;
|
|
18
17
|
}
|
|
19
|
-
interface SharedNodeStateOptions<Factory extends OpaqueReactiveObjectFactory, Spec extends StateSpec> {
|
|
18
|
+
export interface SharedNodeStateOptions<Factory extends OpaqueReactiveObjectFactory, Spec extends StateSpec> {
|
|
20
19
|
readonly clientStateFactory: SpecifiedClientStateFactory<Factory, Spec>;
|
|
21
20
|
}
|
|
22
21
|
export declare const createSharedNodeState: <Factory extends OpaqueReactiveObjectFactory, Spec extends StateSpec>(scope: ReactiveScope, spec: Spec, options: SharedNodeStateOptions<Factory, Spec>) => SharedNodeState<Spec>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Accessor, Signal } from 'solid-js';
|
|
2
2
|
import { SimpleAtomicState } from '../types.ts';
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* Specifies a state object's property as mutable. Basic usage:
|
|
6
5
|
*
|
|
@@ -110,7 +109,7 @@ export type StaticPropertySpec<T> = Exclude<T, NonStaticValue>;
|
|
|
110
109
|
export type StatePropertySpec<T = any> = MutablePropertySpec<T> | ComputedPropertySpec<T> | StaticPropertySpec<T>;
|
|
111
110
|
export declare const isMutablePropertySpec: <T>(propertySpec: StatePropertySpec<T>) => propertySpec is MutablePropertySpec<T>;
|
|
112
111
|
export declare const isComputedPropertySpec: <T>(propertySpec: StatePropertySpec<T>) => propertySpec is ComputedPropertySpec<T>;
|
|
113
|
-
export declare const isStaticPropertySpec: <T>(propertySpec: StatePropertySpec<T>) => propertySpec is
|
|
112
|
+
export declare const isStaticPropertySpec: <T>(propertySpec: StatePropertySpec<T>) => propertySpec is StaticPropertySpec<T>;
|
|
114
113
|
export type StateSpec = Record<string, StatePropertySpec>;
|
|
115
114
|
type SpecifiedStatePropertyValue<PropertySpec extends StatePropertySpec> = PropertySpec extends StatePropertySpec<infer T> ? T : never;
|
|
116
115
|
type DerivedMutableKeys<Spec extends StateSpec> = {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Accessor } from 'solid-js';
|
|
2
|
+
import { TextRange } from '../../../client/TextRange.ts';
|
|
2
3
|
import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const createFieldHint: (context: EvaluationContext, definition: ValueNodeDefinition) => Accessor<TextRange<'hint'> | null>;
|
|
4
|
+
import { LeafNodeDefinition } from '../../../parse/model/LeafNodeDefinition.ts';
|
|
5
|
+
export declare const createFieldHint: (context: EvaluationContext, definition: LeafNodeDefinition) => Accessor<TextRange<"hint", "form"> | null>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Accessor } from 'solid-js';
|
|
2
|
+
import { TextRange } from '../../../client/TextRange.ts';
|
|
2
3
|
import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const createNodeLabel: (context: EvaluationContext, definition: AnyNodeDefinition) => Accessor<TextRange<'label'> | null>;
|
|
4
|
+
import { AnyNodeDefinition } from '../../../parse/model/NodeDefinition.ts';
|
|
5
|
+
export declare const createNodeLabel: (context: EvaluationContext, definition: AnyNodeDefinition) => Accessor<TextRange<"label", "form"> | null>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { TextRange } from '../../../client/TextRange.ts';
|
|
3
|
+
import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
|
|
4
|
+
import { NoteTextDefinition } from '../../../parse/model/NoteNodeDefinition.ts';
|
|
5
|
+
export type NoteTextRole = 'label' | 'hint';
|
|
6
|
+
export type ComputedNoteText<Role extends NoteTextRole = NoteTextRole> = Accessor<TextRange<Role, 'form'>>;
|
|
7
|
+
interface BaseNoteText {
|
|
8
|
+
readonly role: NoteTextRole;
|
|
9
|
+
readonly label: ComputedNoteText<'label'> | null;
|
|
10
|
+
readonly hint: ComputedNoteText<'hint'> | null;
|
|
11
|
+
}
|
|
12
|
+
interface LabelNoteText extends BaseNoteText {
|
|
13
|
+
readonly role: 'label';
|
|
14
|
+
readonly label: ComputedNoteText<'label'>;
|
|
15
|
+
readonly hint: null;
|
|
16
|
+
}
|
|
17
|
+
interface HintNoteText extends BaseNoteText {
|
|
18
|
+
readonly role: 'hint';
|
|
19
|
+
readonly label: null;
|
|
20
|
+
readonly hint: ComputedNoteText<'hint'>;
|
|
21
|
+
}
|
|
22
|
+
export type NoteTextComputation = LabelNoteText | HintNoteText;
|
|
23
|
+
export declare const createNoteText: (context: EvaluationContext, noteTextDefinition: NoteTextDefinition) => NoteTextComputation;
|
|
24
|
+
export {};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { Accessor } from 'solid-js';
|
|
2
|
-
import {
|
|
2
|
+
import { TextRole } from '../../../client/TextRange.ts';
|
|
3
3
|
import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
|
|
4
|
-
import { TextRange
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
readonly fallbackValue?: FallbackValue;
|
|
8
|
-
}
|
|
9
|
-
type ComputedTextRange<Role extends TextRole, Definition extends TextElementDefinition<Role> | null, FallbackValue extends string | null> = Accessor<Definition extends null ? FallbackValue extends null ? TextRange<Role> | null : TextRange<Role> : TextRange<Role>>;
|
|
4
|
+
import { TextRange } from '../../../instance/text/TextRange.ts';
|
|
5
|
+
import { TextRangeDefinition } from '../../../parse/text/abstract/TextRangeDefinition.ts';
|
|
6
|
+
type ComputedFormTextRange<Role extends TextRole> = Accessor<TextRange<Role, 'form'>>;
|
|
10
7
|
/**
|
|
11
8
|
* Creates a text range (e.g. label or hint) from the provided definition,
|
|
12
9
|
* reactive to:
|
|
@@ -16,5 +13,5 @@ type ComputedTextRange<Role extends TextRole, Definition extends TextElementDefi
|
|
|
16
13
|
*
|
|
17
14
|
* @todo This does not yet handle itext translations **with** outputs!
|
|
18
15
|
*/
|
|
19
|
-
export declare const createTextRange: <Role extends TextRole
|
|
16
|
+
export declare const createTextRange: <Role extends TextRole>(context: EvaluationContext, role: Role, definition: TextRangeDefinition<Role>) => ComputedFormTextRange<Role>;
|
|
20
17
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OpaqueReactiveObjectFactory } from '../../../client/OpaqueReactiveObjectFactory.ts';
|
|
2
|
+
import { AncestorNodeValidationState } from '../../../client/validation.ts';
|
|
3
|
+
import { AnyParentNode } from '../../../instance/hierarchy.ts';
|
|
4
|
+
interface AggregatedViolationsOptions {
|
|
5
|
+
readonly clientStateFactory: OpaqueReactiveObjectFactory<AncestorNodeValidationState>;
|
|
6
|
+
}
|
|
7
|
+
export declare const createAggregatedViolations: (context: AnyParentNode, options: AggregatedViolationsOptions) => AncestorNodeValidationState;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
2
|
+
import { OpaqueReactiveObjectFactory } from '../../../client/OpaqueReactiveObjectFactory.ts';
|
|
3
|
+
import { AnyViolation, ConditionValidation, ValidationCondition } from '../../../client/validation.ts';
|
|
4
|
+
import { ValidationContext } from '../../../instance/internal-api/ValidationContext.ts';
|
|
5
|
+
import { SharedNodeState, SharedNodeStateOptions } from '../node-state/createSharedNodeState.ts';
|
|
6
|
+
type ComputedConditionValidation<Condition extends ValidationCondition> = Accessor<ConditionValidation<Condition>>;
|
|
7
|
+
type ComputedViolation = Accessor<AnyViolation | null>;
|
|
8
|
+
interface ValidationStateSpec {
|
|
9
|
+
readonly constraint: ComputedConditionValidation<'constraint'>;
|
|
10
|
+
readonly required: ComputedConditionValidation<'required'>;
|
|
11
|
+
readonly violation: ComputedViolation;
|
|
12
|
+
}
|
|
13
|
+
export type SharedValidationState = SharedNodeState<ValidationStateSpec>;
|
|
14
|
+
interface ValidationStateOptions<Factory extends OpaqueReactiveObjectFactory> extends SharedNodeStateOptions<Factory, ValidationStateSpec> {
|
|
15
|
+
}
|
|
16
|
+
export declare const createValidationState: <Factory extends OpaqueReactiveObjectFactory>(context: ValidationContext, options: ValidationStateOptions<Factory>) => SharedValidationState;
|
|
17
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { XFormsXPathEvaluator } from '@getodk/xpath';
|
|
2
|
-
|
|
3
2
|
interface XFormDOMNormalizationOptions {
|
|
4
3
|
readonly isNormalized: boolean;
|
|
5
4
|
}
|
|
@@ -19,7 +18,7 @@ export declare class XFormDOM {
|
|
|
19
18
|
readonly body: Element;
|
|
20
19
|
protected constructor(sourceXML: string, options: XFormDOMNormalizationOptions);
|
|
21
20
|
createInstance(): XFormDOM;
|
|
22
|
-
toJSON(): Omit<this, "
|
|
21
|
+
toJSON(): Omit<this, "head" | "html" | "title" | "toJSON" | "model" | "primaryInstanceRoot" | "xformDocument" | "rootEvaluator" | "primaryInstanceEvaluator" | "primaryInstance" | "createInstance"> & {
|
|
23
22
|
xformDocument: string;
|
|
24
23
|
html: string;
|
|
25
24
|
head: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { CollectionValues } from '
|
|
2
|
-
|
|
1
|
+
import { CollectionValues } from '../../../common/types/collections/CollectionValues.ts';
|
|
3
2
|
/**
|
|
4
3
|
* Like JavaRosa. Presumably for explicit types which aren't impelemnted?
|
|
5
4
|
*/
|
|
@@ -8,8 +7,7 @@ export type UnsupportedDataType = typeof UNSUPPORTED_DATA_TYPE;
|
|
|
8
7
|
/**
|
|
9
8
|
* Like JavaRosa. Presumably for e.g. groups with explicit binds (`relevant` etc)?
|
|
10
9
|
*/
|
|
11
|
-
|
|
12
|
-
export type NullDataType = typeof NULL_DATA_TYPE;
|
|
10
|
+
export type NullDataType = 'NULL';
|
|
13
11
|
/**
|
|
14
12
|
* As in ODK XForms Spec.
|
|
15
13
|
*
|