@getodk/xforms-engine 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/client/BaseNode.d.ts +4 -0
- package/dist/client/BaseValueNode.d.ts +1 -1
- package/dist/client/GroupNode.d.ts +1 -0
- package/dist/client/InputNode.d.ts +32 -3
- package/dist/client/ModelValueNode.d.ts +1 -0
- package/dist/client/NoteNode.d.ts +24 -7
- package/dist/client/RangeNode.d.ts +36 -0
- package/dist/client/RankNode.d.ts +46 -0
- package/dist/client/RootNode.d.ts +6 -3
- package/dist/client/SelectNode.d.ts +47 -25
- package/dist/client/SubtreeNode.d.ts +1 -0
- package/dist/client/TriggerNode.d.ts +10 -6
- package/dist/client/hierarchy.d.ts +5 -5
- package/dist/client/node-types.d.ts +2 -2
- package/dist/client/unsupported/UnsupportedControlNode.d.ts +1 -3
- package/dist/error/RankMissingValueError.d.ts +3 -0
- package/dist/error/RankValueTypeError.d.ts +6 -0
- package/dist/error/SelectValueTypeError.d.ts +15 -0
- package/dist/error/XFormsSpecViolationError.d.ts +2 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.js +5604 -4666
- package/dist/index.js.map +1 -1
- package/dist/instance/Group.d.ts +1 -0
- package/dist/instance/InputControl.d.ts +5 -3
- package/dist/instance/ModelValue.d.ts +2 -0
- package/dist/instance/Note.d.ts +13 -25
- package/dist/instance/PrimaryInstance.d.ts +1 -0
- package/dist/instance/RangeControl.d.ts +34 -0
- package/dist/instance/RankControl.d.ts +40 -0
- package/dist/instance/Root.d.ts +1 -0
- package/dist/instance/SelectControl.d.ts +66 -0
- package/dist/instance/Subtree.d.ts +1 -0
- package/dist/instance/TriggerControl.d.ts +9 -22
- package/dist/instance/abstract/DescendantNode.d.ts +1 -2
- package/dist/instance/abstract/InstanceNode.d.ts +3 -1
- package/dist/instance/abstract/UnsupportedControl.d.ts +1 -0
- package/dist/instance/abstract/ValueNode.d.ts +0 -1
- package/dist/instance/hierarchy.d.ts +9 -9
- package/dist/instance/internal-api/InstanceValueContext.d.ts +2 -0
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableLeafNode.d.ts +2 -1
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableParentNode.d.ts +2 -1
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableValueNode.d.ts +2 -1
- package/dist/instance/repeat/BaseRepeatRange.d.ts +1 -0
- package/dist/instance/repeat/RepeatInstance.d.ts +1 -0
- package/dist/integration/xpath/adapter/names.d.ts +1 -11
- package/dist/integration/xpath/adapter/traversal.d.ts +10 -9
- package/dist/integration/xpath/static-dom/StaticAttribute.d.ts +10 -3
- package/dist/integration/xpath/static-dom/StaticDocument.d.ts +0 -1
- package/dist/integration/xpath/static-dom/StaticElement.d.ts +12 -4
- package/dist/lib/client-reactivity/submission/createRootSubmissionState.d.ts +3 -0
- package/dist/lib/codecs/Geopoint/Geopoint.d.ts +48 -0
- package/dist/lib/codecs/Geopoint/GeopointValueCodec.d.ts +5 -0
- package/dist/lib/codecs/NoteCodec.d.ts +8 -0
- package/dist/lib/codecs/RangeCodec.d.ts +8 -0
- package/dist/lib/codecs/TriggerCodec.d.ts +7 -0
- package/dist/lib/codecs/ValueArrayCodec.d.ts +11 -0
- package/dist/lib/codecs/ValueCodec.d.ts +2 -2
- package/dist/lib/codecs/getNoteCodec.d.ts +3 -0
- package/dist/lib/codecs/getSelectCodec.d.ts +5 -0
- package/dist/lib/codecs/getSharedValueCodec.d.ts +3 -2
- package/dist/lib/codecs/items/BaseItemCodec.d.ts +9 -0
- package/dist/lib/codecs/items/MultipleValueItemCodec.d.ts +14 -0
- package/dist/lib/codecs/items/SingleValueItemCodec.d.ts +24 -0
- package/dist/lib/dom/query.d.ts +1 -2
- package/dist/lib/names/NamespaceDeclaration.d.ts +45 -0
- package/dist/lib/names/NamespaceDeclarationMap.d.ts +137 -0
- package/dist/lib/names/NamespaceURL.d.ts +30 -0
- package/dist/lib/names/QualifiedName.d.ts +113 -0
- package/dist/lib/number-parsers.d.ts +2 -0
- package/dist/lib/reactivity/createItemCollection.d.ts +21 -0
- package/dist/lib/xml-serialization.d.ts +11 -2
- package/dist/parse/XFormDOM.d.ts +1 -1
- package/dist/parse/body/BodyDefinition.d.ts +2 -2
- package/dist/parse/body/appearance/rangeAppearanceParser.d.ts +3 -0
- package/dist/parse/body/control/InputControlDefinition.d.ts +3 -0
- package/dist/parse/body/control/ItemDefinition.d.ts +14 -0
- package/dist/parse/body/control/ItemsetDefinition.d.ts +18 -0
- package/dist/parse/body/control/RangeControlDefinition.d.ts +31 -2
- package/dist/parse/body/control/RankControlDefinition.d.ts +7 -3
- package/dist/parse/body/control/{select/SelectDefinition.d.ts → SelectControlDefinition.d.ts} +9 -9
- package/dist/parse/expression/ItemsetNodesetExpression.d.ts +1 -1
- package/dist/parse/expression/ItemsetValueExpression.d.ts +1 -1
- package/dist/parse/model/BindDefinition.d.ts +3 -1
- package/dist/parse/model/BindPreloadDefinition.d.ts +42 -0
- package/dist/parse/model/DescendentNodeDefinition.d.ts +4 -13
- package/dist/parse/model/ItextTranslation/ItextTranslationRootDefinition.d.ts +2 -1
- package/dist/parse/model/LeafNodeDefinition.d.ts +7 -4
- package/dist/parse/model/ModelBindMap.d.ts +1 -1
- package/dist/parse/model/NodeDefinition.d.ts +16 -19
- package/dist/parse/model/NoteNodeDefinition.d.ts +6 -5
- package/dist/parse/model/RangeNodeDefinition.d.ts +41 -0
- package/dist/parse/model/RepeatInstanceDefinition.d.ts +7 -4
- package/dist/parse/model/RepeatRangeDefinition.d.ts +7 -4
- package/dist/parse/model/RepeatTemplateDefinition.d.ts +7 -4
- package/dist/parse/model/RootAttributeDefinition.d.ts +24 -0
- package/dist/parse/model/RootAttributeMap.d.ts +23 -0
- package/dist/parse/model/RootDefinition.d.ts +9 -7
- package/dist/parse/model/SubtreeDefinition.d.ts +7 -4
- package/dist/parse/shared/parseStaticDocumentFromDOMSubtree.d.ts +2 -3
- package/dist/parse/text/ItemLabelDefinition.d.ts +1 -1
- package/dist/parse/text/ItemsetLabelDefinition.d.ts +2 -2
- package/dist/parse/text/abstract/TextElementDefinition.d.ts +1 -1
- package/dist/parse/xpath/semantic-analysis.d.ts +1 -3
- package/dist/solid.js +5603 -4665
- package/dist/solid.js.map +1 -1
- package/package.json +15 -12
- package/src/client/BaseNode.ts +5 -0
- package/src/client/BaseValueNode.ts +1 -1
- package/src/client/GroupNode.ts +1 -0
- package/src/client/InputNode.ts +38 -2
- package/src/client/ModelValueNode.ts +1 -0
- package/src/client/NoteNode.ts +43 -7
- package/src/client/RangeNode.ts +51 -0
- package/src/client/RankNode.ts +54 -0
- package/src/client/RootNode.ts +11 -5
- package/src/client/SelectNode.ts +53 -26
- package/src/client/SubtreeNode.ts +1 -0
- package/src/client/TriggerNode.ts +12 -6
- package/src/client/hierarchy.ts +7 -8
- package/src/client/node-types.ts +1 -1
- package/src/client/unsupported/UnsupportedControlNode.ts +2 -6
- package/src/error/RankMissingValueError.ts +5 -0
- package/src/error/RankValueTypeError.ts +13 -0
- package/src/error/SelectValueTypeError.ts +22 -0
- package/src/error/XFormsSpecViolationError.ts +1 -0
- package/src/index.ts +2 -12
- package/src/instance/Group.ts +1 -0
- package/src/instance/InputControl.ts +42 -2
- package/src/instance/ModelValue.ts +2 -0
- package/src/instance/Note.ts +34 -59
- package/src/instance/PrimaryInstance.ts +1 -0
- package/src/instance/RangeControl.ts +113 -0
- package/src/instance/RankControl.ts +199 -0
- package/src/instance/Root.ts +3 -2
- package/src/instance/SelectControl.ts +219 -0
- package/src/instance/Subtree.ts +1 -0
- package/src/instance/TriggerControl.ts +36 -75
- package/src/instance/abstract/DescendantNode.ts +1 -6
- package/src/instance/abstract/InstanceNode.ts +10 -2
- package/src/instance/abstract/UnsupportedControl.ts +1 -0
- package/src/instance/abstract/ValueNode.ts +3 -2
- package/src/instance/children.ts +71 -30
- package/src/instance/hierarchy.ts +21 -16
- package/src/instance/internal-api/InstanceValueContext.ts +2 -0
- package/src/instance/internal-api/submission/ClientReactiveSubmittableLeafNode.ts +2 -1
- package/src/instance/internal-api/submission/ClientReactiveSubmittableParentNode.ts +2 -1
- package/src/instance/internal-api/submission/ClientReactiveSubmittableValueNode.ts +2 -1
- package/src/instance/repeat/BaseRepeatRange.ts +2 -0
- package/src/instance/repeat/RepeatInstance.ts +1 -0
- package/src/instance/resource.ts +4 -1
- package/src/integration/xpath/adapter/names.ts +66 -17
- package/src/integration/xpath/adapter/traversal.ts +10 -9
- package/src/integration/xpath/static-dom/StaticAttribute.ts +15 -7
- package/src/integration/xpath/static-dom/StaticDocument.ts +0 -2
- package/src/integration/xpath/static-dom/StaticElement.ts +21 -8
- package/src/lib/client-reactivity/submission/createLeafNodeSubmissionState.ts +1 -1
- package/src/lib/client-reactivity/submission/createParentNodeSubmissionState.ts +1 -1
- package/src/lib/client-reactivity/submission/createRootSubmissionState.ts +19 -0
- package/src/lib/client-reactivity/submission/createValueNodeSubmissionState.ts +2 -2
- package/src/lib/codecs/Geopoint/Geopoint.ts +150 -0
- package/src/lib/codecs/Geopoint/GeopointValueCodec.ts +20 -0
- package/src/lib/codecs/NoteCodec.ts +32 -0
- package/src/lib/codecs/RangeCodec.ts +65 -0
- package/src/lib/codecs/TriggerCodec.ts +64 -0
- package/src/lib/codecs/ValueArrayCodec.ts +42 -0
- package/src/lib/codecs/ValueCodec.ts +2 -2
- package/src/lib/codecs/getNoteCodec.ts +27 -0
- package/src/lib/codecs/getSelectCodec.ts +27 -0
- package/src/lib/codecs/getSharedValueCodec.ts +5 -3
- package/src/lib/codecs/items/BaseItemCodec.ts +20 -0
- package/src/lib/codecs/items/MultipleValueItemCodec.ts +28 -0
- package/src/lib/codecs/items/SingleValueItemCodec.ts +67 -0
- package/src/lib/dom/query.ts +1 -2
- package/src/lib/names/NamespaceDeclaration.ts +106 -0
- package/src/lib/names/NamespaceDeclarationMap.ts +228 -0
- package/src/lib/names/NamespaceURL.ts +44 -0
- package/src/lib/names/QualifiedName.ts +170 -0
- package/src/lib/number-parsers.ts +25 -0
- package/src/lib/reactivity/createInstanceValueState.ts +50 -0
- package/src/lib/reactivity/{createSelectItems.ts → createItemCollection.ts} +41 -36
- package/src/lib/xml-serialization.ts +76 -9
- package/src/parse/XFormDOM.ts +141 -21
- package/src/parse/XFormDefinition.ts +1 -4
- package/src/parse/body/BodyDefinition.ts +4 -4
- package/src/parse/body/appearance/rangeAppearanceParser.ts +11 -0
- package/src/parse/body/control/InputControlDefinition.ts +9 -0
- package/src/parse/body/control/{select/ItemDefinition.ts → ItemDefinition.ts} +8 -6
- package/src/parse/body/control/{select/ItemsetDefinition.ts → ItemsetDefinition.ts} +11 -9
- package/src/parse/body/control/RangeControlDefinition.ts +91 -6
- package/src/parse/body/control/RankControlDefinition.ts +25 -7
- package/src/parse/body/control/{select/SelectDefinition.ts → SelectControlDefinition.ts} +9 -9
- package/src/parse/expression/ItemsetNodesetExpression.ts +1 -1
- package/src/parse/expression/ItemsetValueExpression.ts +1 -1
- package/src/parse/model/BindDefinition.ts +4 -0
- package/src/parse/model/BindPreloadDefinition.ts +100 -0
- package/src/parse/model/DescendentNodeDefinition.ts +7 -25
- package/src/parse/model/ItextTranslation/ItextTranslationRootDefinition.ts +2 -1
- package/src/parse/model/LeafNodeDefinition.ts +11 -4
- package/src/parse/model/NodeDefinition.ts +24 -45
- package/src/parse/model/NoteNodeDefinition.ts +8 -7
- package/src/parse/model/RangeNodeDefinition.ts +118 -0
- package/src/parse/model/RepeatInstanceDefinition.ts +11 -7
- package/src/parse/model/RepeatRangeDefinition.ts +11 -7
- package/src/parse/model/RepeatTemplateDefinition.ts +11 -7
- package/src/parse/model/RootAttributeDefinition.ts +45 -0
- package/src/parse/model/RootAttributeMap.ts +44 -0
- package/src/parse/model/RootDefinition.ts +29 -28
- package/src/parse/model/SecondaryInstance/sources/GeoJSONExternalSecondaryInstance.ts +1 -0
- package/src/parse/model/SubtreeDefinition.ts +12 -12
- package/src/parse/shared/parseStaticDocumentFromDOMSubtree.ts +3 -3
- package/src/parse/text/ItemLabelDefinition.ts +1 -1
- package/src/parse/text/ItemsetLabelDefinition.ts +2 -2
- package/src/parse/text/abstract/TextElementDefinition.ts +1 -1
- package/src/parse/xpath/semantic-analysis.ts +4 -3
- package/dist/client/unsupported/RangeNode.d.ts +0 -9
- package/dist/client/unsupported/RankNode.d.ts +0 -9
- package/dist/instance/SelectField.d.ts +0 -58
- package/dist/instance/unsupported/RangeControl.d.ts +0 -6
- package/dist/instance/unsupported/RankControl.d.ts +0 -6
- package/dist/integration/xpath/static-dom/StaticNamedNode.d.ts +0 -17
- package/dist/lib/reactivity/createSelectItems.d.ts +0 -16
- package/dist/parse/body/control/select/ItemDefinition.d.ts +0 -13
- package/dist/parse/body/control/select/ItemsetDefinition.d.ts +0 -17
- package/dist/parse/body/control/select/ItemsetNodesetContext.d.ts +0 -9
- package/src/client/unsupported/RangeNode.ts +0 -14
- package/src/client/unsupported/RankNode.ts +0 -14
- package/src/instance/SelectField.ts +0 -263
- package/src/instance/unsupported/RangeControl.ts +0 -9
- package/src/instance/unsupported/RankControl.ts +0 -9
- package/src/integration/xpath/static-dom/StaticNamedNode.ts +0 -45
- package/src/parse/body/control/select/ItemsetNodesetContext.ts +0 -21
package/dist/instance/Group.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export declare class Group extends DescendantNode<GroupDefinition, GroupStateSpe
|
|
|
28
28
|
protected engineState: EngineState<GroupStateSpec>;
|
|
29
29
|
readonly nodeType = "group";
|
|
30
30
|
readonly appearances: GroupNodeAppearances;
|
|
31
|
+
readonly nodeOptions: null;
|
|
31
32
|
readonly currentState: MaterializedChildren<CurrentState<GroupStateSpec>, GeneralChildNode>;
|
|
32
33
|
readonly validationState: AncestorNodeValidationState;
|
|
33
34
|
readonly submissionState: SubmissionState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
2
|
import { Accessor } from 'solid-js';
|
|
3
|
-
import { InputDefinition, InputNode, InputNodeAppearances, InputNodeInputValue } from '../client/InputNode.ts';
|
|
3
|
+
import { InputDefinition, InputNode, InputNodeAppearances, InputNodeInputValue, InputNodeOptions } from '../client/InputNode.ts';
|
|
4
4
|
import { TextRange } from '../client/TextRange.ts';
|
|
5
5
|
import { ValueType } from '../client/ValueType.ts';
|
|
6
6
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
@@ -8,18 +8,19 @@ import { RuntimeInputValue, RuntimeValue } from '../lib/codecs/getSharedValueCod
|
|
|
8
8
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
9
9
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
10
10
|
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
11
|
-
import { Root } from './Root.ts';
|
|
12
11
|
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
13
12
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
14
13
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
15
|
-
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
16
14
|
import { ClientReactiveSubmittableValueNode } from './internal-api/submission/ClientReactiveSubmittableValueNode.ts';
|
|
15
|
+
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
16
|
+
import { Root } from './Root.ts';
|
|
17
17
|
export type AnyInputDefinition = {
|
|
18
18
|
[V in ValueType]: InputDefinition<V>;
|
|
19
19
|
}[ValueType];
|
|
20
20
|
interface InputControlStateSpec<V extends ValueType> extends ValueNodeStateSpec<RuntimeValue<V>> {
|
|
21
21
|
readonly label: Accessor<TextRange<'label'> | null>;
|
|
22
22
|
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
23
|
+
readonly valueOptions: null;
|
|
23
24
|
}
|
|
24
25
|
export declare class InputControl<V extends ValueType = ValueType> extends ValueNode<V, InputDefinition<V>, RuntimeValue<V>, RuntimeInputValue<V>> implements InputNode<V>, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSubmittableValueNode {
|
|
25
26
|
static from(parent: GeneralParentNode, definition: InputDefinition): AnyInputControl;
|
|
@@ -28,6 +29,7 @@ export declare class InputControl<V extends ValueType = ValueType> extends Value
|
|
|
28
29
|
protected readonly engineState: EngineState<InputControlStateSpec<V>>;
|
|
29
30
|
readonly nodeType = "input";
|
|
30
31
|
readonly appearances: InputNodeAppearances;
|
|
32
|
+
readonly nodeOptions: InputNodeOptions<V>;
|
|
31
33
|
readonly currentState: CurrentState<InputControlStateSpec<V>>;
|
|
32
34
|
constructor(parent: GeneralParentNode, definition: InputDefinition<V>);
|
|
33
35
|
setValue(value: InputNodeInputValue<V>): Root;
|
|
@@ -14,6 +14,7 @@ import { ClientReactiveSubmittableValueNode } from './internal-api/submission/Cl
|
|
|
14
14
|
interface ModelValueStateSpec<V extends ValueType> extends ValueNodeStateSpec<RuntimeValue<V>> {
|
|
15
15
|
readonly label: null;
|
|
16
16
|
readonly hint: null;
|
|
17
|
+
readonly valueOptions: null;
|
|
17
18
|
}
|
|
18
19
|
export declare class ModelValue<V extends ValueType = ValueType> extends ValueNode<V, ModelValueDefinition<V>, RuntimeValue<V>, RuntimeInputValue<V>> implements ModelValueNode<V>, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSubmittableValueNode {
|
|
19
20
|
static from(parent: GeneralParentNode, definition: ModelValueDefinition): AnyModelValue;
|
|
@@ -22,6 +23,7 @@ export declare class ModelValue<V extends ValueType = ValueType> extends ValueNo
|
|
|
22
23
|
protected readonly engineState: EngineState<ModelValueStateSpec<V>>;
|
|
23
24
|
readonly nodeType = "model-value";
|
|
24
25
|
readonly appearances: null;
|
|
26
|
+
readonly nodeOptions: null;
|
|
25
27
|
readonly currentState: CurrentState<ModelValueStateSpec<V>>;
|
|
26
28
|
constructor(parent: GeneralParentNode, definition: ModelValueDefinition<V>);
|
|
27
29
|
}
|
package/dist/instance/Note.d.ts
CHANGED
|
@@ -1,48 +1,36 @@
|
|
|
1
1
|
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
2
|
import { Accessor } from 'solid-js';
|
|
3
|
-
import { NoteNode, NoteNodeAppearances } from '../client/NoteNode.ts';
|
|
4
|
-
import { SubmissionState } from '../client/submission/SubmissionState.ts';
|
|
3
|
+
import { NoteNode, NoteNodeAppearances, NoteValue } from '../client/NoteNode.ts';
|
|
5
4
|
import { TextRange } from '../client/TextRange.ts';
|
|
6
|
-
import {
|
|
5
|
+
import { ValueType } from '../client/ValueType.ts';
|
|
7
6
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
7
|
+
import { NoteInputValue, NoteRuntimeValue } from '../lib/codecs/NoteCodec.ts';
|
|
8
8
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
9
9
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
10
10
|
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
11
11
|
import { ComputedNoteText } from '../lib/reactivity/text/createNoteText.ts';
|
|
12
|
-
import { SimpleAtomicState } from '../lib/reactivity/types.ts';
|
|
13
12
|
import { NoteNodeDefinition } from '../parse/model/NoteNodeDefinition.ts';
|
|
14
|
-
import {
|
|
13
|
+
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
15
14
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
16
15
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
17
|
-
import {
|
|
16
|
+
import { ClientReactiveSubmittableValueNode } from './internal-api/submission/ClientReactiveSubmittableValueNode.ts';
|
|
18
17
|
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
19
|
-
|
|
20
|
-
interface NoteStateSpec extends DescendantNodeStateSpec<string> {
|
|
18
|
+
interface NoteStateSpec<V extends ValueType> extends ValueNodeStateSpec<NoteValue<V>> {
|
|
21
19
|
readonly readonly: Accessor<true>;
|
|
22
20
|
readonly noteText: ComputedNoteText;
|
|
23
21
|
readonly label: Accessor<TextRange<'label', 'form'> | null>;
|
|
24
22
|
readonly hint: Accessor<TextRange<'hint', 'form'> | null>;
|
|
25
|
-
readonly children: null;
|
|
26
|
-
readonly value: SimpleAtomicState<string>;
|
|
27
23
|
readonly valueOptions: null;
|
|
28
24
|
}
|
|
29
|
-
export declare class Note extends
|
|
30
|
-
private readonly validation;
|
|
25
|
+
export declare class Note<V extends ValueType = ValueType> extends ValueNode<V, NoteNodeDefinition<V>, NoteRuntimeValue<V>, NoteInputValue<V>> implements NoteNode, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSubmittableValueNode {
|
|
31
26
|
readonly [XPathNodeKindKey] = "element";
|
|
32
|
-
protected readonly state: SharedNodeState<NoteStateSpec
|
|
33
|
-
protected readonly engineState: EngineState<NoteStateSpec
|
|
27
|
+
protected readonly state: SharedNodeState<NoteStateSpec<V>>;
|
|
28
|
+
protected readonly engineState: EngineState<NoteStateSpec<V>>;
|
|
34
29
|
readonly nodeType = "note";
|
|
35
30
|
readonly appearances: NoteNodeAppearances;
|
|
36
|
-
readonly
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
readonly contextNode: this;
|
|
40
|
-
readonly encodeValue: (value: string) => string;
|
|
41
|
-
readonly decodeValue: (value: string) => string;
|
|
42
|
-
constructor(parent: GeneralParentNode, definition: NoteNodeDefinition);
|
|
43
|
-
getXPathValue(): string;
|
|
44
|
-
getViolation(): AnyViolation | null;
|
|
45
|
-
isBlank(): boolean;
|
|
46
|
-
getChildren(): readonly [];
|
|
31
|
+
readonly nodeOptions: null;
|
|
32
|
+
readonly currentState: CurrentState<NoteStateSpec<V>>;
|
|
33
|
+
constructor(parent: GeneralParentNode, definition: NoteNodeDefinition<V>);
|
|
47
34
|
}
|
|
35
|
+
export type AnyNote = Note<'barcode'> | Note<'binary'> | Note<'boolean'> | Note<'date'> | Note<'dateTime'> | Note<'decimal'> | Note<'geopoint'> | Note<'geoshape'> | Note<'geotrace'> | Note<'int'> | Note<'intent'> | Note<'string'> | Note<'time'>;
|
|
48
36
|
export {};
|
|
@@ -48,6 +48,7 @@ export declare class PrimaryInstance extends InstanceNode<RootDefinition, Primar
|
|
|
48
48
|
readonly [XPathNodeKindKey] = "document";
|
|
49
49
|
readonly nodeType = "primary-instance";
|
|
50
50
|
readonly appearances: null;
|
|
51
|
+
readonly nodeOptions: null;
|
|
51
52
|
readonly classes: BodyClassList;
|
|
52
53
|
readonly root: Root;
|
|
53
54
|
readonly currentState: MaterializedChildren<CurrentState<PrimaryInstanceStateSpec>, Root>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
|
+
import { Accessor } from 'solid-js';
|
|
3
|
+
import { RangeInputValue, RangeNode, RangeNodeAppearances, RangeValue } from '../client/RangeNode.ts';
|
|
4
|
+
import { TextRange } from '../client/TextRange.ts';
|
|
5
|
+
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.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 { AnyRangeNodeDefinition, RangeNodeDefinition, RangeValueType } from '../parse/model/RangeNodeDefinition.ts';
|
|
10
|
+
import { Root } from './Root.ts';
|
|
11
|
+
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
12
|
+
import { GeneralParentNode } from './hierarchy.ts';
|
|
13
|
+
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
14
|
+
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
15
|
+
import { ClientReactiveSubmittableValueNode } from './internal-api/submission/ClientReactiveSubmittableValueNode.ts';
|
|
16
|
+
interface RangeControlStateSpec<V extends RangeValueType> extends ValueNodeStateSpec<RangeValue<V>> {
|
|
17
|
+
readonly label: Accessor<TextRange<'label'> | null>;
|
|
18
|
+
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
19
|
+
readonly valueOptions: null;
|
|
20
|
+
}
|
|
21
|
+
export declare class RangeControl<V extends RangeValueType = RangeValueType> extends ValueNode<V, RangeNodeDefinition<V>, RangeValue<V>, RangeInputValue<V>> implements RangeNode<V>, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSubmittableValueNode {
|
|
22
|
+
static from(parent: GeneralParentNode, definition: AnyRangeNodeDefinition): AnyRangeControl;
|
|
23
|
+
readonly [XPathNodeKindKey] = "element";
|
|
24
|
+
protected readonly state: SharedNodeState<RangeControlStateSpec<V>>;
|
|
25
|
+
protected readonly engineState: EngineState<RangeControlStateSpec<V>>;
|
|
26
|
+
readonly nodeType = "range";
|
|
27
|
+
readonly appearances: RangeNodeAppearances;
|
|
28
|
+
readonly nodeOptions: null;
|
|
29
|
+
readonly currentState: CurrentState<RangeControlStateSpec<V>>;
|
|
30
|
+
constructor(parent: GeneralParentNode, definition: RangeNodeDefinition<V>);
|
|
31
|
+
setValue(value: RangeInputValue<V>): Root;
|
|
32
|
+
}
|
|
33
|
+
export type AnyRangeControl = RangeControl<'decimal'> | RangeControl<'int'>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
|
+
import { Accessor } from 'solid-js';
|
|
3
|
+
import { RankDefinition, RankNode, RankValueOptions } from '../client/RankNode.ts';
|
|
4
|
+
import { TextRange } from '../client/TextRange.ts';
|
|
5
|
+
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.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 { Root } from './Root.ts';
|
|
10
|
+
import { ValueNodeStateSpec, ValueNode } from './abstract/ValueNode.ts';
|
|
11
|
+
import { GeneralParentNode } from './hierarchy.ts';
|
|
12
|
+
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
13
|
+
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
14
|
+
import { ClientReactiveSubmittableValueNode } from './internal-api/submission/ClientReactiveSubmittableValueNode.ts';
|
|
15
|
+
import { UnknownAppearanceDefinition } from '../parse/body/appearance/unknownAppearanceParser.ts';
|
|
16
|
+
import { ValueType } from '../client/ValueType.ts';
|
|
17
|
+
export type AnyRankDefinition = {
|
|
18
|
+
[V in ValueType]: RankDefinition<V>;
|
|
19
|
+
}[ValueType];
|
|
20
|
+
interface RankControlStateSpec extends ValueNodeStateSpec<readonly string[]> {
|
|
21
|
+
readonly label: Accessor<TextRange<'label'> | null>;
|
|
22
|
+
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
23
|
+
readonly valueOptions: Accessor<RankValueOptions>;
|
|
24
|
+
}
|
|
25
|
+
export declare class RankControl extends ValueNode<'string', RankDefinition<'string'>, readonly string[], readonly string[]> implements RankNode, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSubmittableValueNode {
|
|
26
|
+
static from(parent: GeneralParentNode, definition: RankDefinition): RankControl;
|
|
27
|
+
private readonly mapOptionsByValue;
|
|
28
|
+
protected readonly getInstanceValue: Accessor<string>;
|
|
29
|
+
readonly [XPathNodeKindKey] = "element";
|
|
30
|
+
protected readonly state: SharedNodeState<RankControlStateSpec>;
|
|
31
|
+
protected readonly engineState: EngineState<RankControlStateSpec>;
|
|
32
|
+
readonly nodeType = "rank";
|
|
33
|
+
readonly appearances: UnknownAppearanceDefinition;
|
|
34
|
+
readonly nodeOptions: null;
|
|
35
|
+
readonly currentState: CurrentState<RankControlStateSpec>;
|
|
36
|
+
private constructor();
|
|
37
|
+
getValueLabel(value: string): TextRange<'item-label'> | null;
|
|
38
|
+
setValues(valuesInOrder: readonly string[]): Root;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
package/dist/instance/Root.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare class Root extends DescendantNode<RootDefinition, RootStateSpec,
|
|
|
47
47
|
readonly isRequired: () => boolean;
|
|
48
48
|
readonly nodeType = "root";
|
|
49
49
|
readonly appearances: null;
|
|
50
|
+
readonly nodeOptions: null;
|
|
50
51
|
readonly classes: BodyClassList;
|
|
51
52
|
readonly currentState: MaterializedChildren<CurrentState<RootStateSpec>, GeneralChildNode>;
|
|
52
53
|
readonly validationState: AncestorNodeValidationState;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
|
+
import { Accessor } from 'solid-js';
|
|
3
|
+
import { SelectDefinition, SelectItem, SelectNode, SelectNodeAppearances, SelectValueOptions } from '../client/SelectNode.ts';
|
|
4
|
+
import { TextRange } from '../client/TextRange.ts';
|
|
5
|
+
import { ValueType } from '../client/ValueType.ts';
|
|
6
|
+
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
7
|
+
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
8
|
+
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
9
|
+
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
10
|
+
import { SelectType } from '../parse/body/control/SelectControlDefinition.ts';
|
|
11
|
+
import { Root } from './Root.ts';
|
|
12
|
+
import { ValueNodeStateSpec, ValueNode } from './abstract/ValueNode.ts';
|
|
13
|
+
import { GeneralParentNode } from './hierarchy.ts';
|
|
14
|
+
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
15
|
+
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
16
|
+
import { ClientReactiveSubmittableValueNode } from './internal-api/submission/ClientReactiveSubmittableValueNode.ts';
|
|
17
|
+
export type AnySelectDefinition = {
|
|
18
|
+
[V in ValueType]: SelectDefinition<V>;
|
|
19
|
+
}[ValueType];
|
|
20
|
+
interface SelectControlStateSpec extends ValueNodeStateSpec<readonly string[]> {
|
|
21
|
+
readonly label: Accessor<TextRange<'label'> | null>;
|
|
22
|
+
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
23
|
+
readonly valueOptions: Accessor<SelectValueOptions>;
|
|
24
|
+
}
|
|
25
|
+
export declare class SelectControl extends ValueNode<'string', SelectDefinition<'string'>, readonly string[], readonly string[]> implements SelectNode, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSubmittableValueNode {
|
|
26
|
+
static from(parent: GeneralParentNode, definition: SelectDefinition): SelectControl;
|
|
27
|
+
private readonly mapOptionsByValue;
|
|
28
|
+
protected readonly getInstanceValue: Accessor<string>;
|
|
29
|
+
readonly [XPathNodeKindKey] = "element";
|
|
30
|
+
protected readonly state: SharedNodeState<SelectControlStateSpec>;
|
|
31
|
+
protected readonly engineState: EngineState<SelectControlStateSpec>;
|
|
32
|
+
readonly nodeType = "select";
|
|
33
|
+
readonly selectType: SelectType;
|
|
34
|
+
readonly appearances: SelectNodeAppearances;
|
|
35
|
+
readonly nodeOptions: null;
|
|
36
|
+
readonly currentState: CurrentState<SelectControlStateSpec>;
|
|
37
|
+
private constructor();
|
|
38
|
+
/**
|
|
39
|
+
* Filters {@link values} to include only those values which are currently
|
|
40
|
+
* available in the mapping produced by {@link mapOptionsByValue}, i.e. within
|
|
41
|
+
* a potentially filtered itemset.
|
|
42
|
+
*
|
|
43
|
+
* Note: this method effectively produces an intersection of
|
|
44
|
+
* {@link sourceValues} and {@link values}. **Importantly**, ordering of the
|
|
45
|
+
* results is deterministic, preserving the order of values as yielded _by
|
|
46
|
+
* {@link sourceValues}_.
|
|
47
|
+
*
|
|
48
|
+
* At time of writing, there are several tests (in `@getodk/scenario`, ported
|
|
49
|
+
* from JavaRosa) which expect the values of a `<select>` to match the order
|
|
50
|
+
* they appear in the control's (potentially filtered) `<itemset>` (or list of
|
|
51
|
+
* `<item>`s, for forms defining those inline).
|
|
52
|
+
*
|
|
53
|
+
* @todo The `<odk:rank>` control, having semantics very similar to
|
|
54
|
+
* `<select>`, will likely perform similar filtering logic. However, one of
|
|
55
|
+
* the important distinctions between these controls is that `<odk:rank>`
|
|
56
|
+
* exists explicitly to control the order of values. It's quite likely that
|
|
57
|
+
* would be achieved by invoking the same logic with the parameter order
|
|
58
|
+
* reversed.
|
|
59
|
+
*/
|
|
60
|
+
private filterValues;
|
|
61
|
+
getValueOption(value: string): SelectItem | null;
|
|
62
|
+
isSelected(value: string): boolean;
|
|
63
|
+
selectValue(value: string | null): Root;
|
|
64
|
+
selectValues(values: readonly string[]): Root;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -27,6 +27,7 @@ export declare class Subtree extends DescendantNode<SubtreeDefinition, SubtreeSt
|
|
|
27
27
|
protected readonly engineState: EngineState<SubtreeStateSpec>;
|
|
28
28
|
readonly nodeType = "subtree";
|
|
29
29
|
readonly appearances: null;
|
|
30
|
+
readonly nodeOptions: null;
|
|
30
31
|
readonly currentState: MaterializedChildren<CurrentState<SubtreeStateSpec>, GeneralChildNode>;
|
|
31
32
|
readonly validationState: AncestorNodeValidationState;
|
|
32
33
|
readonly submissionState: SubmissionState;
|
|
@@ -2,46 +2,33 @@ import { XPathNodeKindKey } from '@getodk/xpath';
|
|
|
2
2
|
import { Accessor } from 'solid-js';
|
|
3
3
|
import { TextRange } from '../client/TextRange.ts';
|
|
4
4
|
import { TriggerNode, TriggerNodeDefinition } from '../client/TriggerNode.ts';
|
|
5
|
-
import { SubmissionState } from '../client/submission/SubmissionState.ts';
|
|
6
|
-
import { AnyViolation, LeafNodeValidationState } from '../client/validation.ts';
|
|
7
5
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
6
|
+
import { TriggerInputValue, TriggerRuntimeValue } from '../lib/codecs/TriggerCodec.ts';
|
|
8
7
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
9
8
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
10
9
|
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
11
|
-
import { SimpleAtomicState } from '../lib/reactivity/types.ts';
|
|
12
10
|
import { UnknownAppearanceDefinition } from '../parse/body/appearance/unknownAppearanceParser.ts';
|
|
13
11
|
import { Root } from './Root.ts';
|
|
14
|
-
import {
|
|
12
|
+
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
15
13
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
16
14
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
17
15
|
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
interface TriggerControlStateSpec extends DescendantNodeStateSpec<boolean> {
|
|
16
|
+
import { ClientReactiveSubmittableValueNode } from './internal-api/submission/ClientReactiveSubmittableValueNode.ts';
|
|
17
|
+
interface TriggerControlStateSpec extends ValueNodeStateSpec<TriggerRuntimeValue> {
|
|
21
18
|
readonly label: Accessor<TextRange<'label'> | null>;
|
|
22
19
|
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
23
|
-
readonly children: null;
|
|
24
|
-
readonly value: SimpleAtomicState<boolean>;
|
|
25
20
|
readonly valueOptions: null;
|
|
26
21
|
}
|
|
27
|
-
export declare class TriggerControl extends
|
|
28
|
-
|
|
22
|
+
export declare class TriggerControl extends ValueNode<'string', TriggerNodeDefinition<'string'>, TriggerRuntimeValue, TriggerInputValue> implements TriggerNode, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSubmittableValueNode {
|
|
23
|
+
static from(parent: GeneralParentNode, definition: TriggerNodeDefinition): TriggerControl;
|
|
29
24
|
readonly [XPathNodeKindKey] = "element";
|
|
30
25
|
protected readonly state: SharedNodeState<TriggerControlStateSpec>;
|
|
31
26
|
protected readonly engineState: EngineState<TriggerControlStateSpec>;
|
|
32
27
|
readonly nodeType = "trigger";
|
|
33
28
|
readonly appearances: UnknownAppearanceDefinition;
|
|
29
|
+
readonly nodeOptions: null;
|
|
34
30
|
readonly currentState: CurrentState<TriggerControlStateSpec>;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
readonly contextNode: this;
|
|
38
|
-
readonly encodeValue: (runtimeValue: boolean) => string;
|
|
39
|
-
readonly decodeValue: (instanceValue: string) => boolean;
|
|
40
|
-
constructor(parent: GeneralParentNode, definition: TriggerNodeDefinition);
|
|
41
|
-
getXPathValue(): string;
|
|
42
|
-
getViolation(): AnyViolation | null;
|
|
43
|
-
isBlank(): boolean;
|
|
44
|
-
getChildren(): readonly [];
|
|
45
|
-
setValue(value: boolean): Root;
|
|
31
|
+
private constructor();
|
|
32
|
+
setValue(value: TriggerInputValue): Root;
|
|
46
33
|
}
|
|
47
34
|
export {};
|
|
@@ -6,7 +6,6 @@ import { InstanceNodeType } from '../../client/node-types.ts';
|
|
|
6
6
|
import { PrimaryInstanceXPathChildNode } from '../../integration/xpath/adapter/kind.ts';
|
|
7
7
|
import { XFormsXPathPrimaryInstanceDescendantNode, XFormsXPathPrimaryInstanceDescendantNodeKind } from '../../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
8
8
|
import { EngineXPathEvaluator } from '../../integration/xpath/EngineXPathEvaluator.ts';
|
|
9
|
-
import { AnyDescendantNodeDefinition } from '../../parse/model/DescendentNodeDefinition.ts';
|
|
10
9
|
import { AnyNodeDefinition } from '../../parse/model/NodeDefinition.ts';
|
|
11
10
|
import { AnyChildNode, AnyParentNode } from '../hierarchy.ts';
|
|
12
11
|
import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
|
|
@@ -19,7 +18,7 @@ export interface DescendantNodeSharedStateSpec {
|
|
|
19
18
|
readonly required: Accessor<boolean>;
|
|
20
19
|
}
|
|
21
20
|
export type DescendantNodeStateSpec<Value = never> = InstanceNodeStateSpec<Value> & DescendantNodeSharedStateSpec;
|
|
22
|
-
export type DescendantNodeDefinition =
|
|
21
|
+
export type DescendantNodeDefinition = AnyNodeDefinition;
|
|
23
22
|
export type AnyDescendantNode = DescendantNode<DescendantNodeDefinition, DescendantNodeStateSpec<any>, any, any>;
|
|
24
23
|
interface DescendantNodeOptions {
|
|
25
24
|
readonly computeReference?: Accessor<string>;
|
|
@@ -25,6 +25,7 @@ export type EngineInstanceNodeType = ClientInstanceNodeType | 'primary-instance'
|
|
|
25
25
|
export interface BaseEngineNode extends Omit<BaseNode, 'nodeType'> {
|
|
26
26
|
readonly nodeType: EngineInstanceNodeType;
|
|
27
27
|
}
|
|
28
|
+
export type InstanceNodeValueOptionsStateSpec = Accessor<null> | Accessor<readonly unknown[]> | null;
|
|
28
29
|
export interface InstanceNodeStateSpec<Value = never> {
|
|
29
30
|
readonly reference: Accessor<string> | string;
|
|
30
31
|
readonly readonly: Accessor<boolean> | boolean;
|
|
@@ -33,7 +34,7 @@ export interface InstanceNodeStateSpec<Value = never> {
|
|
|
33
34
|
readonly label: Accessor<TextRange<'label'> | null> | null;
|
|
34
35
|
readonly hint: Accessor<TextRange<'hint'> | null> | null;
|
|
35
36
|
readonly children: Accessor<readonly FormNodeID[]> | null;
|
|
36
|
-
readonly valueOptions:
|
|
37
|
+
readonly valueOptions: InstanceNodeValueOptionsStateSpec;
|
|
37
38
|
readonly value: Signal<Value> | SimpleAtomicState<Value> | null;
|
|
38
39
|
}
|
|
39
40
|
type AnyInstanceNode = InstanceNode<AnyNodeDefinition, InstanceNodeStateSpec<any>, any>;
|
|
@@ -85,6 +86,7 @@ export declare abstract class InstanceNode<Definition extends AnyNodeDefinition,
|
|
|
85
86
|
readonly nodeId: FormNodeID;
|
|
86
87
|
abstract readonly nodeType: EngineInstanceNodeType;
|
|
87
88
|
abstract readonly appearances: NodeAppearances<Definition>;
|
|
89
|
+
abstract readonly nodeOptions: object | null;
|
|
88
90
|
abstract readonly currentState: InstanceNodeCurrentState<Spec, Child>;
|
|
89
91
|
abstract readonly validationState: NodeValidationState;
|
|
90
92
|
abstract readonly submissionState: SubmissionState;
|
|
@@ -37,6 +37,7 @@ export declare abstract class UnsupportedControl<Type extends UnsupportedControl
|
|
|
37
37
|
protected readonly engineState: EngineState<UnsupportedControlStateSpec>;
|
|
38
38
|
abstract readonly nodeType: Type;
|
|
39
39
|
readonly appearances: UnknownAppearanceDefinition;
|
|
40
|
+
readonly nodeOptions: null;
|
|
40
41
|
readonly currentState: CurrentState<UnsupportedControlStateSpec>;
|
|
41
42
|
get validationState(): LeafNodeValidationState;
|
|
42
43
|
readonly submissionState: SubmissionState;
|
|
@@ -22,7 +22,6 @@ import { DescendantNodeStateSpec, DescendantNode } from './DescendantNode.ts';
|
|
|
22
22
|
export type ValueNodeDefinition<V extends ValueType> = LeafNodeDefinition<V>;
|
|
23
23
|
export interface ValueNodeStateSpec<RuntimeValue> extends DescendantNodeStateSpec<RuntimeValue> {
|
|
24
24
|
readonly children: null;
|
|
25
|
-
readonly valueOptions: null;
|
|
26
25
|
readonly value: SimpleAtomicState<RuntimeValue>;
|
|
27
26
|
readonly instanceValue: Accessor<string>;
|
|
28
27
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { Group } from './Group.ts';
|
|
2
2
|
import { AnyInputControl } from './InputControl.ts';
|
|
3
3
|
import { AnyModelValue } from './ModelValue.ts';
|
|
4
|
-
import {
|
|
4
|
+
import { AnyNote } from './Note.ts';
|
|
5
5
|
import { PrimaryInstance } from './PrimaryInstance.ts';
|
|
6
|
+
import { AnyRangeControl } from './RangeControl.ts';
|
|
6
7
|
import { RepeatInstance } from './repeat/RepeatInstance.ts';
|
|
7
8
|
import { RepeatRangeControlled } from './repeat/RepeatRangeControlled.ts';
|
|
8
9
|
import { RepeatRangeUncontrolled } from './repeat/RepeatRangeUncontrolled.ts';
|
|
9
10
|
import { Root } from './Root.ts';
|
|
10
|
-
import {
|
|
11
|
+
import { SelectControl } from './SelectControl.ts';
|
|
11
12
|
import { Subtree } from './Subtree.ts';
|
|
12
13
|
import { TriggerControl } from './TriggerControl.ts';
|
|
13
|
-
import {
|
|
14
|
-
import { RankControl } from './unsupported/RankControl.ts';
|
|
14
|
+
import { RankControl } from './RankControl.ts';
|
|
15
15
|
import { UploadControl } from './unsupported/UploadControl.ts';
|
|
16
16
|
export type RepeatRange = RepeatRangeControlled | RepeatRangeUncontrolled;
|
|
17
|
-
export type AnyUnsupportedControl =
|
|
18
|
-
export type AnyNode = PrimaryInstance | Root | Group | Subtree | RepeatRange | RepeatInstance |
|
|
17
|
+
export type AnyUnsupportedControl = UploadControl;
|
|
18
|
+
export type AnyNode = PrimaryInstance | Root | Group | Subtree | RepeatRange | RepeatInstance | AnyNote | AnyModelValue | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | AnyUnsupportedControl;
|
|
19
19
|
export type AnyParentNode = PrimaryInstance | Root | Group | Subtree | RepeatRange | RepeatInstance;
|
|
20
20
|
export type GeneralParentNode = Root | Group | Subtree | RepeatInstance;
|
|
21
|
-
export type AnyChildNode = Root | Group | Subtree | RepeatRange | RepeatInstance | AnyModelValue |
|
|
22
|
-
export type GeneralChildNode = Group | Subtree | RepeatRange | AnyModelValue |
|
|
23
|
-
export type AnyValueNode = AnyModelValue |
|
|
21
|
+
export type AnyChildNode = Root | Group | Subtree | RepeatRange | RepeatInstance | AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | AnyUnsupportedControl;
|
|
22
|
+
export type GeneralChildNode = Group | Subtree | RepeatRange | AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | AnyUnsupportedControl;
|
|
23
|
+
export type AnyValueNode = AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | AnyUnsupportedControl;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ReactiveScope } from '../../lib/reactivity/scope.ts';
|
|
2
2
|
import { BindComputationExpression } from '../../parse/expression/BindComputationExpression.ts';
|
|
3
|
+
import { AnyBindPreloadDefinition } from '../../parse/model/BindPreloadDefinition.ts';
|
|
3
4
|
import { EvaluationContext } from './EvaluationContext.ts';
|
|
4
5
|
export type DecodeInstanceValue = (value: string) => string;
|
|
5
6
|
interface InstanceValueContextDefinitionBind {
|
|
7
|
+
readonly preload: AnyBindPreloadDefinition | null;
|
|
6
8
|
readonly calculate: BindComputationExpression<'calculate'> | null;
|
|
7
9
|
readonly readonly: BindComputationExpression<'readonly'>;
|
|
8
10
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SubmissionState } from '../../../client/submission/SubmissionState.ts';
|
|
2
|
+
import { QualifiedName } from '../../../lib/names/QualifiedName.ts';
|
|
2
3
|
import { EscapedXMLText } from '../../../lib/xml-serialization.ts';
|
|
3
4
|
import { ClientReactiveSubmittableChildNode, ClientReactiveSubmittableParentNode } from './ClientReactiveSubmittableParentNode.ts';
|
|
4
5
|
interface ClientReactiveSubmittableLeafNodeCurrentState<RuntimeValue> {
|
|
@@ -7,7 +8,7 @@ interface ClientReactiveSubmittableLeafNodeCurrentState<RuntimeValue> {
|
|
|
7
8
|
}
|
|
8
9
|
export type SerializedSubmissionValue = string;
|
|
9
10
|
interface ClientReactiveSubmittableLeafNodeDefinition {
|
|
10
|
-
readonly
|
|
11
|
+
readonly qualifiedName: QualifiedName;
|
|
11
12
|
}
|
|
12
13
|
export interface ClientReactiveSubmittableLeafNode<RuntimeValue> {
|
|
13
14
|
readonly definition: ClientReactiveSubmittableLeafNodeDefinition;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SubmissionState } from '../../../client/submission/SubmissionState.ts';
|
|
2
|
+
import { QualifiedName } from '../../../lib/names/QualifiedName.ts';
|
|
2
3
|
export interface ClientReactiveSubmittableChildNode {
|
|
3
4
|
readonly submissionState: SubmissionState;
|
|
4
5
|
}
|
|
@@ -7,7 +8,7 @@ interface ClientReactiveSubmittableParentNodeCurrentState<Child extends ClientRe
|
|
|
7
8
|
get children(): readonly Child[];
|
|
8
9
|
}
|
|
9
10
|
export interface ClientReactiveSubmittableParentNodeDefinition {
|
|
10
|
-
readonly
|
|
11
|
+
readonly qualifiedName: QualifiedName;
|
|
11
12
|
}
|
|
12
13
|
export interface ClientReactiveSubmittableParentNode<Child extends ClientReactiveSubmittableChildNode> {
|
|
13
14
|
readonly definition: ClientReactiveSubmittableParentNodeDefinition;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SubmissionState } from '../../../client/submission/SubmissionState.ts';
|
|
2
|
+
import { QualifiedName } from '../../../lib/names/QualifiedName.ts';
|
|
2
3
|
import { ClientReactiveSubmittableChildNode, ClientReactiveSubmittableParentNode } from './ClientReactiveSubmittableParentNode.ts';
|
|
3
4
|
interface ClientReactiveSubmittableValueNodeCurrentState {
|
|
4
5
|
get relevant(): boolean;
|
|
@@ -6,7 +7,7 @@ interface ClientReactiveSubmittableValueNodeCurrentState {
|
|
|
6
7
|
}
|
|
7
8
|
export type SerializedSubmissionValue = string;
|
|
8
9
|
interface ClientReactiveSubmittableValueNodeDefinition {
|
|
9
|
-
readonly
|
|
10
|
+
readonly qualifiedName: QualifiedName;
|
|
10
11
|
}
|
|
11
12
|
export interface ClientReactiveSubmittableValueNode {
|
|
12
13
|
readonly definition: ClientReactiveSubmittableValueNodeDefinition;
|
|
@@ -101,6 +101,7 @@ export declare abstract class BaseRepeatRange<Definition extends AnyRepeatRangeD
|
|
|
101
101
|
* appearances" should apply, under which circumstances.
|
|
102
102
|
*/
|
|
103
103
|
abstract readonly appearances: NodeAppearances<Definition>;
|
|
104
|
+
readonly nodeOptions: null;
|
|
104
105
|
readonly currentState: MaterializedChildren<CurrentState<RepeatRangeStateSpec>, RepeatInstance>;
|
|
105
106
|
abstract readonly validationState: AncestorNodeValidationState;
|
|
106
107
|
readonly submissionState: SubmissionState;
|
|
@@ -58,6 +58,7 @@ export declare class RepeatInstance extends DescendantNode<RepeatDefinition, Rep
|
|
|
58
58
|
* @see {@link RepeatRange.appearances}
|
|
59
59
|
*/
|
|
60
60
|
readonly appearances: RepeatInstanceNodeAppearances;
|
|
61
|
+
readonly nodeOptions: null;
|
|
61
62
|
readonly currentState: MaterializedChildren<CurrentState<RepeatInstanceStateSpec>, GeneralChildNode>;
|
|
62
63
|
readonly validationState: AncestorNodeValidationState;
|
|
63
64
|
readonly submissionState: SubmissionState;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { EngineXPathNode } from './kind.ts';
|
|
2
2
|
export declare const getEngineXPathNodeNamespaceURI: (node: EngineXPathNode) => string | null;
|
|
3
|
-
/**
|
|
4
|
-
* @todo currently, neither {@link InstanceNode} nor {@link StaticNode} account
|
|
5
|
-
* for prefixes in qualified names. This was already a general enough gap that
|
|
6
|
-
* it makes sense to defer to a broader solution as it becomes a priority
|
|
7
|
-
* (likely prompted by a bug report about unexpected behavior of the XPath
|
|
8
|
-
* `name` function).
|
|
9
|
-
*/
|
|
10
3
|
export declare const getEngineXPathNodeQualifiedName: (node: EngineXPathNode) => string;
|
|
11
4
|
export declare const getEngineXPathNodeLocalName: (node: EngineXPathNode) => string;
|
|
12
5
|
export declare const getEngineProcessingInstructionName: () => never;
|
|
13
|
-
|
|
14
|
-
* @todo @see {@link getNamespaceDeclarations}
|
|
15
|
-
*/
|
|
16
|
-
export declare const resolveEngineXPathNodeNamespaceURI: (_: EngineXPathNode, prefix: string | null) => "http://www.w3.org/1999/xhtml" | "http://www.w3.org/2005/xpath-functions" | "http://openrosa.org/javarosa" | "http://www.opendatakit.org/xforms" | "http://openrosa.org/xforms" | "http://www.w3.org/2002/xforms" | "http://enketo.org/xforms" | null;
|
|
6
|
+
export declare const resolveEngineXPathNodeNamespaceURI: (node: EngineXPathNode, prefix: string | null) => string | null;
|
|
@@ -2,16 +2,17 @@ import { EngineXPathAttribute, EngineXPathDocument, EngineXPathElement, EngineXP
|
|
|
2
2
|
export declare const getContainingEngineXPathDocument: (node: EngineXPathNode) => EngineXPathDocument;
|
|
3
3
|
export declare const getEngineXPathAttributes: (node: EngineXPathNode) => Iterable<EngineXPathAttribute>;
|
|
4
4
|
/**
|
|
5
|
-
* @todo
|
|
6
|
-
*
|
|
7
|
-
* itext `translation`, secondary `instance`). Expressions defined in such forms
|
|
8
|
-
* may also expect to use those namespace declarations. It would even seem
|
|
9
|
-
* likely! Why declare namespaces on a subtree if you don't intend to use them?
|
|
10
|
-
* We don't currently capture namespace declarations below `h:html` in the parse
|
|
11
|
-
* stage (which, if we intend to support the use case, is where we should
|
|
12
|
-
* start).
|
|
5
|
+
* @todo We've now laid most of the groundwork necessary to implement this
|
|
6
|
+
* properly. At time of writing it has still been deferred because:
|
|
13
7
|
*
|
|
14
|
-
*
|
|
8
|
+
* 1. The scope of changes enabling it is already a fairly large yak shave.
|
|
9
|
+
* 2. It is only used to support XPath LocationPath Steps whose AxisName is
|
|
10
|
+
* `namespace`. If we _ever_ support this, it would probably be for extremely
|
|
11
|
+
* niche use cases!
|
|
12
|
+
*
|
|
13
|
+
* @todo Since we've consciously deferred implementing this (twice now!), should
|
|
14
|
+
* it throw? It might be nice to be alerted if the assumptions in point 2 above
|
|
15
|
+
* are somehow wrong (or become wrong).
|
|
15
16
|
*/
|
|
16
17
|
export declare const getNamespaceDeclarations: () => Iterable<never>;
|
|
17
18
|
export declare const getParentNode: (node: EngineXPathNode) => EngineXPathParentNode | null;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
|
+
import { QualifiedName } from '../../../lib/names/QualifiedName.ts';
|
|
2
3
|
import { XFormsXPathAttribute } from '../adapter/XFormsXPathNode.ts';
|
|
4
|
+
import { StaticDocument } from './StaticDocument.ts';
|
|
3
5
|
import { StaticElement } from './StaticElement.ts';
|
|
4
|
-
import {
|
|
5
|
-
interface StaticAttributeOptions
|
|
6
|
+
import { StaticNode } from './StaticNode.ts';
|
|
7
|
+
interface StaticAttributeOptions {
|
|
8
|
+
readonly namespaceURI: string | null;
|
|
9
|
+
readonly prefix?: string | null;
|
|
10
|
+
readonly localName: string;
|
|
6
11
|
readonly value: string;
|
|
7
12
|
}
|
|
8
|
-
export declare class StaticAttribute extends
|
|
13
|
+
export declare class StaticAttribute extends StaticNode<'attribute'> implements XFormsXPathAttribute {
|
|
9
14
|
readonly parent: StaticElement;
|
|
10
15
|
readonly [XPathNodeKindKey] = "attribute";
|
|
11
16
|
readonly nodeType = "static-attribute";
|
|
17
|
+
readonly rootDocument: StaticDocument;
|
|
12
18
|
readonly root: StaticElement;
|
|
19
|
+
readonly qualifiedName: QualifiedName;
|
|
13
20
|
readonly attributes: readonly [];
|
|
14
21
|
readonly children: null;
|
|
15
22
|
readonly value: string;
|
|
@@ -8,7 +8,6 @@ export declare abstract class StaticDocument<DocumentRoot extends StaticElement
|
|
|
8
8
|
readonly nodeType = "static-document";
|
|
9
9
|
readonly rootDocument: StaticDocument;
|
|
10
10
|
readonly root: DocumentRoot;
|
|
11
|
-
readonly isXFormsNamespace: boolean;
|
|
12
11
|
readonly parent: null;
|
|
13
12
|
readonly children: readonly [root: DocumentRoot];
|
|
14
13
|
constructor(rootFactory: StaticDocumentRootFactory<StaticDocument<DocumentRoot>, DocumentRoot>);
|