@getodk/xforms-engine 0.3.0 → 0.5.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 +15 -5
- package/dist/client/BaseValueNode.d.ts +32 -0
- package/dist/client/EngineConfig.d.ts +49 -49
- package/dist/client/GroupNode.d.ts +2 -3
- package/dist/client/InputNode.d.ts +53 -0
- package/dist/client/ModelValueNode.d.ts +13 -9
- package/dist/client/NodeAppearances.d.ts +1 -2
- package/dist/client/NoteNode.d.ts +3 -4
- package/dist/client/RootNode.d.ts +36 -10
- package/dist/client/SelectNode.d.ts +4 -5
- 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/ValueType.d.ts +3 -0
- package/dist/client/constants.d.ts +50 -1
- package/dist/client/hierarchy.d.ts +9 -5
- package/dist/client/identity.d.ts +14 -0
- package/dist/client/index.d.ts +0 -1
- package/dist/client/node-types.d.ts +3 -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/resources.d.ts +93 -0
- package/dist/client/submission/SubmissionData.d.ts +7 -0
- package/dist/client/submission/SubmissionDefinition.d.ts +14 -0
- package/dist/client/submission/SubmissionInstanceFile.d.ts +6 -0
- package/dist/client/submission/SubmissionOptions.d.ts +23 -0
- package/dist/client/submission/SubmissionResult.d.ts +91 -0
- package/dist/client/submission/SubmissionState.d.ts +12 -0
- package/dist/client/unsupported/RangeNode.d.ts +9 -0
- package/dist/client/unsupported/RankNode.d.ts +9 -0
- package/dist/client/unsupported/UnsupportedControlNode.d.ts +32 -0
- package/dist/client/unsupported/UploadNode.d.ts +9 -0
- package/dist/client/validation.d.ts +2 -3
- package/dist/error/ErrorProductionDesignPendingError.d.ts +7 -0
- package/dist/error/ValueTypeInvariantError.d.ts +17 -0
- package/dist/error/XPathFunctionalityError.d.ts +14 -0
- package/dist/error/XPathFunctionalityNotSupportedError.d.ts +7 -0
- package/dist/error/XPathFunctionalityPendingError.d.ts +7 -0
- package/dist/index.d.ts +16 -4
- package/dist/index.js +8559 -4700
- package/dist/index.js.map +1 -1
- package/dist/instance/Group.d.ts +9 -5
- package/dist/instance/InputControl.d.ts +36 -0
- package/dist/instance/ModelValue.d.ts +16 -27
- package/dist/instance/Note.d.ts +11 -5
- package/dist/instance/PrimaryInstance.d.ts +84 -0
- package/dist/instance/Root.d.ts +31 -28
- package/dist/instance/SelectField.d.ts +13 -6
- package/dist/instance/Subtree.d.ts +10 -6
- package/dist/instance/TriggerControl.d.ts +47 -0
- package/dist/instance/abstract/DescendantNode.d.ts +33 -26
- package/dist/instance/abstract/InstanceNode.d.ts +50 -31
- package/dist/instance/abstract/UnsupportedControl.d.ts +53 -0
- package/dist/instance/abstract/ValueNode.d.ts +48 -0
- package/dist/instance/children.d.ts +0 -1
- package/dist/instance/hierarchy.d.ts +13 -8
- package/dist/instance/identity.d.ts +2 -7
- package/dist/instance/index.d.ts +0 -1
- package/dist/instance/internal-api/EvaluationContext.d.ts +53 -13
- package/dist/instance/internal-api/InstanceConfig.d.ts +8 -3
- package/dist/instance/internal-api/InstanceValueContext.d.ts +20 -0
- package/dist/instance/internal-api/PrimaryInstanceDocument.d.ts +36 -0
- package/dist/instance/internal-api/TranslationContext.d.ts +3 -3
- package/dist/instance/internal-api/ValidationContext.d.ts +12 -6
- package/dist/instance/internal-api/ValueContext.d.ts +5 -5
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableInstance.d.ts +14 -0
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableLeafNode.d.ts +31 -0
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableParentNode.d.ts +18 -0
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableValueNode.d.ts +17 -0
- package/dist/instance/repeat/BaseRepeatRange.d.ts +40 -85
- package/dist/instance/repeat/RepeatInstance.d.ts +11 -30
- package/dist/instance/repeat/RepeatRangeControlled.d.ts +3 -4
- package/dist/instance/repeat/RepeatRangeUncontrolled.d.ts +3 -4
- package/dist/instance/resource.d.ts +1 -2
- package/dist/instance/text/TextChunk.d.ts +0 -1
- package/dist/instance/text/TextRange.d.ts +1 -2
- package/dist/instance/unsupported/RangeControl.d.ts +6 -0
- package/dist/instance/unsupported/RankControl.d.ts +6 -0
- package/dist/instance/unsupported/UploadControl.d.ts +6 -0
- package/dist/integration/xpath/EngineXPathEvaluator.d.ts +14 -0
- package/dist/integration/xpath/adapter/XFormsXPathNode.d.ts +71 -0
- package/dist/integration/xpath/adapter/engineDOMAdapter.d.ts +5 -0
- package/dist/integration/xpath/adapter/kind.d.ts +32 -0
- package/dist/integration/xpath/adapter/names.d.ts +16 -0
- package/dist/integration/xpath/adapter/traversal.d.ts +25 -0
- package/dist/integration/xpath/adapter/values.d.ts +2 -0
- package/dist/integration/xpath/static-dom/StaticAttribute.d.ts +19 -0
- package/dist/integration/xpath/static-dom/StaticDocument.d.ts +16 -0
- package/dist/integration/xpath/static-dom/StaticElement.d.ts +40 -0
- package/dist/integration/xpath/static-dom/StaticNamedNode.d.ts +17 -0
- package/dist/integration/xpath/static-dom/StaticNode.d.ts +33 -0
- package/dist/integration/xpath/static-dom/StaticText.d.ts +16 -0
- package/dist/lib/TokenListParser.d.ts +3 -3
- package/dist/lib/client-reactivity/submission/createInstanceSubmissionState.d.ts +3 -0
- package/dist/lib/client-reactivity/submission/createLeafNodeSubmissionState.d.ts +3 -0
- package/dist/lib/client-reactivity/submission/createNodeRangeSubmissionState.d.ts +4 -0
- package/dist/lib/client-reactivity/submission/createParentNodeSubmissionState.d.ts +4 -0
- package/dist/lib/client-reactivity/submission/createValueNodeSubmissionState.d.ts +3 -0
- package/dist/lib/client-reactivity/submission/prepareSubmission.d.ts +8 -0
- package/dist/lib/codecs/DecimalValueCodec.d.ts +6 -0
- package/dist/lib/codecs/IntValueCodec.d.ts +6 -0
- package/dist/lib/codecs/StringValueCodec.d.ts +4 -0
- package/dist/lib/codecs/ValueCodec.d.ts +30 -0
- package/dist/lib/codecs/ValueTypePlaceholderCodec.d.ts +12 -0
- package/dist/lib/codecs/getSharedValueCodec.d.ts +47 -0
- package/dist/lib/dom/query.d.ts +4 -2
- package/dist/lib/reactivity/createChildrenState.d.ts +7 -6
- package/dist/lib/reactivity/createComputedExpression.d.ts +19 -7
- package/dist/lib/reactivity/createInstanceValueState.d.ts +40 -0
- package/dist/lib/reactivity/createNoteReadonlyThunk.d.ts +2 -3
- package/dist/lib/reactivity/createSelectItems.d.ts +0 -1
- package/dist/lib/reactivity/createTranslationState.d.ts +19 -0
- package/dist/lib/reactivity/createValueState.d.ts +6 -11
- package/dist/lib/reactivity/materializeCurrentStateChildren.d.ts +4 -5
- 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/lib/xml-serialization.d.ts +41 -0
- package/dist/parse/XFormDOM.d.ts +42 -0
- package/dist/{XFormDefinition.d.ts → parse/XFormDefinition.d.ts} +3 -5
- package/dist/parse/attachments/FormAttachmentResource.d.ts +27 -0
- package/dist/{body → parse/body}/BodyDefinition.d.ts +16 -11
- 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/parse/body/appearance/inputAppearanceParser.d.ts +3 -0
- 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/control/InputDefinition.d.ts → parse/body/control/InputControlDefinition.d.ts} +2 -3
- 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 +1 -4
- 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/parse/expression/abstract/DependencyContext.d.ts +7 -0
- package/dist/{expression → parse/expression/abstract}/DependentExpression.d.ts +4 -6
- package/dist/parse/expression/abstract/TextChunkExpression.d.ts +17 -0
- package/dist/parse/model/BindDefinition.d.ts +38 -0
- package/dist/parse/model/BindTypeDefinition.d.ts +20 -0
- package/dist/{model → parse/model}/DescendentNodeDefinition.d.ts +0 -2
- package/dist/parse/model/FormSubmissionDefinition.d.ts +8 -0
- package/dist/parse/model/ItextTranslation/ItextTranslationDefinition.d.ts +4 -0
- package/dist/parse/model/ItextTranslation/ItextTranslationRootDefinition.d.ts +8 -0
- package/dist/parse/model/ItextTranslation/ItextTranslationsDefinition.d.ts +8 -0
- package/dist/{model → parse/model}/LeafNodeDefinition.d.ts +4 -3
- package/dist/{model → parse/model}/ModelBindMap.d.ts +1 -2
- package/dist/{model → parse/model}/ModelDefinition.d.ts +3 -2
- package/dist/{model → parse/model}/NodeDefinition.d.ts +0 -2
- package/dist/parse/{NoteNodeDefinition.d.ts → model/NoteNodeDefinition.d.ts} +12 -13
- 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 +5 -5
- package/dist/parse/model/SecondaryInstance/SecondaryInstanceDefinition.d.ts +4 -0
- package/dist/parse/model/SecondaryInstance/SecondaryInstanceRootDefinition.d.ts +7 -0
- package/dist/parse/model/SecondaryInstance/SecondaryInstancesDefinition.d.ts +13 -0
- package/dist/parse/model/SecondaryInstance/sources/BlankSecondaryInstanceSource.d.ts +14 -0
- package/dist/parse/model/SecondaryInstance/sources/CSVExternalSecondaryInstance.d.ts +22 -0
- package/dist/parse/model/SecondaryInstance/sources/ExternalSecondaryInstanceResource.d.ts +23 -0
- package/dist/parse/model/SecondaryInstance/sources/ExternalSecondaryInstanceSource.d.ts +9 -0
- package/dist/parse/model/SecondaryInstance/sources/GeoJSONExternalSecondaryInstance.d.ts +5 -0
- package/dist/parse/model/SecondaryInstance/sources/InternalSecondaryInstanceSource.d.ts +7 -0
- package/dist/parse/model/SecondaryInstance/sources/SecondaryInstanceSource.d.ts +13 -0
- package/dist/parse/model/SecondaryInstance/sources/XMLExternalSecondaryInstanceSource.d.ts +12 -0
- package/dist/{model → parse/model}/SubtreeDefinition.d.ts +1 -2
- package/dist/parse/shared/parseStaticDocumentFromDOMSubtree.d.ts +24 -0
- 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 +4 -7
- 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 +5 -1
- package/dist/parse/xpath/syntax-traversal.d.ts +0 -1
- package/dist/solid.js +8398 -4543
- package/dist/solid.js.map +1 -1
- package/package.json +14 -12
- package/src/client/BaseNode.ts +17 -7
- package/src/client/BaseValueNode.ts +35 -0
- package/src/client/EngineConfig.ts +52 -51
- package/src/client/GroupNode.ts +2 -2
- package/src/client/InputNode.ts +77 -0
- package/src/client/ModelValueNode.ts +31 -8
- package/src/client/NodeAppearances.ts +1 -1
- package/src/client/NoteNode.ts +3 -3
- package/src/client/RootNode.ts +39 -9
- package/src/client/SelectNode.ts +5 -5
- package/src/client/SubtreeNode.ts +1 -1
- package/src/client/TextRange.ts +4 -5
- package/src/client/TriggerNode.ts +29 -0
- package/src/client/ValueType.ts +4 -0
- package/src/client/constants.ts +67 -0
- package/src/client/hierarchy.ts +16 -4
- package/src/client/identity.ts +16 -0
- package/src/client/node-types.ts +19 -5
- 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/resources.ts +118 -0
- package/src/client/submission/SubmissionData.ts +12 -0
- package/src/client/submission/SubmissionDefinition.ts +16 -0
- package/src/client/submission/SubmissionInstanceFile.ts +9 -0
- package/src/client/submission/SubmissionOptions.ts +28 -0
- package/src/client/submission/SubmissionResult.ts +124 -0
- package/src/client/submission/SubmissionState.ts +14 -0
- package/src/client/unsupported/RangeNode.ts +14 -0
- package/src/client/unsupported/RankNode.ts +14 -0
- package/src/client/unsupported/UnsupportedControlNode.ts +40 -0
- package/src/client/unsupported/UploadNode.ts +14 -0
- package/src/client/validation.ts +2 -2
- package/src/error/ErrorProductionDesignPendingError.ts +6 -0
- package/src/error/ValueTypeInvariantError.ts +22 -0
- package/src/error/XPathFunctionalityError.ts +26 -0
- package/src/error/XPathFunctionalityNotSupportedError.ts +18 -0
- package/src/error/XPathFunctionalityPendingError.ts +18 -0
- package/src/index.ts +16 -2
- package/src/instance/Group.ts +17 -5
- package/src/instance/InputControl.ts +119 -0
- package/src/instance/ModelValue.ts +47 -54
- package/src/instance/Note.ts +26 -10
- package/src/instance/PrimaryInstance.ts +244 -0
- package/src/instance/Root.ts +64 -132
- package/src/instance/SelectField.ts +62 -25
- package/src/instance/Subtree.ts +19 -7
- package/src/instance/{StringField.ts → TriggerControl.ts} +61 -30
- package/src/instance/abstract/DescendantNode.ts +92 -47
- package/src/instance/abstract/InstanceNode.ts +104 -98
- package/src/instance/abstract/UnsupportedControl.ts +174 -0
- package/src/instance/abstract/ValueNode.ts +127 -0
- package/src/instance/children.ts +83 -14
- package/src/instance/hierarchy.ts +36 -14
- package/src/instance/identity.ts +3 -9
- package/src/instance/index.ts +26 -8
- package/src/instance/internal-api/EvaluationContext.ts +61 -14
- package/src/instance/internal-api/InstanceConfig.ts +9 -2
- package/src/instance/internal-api/InstanceValueContext.ts +24 -0
- package/src/instance/internal-api/PrimaryInstanceDocument.ts +53 -0
- package/src/instance/internal-api/TranslationContext.ts +3 -2
- package/src/instance/internal-api/ValidationContext.ts +13 -5
- package/src/instance/internal-api/ValueContext.ts +5 -4
- package/src/instance/internal-api/submission/ClientReactiveSubmittableInstance.ts +20 -0
- package/src/instance/internal-api/submission/ClientReactiveSubmittableLeafNode.ts +42 -0
- package/src/instance/internal-api/submission/ClientReactiveSubmittableParentNode.ts +25 -0
- package/src/instance/internal-api/submission/ClientReactiveSubmittableValueNode.ts +23 -0
- package/src/instance/repeat/BaseRepeatRange.ts +51 -132
- package/src/instance/repeat/RepeatInstance.ts +20 -46
- package/src/instance/repeat/RepeatRangeControlled.ts +6 -6
- package/src/instance/repeat/RepeatRangeUncontrolled.ts +3 -5
- package/src/instance/resource.ts +1 -1
- package/src/instance/text/TextChunk.ts +1 -1
- package/src/instance/unsupported/RangeControl.ts +9 -0
- package/src/instance/unsupported/RankControl.ts +9 -0
- package/src/instance/unsupported/UploadControl.ts +9 -0
- package/src/integration/xpath/EngineXPathEvaluator.ts +22 -0
- package/src/integration/xpath/adapter/XFormsXPathNode.ts +126 -0
- package/src/integration/xpath/adapter/engineDOMAdapter.ts +57 -0
- package/src/integration/xpath/adapter/kind.ts +114 -0
- package/src/integration/xpath/adapter/names.ts +99 -0
- package/src/integration/xpath/adapter/traversal.ts +228 -0
- package/src/integration/xpath/adapter/values.ts +5 -0
- package/src/integration/xpath/static-dom/StaticAttribute.ts +33 -0
- package/src/integration/xpath/static-dom/StaticDocument.ts +38 -0
- package/src/integration/xpath/static-dom/StaticElement.ts +106 -0
- package/src/integration/xpath/static-dom/StaticNamedNode.ts +45 -0
- package/src/integration/xpath/static-dom/StaticNode.ts +68 -0
- package/src/integration/xpath/static-dom/StaticText.ts +28 -0
- package/src/lib/TokenListParser.ts +11 -7
- package/src/lib/client-reactivity/README.md +0 -0
- package/src/lib/client-reactivity/submission/createInstanceSubmissionState.ts +12 -0
- package/src/lib/client-reactivity/submission/createLeafNodeSubmissionState.ts +20 -0
- package/src/lib/client-reactivity/submission/createNodeRangeSubmissionState.ts +17 -0
- package/src/lib/client-reactivity/submission/createParentNodeSubmissionState.ts +22 -0
- package/src/lib/client-reactivity/submission/createValueNodeSubmissionState.ts +21 -0
- package/src/lib/client-reactivity/submission/prepareSubmission.ts +172 -0
- package/src/lib/codecs/DecimalValueCodec.ts +46 -0
- package/src/lib/codecs/IntValueCodec.ts +100 -0
- package/src/lib/codecs/StringValueCodec.ts +11 -0
- package/src/lib/codecs/ValueCodec.ts +106 -0
- package/src/lib/codecs/ValueTypePlaceholderCodec.ts +19 -0
- package/src/lib/codecs/getSharedValueCodec.ts +77 -0
- package/src/lib/dom/query.ts +8 -1
- package/src/lib/reactivity/createChildrenState.ts +8 -6
- package/src/lib/reactivity/createComputedExpression.ts +59 -36
- package/src/lib/reactivity/createInstanceValueState.ts +166 -0
- package/src/lib/reactivity/createNoteReadonlyThunk.ts +12 -7
- package/src/lib/reactivity/createSelectItems.ts +23 -23
- package/src/lib/reactivity/createTranslationState.ts +61 -0
- package/src/lib/reactivity/createValueState.ts +64 -122
- package/src/lib/reactivity/materializeCurrentStateChildren.ts +7 -7
- 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 +8 -7
- package/src/lib/reactivity/validation/createAggregatedViolations.ts +9 -4
- package/src/lib/reactivity/validation/createValidation.ts +2 -3
- package/src/lib/xml-serialization.ts +96 -0
- package/src/{XFormDOM.ts → parse/XFormDOM.ts} +110 -75
- package/src/{XFormDefinition.ts → parse/XFormDefinition.ts} +3 -8
- package/src/parse/attachments/FormAttachmentResource.ts +40 -0
- package/src/{body → parse/body}/BodyDefinition.ts +46 -29
- 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 +2 -2
- 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/{body/control/InputDefinition.ts → parse/body/control/InputControlDefinition.ts} +3 -5
- 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 +1 -6
- 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}/DependencyContext.ts +0 -26
- package/src/{expression → parse/expression/abstract}/DependentExpression.ts +5 -16
- package/src/parse/expression/abstract/TextChunkExpression.ts +38 -0
- package/src/parse/model/BindDefinition.ts +104 -0
- package/src/parse/model/BindTypeDefinition.ts +175 -0
- package/src/{model → parse/model}/DescendentNodeDefinition.ts +0 -6
- package/src/parse/model/FormSubmissionDefinition.ts +44 -0
- package/src/parse/model/ItextTranslation/ItextTranslationDefinition.ts +4 -0
- package/src/parse/model/ItextTranslation/ItextTranslationRootDefinition.ts +41 -0
- package/src/parse/model/ItextTranslation/ItextTranslationsDefinition.ts +31 -0
- package/src/{model → parse/model}/LeafNodeDefinition.ts +4 -1
- package/src/{model → parse/model}/ModelBindMap.ts +6 -8
- package/src/parse/model/ModelDefinition.ts +24 -0
- package/src/{model → parse/model}/NodeDefinition.ts +0 -3
- package/src/parse/{NoteNodeDefinition.ts → model/NoteNodeDefinition.ts} +12 -12
- package/src/{model → parse/model}/RepeatRangeDefinition.ts +1 -1
- package/src/{model → parse/model}/RootDefinition.ts +4 -3
- package/src/parse/model/SecondaryInstance/SecondaryInstanceDefinition.ts +4 -0
- package/src/parse/model/SecondaryInstance/SecondaryInstanceRootDefinition.ts +12 -0
- package/src/parse/model/SecondaryInstance/SecondaryInstancesDefinition.ts +102 -0
- package/src/parse/model/SecondaryInstance/sources/BlankSecondaryInstanceSource.ts +40 -0
- package/src/parse/model/SecondaryInstance/sources/CSVExternalSecondaryInstance.ts +288 -0
- package/src/parse/model/SecondaryInstance/sources/ExternalSecondaryInstanceResource.ts +222 -0
- package/src/parse/model/SecondaryInstance/sources/ExternalSecondaryInstanceSource.ts +22 -0
- package/src/parse/model/SecondaryInstance/sources/GeoJSONExternalSecondaryInstance.ts +414 -0
- package/src/parse/model/SecondaryInstance/sources/InternalSecondaryInstanceSource.ts +19 -0
- package/src/parse/model/SecondaryInstance/sources/SecondaryInstanceSource.ts +29 -0
- package/src/parse/model/SecondaryInstance/sources/XMLExternalSecondaryInstanceSource.ts +32 -0
- package/src/parse/shared/parseStaticDocumentFromDOMSubtree.ts +149 -0
- 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 +4 -10
- package/src/parse/xpath/semantic-analysis.ts +29 -0
- package/dist/XFormDOM.d.ts +0 -32
- package/dist/XFormDataType.d.ts +0 -27
- package/dist/body/appearance/inputAppearanceParser.d.ts +0 -4
- package/dist/client/StringNode.d.ts +0 -47
- package/dist/expression/DependencyContext.d.ts +0 -13
- package/dist/instance/StringField.d.ts +0 -45
- package/dist/instance/internal-api/SubscribableDependency.d.ts +0 -60
- 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/XFormDataType.ts +0 -64
- package/src/client/StringNode.ts +0 -52
- package/src/instance/internal-api/SubscribableDependency.ts +0 -61
- package/src/model/BindDefinition.ts +0 -106
- package/src/model/ModelDefinition.ts +0 -19
- 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/{body → parse/body}/UnsupportedBodyElementDefinition.ts +0 -0
- /package/src/{body → parse/body}/group/LogicalGroupDefinition.ts +0 -0
- /package/src/{body → parse/body}/group/StructuralGroupDefinition.ts +0 -0
- /package/src/{model → parse/model}/BindElement.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
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { XFORMS_NAMESPACE_URI } from '@getodk/common/constants/xmlns.ts';
|
|
2
|
+
import { parseStaticDocumentFromDOMSubtree } from '../../../shared/parseStaticDocumentFromDOMSubtree.ts';
|
|
3
|
+
import { SecondaryInstanceDefinition } from '../SecondaryInstanceDefinition.ts';
|
|
4
|
+
import { SecondaryInstanceRootDefinition } from '../SecondaryInstanceRootDefinition.ts';
|
|
5
|
+
import { ExternalSecondaryInstanceSource } from './ExternalSecondaryInstanceSource.ts';
|
|
6
|
+
import type { InternalSecondaryInstanceSource } from './InternalSecondaryInstanceSource.ts';
|
|
7
|
+
|
|
8
|
+
export class XMLExternalSecondaryInstanceSource extends ExternalSecondaryInstanceSource<'xml'> {
|
|
9
|
+
/**
|
|
10
|
+
* Note: this logic is a superset of the logic in
|
|
11
|
+
* {@link InternalSecondaryInstanceSource.parseDefinition}. That subset is so
|
|
12
|
+
* trivial/already sufficiently abstracted that it doesn't really make a lot
|
|
13
|
+
* of sense to abstract further, but it might be worth considering if both
|
|
14
|
+
* method implementations grow their responsibilities in the same ways.
|
|
15
|
+
*/
|
|
16
|
+
parseDefinition(): SecondaryInstanceDefinition {
|
|
17
|
+
const xmlDocument = this.domElement.ownerDocument.implementation.createDocument(
|
|
18
|
+
XFORMS_NAMESPACE_URI,
|
|
19
|
+
'instance'
|
|
20
|
+
);
|
|
21
|
+
const instanceElement = xmlDocument.documentElement;
|
|
22
|
+
|
|
23
|
+
instanceElement.setAttribute('id', this.instanceId);
|
|
24
|
+
instanceElement.innerHTML = this.resource.data;
|
|
25
|
+
|
|
26
|
+
return parseStaticDocumentFromDOMSubtree(
|
|
27
|
+
SecondaryInstanceDefinition,
|
|
28
|
+
SecondaryInstanceRootDefinition,
|
|
29
|
+
instanceElement
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { UnreachableError } from '@getodk/common/lib/error/UnreachableError.ts';
|
|
2
|
+
import type { AnyConstructor } from '@getodk/common/types/helpers.js';
|
|
3
|
+
import { StaticAttribute } from '../../integration/xpath/static-dom/StaticAttribute.ts';
|
|
4
|
+
import type {
|
|
5
|
+
StaticDocument,
|
|
6
|
+
StaticDocumentRootFactory,
|
|
7
|
+
} from '../../integration/xpath/static-dom/StaticDocument.ts';
|
|
8
|
+
import type {
|
|
9
|
+
StaticElementAttributesFactory,
|
|
10
|
+
StaticElementChildNodesFactory,
|
|
11
|
+
} from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
12
|
+
import { StaticElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
13
|
+
import type { StaticNamedNodeOptions } from '../../integration/xpath/static-dom/StaticNamedNode.ts';
|
|
14
|
+
import type { StaticParentNode } from '../../integration/xpath/static-dom/StaticNode.ts';
|
|
15
|
+
import { StaticText } from '../../integration/xpath/static-dom/StaticText.ts';
|
|
16
|
+
|
|
17
|
+
type ConcreteConstructor<T extends AnyConstructor> = Pick<T, keyof T>;
|
|
18
|
+
|
|
19
|
+
// prettier-ignore
|
|
20
|
+
export type ConcreteStaticDocumentConstructor<
|
|
21
|
+
T extends StaticDocument<Root>,
|
|
22
|
+
Root extends StaticElement,
|
|
23
|
+
> =
|
|
24
|
+
& ConcreteConstructor<typeof StaticDocument<Root>>
|
|
25
|
+
& (new (rootFactory: StaticDocumentRootFactory<T, Root>) => T);
|
|
26
|
+
|
|
27
|
+
const domElementAttributesFactory = (domElement: Element): StaticElementAttributesFactory => {
|
|
28
|
+
const attributes = Array.from(domElement.attributes);
|
|
29
|
+
|
|
30
|
+
return (element) => {
|
|
31
|
+
return attributes.map((attr) => {
|
|
32
|
+
return new StaticAttribute(element, attr);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const { ELEMENT_NODE, CDATA_SECTION_NODE, TEXT_NODE } = Node;
|
|
38
|
+
|
|
39
|
+
interface StaticChildElementSource {
|
|
40
|
+
readonly domType: typeof ELEMENT_NODE;
|
|
41
|
+
readonly domNode: Element;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface StaticChildTextSource {
|
|
45
|
+
readonly domType: typeof CDATA_SECTION_NODE | typeof TEXT_NODE;
|
|
46
|
+
readonly domNode: CharacterData;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// prettier-ignore
|
|
50
|
+
type StaticChildNodeSource =
|
|
51
|
+
| StaticChildElementSource
|
|
52
|
+
| StaticChildTextSource;
|
|
53
|
+
|
|
54
|
+
export const toStaticChildNodeSource = (childNode: ChildNode): StaticChildNodeSource | null => {
|
|
55
|
+
const domType = childNode.nodeType;
|
|
56
|
+
|
|
57
|
+
switch (domType) {
|
|
58
|
+
case ELEMENT_NODE:
|
|
59
|
+
return {
|
|
60
|
+
domType,
|
|
61
|
+
domNode: childNode as Element,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
case TEXT_NODE:
|
|
65
|
+
return {
|
|
66
|
+
domType,
|
|
67
|
+
domNode: childNode as Text,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
case CDATA_SECTION_NODE:
|
|
71
|
+
return {
|
|
72
|
+
domType,
|
|
73
|
+
domNode: childNode as CDATASection,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
default:
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const toStaticChildNodeSources = (childNode: ChildNode): StaticChildNodeSource | readonly [] => {
|
|
82
|
+
return toStaticChildNodeSource(childNode) ?? [];
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const domElementChildNodesFactory = (domElement: Element): StaticElementChildNodesFactory => {
|
|
86
|
+
const childNodeSources = Array.from(domElement.childNodes).flatMap(toStaticChildNodeSources);
|
|
87
|
+
|
|
88
|
+
return (parent) => {
|
|
89
|
+
return childNodeSources.map((domSource) => {
|
|
90
|
+
switch (domSource.domType) {
|
|
91
|
+
case ELEMENT_NODE:
|
|
92
|
+
return parseStaticElementFromDOMElement(parent, StaticElement, domSource.domNode);
|
|
93
|
+
|
|
94
|
+
case TEXT_NODE:
|
|
95
|
+
case CDATA_SECTION_NODE:
|
|
96
|
+
return new StaticText(parent, domSource.domNode.data);
|
|
97
|
+
|
|
98
|
+
default:
|
|
99
|
+
throw new UnreachableError(domSource);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// prettier-ignore
|
|
106
|
+
export type StaticElementConstructor<
|
|
107
|
+
T extends StaticElement<Parent>,
|
|
108
|
+
Parent extends StaticParentNode = StaticParentNode
|
|
109
|
+
> =
|
|
110
|
+
& ConcreteConstructor<typeof StaticElement>
|
|
111
|
+
& {
|
|
112
|
+
readonly prototype: T;
|
|
113
|
+
|
|
114
|
+
new (
|
|
115
|
+
parent: Parent,
|
|
116
|
+
attributesFactory: StaticElementAttributesFactory,
|
|
117
|
+
childNodesFactory: StaticElementChildNodesFactory,
|
|
118
|
+
options: StaticNamedNodeOptions
|
|
119
|
+
): T;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const parseStaticElementFromDOMElement = <
|
|
123
|
+
T extends StaticElement,
|
|
124
|
+
Parent extends StaticParentNode = StaticParentNode,
|
|
125
|
+
>(
|
|
126
|
+
parent: Parent,
|
|
127
|
+
ElementConstructor: StaticElementConstructor<T, Parent>,
|
|
128
|
+
domElement: Element
|
|
129
|
+
): T => {
|
|
130
|
+
const attributesFactory = domElementAttributesFactory(domElement);
|
|
131
|
+
const childNodesFactory = domElementChildNodesFactory(domElement);
|
|
132
|
+
|
|
133
|
+
return new ElementConstructor(parent, attributesFactory, childNodesFactory, domElement);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const parseStaticDocumentFromDOMSubtree = <
|
|
137
|
+
T extends StaticDocument<Root>,
|
|
138
|
+
Root extends StaticElement<T>,
|
|
139
|
+
>(
|
|
140
|
+
DocumentConstructor: ConcreteStaticDocumentConstructor<T, Root>,
|
|
141
|
+
DocumentRootConstructor: StaticElementConstructor<Root, T>,
|
|
142
|
+
subtreeRootElement: Element
|
|
143
|
+
): T => {
|
|
144
|
+
const rootFactory: StaticDocumentRootFactory<T, Root> = (parent) => {
|
|
145
|
+
return parseStaticElementFromDOMElement(parent, DocumentRootConstructor, subtreeRootElement);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
return new DocumentConstructor(rootFactory);
|
|
149
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LocalNamedElement } from '@getodk/common/types/dom.ts';
|
|
2
|
-
import type { XFormDefinition } from '../../XFormDefinition.ts';
|
|
3
|
-
import type { AnyControlDefinition } from '../../body/control/ControlDefinition.ts';
|
|
4
2
|
import { getHintElement } from '../../lib/dom/query.ts';
|
|
3
|
+
import type { XFormDefinition } from '../../parse/XFormDefinition.ts';
|
|
4
|
+
import type { AnyControlDefinition } from '../body/control/ControlDefinition.ts';
|
|
5
5
|
import { TextElementDefinition } from './abstract/TextElementDefinition.ts';
|
|
6
6
|
|
|
7
7
|
interface HintElement extends LocalNamedElement<'hint'> {}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LocalNamedElement } from '@getodk/common/types/dom.ts';
|
|
2
|
-
import type { XFormDefinition } from '../../XFormDefinition.ts';
|
|
3
|
-
import type { ItemDefinition } from '../../body/control/select/ItemDefinition.ts';
|
|
4
2
|
import { getLabelElement } from '../../lib/dom/query.ts';
|
|
3
|
+
import type { XFormDefinition } from '../../parse/XFormDefinition.ts';
|
|
4
|
+
import type { ItemDefinition } from '../body/control/select/ItemDefinition.ts';
|
|
5
5
|
import { TextElementDefinition } from './abstract/TextElementDefinition.ts';
|
|
6
6
|
|
|
7
7
|
interface LabelElement extends LocalNamedElement<'label'> {}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { LocalNamedElement } from '@getodk/common/types/dom.ts';
|
|
2
|
-
import type { XFormDefinition } from '../../XFormDefinition.ts';
|
|
3
|
-
import type { ItemDefinition } from '../../body/control/select/ItemDefinition.ts';
|
|
4
|
-
import type { ItemsetDefinition } from '../../body/control/select/ItemsetDefinition.ts';
|
|
5
2
|
import { getLabelElement } from '../../lib/dom/query.ts';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import type { XFormDefinition } from '../../parse/XFormDefinition.ts';
|
|
4
|
+
import type { ItemDefinition } from '../body/control/select/ItemDefinition.ts';
|
|
5
|
+
import type { ItemsetDefinition } from '../body/control/select/ItemsetDefinition.ts';
|
|
6
|
+
import { TextReferenceExpression } from '../expression/TextReferenceExpression.ts';
|
|
7
|
+
import { TextTranslationExpression } from '../expression/TextTranslationExpression.ts';
|
|
8
8
|
import type { RefAttributeChunk } from './abstract/TextElementDefinition.ts';
|
|
9
9
|
import { TextRangeDefinition } from './abstract/TextRangeDefinition.ts';
|
|
10
10
|
|
|
@@ -36,8 +36,8 @@ export class ItemsetLabelDefinition extends TextRangeDefinition<'item-label'> {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const refChunk =
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
TextTranslationExpression.from(this, refExpression) ??
|
|
40
|
+
TextReferenceExpression.from(this, refExpression);
|
|
41
41
|
|
|
42
42
|
this.chunks = [refChunk];
|
|
43
43
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { LocalNamedElement } from '@getodk/common/types/dom.ts';
|
|
2
|
-
import type { XFormDefinition } from '../../XFormDefinition.ts';
|
|
3
|
-
import type { AnyGroupElementDefinition } from '../../body/BodyDefinition.ts';
|
|
4
|
-
import type { RepeatElementDefinition } from '../../body/RepeatElementDefinition.ts';
|
|
5
|
-
import type { AnyControlDefinition } from '../../body/control/ControlDefinition.ts';
|
|
6
|
-
import type { BaseGroupDefinition } from '../../body/group/BaseGroupDefinition.ts';
|
|
7
2
|
import { getLabelElement, getRepeatGroupLabelElement } from '../../lib/dom/query.ts';
|
|
3
|
+
import type { XFormDefinition } from '../../parse/XFormDefinition.ts';
|
|
4
|
+
import type { AnyGroupElementDefinition } from '../../parse/body/BodyDefinition.ts';
|
|
5
|
+
import type { RepeatElementDefinition } from '../body/RepeatElementDefinition.ts';
|
|
6
|
+
import type { AnyControlDefinition } from '../body/control/ControlDefinition.ts';
|
|
7
|
+
import type { BaseGroupDefinition } from '../body/group/BaseGroupDefinition.ts';
|
|
8
8
|
import { TextElementDefinition } from './abstract/TextElementDefinition.ts';
|
|
9
9
|
|
|
10
10
|
// prettier-ignore
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JAVAROSA_NAMESPACE_URI } from '@getodk/common/constants/xmlns.ts';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { TextLiteralExpression } from '../expression/TextLiteralExpression.ts';
|
|
3
|
+
import { TextTranslationExpression } from '../expression/TextTranslationExpression.ts';
|
|
4
|
+
import type { BindDefinition } from '../model/BindDefinition.ts';
|
|
5
5
|
import type { TextBindAttributeLocalName, TextSourceNode } from './abstract/TextRangeDefinition.ts';
|
|
6
6
|
import { TextRangeDefinition } from './abstract/TextRangeDefinition.ts';
|
|
7
7
|
|
|
@@ -9,8 +9,8 @@ export type MessageSourceNode = TextSourceNode<TextBindAttributeLocalName>;
|
|
|
9
9
|
|
|
10
10
|
// prettier-ignore
|
|
11
11
|
type MessageChunk =
|
|
12
|
-
|
|
|
13
|
-
|
|
|
12
|
+
| TextLiteralExpression
|
|
13
|
+
| TextTranslationExpression;
|
|
14
14
|
|
|
15
15
|
export class MessageDefinition<
|
|
16
16
|
Type extends TextBindAttributeLocalName,
|
|
@@ -38,8 +38,8 @@ export class MessageDefinition<
|
|
|
38
38
|
super(bind.form, bind, null);
|
|
39
39
|
|
|
40
40
|
const chunk: MessageChunk =
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
TextTranslationExpression.fromMessage(this, message) ??
|
|
42
|
+
TextLiteralExpression.from(this, message);
|
|
43
43
|
|
|
44
44
|
this.chunks = [chunk];
|
|
45
45
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { isElementNode, isTextNode } from '@getodk/common/lib/dom/predicates.ts';
|
|
2
|
-
import type { XFormDefinition } from '../../../XFormDefinition.ts';
|
|
3
|
-
import type { ItemDefinition } from '../../../body/control/select/ItemDefinition.ts';
|
|
4
2
|
import type { ElementTextRole } from '../../../client/TextRange.ts';
|
|
3
|
+
import type { XFormDefinition } from '../../../parse/XFormDefinition.ts';
|
|
4
|
+
import type { ItemDefinition } from '../../body/control/select/ItemDefinition.ts';
|
|
5
|
+
import { TextLiteralExpression } from '../../expression/TextLiteralExpression.ts';
|
|
6
|
+
import { TextOutputExpression } from '../../expression/TextOutputExpression.ts';
|
|
7
|
+
import { TextReferenceExpression } from '../../expression/TextReferenceExpression.ts';
|
|
8
|
+
import { TextTranslationExpression } from '../../expression/TextTranslationExpression.ts';
|
|
5
9
|
import { parseNodesetReference } from '../../xpath/reference-parsing.ts';
|
|
6
10
|
import type { HintDefinition } from '../HintDefinition.ts';
|
|
7
11
|
import type { ItemLabelDefinition } from '../ItemLabelDefinition.ts';
|
|
8
12
|
import type { ItemsetLabelDefinition } from '../ItemsetLabelDefinition.ts';
|
|
9
13
|
import type { LabelDefinition, LabelOwner } from '../LabelDefinition.ts';
|
|
10
|
-
import { OutputChunkDefinition } from '../OutputChunkDefinition.ts';
|
|
11
|
-
import { ReferenceChunkDefinition } from '../ReferenceChunkDefinition.ts';
|
|
12
|
-
import { StaticTextChunkDefinition } from '../StaticTextChunkDefinition.ts';
|
|
13
|
-
import { TranslationChunkDefinition } from '../TranslationChunkDefinition.ts';
|
|
14
14
|
import type { TextSourceNode } from './TextRangeDefinition.ts';
|
|
15
15
|
import { TextRangeDefinition } from './TextRangeDefinition.ts';
|
|
16
16
|
|
|
17
17
|
// prettier-ignore
|
|
18
18
|
export type RefAttributeChunk =
|
|
19
|
-
|
|
|
20
|
-
|
|
|
19
|
+
| TextReferenceExpression
|
|
20
|
+
| TextTranslationExpression;
|
|
21
21
|
|
|
22
22
|
// prettier-ignore
|
|
23
23
|
type TextElementChildChunk =
|
|
24
|
-
|
|
|
25
|
-
|
|
|
24
|
+
| TextOutputExpression
|
|
25
|
+
| TextLiteralExpression;
|
|
26
26
|
|
|
27
27
|
// prettier-ignore
|
|
28
28
|
type TextElementChunks =
|
|
@@ -45,19 +45,19 @@ export abstract class TextElementDefinition<
|
|
|
45
45
|
if (refExpression == null) {
|
|
46
46
|
this.chunks = Array.from(sourceNode.childNodes).flatMap((childNode) => {
|
|
47
47
|
if (isElementNode(childNode)) {
|
|
48
|
-
return
|
|
48
|
+
return TextOutputExpression.from(context, childNode) ?? [];
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
if (isTextNode(childNode)) {
|
|
52
|
-
return
|
|
52
|
+
return TextLiteralExpression.from(context, childNode.data);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
return [];
|
|
56
56
|
});
|
|
57
57
|
} else {
|
|
58
58
|
const refChunk =
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
TextTranslationExpression.from(context, refExpression) ??
|
|
60
|
+
TextReferenceExpression.from(context, refExpression);
|
|
61
61
|
this.chunks = [refChunk];
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { LocalNamedElement } from '@getodk/common/types/dom.ts';
|
|
2
|
-
import type { XFormDefinition } from '../../../XFormDefinition.ts';
|
|
3
2
|
import type { TextRole } from '../../../client/TextRange.ts';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import type { XFormDefinition } from '../../../parse/XFormDefinition.ts';
|
|
4
|
+
import { DependencyContext } from '../../expression/abstract/DependencyContext.ts';
|
|
5
|
+
import type { AnyTextChunkExpression } from '../../expression/abstract/TextChunkExpression.ts';
|
|
6
6
|
import type { AnyMessageDefinition } from '../MessageDefinition.ts';
|
|
7
|
-
import type { AnyTextChunkDefinition } from './TextChunkDefinition.ts';
|
|
8
7
|
import type { AnyTextElementDefinition } from './TextElementDefinition.ts';
|
|
9
8
|
|
|
10
9
|
export type TextBindAttributeLocalName = 'constraintMsg' | 'requiredMsg';
|
|
@@ -25,7 +24,7 @@ export abstract class TextRangeDefinition<Role extends TextRole> extends Depende
|
|
|
25
24
|
readonly parentReference: string | null;
|
|
26
25
|
readonly reference: string | null;
|
|
27
26
|
|
|
28
|
-
abstract readonly chunks: readonly
|
|
27
|
+
abstract readonly chunks: readonly AnyTextChunkExpression[];
|
|
29
28
|
|
|
30
29
|
override get isTranslated(): boolean {
|
|
31
30
|
return (
|
|
@@ -52,11 +51,6 @@ export abstract class TextRangeDefinition<Role extends TextRole> extends Depende
|
|
|
52
51
|
this.parentReference = ownerContext.parentReference;
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
override registerDependentExpression(expression: AnyDependentExpression): void {
|
|
56
|
-
this.ownerContext.registerDependentExpression(expression);
|
|
57
|
-
super.registerDependentExpression(expression);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
54
|
toJSON(): object {
|
|
61
55
|
const { form, ownerContext, ...rest } = this;
|
|
62
56
|
|
|
@@ -9,7 +9,9 @@ import type {
|
|
|
9
9
|
FilterPathExprNode,
|
|
10
10
|
FunctionCallNode,
|
|
11
11
|
FunctionNameNode,
|
|
12
|
+
LocalPartNode,
|
|
12
13
|
NumberNode,
|
|
14
|
+
PrefixNode,
|
|
13
15
|
RelativeLocationPathNode,
|
|
14
16
|
StringLiteralNode,
|
|
15
17
|
} from '@getodk/xpath/static/grammar/SyntaxNode.js';
|
|
@@ -464,3 +466,30 @@ export const isConstantTruthyExpression = (
|
|
|
464
466
|
throw new UnreachableError(syntaxNode);
|
|
465
467
|
}
|
|
466
468
|
};
|
|
469
|
+
|
|
470
|
+
interface QualifiedNameExpression {
|
|
471
|
+
readonly prefix: string;
|
|
472
|
+
readonly localPart: string;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export const parseQualifiedNameExpression = (
|
|
476
|
+
expression: string
|
|
477
|
+
): QualifiedNameExpression | null => {
|
|
478
|
+
const { rootNode } = expressionParser.parse(expression);
|
|
479
|
+
const syntaxNode = findTypedPrincipalExpressionNode(['prefixed_name'], rootNode);
|
|
480
|
+
|
|
481
|
+
if (syntaxNode == null) {
|
|
482
|
+
return null;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
const [prefixNode, localPartNode, ...rest] = syntaxNode.children;
|
|
486
|
+
|
|
487
|
+
prefixNode satisfies PrefixNode;
|
|
488
|
+
localPartNode satisfies LocalPartNode;
|
|
489
|
+
rest satisfies readonly [];
|
|
490
|
+
|
|
491
|
+
return {
|
|
492
|
+
prefix: prefixNode.text,
|
|
493
|
+
localPart: localPartNode.text,
|
|
494
|
+
};
|
|
495
|
+
};
|
package/dist/XFormDOM.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { XFormsXPathEvaluator } from '@getodk/xpath';
|
|
2
|
-
|
|
3
|
-
interface XFormDOMNormalizationOptions {
|
|
4
|
-
readonly isNormalized: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare class XFormDOM {
|
|
7
|
-
protected readonly sourceXML: string;
|
|
8
|
-
static from(sourceXML: string): XFormDOM;
|
|
9
|
-
protected readonly normalizedXML: string;
|
|
10
|
-
readonly rootEvaluator: XFormsXPathEvaluator;
|
|
11
|
-
readonly primaryInstanceEvaluator: XFormsXPathEvaluator;
|
|
12
|
-
readonly xformDocument: XMLDocument;
|
|
13
|
-
readonly html: Element;
|
|
14
|
-
readonly head: Element;
|
|
15
|
-
readonly title: Element;
|
|
16
|
-
readonly model: Element;
|
|
17
|
-
readonly primaryInstance: Element;
|
|
18
|
-
readonly primaryInstanceRoot: Element;
|
|
19
|
-
readonly body: Element;
|
|
20
|
-
protected constructor(sourceXML: string, options: XFormDOMNormalizationOptions);
|
|
21
|
-
createInstance(): XFormDOM;
|
|
22
|
-
toJSON(): Omit<this, "xformDocument" | "html" | "rootEvaluator" | "primaryInstanceEvaluator" | "head" | "title" | "model" | "primaryInstance" | "primaryInstanceRoot" | "createInstance" | "toJSON"> & {
|
|
23
|
-
xformDocument: string;
|
|
24
|
-
html: string;
|
|
25
|
-
head: string;
|
|
26
|
-
title: string;
|
|
27
|
-
model: string;
|
|
28
|
-
primaryInstance: string;
|
|
29
|
-
primaryInstanceRoot: string;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export {};
|
package/dist/XFormDataType.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { CollectionValues } from '../../common/types/collections/CollectionValues.ts';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Like JavaRosa. Presumably for explicit types which aren't impelemnted?
|
|
5
|
-
*/
|
|
6
|
-
declare const UNSUPPORTED_DATA_TYPE = "UNSUPPORTED";
|
|
7
|
-
export type UnsupportedDataType = typeof UNSUPPORTED_DATA_TYPE;
|
|
8
|
-
/**
|
|
9
|
-
* Like JavaRosa. Presumably for e.g. groups with explicit binds (`relevant` etc)?
|
|
10
|
-
*/
|
|
11
|
-
declare const NULL_DATA_TYPE = "NULL";
|
|
12
|
-
export type NullDataType = typeof NULL_DATA_TYPE;
|
|
13
|
-
/**
|
|
14
|
-
* As in ODK XForms Spec.
|
|
15
|
-
*
|
|
16
|
-
* TODO: it's unclear why JavaRosa's `DataType` hews closely to the spec, but
|
|
17
|
-
* has certain differences (e.g. string -> TEXT, int -> INTEGER). It's also
|
|
18
|
-
* not immediately clear how additive types like CHOICE and MULTIPLE_ITEMS
|
|
19
|
-
* square with the underlying spec types.
|
|
20
|
-
*/
|
|
21
|
-
export declare const XFORM_SPEC_DATA_TYPES: readonly ["string", "int", "boolean", "decimal", "date", "time", "dateTime", "geopoint", "geotrace", "geoshape", "binary", "barcode", "intent"];
|
|
22
|
-
export type XFormSpecDataType = CollectionValues<typeof XFORM_SPEC_DATA_TYPES>;
|
|
23
|
-
export type XFormDataType = NullDataType | UnsupportedDataType | XFormSpecDataType;
|
|
24
|
-
declare const DEFAULT_XFORM_DATA_TYPE = "string";
|
|
25
|
-
export type DefaultXFormDataType = typeof DEFAULT_XFORM_DATA_TYPE;
|
|
26
|
-
export declare const bindDataType: (bindType: string | null) => XFormDataType;
|
|
27
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { TokenListParser, ParsedTokenList } from '../../lib/TokenListParser.ts';
|
|
2
|
-
|
|
3
|
-
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
|
-
export type InputAppearanceDefinition = ParsedTokenList<typeof inputAppearanceParser>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { InputDefinition } from '../body/control/InputDefinition.ts';
|
|
2
|
-
import { LeafNodeDefinition } from '../model/LeafNodeDefinition.ts';
|
|
3
|
-
import { BaseNode, BaseNodeState } from './BaseNode.ts';
|
|
4
|
-
import { NodeAppearances } from './NodeAppearances.ts';
|
|
5
|
-
import { RootNode } from './RootNode.ts';
|
|
6
|
-
import { GeneralParentNode } from './hierarchy.ts';
|
|
7
|
-
import { LeafNodeValidationState } from './validation.ts';
|
|
8
|
-
|
|
9
|
-
export interface StringNodeState extends BaseNodeState {
|
|
10
|
-
get children(): null;
|
|
11
|
-
get valueOptions(): null;
|
|
12
|
-
/**
|
|
13
|
-
* Reflects the current value of a {@link StringNode}. This value may be
|
|
14
|
-
* populated when a form is loaded, and it may be updated by certain
|
|
15
|
-
* computations defined by the form. It may also be updated by a client, using
|
|
16
|
-
* the {@link StringNode.setValue} method.
|
|
17
|
-
*/
|
|
18
|
-
get value(): string;
|
|
19
|
-
}
|
|
20
|
-
export interface StringDefinition extends LeafNodeDefinition {
|
|
21
|
-
readonly bodyElement: InputDefinition;
|
|
22
|
-
}
|
|
23
|
-
export type StringNodeAppearances = NodeAppearances<StringDefinition>;
|
|
24
|
-
/**
|
|
25
|
-
* A node which can be assigned a string/text value. A string node **MAY**
|
|
26
|
-
* correspond to form field defined as an XForms `<input>`, which a user-facing
|
|
27
|
-
* client would likely present for a user to fill. It may not correspond to an
|
|
28
|
-
* `<input>`, or necessarily have any presentational implications for a client
|
|
29
|
-
* (for instance if the node is bound to an XForms `calculate` expression).
|
|
30
|
-
*/
|
|
31
|
-
export interface StringNode extends BaseNode {
|
|
32
|
-
readonly nodeType: 'string';
|
|
33
|
-
readonly appearances: StringNodeAppearances;
|
|
34
|
-
readonly definition: StringDefinition;
|
|
35
|
-
readonly root: RootNode;
|
|
36
|
-
readonly parent: GeneralParentNode;
|
|
37
|
-
readonly currentState: StringNodeState;
|
|
38
|
-
readonly validationState: LeafNodeValidationState;
|
|
39
|
-
/**
|
|
40
|
-
* For use by a client to update the value of a string node.
|
|
41
|
-
*
|
|
42
|
-
* @todo [how] should we express write restrictions to a client? E.g. what
|
|
43
|
-
* happens when a string node is readonly, and a client attempts to call this
|
|
44
|
-
* method?
|
|
45
|
-
*/
|
|
46
|
-
setValue(value: string): RootNode;
|
|
47
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AnyDependentExpression } from './DependentExpression.ts';
|
|
2
|
-
|
|
3
|
-
export declare abstract class DependencyContext {
|
|
4
|
-
abstract get parentReference(): string | null;
|
|
5
|
-
abstract get reference(): string | null;
|
|
6
|
-
protected readonly dependentExpressions: Set<AnyDependentExpression>;
|
|
7
|
-
protected dependencyExpressionsCache: ReadonlySet<string> | null;
|
|
8
|
-
get dependencyExpressions(): ReadonlySet<string>;
|
|
9
|
-
get isTranslated(): boolean;
|
|
10
|
-
set isTranslated(value: true);
|
|
11
|
-
protected _isTranslated: boolean;
|
|
12
|
-
registerDependentExpression(expression: AnyDependentExpression): void;
|
|
13
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Accessor } from 'solid-js';
|
|
2
|
-
import { InputDefinition } from '../body/control/InputDefinition.ts';
|
|
3
|
-
import { StringNode, StringNodeAppearances } from '../client/StringNode.ts';
|
|
4
|
-
import { TextRange } from '../client/TextRange.ts';
|
|
5
|
-
import { AnyViolation, LeafNodeValidationState } from '../client/validation.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 { SimpleAtomicState } from '../lib/reactivity/types.ts';
|
|
10
|
-
import { LeafNodeDefinition } from '../model/LeafNodeDefinition.ts';
|
|
11
|
-
import { Root } from './Root.ts';
|
|
12
|
-
import { DescendantNodeStateSpec, DescendantNode } from './abstract/DescendantNode.ts';
|
|
13
|
-
import { GeneralParentNode } from './hierarchy.ts';
|
|
14
|
-
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
15
|
-
import { SubscribableDependency } from './internal-api/SubscribableDependency.ts';
|
|
16
|
-
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
17
|
-
import { ValueContext } from './internal-api/ValueContext.ts';
|
|
18
|
-
|
|
19
|
-
export interface StringFieldDefinition extends LeafNodeDefinition {
|
|
20
|
-
readonly bodyElement: InputDefinition;
|
|
21
|
-
}
|
|
22
|
-
interface StringFieldStateSpec extends DescendantNodeStateSpec<string> {
|
|
23
|
-
readonly label: Accessor<TextRange<'label'> | null>;
|
|
24
|
-
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
25
|
-
readonly children: null;
|
|
26
|
-
readonly value: SimpleAtomicState<string>;
|
|
27
|
-
readonly valueOptions: null;
|
|
28
|
-
}
|
|
29
|
-
export declare class StringField extends DescendantNode<StringFieldDefinition, StringFieldStateSpec, null> implements StringNode, EvaluationContext, SubscribableDependency, ValidationContext, ValueContext<string> {
|
|
30
|
-
private readonly validation;
|
|
31
|
-
protected readonly state: SharedNodeState<StringFieldStateSpec>;
|
|
32
|
-
protected engineState: EngineState<StringFieldStateSpec>;
|
|
33
|
-
readonly nodeType = "string";
|
|
34
|
-
readonly appearances: StringNodeAppearances;
|
|
35
|
-
readonly currentState: CurrentState<StringFieldStateSpec>;
|
|
36
|
-
get validationState(): LeafNodeValidationState;
|
|
37
|
-
readonly encodeValue: (value: string) => string;
|
|
38
|
-
readonly decodeValue: (value: string) => string;
|
|
39
|
-
constructor(parent: GeneralParentNode, definition: StringFieldDefinition);
|
|
40
|
-
getViolation(): AnyViolation | null;
|
|
41
|
-
isBlank(): boolean;
|
|
42
|
-
getChildren(): readonly [];
|
|
43
|
-
setValue(value: string): Root;
|
|
44
|
-
}
|
|
45
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { ReactiveScope } from '../../lib/reactivity/scope.ts';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Provides a common interface to explicitly establish a reactive subscription
|
|
5
|
-
* to a form node, regardless of which node-specific details might trigger
|
|
6
|
-
* reactive updates. This is primarily intended for use in coordination with a
|
|
7
|
-
* node's {@link EvaluationContext} interface, so that computed expression
|
|
8
|
-
* evaluations can be re-executed when their dependencies update, without
|
|
9
|
-
* requiring a given evaluation to handle node-specific logic to determine
|
|
10
|
-
* when/whether updates have occurred.
|
|
11
|
-
*
|
|
12
|
-
* @example Given a form with these bindings:
|
|
13
|
-
*
|
|
14
|
-
* ```xml
|
|
15
|
-
* <bind nodeset="/data/field-1" />
|
|
16
|
-
* <bind nodeset="/data/field-2" type="int" />
|
|
17
|
-
* <bind nodeset="/data/group-a" relevant="/data/field-1 != ''" />
|
|
18
|
-
* <bind nodeset="/data/group-a/field-a-1" calculate="/data/field-2 * 2" />
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* The field `/data/group-a/field-a-1`'s calculate has two dependencies:
|
|
22
|
-
*
|
|
23
|
-
* - `/data-field-2` (explicit)
|
|
24
|
-
* - `/data/group-a` (implicit: non-relevance is inherited)
|
|
25
|
-
*
|
|
26
|
-
* (This is an oversimplification, but it helps to illustrate the concept.)
|
|
27
|
-
*
|
|
28
|
-
* The first dependency's subscription is clearly concerned with that leaf
|
|
29
|
-
* node's value. In which case, that node's `subscribe` method should react to
|
|
30
|
-
* updates to its value (e.g. its `currentState.value` or the internal reactive
|
|
31
|
-
* representation thereof).
|
|
32
|
-
*
|
|
33
|
-
* Whereas the second dependency has no value (no parent nodes do); instead, the
|
|
34
|
-
* subscription would be concerned with that node's relevance. In which case,
|
|
35
|
-
* that node's `subscribe` method should react to updates to its relevance state
|
|
36
|
-
* (e.g. its `currentState.relevant` or the internal reactive represeentation
|
|
37
|
-
* thereof).
|
|
38
|
-
*
|
|
39
|
-
* @example Given a form with:
|
|
40
|
-
*
|
|
41
|
-
* ```xml
|
|
42
|
-
* <!-- model -->
|
|
43
|
-
* <bind nodeset="/data/repeat-a/field-a-1" calculate="position(..)" />
|
|
44
|
-
* <!-- body -->
|
|
45
|
-
* <repeat nodeset="/data/repeat-a" />
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* The field `/data/repeat-a/field-a-1` has a dependency on its containing
|
|
49
|
-
* repeat instance. That node also doesn't have a value, and here the dynamic
|
|
50
|
-
* aspect of the dependency is the node's current position. Here the node's
|
|
51
|
-
* `subscribe` method should react to changes in its position (likely indirectly
|
|
52
|
-
* by reading its `contextReference`).
|
|
53
|
-
*
|
|
54
|
-
* @see {@link EvaluationContext}
|
|
55
|
-
* @see {@link EvaluationContext.contextReference}
|
|
56
|
-
*/
|
|
57
|
-
export interface SubscribableDependency {
|
|
58
|
-
readonly scope: ReactiveScope;
|
|
59
|
-
readonly subscribe: VoidFunction;
|
|
60
|
-
}
|