@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
|
@@ -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];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Accessor } from 'solid-js';
|
|
2
2
|
import { TextRange } from '../../../client/TextRange.ts';
|
|
3
3
|
import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
|
|
4
|
-
import { LeafNodeDefinition } from '../../../model/LeafNodeDefinition.ts';
|
|
5
|
-
|
|
4
|
+
import { LeafNodeDefinition } from '../../../parse/model/LeafNodeDefinition.ts';
|
|
6
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
2
|
import { TextRange } from '../../../client/TextRange.ts';
|
|
3
3
|
import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
|
|
4
|
-
import { AnyNodeDefinition } from '../../../model/NodeDefinition.ts';
|
|
5
|
-
|
|
4
|
+
import { AnyNodeDefinition } from '../../../parse/model/NodeDefinition.ts';
|
|
6
5
|
export declare const createNodeLabel: (context: EvaluationContext, definition: AnyNodeDefinition) => Accessor<TextRange<"label", "form"> | null>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Accessor } from 'solid-js';
|
|
2
2
|
import { TextRange } from '../../../client/TextRange.ts';
|
|
3
3
|
import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
|
|
4
|
-
import { NoteTextDefinition } from '../../../parse/NoteNodeDefinition.ts';
|
|
5
|
-
|
|
4
|
+
import { NoteTextDefinition } from '../../../parse/model/NoteNodeDefinition.ts';
|
|
6
5
|
export type NoteTextRole = 'label' | 'hint';
|
|
7
6
|
export type ComputedNoteText<Role extends NoteTextRole = NoteTextRole> = Accessor<TextRange<Role, 'form'>>;
|
|
8
7
|
interface BaseNoteText {
|
|
@@ -3,7 +3,6 @@ import { TextRole } from '../../../client/TextRange.ts';
|
|
|
3
3
|
import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
|
|
4
4
|
import { TextRange } from '../../../instance/text/TextRange.ts';
|
|
5
5
|
import { TextRangeDefinition } from '../../../parse/text/abstract/TextRangeDefinition.ts';
|
|
6
|
-
|
|
7
6
|
type ComputedFormTextRange<Role extends TextRole> = Accessor<TextRange<Role, 'form'>>;
|
|
8
7
|
/**
|
|
9
8
|
* Creates a text range (e.g. label or hint) from the provided definition,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { OpaqueReactiveObjectFactory } from '../../../client/OpaqueReactiveObjectFactory.ts';
|
|
2
2
|
import { AncestorNodeValidationState } from '../../../client/validation.ts';
|
|
3
3
|
import { AnyParentNode } from '../../../instance/hierarchy.ts';
|
|
4
|
-
|
|
5
4
|
interface AggregatedViolationsOptions {
|
|
6
5
|
readonly clientStateFactory: OpaqueReactiveObjectFactory<AncestorNodeValidationState>;
|
|
7
6
|
}
|
|
@@ -3,7 +3,6 @@ import { OpaqueReactiveObjectFactory } from '../../../client/OpaqueReactiveObjec
|
|
|
3
3
|
import { AnyViolation, ConditionValidation, ValidationCondition } from '../../../client/validation.ts';
|
|
4
4
|
import { ValidationContext } from '../../../instance/internal-api/ValidationContext.ts';
|
|
5
5
|
import { SharedNodeState, SharedNodeStateOptions } from '../node-state/createSharedNodeState.ts';
|
|
6
|
-
|
|
7
6
|
type ComputedConditionValidation<Condition extends ValidationCondition> = Accessor<ConditionValidation<Condition>>;
|
|
8
7
|
type ComputedViolation = Accessor<AnyViolation | null>;
|
|
9
8
|
interface ValidationStateSpec {
|
|
@@ -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
|
*
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BodyDefinition } from './body/BodyDefinition.ts';
|
|
1
|
+
import { BodyDefinition } from '../parse/body/BodyDefinition.ts';
|
|
3
2
|
import { ModelDefinition } from './model/ModelDefinition.ts';
|
|
4
|
-
|
|
3
|
+
import { XFormDOM } from './XFormDOM.ts';
|
|
5
4
|
export declare class XFormDefinition {
|
|
6
5
|
readonly sourceXML: string;
|
|
7
6
|
readonly xformDOM: XFormDOM;
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { RepeatElementDefinition } from './RepeatElementDefinition.ts';
|
|
5
|
-
import { UnsupportedBodyElementDefinition } from './UnsupportedBodyElementDefinition.ts';
|
|
1
|
+
import { ParsedTokenList, TokenListParser } from '../../lib/TokenListParser.ts';
|
|
2
|
+
import { XFormDefinition } from '../../parse/XFormDefinition.ts';
|
|
3
|
+
import { DependencyContext } from '../expression/abstract/DependencyContext.ts';
|
|
6
4
|
import { InputDefinition } from './control/InputDefinition.ts';
|
|
5
|
+
import { RangeControlDefinition } from './control/RangeControlDefinition.ts';
|
|
6
|
+
import { RankControlDefinition } from './control/RankControlDefinition.ts';
|
|
7
7
|
import { AnySelectDefinition } from './control/select/SelectDefinition.ts';
|
|
8
|
+
import { TriggerControlDefinition } from './control/TriggerControlDefinition.ts';
|
|
9
|
+
import { UploadControlDefinition } from './control/UploadControlDefinition.ts';
|
|
8
10
|
import { LogicalGroupDefinition } from './group/LogicalGroupDefinition.ts';
|
|
9
11
|
import { PresentationGroupDefinition } from './group/PresentationGroupDefinition.ts';
|
|
10
12
|
import { StructuralGroupDefinition } from './group/StructuralGroupDefinition.ts';
|
|
11
|
-
|
|
13
|
+
import { RepeatElementDefinition } from './RepeatElementDefinition.ts';
|
|
14
|
+
import { UnsupportedBodyElementDefinition } from './UnsupportedBodyElementDefinition.ts';
|
|
12
15
|
export interface BodyElementParentContext {
|
|
16
|
+
readonly body: BodyDefinition;
|
|
13
17
|
readonly reference: string | null;
|
|
14
18
|
readonly element: Element;
|
|
15
19
|
}
|
|
16
|
-
export type ControlElementDefinition = AnySelectDefinition | InputDefinition;
|
|
20
|
+
export type ControlElementDefinition = AnySelectDefinition | InputDefinition | RangeControlDefinition | RankControlDefinition | TriggerControlDefinition | UploadControlDefinition;
|
|
17
21
|
type SupportedBodyElementDefinition = RepeatElementDefinition | LogicalGroupDefinition | PresentationGroupDefinition | StructuralGroupDefinition | ControlElementDefinition;
|
|
18
22
|
export type AnyBodyElementDefinition = SupportedBodyElementDefinition | UnsupportedBodyElementDefinition;
|
|
19
23
|
export type BodyElementDefinitionArray = readonly AnyBodyElementDefinition[];
|
|
@@ -38,9 +42,9 @@ declare class BodyElementMap extends Map<BodyElementReference, AnyBodyElementDef
|
|
|
38
42
|
}
|
|
39
43
|
declare const bodyClassParser: TokenListParser<"pages", "pages">;
|
|
40
44
|
export type BodyClassList = ParsedTokenList<typeof bodyClassParser>;
|
|
41
|
-
export declare class BodyDefinition extends DependencyContext {
|
|
45
|
+
export declare class BodyDefinition extends DependencyContext implements BodyElementParentContext {
|
|
42
46
|
protected readonly form: XFormDefinition;
|
|
43
|
-
|
|
47
|
+
readonly body: BodyDefinition;
|
|
44
48
|
readonly element: Element;
|
|
45
49
|
/**
|
|
46
50
|
* @todo this class is already an oddity in that it's **like** an element
|
|
@@ -65,6 +69,7 @@ export declare class BodyDefinition extends DependencyContext {
|
|
|
65
69
|
readonly reference: string;
|
|
66
70
|
constructor(form: XFormDefinition);
|
|
67
71
|
getBodyElement(reference: string): AnyBodyElementDefinition | null;
|
|
68
|
-
|
|
72
|
+
getChildElementDefinitions(form: XFormDefinition, parent: BodyElementParentContext, parentElement: Element, children?: readonly Element[]): readonly AnyBodyElementDefinition[];
|
|
73
|
+
toJSON(): Omit<this, "form" | "isTranslated" | "toJSON" | "dependencyExpressions" | "registerDependentExpression" | "getBodyElement" | "getChildElementDefinitions">;
|
|
69
74
|
}
|
|
70
75
|
export {};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
+
import { DependencyContext } from '../expression/abstract/DependencyContext.ts';
|
|
2
|
+
import { HintDefinition } from '../text/HintDefinition.ts';
|
|
3
|
+
import { ItemLabelDefinition } from '../text/ItemLabelDefinition.ts';
|
|
4
|
+
import { LabelDefinition } from '../text/LabelDefinition.ts';
|
|
1
5
|
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
2
|
-
import {
|
|
3
|
-
import { HintDefinition } from '../parse/text/HintDefinition.ts';
|
|
4
|
-
import { ItemLabelDefinition } from '../parse/text/ItemLabelDefinition.ts';
|
|
5
|
-
import { LabelDefinition } from '../parse/text/LabelDefinition.ts';
|
|
6
|
-
import { BodyElementParentContext } from './BodyDefinition.ts';
|
|
7
|
-
|
|
6
|
+
import { BodyDefinition, BodyElementParentContext } from './BodyDefinition.ts';
|
|
8
7
|
/**
|
|
9
8
|
* These category names roughly correspond to each of the ODK XForms spec's
|
|
10
9
|
* {@link https://getodk.github.io/xforms-spec/#body-elements | Body Elements}
|
|
11
10
|
* tables.
|
|
12
11
|
*/
|
|
13
12
|
type BodyElementCategory = 'control' | 'structure' | 'support' | 'UNSUPPORTED';
|
|
14
|
-
export declare abstract class BodyElementDefinition<Type extends string> extends DependencyContext {
|
|
13
|
+
export declare abstract class BodyElementDefinition<Type extends string> extends DependencyContext implements BodyElementParentContext {
|
|
15
14
|
protected readonly form: XFormDefinition;
|
|
16
15
|
readonly parent: BodyElementParentContext;
|
|
17
16
|
readonly element: Element;
|
|
18
17
|
static isCompatible(localName: string, element: Element): boolean;
|
|
18
|
+
readonly body: BodyDefinition;
|
|
19
19
|
abstract readonly category: BodyElementCategory;
|
|
20
20
|
abstract readonly type: Type;
|
|
21
21
|
readonly hint: HintDefinition | null;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { BodyElementDefinitionArray, BodyElementParentContext } from '../body/BodyDefinition.ts';
|
|
3
|
+
import { LabelDefinition } from '../text/LabelDefinition.ts';
|
|
4
4
|
import { BodyElementDefinition } from './BodyElementDefinition.ts';
|
|
5
5
|
import { StructureElementAppearanceDefinition } from './appearance/structureElementAppearanceParser.ts';
|
|
6
|
-
|
|
7
6
|
export declare class RepeatElementDefinition extends BodyElementDefinition<'repeat'> {
|
|
8
7
|
static isCompatible(localName: string): boolean;
|
|
9
8
|
readonly category = "structure";
|
|
@@ -15,5 +14,5 @@ export declare class RepeatElementDefinition extends BodyElementDefinition<'repe
|
|
|
15
14
|
readonly noAddRemoveExpression: string | null;
|
|
16
15
|
readonly children: BodyElementDefinitionArray;
|
|
17
16
|
constructor(form: XFormDefinition, parent: BodyElementParentContext, element: Element);
|
|
18
|
-
toJSON(): Omit<this, "
|
|
17
|
+
toJSON(): Omit<this, "parent" | "form" | "isTranslated" | "toJSON" | "dependencyExpressions" | "registerDependentExpression">;
|
|
19
18
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
2
2
|
import { BodyElementParentContext } from './BodyDefinition.ts';
|
|
3
3
|
import { BodyElementDefinition } from './BodyElementDefinition.ts';
|
|
4
|
-
|
|
5
4
|
export declare class UnsupportedBodyElementDefinition extends BodyElementDefinition<'UNSUPPORTED'> {
|
|
6
5
|
static isCompatible(): boolean;
|
|
7
6
|
readonly category = "UNSUPPORTED";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TokenListParser, ParsedTokenList } from '
|
|
2
|
-
|
|
1
|
+
import { TokenListParser, ParsedTokenList } from '../../../lib/TokenListParser.ts';
|
|
3
2
|
export declare const inputAppearanceParser: TokenListParser<"multiline" | "numbers" | "url" | "thousand-sep" | "no-calendar" | "month-year" | "year" | "ethiopian" | "coptic" | "islamic" | "bikram-sambat" | "myanmar" | "persian" | "placement-map" | "maps" | "hidden-answer" | "annotate" | "draw" | "signature" | "new-front" | "new" | "front" | "printer" | "masked", "multiline" | "numbers" | "url" | "thousand-sep" | "no-calendar" | "month-year" | "year" | "ethiopian" | "coptic" | "islamic" | "bikram-sambat" | "myanmar" | "persian" | "placement-map" | "maps" | "hidden-answer" | "annotate" | "draw" | "signature" | "new-front" | "new" | "front" | "printer" | "masked">;
|
|
4
3
|
export type InputAppearanceDefinition = ParsedTokenList<typeof inputAppearanceParser>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TokenListParser, ParsedTokenList } from '
|
|
2
|
-
|
|
1
|
+
import { TokenListParser, ParsedTokenList } from '../../../lib/TokenListParser.ts';
|
|
3
2
|
export declare const selectAppearanceParser: TokenListParser<"map" | "label" | "compact" | "horizontal" | "horizontal-compact" | "list-nolabel" | "minimal" | "columns" | "columns-1" | "columns-2" | "columns-3" | "columns-4" | "columns-5" | "columns-pack" | "autocomplete" | "likert" | "quick" | "quickcompact", "autocomplete">;
|
|
4
3
|
export type SelectAppearanceDefinition = ParsedTokenList<typeof selectAppearanceParser>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TokenListParser, ParsedTokenList } from '
|
|
2
|
-
|
|
1
|
+
import { TokenListParser, ParsedTokenList } from '../../../lib/TokenListParser.ts';
|
|
3
2
|
export declare const structureElementAppearanceParser: TokenListParser<"field-list" | "table-list", "field-list" | "table-list">;
|
|
4
3
|
export type StructureElementAppearanceDefinition = ParsedTokenList<typeof structureElementAppearanceParser>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { ParsedTokenList } from '../../../lib/TokenListParser.ts';
|
|
2
|
+
import { HintDefinition } from '../../text/HintDefinition.ts';
|
|
3
|
+
import { LabelDefinition } from '../../text/LabelDefinition.ts';
|
|
1
4
|
import { XFormDefinition } from '../../XFormDefinition.ts';
|
|
2
|
-
import { ParsedTokenList } from '../../lib/TokenListParser.ts';
|
|
3
|
-
import { HintDefinition } from '../../parse/text/HintDefinition.ts';
|
|
4
|
-
import { LabelDefinition } from '../../parse/text/LabelDefinition.ts';
|
|
5
5
|
import { BodyElementParentContext } from '../BodyDefinition.ts';
|
|
6
6
|
import { BodyElementDefinition } from '../BodyElementDefinition.ts';
|
|
7
|
-
|
|
8
7
|
type ControlType = 'input' | 'range' | 'rank' | 'select' | 'select1' | 'trigger' | 'upload';
|
|
9
8
|
export declare abstract class ControlDefinition<Type extends ControlType> extends BodyElementDefinition<Type> {
|
|
10
9
|
readonly category = "control";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { XFormDefinition } from '../../XFormDefinition.ts';
|
|
2
|
-
import { BodyElementParentContext } from '../BodyDefinition.ts';
|
|
3
2
|
import { InputAppearanceDefinition } from '../appearance/inputAppearanceParser.ts';
|
|
3
|
+
import { BodyElementParentContext } from '../BodyDefinition.ts';
|
|
4
4
|
import { ControlDefinition } from './ControlDefinition.ts';
|
|
5
|
-
|
|
6
5
|
export declare class InputDefinition extends ControlDefinition<'input'> {
|
|
7
6
|
static isCompatible(localName: string): boolean;
|
|
8
7
|
readonly type = "input";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { XFormDefinition } from '../../XFormDefinition.ts';
|
|
2
|
+
import { UnknownAppearanceDefinition } from '../appearance/unknownAppearanceParser.ts';
|
|
3
|
+
import { BodyElementParentContext } from '../BodyDefinition.ts';
|
|
4
|
+
import { ControlDefinition } from './ControlDefinition.ts';
|
|
5
|
+
export declare class RangeControlDefinition extends ControlDefinition<'range'> {
|
|
6
|
+
static isCompatible(localName: string): boolean;
|
|
7
|
+
readonly type = "range";
|
|
8
|
+
readonly appearances: UnknownAppearanceDefinition;
|
|
9
|
+
constructor(form: XFormDefinition, parent: BodyElementParentContext, element: Element);
|
|
10
|
+
toJSON(): object;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { XFormDefinition } from '../../XFormDefinition.ts';
|
|
2
|
+
import { UnknownAppearanceDefinition } from '../appearance/unknownAppearanceParser.ts';
|
|
3
|
+
import { BodyElementParentContext } from '../BodyDefinition.ts';
|
|
4
|
+
import { ControlDefinition } from './ControlDefinition.ts';
|
|
5
|
+
export declare class RankControlDefinition extends ControlDefinition<'rank'> {
|
|
6
|
+
static isCompatible(localName: string, element: Element): boolean;
|
|
7
|
+
readonly type = "rank";
|
|
8
|
+
readonly appearances: UnknownAppearanceDefinition;
|
|
9
|
+
constructor(form: XFormDefinition, parent: BodyElementParentContext, element: Element);
|
|
10
|
+
toJSON(): object;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { XFormDefinition } from '../../XFormDefinition.ts';
|
|
2
|
+
import { UnknownAppearanceDefinition } from '../appearance/unknownAppearanceParser.ts';
|
|
3
|
+
import { BodyElementParentContext } from '../BodyDefinition.ts';
|
|
4
|
+
import { ControlDefinition } from './ControlDefinition.ts';
|
|
5
|
+
export declare class TriggerControlDefinition extends ControlDefinition<'trigger'> {
|
|
6
|
+
static isCompatible(localName: string): boolean;
|
|
7
|
+
readonly type = "trigger";
|
|
8
|
+
readonly appearances: UnknownAppearanceDefinition;
|
|
9
|
+
constructor(form: XFormDefinition, parent: BodyElementParentContext, element: Element);
|
|
10
|
+
toJSON(): object;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { XFormDefinition } from '../../XFormDefinition.ts';
|
|
2
|
+
import { UnknownAppearanceDefinition } from '../appearance/unknownAppearanceParser.ts';
|
|
3
|
+
import { BodyElementParentContext } from '../BodyDefinition.ts';
|
|
4
|
+
import { ControlDefinition } from './ControlDefinition.ts';
|
|
5
|
+
export declare class UploadControlDefinition extends ControlDefinition<'upload'> {
|
|
6
|
+
static isCompatible(localName: string): boolean;
|
|
7
|
+
readonly type = "upload";
|
|
8
|
+
readonly appearances: UnknownAppearanceDefinition;
|
|
9
|
+
constructor(form: XFormDefinition, parent: BodyElementParentContext, element: Element);
|
|
10
|
+
toJSON(): object;
|
|
11
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ItemElement } from '
|
|
2
|
-
import { ItemLabelDefinition } from '../../../
|
|
1
|
+
import { ItemElement } from '../../../../lib/dom/query.ts';
|
|
2
|
+
import { ItemLabelDefinition } from '../../../text/ItemLabelDefinition.ts';
|
|
3
3
|
import { XFormDefinition } from '../../../XFormDefinition.ts';
|
|
4
4
|
import { BodyElementDefinition } from '../../BodyElementDefinition.ts';
|
|
5
5
|
import { AnySelectDefinition } from './SelectDefinition.ts';
|
|
6
|
-
|
|
7
6
|
export declare class ItemDefinition extends BodyElementDefinition<'item'> {
|
|
8
7
|
readonly parent: AnySelectDefinition;
|
|
9
8
|
readonly category = "support";
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { ItemsetElement } from '../../../../lib/dom/query.ts';
|
|
2
|
+
import { ItemsetNodesetExpression } from '../../../expression/ItemsetNodesetExpression.ts';
|
|
3
|
+
import { ItemsetValueExpression } from '../../../expression/ItemsetValueExpression.ts';
|
|
4
|
+
import { ItemsetLabelDefinition } from '../../../text/ItemsetLabelDefinition.ts';
|
|
1
5
|
import { XFormDefinition } from '../../../XFormDefinition.ts';
|
|
2
|
-
import { ItemsetElement } from '../../../lib/dom/query.ts';
|
|
3
|
-
import { ItemsetLabelDefinition } from '../../../parse/text/ItemsetLabelDefinition.ts';
|
|
4
6
|
import { BodyElementDefinition } from '../../BodyElementDefinition.ts';
|
|
5
|
-
import { ItemsetNodesetExpression } from './ItemsetNodesetExpression.ts';
|
|
6
|
-
import { ItemsetValueExpression } from './ItemsetValueExpression.ts';
|
|
7
7
|
import { AnySelectDefinition } from './SelectDefinition.ts';
|
|
8
|
-
|
|
9
8
|
export declare class ItemsetDefinition extends BodyElementDefinition<'itemset'> {
|
|
10
9
|
readonly parent: AnySelectDefinition;
|
|
11
10
|
readonly category = "support";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { DependencyContext } from '../../../expression/DependencyContext.ts';
|
|
2
|
-
import { AnyDependentExpression } from '../../../expression/DependentExpression.ts';
|
|
1
|
+
import { DependencyContext } from '../../../expression/abstract/DependencyContext.ts';
|
|
2
|
+
import { AnyDependentExpression } from '../../../expression/abstract/DependentExpression.ts';
|
|
3
3
|
import { ItemsetDefinition } from './ItemsetDefinition.ts';
|
|
4
|
-
|
|
5
4
|
export declare class ItemsetNodesetContext extends DependencyContext {
|
|
6
5
|
protected readonly itemset: ItemsetDefinition;
|
|
7
6
|
readonly parentReference: null;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import { CollectionValues } from '
|
|
2
|
-
import { LocalNamedElement } from '
|
|
1
|
+
import { CollectionValues } from '../../../../../../common/types/collections/CollectionValues.ts';
|
|
2
|
+
import { LocalNamedElement } from '../../../../../../common/types/dom.ts';
|
|
3
3
|
import { XFormDefinition } from '../../../XFormDefinition.ts';
|
|
4
|
-
import { AnyBodyElementDefinition, BodyElementParentContext } from '../../BodyDefinition.ts';
|
|
5
4
|
import { SelectAppearanceDefinition } from '../../appearance/selectAppearanceParser.ts';
|
|
5
|
+
import { AnyBodyElementDefinition, BodyElementParentContext } from '../../BodyDefinition.ts';
|
|
6
6
|
import { ControlDefinition } from '../ControlDefinition.ts';
|
|
7
7
|
import { ItemDefinition } from './ItemDefinition.ts';
|
|
8
8
|
import { ItemsetDefinition } from './ItemsetDefinition.ts';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @todo We were previously a bit overzealous about introducing `<rank>` support
|
|
12
|
-
* here. It'll likely still fit, but we should approach it with more intention.
|
|
13
|
-
*
|
|
14
|
-
* @todo `<trigger>` is *almost* reasonable to support here too. The main
|
|
15
|
-
* hesitation is that its single, implicit "item" does not have a distinct
|
|
16
|
-
* <label>, and presumably has different UX **and translation** considerations.
|
|
17
|
-
*/
|
|
18
9
|
declare const selectLocalNames: Set<"select" | "select1">;
|
|
19
10
|
export type SelectType = CollectionValues<typeof selectLocalNames>;
|
|
20
11
|
export interface SelectElement extends LocalNamedElement<SelectType> {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { LabelDefinition } from '../../text/LabelDefinition.ts';
|
|
1
2
|
import { XFormDefinition } from '../../XFormDefinition.ts';
|
|
2
|
-
import {
|
|
3
|
+
import { StructureElementAppearanceDefinition } from '../appearance/structureElementAppearanceParser.ts';
|
|
3
4
|
import { BodyElementDefinitionArray, BodyElementParentContext } from '../BodyDefinition.ts';
|
|
4
5
|
import { BodyElementDefinition } from '../BodyElementDefinition.ts';
|
|
5
|
-
import { StructureElementAppearanceDefinition } from '../appearance/structureElementAppearanceParser.ts';
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* These type names are derived from **and expand upon** the language used in
|
|
9
8
|
* the ODK XForms spec to describe various group usage. Whereas the spec
|
|
@@ -37,6 +36,5 @@ export declare abstract class BaseGroupDefinition<Type extends GroupType> extend
|
|
|
37
36
|
readonly reference: string | null;
|
|
38
37
|
readonly appearances: StructureElementAppearanceDefinition;
|
|
39
38
|
readonly label: LabelDefinition | null;
|
|
40
|
-
constructor(form: XFormDefinition, parent: BodyElementParentContext, element: Element
|
|
41
|
-
getChildren(element: Element): BodyElementDefinitionArray;
|
|
39
|
+
constructor(form: XFormDefinition, parent: BodyElementParentContext, element: Element);
|
|
42
40
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { LabelDefinition } from '../../text/LabelDefinition.ts';
|
|
1
2
|
import { XFormDefinition } from '../../XFormDefinition.ts';
|
|
2
|
-
import { LabelDefinition } from '../../parse/text/LabelDefinition.ts';
|
|
3
3
|
import { BodyElementParentContext } from '../BodyDefinition.ts';
|
|
4
4
|
import { BaseGroupDefinition } from './BaseGroupDefinition.ts';
|
|
5
|
-
|
|
6
5
|
export declare class PresentationGroupDefinition extends BaseGroupDefinition<'presentation-group'> {
|
|
7
6
|
static isCompatible(localName: string, element: Element): boolean;
|
|
8
7
|
readonly type = "presentation-group";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { BindDefinition } from '../model/BindDefinition.ts';
|
|
2
|
+
import { DependentExpression } from './abstract/DependentExpression.ts';
|
|
4
3
|
declare const defaultBindComputationExpressions: {
|
|
5
4
|
readonly calculate: null;
|
|
6
5
|
readonly constraint: "true()";
|
|
@@ -11,7 +10,7 @@ declare const defaultBindComputationExpressions: {
|
|
|
11
10
|
};
|
|
12
11
|
type DefaultBindComputationExpressions = typeof defaultBindComputationExpressions;
|
|
13
12
|
export type BindComputationType = keyof DefaultBindComputationExpressions;
|
|
14
|
-
type BindComputationFactoryResult<Type extends BindComputationType> = DefaultBindComputationExpressions[Type] extends null ?
|
|
13
|
+
type BindComputationFactoryResult<Type extends BindComputationType> = DefaultBindComputationExpressions[Type] extends null ? BindComputationExpression<Type> | null : BindComputationExpression<Type>;
|
|
15
14
|
declare const bindComputationResultTypes: {
|
|
16
15
|
readonly calculate: "string";
|
|
17
16
|
readonly constraint: "boolean";
|
|
@@ -22,9 +21,9 @@ declare const bindComputationResultTypes: {
|
|
|
22
21
|
};
|
|
23
22
|
type BindComputationResultTypes = typeof bindComputationResultTypes;
|
|
24
23
|
export type BindComputationResultType<Computation extends BindComputationType> = BindComputationResultTypes[Computation];
|
|
25
|
-
export declare class
|
|
24
|
+
export declare class BindComputationExpression<Computation extends BindComputationType> extends DependentExpression<BindComputationResultType<Computation>> {
|
|
26
25
|
readonly computation: Computation;
|
|
27
|
-
static
|
|
26
|
+
static forComputation<Type extends BindComputationType>(bind: BindDefinition, computation: Type): BindComputationFactoryResult<Type>;
|
|
28
27
|
readonly isDefaultExpression: boolean;
|
|
29
28
|
protected constructor(bind: BindDefinition, computation: Computation, expression: string | null);
|
|
30
29
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { ItemsetDefinition } from '../body/control/select/ItemsetDefinition.ts';
|
|
2
|
+
import { DependentExpression } from './abstract/DependentExpression.ts';
|
|
4
3
|
export declare class ItemsetNodesetExpression extends DependentExpression<'nodes'> {
|
|
5
4
|
constructor(itemset: ItemsetDefinition, nodesetExpression: string);
|
|
6
5
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { ItemsetDefinition } from '../body/control/select/ItemsetDefinition.ts';
|
|
2
|
+
import { DependentExpression } from './abstract/DependentExpression.ts';
|
|
4
3
|
export declare class ItemsetValueExpression extends DependentExpression<'string'> {
|
|
5
4
|
readonly itemset: ItemsetDefinition;
|
|
6
5
|
constructor(itemset: ItemsetDefinition, expression: string);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { RepeatElementDefinition } from '
|
|
2
|
-
import { DependentExpression } from '
|
|
3
|
-
|
|
1
|
+
import { RepeatElementDefinition } from '../body/RepeatElementDefinition.ts';
|
|
2
|
+
import { DependentExpression } from './abstract/DependentExpression.ts';
|
|
4
3
|
/**
|
|
5
4
|
* Represents either of these
|
|
6
5
|
* {@link https://getodk.github.io/xforms-spec/#body-attributes | body attributes}:
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnyTextRangeDefinition } from '../text/abstract/TextRangeDefinition.ts';
|
|
2
|
+
import { TextChunkExpression } from './abstract/TextChunkExpression.ts';
|
|
3
|
+
export type TextLiteralSourceNode = Attr | Text;
|
|
4
|
+
export declare class TextLiteralExpression extends TextChunkExpression<'literal'> {
|
|
5
|
+
readonly stringValue: string;
|
|
6
|
+
static from(context: AnyTextRangeDefinition, stringValue: string): TextLiteralExpression;
|
|
7
|
+
readonly source = "literal";
|
|
8
|
+
private constructor();
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnyTextRangeDefinition } from '../text/abstract/TextRangeDefinition.ts';
|
|
2
|
+
import { TextChunkExpression } from './abstract/TextChunkExpression.ts';
|
|
3
|
+
export declare class TextOutputExpression extends TextChunkExpression<'output'> {
|
|
4
|
+
static from(context: AnyTextRangeDefinition, element: Element): TextOutputExpression | null;
|
|
5
|
+
readonly source = "output";
|
|
6
|
+
private constructor();
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnyTextRangeDefinition } from '../text/abstract/TextRangeDefinition.ts';
|
|
2
|
+
import { TextChunkExpression } from './abstract/TextChunkExpression.ts';
|
|
3
|
+
export declare class TextReferenceExpression extends TextChunkExpression<'reference'> {
|
|
4
|
+
static from(context: AnyTextRangeDefinition, refExpression: string): TextReferenceExpression;
|
|
5
|
+
readonly source = "reference";
|
|
6
|
+
private constructor();
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AnyTextRangeDefinition } from '../text/abstract/TextRangeDefinition.ts';
|
|
2
|
+
import { TextChunkExpression } from './abstract/TextChunkExpression.ts';
|
|
3
|
+
export declare class TextTranslationExpression extends TextChunkExpression<'translation'> {
|
|
4
|
+
static fromMessage(context: AnyTextRangeDefinition, maybeExpression: string): TextTranslationExpression | null;
|
|
5
|
+
static from(context: AnyTextRangeDefinition, maybeExpression: string): TextTranslationExpression | null;
|
|
6
|
+
readonly source = "translation";
|
|
7
|
+
private constructor();
|
|
8
|
+
}
|