@getodk/xforms-engine 0.5.0 → 0.7.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 +8 -4
- package/dist/client/BaseValueNode.d.ts +8 -4
- 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 +21 -14
- 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/constants.d.ts +11 -12
- package/dist/client/form/CreateFormInstance.d.ts +14 -0
- package/dist/client/form/EditFormInstance.d.ts +62 -0
- package/dist/client/form/FormInstance.d.ts +104 -0
- package/dist/client/form/FormInstanceConfig.d.ts +17 -0
- package/dist/client/form/FormResource.d.ts +1 -0
- package/dist/client/form/LoadForm.d.ts +79 -0
- package/dist/client/form/LoadFormResult.d.ts +67 -0
- package/dist/client/form/RestoreFormInstance.d.ts +8 -0
- package/dist/client/hierarchy.d.ts +5 -5
- package/dist/client/index.d.ts +37 -11
- package/dist/client/node-types.d.ts +2 -2
- package/dist/client/repeat/BaseRepeatRangeNode.d.ts +3 -4
- package/dist/client/repeat/RepeatInstanceNode.d.ts +4 -5
- package/dist/client/repeat/RepeatRangeControlledNode.d.ts +2 -2
- package/dist/client/repeat/RepeatRangeUncontrolledNode.d.ts +2 -2
- package/dist/client/resources.d.ts +1 -1
- package/dist/client/serialization/InstanceData.d.ts +12 -0
- package/dist/client/serialization/InstanceFile.d.ts +6 -0
- package/dist/client/serialization/InstancePayload.d.ts +93 -0
- package/dist/client/serialization/InstancePayloadOptions.d.ts +23 -0
- package/dist/client/serialization/InstanceState.d.ts +12 -0
- package/dist/client/submission/{SubmissionDefinition.d.ts → SubmissionMeta.d.ts} +1 -1
- package/dist/client/unsupported/UnsupportedControlNode.d.ts +1 -3
- package/dist/entrypoints/FormInstance.d.ts +20 -0
- package/dist/entrypoints/FormResult/BaseFormResult.d.ts +22 -0
- package/dist/entrypoints/FormResult/BaseInstantiableFormResult.d.ts +25 -0
- package/dist/entrypoints/FormResult/FormFailureResult.d.ts +17 -0
- package/dist/entrypoints/FormResult/FormSuccessResult.d.ts +15 -0
- package/dist/entrypoints/FormResult/FormWarningResult.d.ts +15 -0
- package/dist/entrypoints/createInstance.d.ts +9 -0
- package/dist/entrypoints/editInstance.d.ts +9 -0
- package/dist/entrypoints/index.d.ts +4 -0
- package/dist/entrypoints/loadForm.d.ts +4 -0
- package/dist/entrypoints/restoreInstance.d.ts +9 -0
- package/dist/error/LoadFormFailureError.d.ts +9 -0
- package/dist/error/MalformedInstanceDataError.d.ts +3 -0
- 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/TemplatedNodeAttributeSerializationError.d.ts +22 -0
- package/dist/error/XFormsSpecViolationError.d.ts +2 -0
- package/dist/index.d.ts +2 -34
- package/dist/index.js +7274 -5840
- package/dist/index.js.map +1 -1
- package/dist/instance/Group.d.ts +7 -5
- package/dist/instance/InputControl.d.ts +9 -6
- package/dist/instance/ModelValue.d.ts +7 -4
- package/dist/instance/Note.d.ts +14 -25
- package/dist/instance/PrimaryInstance.d.ts +36 -8
- package/dist/instance/RangeControl.d.ts +35 -0
- package/dist/instance/RankControl.d.ts +41 -0
- package/dist/instance/Root.d.ts +8 -9
- package/dist/instance/SelectControl.d.ts +67 -0
- package/dist/instance/Subtree.d.ts +7 -5
- package/dist/instance/TriggerControl.d.ts +10 -22
- package/dist/instance/abstract/DescendantNode.d.ts +11 -3
- package/dist/instance/abstract/InstanceNode.d.ts +10 -5
- package/dist/instance/abstract/ValueNode.d.ts +7 -6
- package/dist/instance/children/DescendantNodeInitOptions.d.ts +32 -0
- package/dist/instance/{children.d.ts → children/buildChildren.d.ts} +1 -1
- package/dist/instance/children/childrenInitOptions.d.ts +9 -0
- package/dist/instance/children/normalizeChildInitOptions.d.ts +2 -0
- package/dist/instance/hierarchy.d.ts +9 -9
- package/dist/instance/input/InitialInstanceState.d.ts +13 -0
- package/dist/instance/input/InstanceAttachmentMap.d.ts +19 -0
- package/dist/instance/internal-api/InstanceConfig.d.ts +2 -9
- package/dist/instance/internal-api/InstanceValueContext.d.ts +10 -1
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableInstance.d.ts +14 -0
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableLeafNode.d.ts +32 -0
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableParentNode.d.ts +18 -0
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableTemplatedNode.d.ts +13 -0
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableValueNode.d.ts +21 -0
- package/dist/instance/repeat/BaseRepeatRange.d.ts +11 -8
- package/dist/instance/repeat/RepeatInstance.d.ts +11 -7
- package/dist/instance/repeat/RepeatRangeControlled.d.ts +27 -3
- package/dist/instance/repeat/RepeatRangeUncontrolled.d.ts +4 -3
- package/dist/instance/resource.d.ts +5 -1
- package/dist/instance/unsupported/UploadControl.d.ts +32 -4
- package/dist/integration/xpath/EngineXPathEvaluator.d.ts +2 -2
- package/dist/integration/xpath/adapter/kind.d.ts +4 -10
- 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 -4
- package/dist/integration/xpath/static-dom/StaticDocument.d.ts +13 -11
- package/dist/integration/xpath/static-dom/StaticElement.d.ts +25 -18
- package/dist/integration/xpath/static-dom/StaticNode.d.ts +1 -1
- package/dist/integration/xpath/static-dom/StaticParentNode.d.ts +13 -0
- package/dist/integration/xpath/static-dom/staticNodeName.d.ts +3 -0
- package/dist/lib/client-reactivity/instance-state/createNodeRangeInstanceState.d.ts +4 -0
- package/dist/lib/client-reactivity/instance-state/createParentNodeInstanceState.d.ts +4 -0
- package/dist/lib/client-reactivity/instance-state/createPrimaryInstanceState.d.ts +3 -0
- package/dist/lib/client-reactivity/instance-state/createRootInstanceState.d.ts +3 -0
- package/dist/lib/client-reactivity/instance-state/createTemplatedNodeInstanceState.d.ts +6 -0
- package/dist/lib/client-reactivity/instance-state/createValueNodeInstanceState.d.ts +3 -0
- package/dist/lib/client-reactivity/instance-state/prepareInstancePayload.d.ts +8 -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/TempUnsupportedControlCodec.d.ts +7 -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/names/UnprefixedXFormsName.d.ts +4 -0
- package/dist/lib/number-parsers.d.ts +2 -0
- package/dist/lib/reactivity/createInstanceValueState.d.ts +2 -27
- 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/ItextTranslationsDefinition.d.ts +18 -0
- package/dist/parse/model/LeafNodeDefinition.d.ts +9 -7
- package/dist/parse/model/ModelDefinition.d.ts +9 -2
- package/dist/parse/model/NodeDefinition.d.ts +30 -45
- package/dist/parse/model/NoteNodeDefinition.d.ts +7 -5
- package/dist/parse/model/RangeNodeDefinition.d.ts +42 -0
- package/dist/parse/model/RepeatDefinition.d.ts +62 -0
- package/dist/parse/model/RootAttributeDefinition.d.ts +21 -0
- package/dist/parse/model/RootAttributeMap.d.ts +24 -0
- package/dist/parse/model/RootDefinition.d.ts +15 -14
- package/dist/parse/model/SecondaryInstance/SecondaryInstancesDefinition.d.ts +15 -2
- package/dist/parse/model/SecondaryInstance/assertSecondaryInstanceDefinition.d.ts +5 -0
- package/dist/parse/model/SecondaryInstance/defineSecondaryInstance.d.ts +5 -0
- package/dist/parse/model/SecondaryInstance/sources/BlankSecondaryInstanceSource.d.ts +1 -7
- package/dist/parse/model/SecondaryInstance/sources/CSVExternalSecondaryInstance.d.ts +1 -1
- package/dist/parse/model/SecondaryInstance/sources/GeoJSONExternalSecondaryInstance.d.ts +1 -1
- package/dist/parse/model/SecondaryInstance/sources/InternalSecondaryInstanceSource.d.ts +1 -1
- package/dist/parse/model/SecondaryInstance/sources/SecondaryInstanceSource.d.ts +1 -1
- package/dist/parse/model/SecondaryInstance/sources/XMLExternalSecondaryInstanceSource.d.ts +1 -1
- package/dist/parse/model/{FormSubmissionDefinition.d.ts → SubmissionDefinition.d.ts} +2 -2
- package/dist/parse/model/SubtreeDefinition.d.ts +9 -7
- package/dist/parse/model/nodeDefinitionMap.d.ts +5 -0
- package/dist/parse/shared/parseInstanceXML.d.ts +21 -0
- package/dist/parse/shared/parseStaticDocumentFromDOMSubtree.d.ts +4 -22
- 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 +7247 -5813
- package/dist/solid.js.map +1 -1
- package/package.json +15 -12
- package/src/client/BaseNode.ts +9 -4
- package/src/client/BaseValueNode.ts +8 -4
- 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 +30 -16
- package/src/client/SelectNode.ts +53 -26
- package/src/client/SubtreeNode.ts +1 -0
- package/src/client/TriggerNode.ts +12 -6
- package/src/client/constants.ts +12 -14
- package/src/client/form/CreateFormInstance.ts +19 -0
- package/src/client/form/EditFormInstance.ts +93 -0
- package/src/client/form/FormInstance.ts +114 -0
- package/src/client/form/FormInstanceConfig.ts +18 -0
- package/src/client/form/FormResource.ts +1 -0
- package/src/client/form/LoadForm.ts +92 -0
- package/src/client/form/LoadFormResult.ts +103 -0
- package/src/client/form/RestoreFormInstance.ts +14 -0
- package/src/client/hierarchy.ts +7 -8
- package/src/client/index.ts +47 -29
- package/src/client/node-types.ts +3 -5
- package/src/client/repeat/BaseRepeatRangeNode.ts +3 -4
- package/src/client/repeat/RepeatInstanceNode.ts +4 -8
- package/src/client/repeat/RepeatRangeControlledNode.ts +2 -2
- package/src/client/repeat/RepeatRangeUncontrolledNode.ts +2 -2
- package/src/client/resources.ts +2 -2
- package/src/client/serialization/InstanceData.ts +16 -0
- package/src/client/serialization/InstanceFile.ts +9 -0
- package/src/client/serialization/InstancePayload.ts +126 -0
- package/src/client/serialization/InstancePayloadOptions.ts +28 -0
- package/src/client/serialization/InstanceState.ts +14 -0
- package/src/client/submission/{SubmissionDefinition.ts → SubmissionMeta.ts} +1 -1
- package/src/client/unsupported/UnsupportedControlNode.ts +2 -6
- package/src/entrypoints/FormInstance.ts +55 -0
- package/src/entrypoints/FormResult/BaseFormResult.ts +40 -0
- package/src/entrypoints/FormResult/BaseInstantiableFormResult.ts +109 -0
- package/src/entrypoints/FormResult/FormFailureResult.ts +44 -0
- package/src/entrypoints/FormResult/FormSuccessResult.ts +25 -0
- package/src/entrypoints/FormResult/FormWarningResult.ts +25 -0
- package/src/entrypoints/createInstance.ts +23 -0
- package/src/entrypoints/editInstance.ts +24 -0
- package/src/entrypoints/index.ts +4 -0
- package/src/entrypoints/loadForm.ts +154 -0
- package/src/entrypoints/restoreInstance.ts +27 -0
- package/src/error/LoadFormFailureError.ts +114 -0
- package/src/error/MalformedInstanceDataError.ts +3 -0
- package/src/error/RankMissingValueError.ts +5 -0
- package/src/error/RankValueTypeError.ts +13 -0
- package/src/error/SelectValueTypeError.ts +22 -0
- package/src/error/TemplatedNodeAttributeSerializationError.ts +24 -0
- package/src/error/XFormsSpecViolationError.ts +1 -0
- package/src/index.ts +2 -56
- package/src/instance/Group.ts +17 -15
- package/src/instance/InputControl.ts +58 -12
- package/src/instance/ModelValue.ts +19 -11
- package/src/instance/Note.ts +40 -64
- package/src/instance/PrimaryInstance.ts +70 -31
- package/src/instance/RangeControl.ts +119 -0
- package/src/instance/RankControl.ts +208 -0
- package/src/instance/Root.ts +21 -31
- package/src/instance/SelectControl.ts +228 -0
- package/src/instance/Subtree.ts +17 -15
- package/src/instance/TriggerControl.ts +50 -80
- package/src/instance/abstract/DescendantNode.ts +13 -8
- package/src/instance/abstract/InstanceNode.ts +19 -7
- package/src/instance/abstract/ValueNode.ts +14 -15
- package/src/instance/children/DescendantNodeInitOptions.ts +35 -0
- package/src/instance/children/buildChildren.ts +206 -0
- package/src/instance/children/childrenInitOptions.ts +117 -0
- package/src/instance/children/normalizeChildInitOptions.ts +332 -0
- package/src/instance/hierarchy.ts +21 -16
- package/src/instance/input/InitialInstanceState.ts +108 -0
- package/src/instance/input/InstanceAttachmentMap.ts +142 -0
- package/src/instance/internal-api/InstanceConfig.ts +3 -10
- package/src/instance/internal-api/InstanceValueContext.ts +11 -1
- package/src/instance/internal-api/serialization/ClientReactiveSerializableInstance.ts +20 -0
- package/src/instance/internal-api/serialization/ClientReactiveSerializableLeafNode.ts +43 -0
- package/src/instance/internal-api/serialization/ClientReactiveSerializableParentNode.ts +26 -0
- package/src/instance/internal-api/serialization/ClientReactiveSerializableTemplatedNode.ts +24 -0
- package/src/instance/internal-api/serialization/ClientReactiveSerializableValueNode.ts +28 -0
- package/src/instance/repeat/BaseRepeatRange.ts +21 -24
- package/src/instance/repeat/RepeatInstance.ts +27 -19
- package/src/instance/repeat/RepeatRangeControlled.ts +90 -17
- package/src/instance/repeat/RepeatRangeUncontrolled.ts +10 -9
- package/src/instance/resource.ts +18 -2
- package/src/instance/unsupported/UploadControl.ts +116 -5
- package/src/integration/xpath/EngineXPathEvaluator.ts +2 -2
- package/src/integration/xpath/adapter/kind.ts +1 -28
- package/src/integration/xpath/adapter/names.ts +66 -17
- package/src/integration/xpath/adapter/traversal.ts +12 -11
- package/src/integration/xpath/static-dom/StaticAttribute.ts +16 -7
- package/src/integration/xpath/static-dom/StaticDocument.ts +17 -18
- package/src/integration/xpath/static-dom/StaticElement.ts +211 -52
- package/src/integration/xpath/static-dom/StaticNode.ts +1 -1
- package/src/integration/xpath/static-dom/StaticParentNode.ts +22 -0
- package/src/integration/xpath/static-dom/staticNodeName.ts +20 -0
- package/src/lib/client-reactivity/instance-state/createNodeRangeInstanceState.ts +17 -0
- package/src/lib/client-reactivity/instance-state/createParentNodeInstanceState.ts +22 -0
- package/src/lib/client-reactivity/instance-state/createPrimaryInstanceState.ts +12 -0
- package/src/lib/client-reactivity/instance-state/createRootInstanceState.ts +19 -0
- package/src/lib/client-reactivity/instance-state/createTemplatedNodeInstanceState.ts +31 -0
- package/src/lib/client-reactivity/instance-state/createValueNodeInstanceState.ts +21 -0
- package/src/lib/client-reactivity/instance-state/prepareInstancePayload.ts +173 -0
- 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/TempUnsupportedControlCodec.ts +32 -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/names/UnprefixedXFormsName.ts +12 -0
- package/src/lib/number-parsers.ts +25 -0
- package/src/lib/reactivity/createInstanceValueState.ts +69 -43
- 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/ItextTranslationsDefinition.ts +79 -0
- package/src/parse/model/LeafNodeDefinition.ts +13 -8
- package/src/parse/model/ModelDefinition.ts +36 -3
- package/src/parse/model/NodeDefinition.ts +38 -85
- package/src/parse/model/NoteNodeDefinition.ts +12 -10
- package/src/parse/model/RangeNodeDefinition.ts +119 -0
- package/src/parse/model/RepeatDefinition.ts +382 -0
- package/src/parse/model/RootAttributeDefinition.ts +44 -0
- package/src/parse/model/RootAttributeMap.ts +49 -0
- package/src/parse/model/RootDefinition.ts +42 -43
- package/src/parse/model/SecondaryInstance/SecondaryInstancesDefinition.ts +23 -2
- package/src/parse/model/SecondaryInstance/assertSecondaryInstanceDefinition.ts +14 -0
- package/src/parse/model/SecondaryInstance/defineSecondaryInstance.ts +32 -0
- package/src/parse/model/SecondaryInstance/sources/BlankSecondaryInstanceSource.ts +3 -24
- package/src/parse/model/SecondaryInstance/sources/CSVExternalSecondaryInstance.ts +33 -86
- package/src/parse/model/SecondaryInstance/sources/GeoJSONExternalSecondaryInstance.ts +64 -136
- package/src/parse/model/SecondaryInstance/sources/InternalSecondaryInstanceSource.ts +9 -7
- package/src/parse/model/SecondaryInstance/sources/SecondaryInstanceSource.ts +1 -1
- package/src/parse/model/SecondaryInstance/sources/XMLExternalSecondaryInstanceSource.ts +7 -7
- package/src/parse/model/{FormSubmissionDefinition.ts → SubmissionDefinition.ts} +2 -2
- package/src/parse/model/SubtreeDefinition.ts +15 -16
- package/src/parse/model/nodeDefinitionMap.ts +34 -0
- package/src/parse/shared/parseInstanceXML.ts +79 -0
- package/src/parse/shared/parseStaticDocumentFromDOMSubtree.ts +46 -131
- 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/EngineConfig.d.ts +0 -79
- package/dist/client/submission/SubmissionData.d.ts +0 -7
- package/dist/client/submission/SubmissionInstanceFile.d.ts +0 -6
- package/dist/client/submission/SubmissionOptions.d.ts +0 -23
- package/dist/client/submission/SubmissionResult.d.ts +0 -91
- package/dist/client/submission/SubmissionState.d.ts +0 -12
- 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/abstract/UnsupportedControl.d.ts +0 -53
- package/dist/instance/index.d.ts +0 -8
- package/dist/instance/internal-api/ValueContext.d.ts +0 -23
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableInstance.d.ts +0 -14
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableLeafNode.d.ts +0 -31
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableParentNode.d.ts +0 -18
- package/dist/instance/internal-api/submission/ClientReactiveSubmittableValueNode.d.ts +0 -17
- 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/client-reactivity/submission/createInstanceSubmissionState.d.ts +0 -3
- package/dist/lib/client-reactivity/submission/createLeafNodeSubmissionState.d.ts +0 -3
- package/dist/lib/client-reactivity/submission/createNodeRangeSubmissionState.d.ts +0 -4
- package/dist/lib/client-reactivity/submission/createParentNodeSubmissionState.d.ts +0 -4
- package/dist/lib/client-reactivity/submission/createValueNodeSubmissionState.d.ts +0 -3
- package/dist/lib/client-reactivity/submission/prepareSubmission.d.ts +0 -8
- package/dist/lib/reactivity/createSelectItems.d.ts +0 -16
- package/dist/lib/reactivity/createValueState.d.ts +0 -40
- 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/dist/parse/model/ItextTranslation/ItextTranslationDefinition.d.ts +0 -4
- package/dist/parse/model/ItextTranslation/ItextTranslationRootDefinition.d.ts +0 -8
- package/dist/parse/model/ItextTranslation/ItextTranslationsDefinition.d.ts +0 -8
- package/dist/parse/model/RepeatInstanceDefinition.d.ts +0 -14
- package/dist/parse/model/RepeatRangeDefinition.d.ts +0 -29
- package/dist/parse/model/RepeatTemplateDefinition.d.ts +0 -28
- package/dist/parse/model/SecondaryInstance/SecondaryInstanceDefinition.d.ts +0 -4
- package/dist/parse/model/SecondaryInstance/SecondaryInstanceRootDefinition.d.ts +0 -7
- package/src/client/EngineConfig.ts +0 -84
- package/src/client/submission/SubmissionData.ts +0 -12
- package/src/client/submission/SubmissionInstanceFile.ts +0 -9
- package/src/client/submission/SubmissionOptions.ts +0 -28
- package/src/client/submission/SubmissionResult.ts +0 -124
- package/src/client/submission/SubmissionState.ts +0 -14
- 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/abstract/UnsupportedControl.ts +0 -174
- package/src/instance/children.ts +0 -158
- package/src/instance/index.ts +0 -55
- package/src/instance/internal-api/ValueContext.ts +0 -28
- package/src/instance/internal-api/submission/ClientReactiveSubmittableInstance.ts +0 -20
- package/src/instance/internal-api/submission/ClientReactiveSubmittableLeafNode.ts +0 -42
- package/src/instance/internal-api/submission/ClientReactiveSubmittableParentNode.ts +0 -25
- package/src/instance/internal-api/submission/ClientReactiveSubmittableValueNode.ts +0 -23
- 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/lib/client-reactivity/submission/createInstanceSubmissionState.ts +0 -12
- package/src/lib/client-reactivity/submission/createLeafNodeSubmissionState.ts +0 -20
- package/src/lib/client-reactivity/submission/createNodeRangeSubmissionState.ts +0 -17
- package/src/lib/client-reactivity/submission/createParentNodeSubmissionState.ts +0 -22
- package/src/lib/client-reactivity/submission/createValueNodeSubmissionState.ts +0 -21
- package/src/lib/client-reactivity/submission/prepareSubmission.ts +0 -172
- package/src/lib/reactivity/createValueState.ts +0 -200
- package/src/parse/body/control/select/ItemsetNodesetContext.ts +0 -21
- package/src/parse/model/ItextTranslation/ItextTranslationDefinition.ts +0 -4
- package/src/parse/model/ItextTranslation/ItextTranslationRootDefinition.ts +0 -41
- package/src/parse/model/ItextTranslation/ItextTranslationsDefinition.ts +0 -31
- package/src/parse/model/RepeatInstanceDefinition.ts +0 -34
- package/src/parse/model/RepeatRangeDefinition.ts +0 -94
- package/src/parse/model/RepeatTemplateDefinition.ts +0 -145
- package/src/parse/model/SecondaryInstance/SecondaryInstanceDefinition.ts +0 -4
- package/src/parse/model/SecondaryInstance/SecondaryInstanceRootDefinition.ts +0 -12
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
import { AnyBodyElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
2
|
import { BindDefinition } from './BindDefinition.ts';
|
|
3
|
-
import {
|
|
3
|
+
import { NodeDefinitionType, ParentNodeDefinition, NodeDefinition } from './NodeDefinition.ts';
|
|
4
4
|
import { RootDefinition } from './RootDefinition.ts';
|
|
5
5
|
export type DescendentNodeType = Exclude<NodeDefinitionType, 'root'>;
|
|
6
6
|
type DescendentNodeBodyElement = AnyBodyElementDefinition;
|
|
7
|
-
export declare abstract class DescendentNodeDefinition<Type extends DescendentNodeType, BodyElement extends DescendentNodeBodyElement | null = DescendentNodeBodyElement | null>
|
|
8
|
-
readonly parent:
|
|
9
|
-
readonly bind: BindDefinition;
|
|
7
|
+
export declare abstract class DescendentNodeDefinition<Type extends DescendentNodeType, BodyElement extends DescendentNodeBodyElement | null = DescendentNodeBodyElement | null> extends NodeDefinition<Type> {
|
|
8
|
+
readonly parent: ParentNodeDefinition;
|
|
10
9
|
readonly bodyElement: BodyElement;
|
|
11
|
-
abstract readonly type: Type;
|
|
12
|
-
abstract readonly children: NodeChildren<Type>;
|
|
13
|
-
abstract readonly instances: NodeInstances<Type>;
|
|
14
|
-
abstract readonly defaultValue: NodeDefaultValue<Type>;
|
|
15
|
-
abstract readonly node: ModelNode<Type>;
|
|
16
|
-
abstract readonly nodeName: string;
|
|
17
10
|
readonly root: RootDefinition;
|
|
18
|
-
readonly nodeset: string;
|
|
19
11
|
readonly isTranslated: boolean;
|
|
20
|
-
constructor(parent:
|
|
12
|
+
constructor(parent: ParentNodeDefinition, bind: BindDefinition, bodyElement: BodyElement);
|
|
21
13
|
}
|
|
22
|
-
export type AnyDescendantNodeDefinition = DescendentNodeDefinition<any, any>;
|
|
23
14
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { XFORMS_KNOWN_ATTRIBUTE, XFORMS_LOCAL_NAME, XFormsItextTranslationMap } from '@getodk/xpath';
|
|
2
|
+
import { StaticDocument } from '../../integration/xpath/static-dom/StaticDocument.ts';
|
|
3
|
+
import { StaticElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
4
|
+
import { XFormDOM } from '../XFormDOM.ts';
|
|
5
|
+
export interface ItextTranslationDefinition extends StaticDocument {
|
|
6
|
+
readonly rootDocument: ItextTranslationDefinition;
|
|
7
|
+
readonly root: ItextTranslationRootDefinition;
|
|
8
|
+
}
|
|
9
|
+
export interface ItextTranslationRootDefinition extends StaticElement {
|
|
10
|
+
readonly [XFORMS_LOCAL_NAME]: 'translation';
|
|
11
|
+
readonly [XFORMS_KNOWN_ATTRIBUTE]: 'lang';
|
|
12
|
+
readonly root: ItextTranslationRootDefinition;
|
|
13
|
+
readonly rootDocument: ItextTranslationDefinition;
|
|
14
|
+
}
|
|
15
|
+
export declare class ItextTranslationsDefinition extends Map<string, ItextTranslationRootDefinition> implements XFormsItextTranslationMap<ItextTranslationRootDefinition> {
|
|
16
|
+
static from(xformDOM: XFormDOM): ItextTranslationsDefinition;
|
|
17
|
+
private constructor();
|
|
18
|
+
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { ValueType } from '../../client/ValueType.ts';
|
|
2
|
+
import { StaticLeafElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
3
|
+
import { NamespaceDeclarationMap, NamedSubtreeDefinition } from '../../lib/names/NamespaceDeclarationMap.ts';
|
|
4
|
+
import { QualifiedName } from '../../lib/names/QualifiedName.ts';
|
|
2
5
|
import { AnyBodyElementDefinition, ControlElementDefinition } from '../body/BodyDefinition.ts';
|
|
3
6
|
import { BindDefinition } from './BindDefinition.ts';
|
|
4
7
|
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
5
|
-
import {
|
|
6
|
-
export declare class LeafNodeDefinition<V extends ValueType = ValueType> extends DescendentNodeDefinition<'leaf-node', ControlElementDefinition | null> implements
|
|
7
|
-
readonly
|
|
8
|
+
import { ParentNodeDefinition } from './NodeDefinition.ts';
|
|
9
|
+
export declare class LeafNodeDefinition<V extends ValueType = ValueType> extends DescendentNodeDefinition<'leaf-node', ControlElementDefinition | null> implements NamedSubtreeDefinition {
|
|
10
|
+
readonly template: StaticLeafElement;
|
|
8
11
|
readonly type = "leaf-node";
|
|
9
12
|
readonly valueType: V;
|
|
10
|
-
readonly
|
|
13
|
+
readonly namespaceDeclarations: NamespaceDeclarationMap;
|
|
14
|
+
readonly qualifiedName: QualifiedName;
|
|
11
15
|
readonly children: null;
|
|
12
|
-
|
|
13
|
-
readonly defaultValue: string;
|
|
14
|
-
constructor(parent: ParentNodeDefinition, bind: BindDefinition, bodyElement: AnyBodyElementDefinition | null, node: Element);
|
|
16
|
+
constructor(parent: ParentNodeDefinition, bind: BindDefinition, bodyElement: AnyBodyElementDefinition | null, template: StaticLeafElement);
|
|
15
17
|
toJSON(): Omit<this, "parent" | "toJSON" | "bind" | "root" | "bodyElement">;
|
|
16
18
|
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
+
import { StaticDocument } from '../../integration/xpath/static-dom/StaticDocument.ts';
|
|
1
2
|
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
2
|
-
import { ItextTranslationsDefinition } from './
|
|
3
|
+
import { ItextTranslationsDefinition } from './ItextTranslationsDefinition.ts';
|
|
3
4
|
import { ModelBindMap } from './ModelBindMap.ts';
|
|
5
|
+
import { AnyNodeDefinition } from './NodeDefinition.ts';
|
|
6
|
+
import { NodeDefinitionMap } from './nodeDefinitionMap.ts';
|
|
4
7
|
import { RootDefinition } from './RootDefinition.ts';
|
|
5
8
|
export declare class ModelDefinition {
|
|
6
9
|
readonly form: XFormDefinition;
|
|
7
10
|
readonly binds: ModelBindMap;
|
|
8
11
|
readonly root: RootDefinition;
|
|
12
|
+
readonly nodes: NodeDefinitionMap;
|
|
13
|
+
readonly instance: StaticDocument;
|
|
9
14
|
readonly itextTranslations: ItextTranslationsDefinition;
|
|
10
15
|
constructor(form: XFormDefinition);
|
|
11
|
-
|
|
16
|
+
getNodeDefinition(nodeset: string): AnyNodeDefinition;
|
|
17
|
+
getRootDefinition(instance: StaticDocument): RootDefinition;
|
|
18
|
+
toJSON(): Omit<this, "form" | "toJSON" | "getNodeDefinition" | "getRootDefinition">;
|
|
12
19
|
}
|
|
@@ -1,73 +1,58 @@
|
|
|
1
|
+
import { StaticElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
2
|
+
import { NamedSubtreeDefinition, NamespaceDeclarationMap } from '../../lib/names/NamespaceDeclarationMap.ts';
|
|
3
|
+
import { QualifiedName } from '../../lib/names/QualifiedName.ts';
|
|
1
4
|
import { AnyBodyElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
5
|
import { RepeatElementDefinition } from '../body/RepeatElementDefinition.ts';
|
|
3
6
|
import { BindDefinition } from './BindDefinition.ts';
|
|
4
7
|
import { LeafNodeDefinition } from './LeafNodeDefinition.ts';
|
|
5
|
-
import {
|
|
6
|
-
import { AnyRepeatRangeDefinition } from './RepeatRangeDefinition.ts';
|
|
7
|
-
import { RepeatTemplateDefinition } from './RepeatTemplateDefinition.ts';
|
|
8
|
+
import { AnyRepeatDefinition } from './RepeatDefinition.ts';
|
|
8
9
|
import { RootDefinition } from './RootDefinition.ts';
|
|
9
10
|
import { SubtreeDefinition } from './SubtreeDefinition.ts';
|
|
10
11
|
/**
|
|
11
|
-
* Corresponds to
|
|
12
|
+
* Corresponds to a model instance root node, i.e.:
|
|
12
13
|
*
|
|
13
14
|
* - the element matching `/*` in primary instance expressions, a.k.a.
|
|
14
15
|
* - `/h:html/h:head/xf:model/xf:instance[1]/*`
|
|
15
16
|
*/
|
|
16
17
|
export type RootNodeType = 'root';
|
|
17
18
|
/**
|
|
18
|
-
* Corresponds to
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* as a template from the form's first element matched by a <repeat nodeset>.
|
|
26
|
-
*/
|
|
27
|
-
export type RepeatTemplateType = 'repeat-template';
|
|
28
|
-
/**
|
|
29
|
-
* Corresponds to a single instance of a model/entry DOM subtree which
|
|
30
|
-
* in turn corresponds to a <repeat> in the form body definition, and a
|
|
31
|
-
* 'repeat-range' definition.
|
|
19
|
+
* Corresponds to the combined concepts defining a "repeat".
|
|
20
|
+
*
|
|
21
|
+
* @see {@link RepeatDefinition} for details on these concepts and how they are used to produce a "repeat definition", as such.
|
|
22
|
+
*
|
|
23
|
+
* , including or
|
|
24
|
+
* referencing all of the following:
|
|
25
|
+
*
|
|
32
26
|
*/
|
|
33
|
-
export type
|
|
27
|
+
export type RepeatType = 'repeat';
|
|
34
28
|
/**
|
|
35
|
-
* Corresponds to a model
|
|
29
|
+
* Corresponds to a model instance subtree which **does not** correspond to a
|
|
36
30
|
* <repeat> in the form definition. This will typically correspond to a <group>,
|
|
37
31
|
* but this is not strictly necessary per spec (hence the distinct name).
|
|
38
32
|
*/
|
|
39
33
|
export type SubtreeNodeType = 'subtree';
|
|
40
34
|
/**
|
|
41
|
-
* Corresponds to a model
|
|
35
|
+
* Corresponds to a model instance leaf node, i.e. one of:
|
|
42
36
|
*
|
|
43
37
|
* - An element with no child elements
|
|
44
38
|
* - Any attribute corresponding to a bind's `nodeset` expression
|
|
45
39
|
*/
|
|
46
40
|
export type LeafNodeType = 'leaf-node';
|
|
47
|
-
export type NodeDefinitionType = RootNodeType |
|
|
48
|
-
export type ParentNodeDefinition = RootDefinition |
|
|
49
|
-
export type ChildNodeDefinition =
|
|
50
|
-
export
|
|
51
|
-
export type NodeChildren<Type extends NodeDefinitionType> = Type extends ParentNodeDefinition['type'] ? readonly ChildNodeDefinition[] : null;
|
|
52
|
-
export type NodeInstances<Type extends NodeDefinitionType> = Type extends 'repeat-range' ? readonly RepeatInstanceDefinition[] : null;
|
|
53
|
-
export type NodeParent<Type extends NodeDefinitionType> = Type extends ChildNodeDefinition['type'] | ChildNodeInstanceDefinition['type'] ? ParentNodeDefinition : null;
|
|
54
|
-
export type ModelNode<Type extends NodeDefinitionType> = Type extends 'repeat-range' ? null : Element;
|
|
55
|
-
export type NodeDefaultValue<Type extends NodeDefinitionType> = Type extends 'leaf-node' ? string : null;
|
|
56
|
-
export interface NodeDefinition<Type extends NodeDefinitionType> {
|
|
57
|
-
readonly type: Type;
|
|
41
|
+
export type NodeDefinitionType = RootNodeType | RepeatType | SubtreeNodeType | LeafNodeType;
|
|
42
|
+
export type ParentNodeDefinition = RootDefinition | AnyRepeatDefinition | SubtreeDefinition;
|
|
43
|
+
export type ChildNodeDefinition = AnyRepeatDefinition | LeafNodeDefinition | SubtreeDefinition;
|
|
44
|
+
export declare abstract class NodeDefinition<Type extends NodeDefinitionType> implements NamedSubtreeDefinition {
|
|
58
45
|
readonly bind: BindDefinition;
|
|
46
|
+
abstract readonly type: Type;
|
|
47
|
+
abstract readonly namespaceDeclarations: NamespaceDeclarationMap;
|
|
48
|
+
abstract readonly qualifiedName: QualifiedName;
|
|
49
|
+
abstract readonly bodyElement: AnyBodyElementDefinition | RepeatElementDefinition | null;
|
|
50
|
+
abstract readonly isTranslated: boolean;
|
|
51
|
+
abstract readonly root: RootDefinition;
|
|
52
|
+
abstract readonly parent: ParentNodeDefinition | null;
|
|
53
|
+
abstract readonly template: StaticElement;
|
|
54
|
+
abstract readonly children: readonly ChildNodeDefinition[] | null;
|
|
59
55
|
readonly nodeset: string;
|
|
60
|
-
|
|
61
|
-
readonly bodyElement: AnyBodyElementDefinition | RepeatElementDefinition | null;
|
|
62
|
-
readonly isTranslated: boolean;
|
|
63
|
-
readonly root: RootDefinition;
|
|
64
|
-
readonly parent: NodeParent<Type>;
|
|
65
|
-
readonly children: NodeChildren<Type>;
|
|
66
|
-
readonly instances: NodeInstances<Type>;
|
|
67
|
-
readonly node: ModelNode<Type>;
|
|
68
|
-
readonly defaultValue: NodeDefaultValue<Type>;
|
|
56
|
+
constructor(bind: BindDefinition);
|
|
69
57
|
}
|
|
70
|
-
export type AnyNodeDefinition = RootDefinition |
|
|
71
|
-
export type TypedNodeDefinition<Type> = Extract<AnyNodeDefinition, {
|
|
72
|
-
readonly type: Type;
|
|
73
|
-
}>;
|
|
58
|
+
export type AnyNodeDefinition = RootDefinition | AnyRepeatDefinition | SubtreeDefinition | LeafNodeDefinition;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ValueType } from '../../client/ValueType.ts';
|
|
2
|
+
import { StaticLeafElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
1
3
|
import { AnyBodyElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
4
|
import { InputControlDefinition } from '../body/control/InputControlDefinition.ts';
|
|
3
5
|
import { BindComputationExpression } from '../expression/BindComputationExpression.ts';
|
|
@@ -8,7 +10,7 @@ import { BindDefinition } from './BindDefinition.ts';
|
|
|
8
10
|
import { LeafNodeDefinition } from './LeafNodeDefinition.ts';
|
|
9
11
|
import { ParentNodeDefinition } from './NodeDefinition.ts';
|
|
10
12
|
export type NoteReadonlyDefinition = BindComputationExpression<'readonly'> & ConstantTruthyDependentExpression;
|
|
11
|
-
export interface NoteBindDefinition extends BindDefinition {
|
|
13
|
+
export interface NoteBindDefinition<V extends ValueType> extends BindDefinition<V> {
|
|
12
14
|
readonly readonly: NoteReadonlyDefinition;
|
|
13
15
|
}
|
|
14
16
|
export type NoteTextDefinition = LabelDefinition | HintDefinition;
|
|
@@ -21,10 +23,10 @@ export type NoteTextDefinition = LabelDefinition | HintDefinition;
|
|
|
21
23
|
* aspects of the node's interface (such as its {@link NoteNode.nodeType} and
|
|
22
24
|
* distinct {@link NoteNode.currentState} types) to handle note-specific logic.
|
|
23
25
|
*/
|
|
24
|
-
export declare class NoteNodeDefinition extends LeafNodeDefinition {
|
|
25
|
-
readonly bind: NoteBindDefinition
|
|
26
|
+
export declare class NoteNodeDefinition<V extends ValueType = ValueType> extends LeafNodeDefinition<V> {
|
|
27
|
+
readonly bind: NoteBindDefinition<V>;
|
|
26
28
|
readonly bodyElement: InputControlDefinition;
|
|
27
29
|
readonly noteTextDefinition: NoteTextDefinition;
|
|
28
|
-
static from(parent: ParentNodeDefinition, bind: BindDefinition
|
|
29
|
-
constructor(parent: ParentNodeDefinition, bind: NoteBindDefinition
|
|
30
|
+
static from<V extends ValueType>(parent: ParentNodeDefinition, bind: BindDefinition<V>, bodyElement: AnyBodyElementDefinition | null, node: StaticLeafElement): NoteNodeDefinition<V> | null;
|
|
31
|
+
constructor(parent: ParentNodeDefinition, bind: NoteBindDefinition<V>, bodyElement: InputControlDefinition, noteTextDefinition: NoteTextDefinition, template: StaticLeafElement);
|
|
30
32
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ValueType } from '../../client/ValueType.ts';
|
|
2
|
+
import { StaticLeafElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
3
|
+
import { RuntimeValue } from '../../lib/codecs/getSharedValueCodec.ts';
|
|
4
|
+
import { RangeControlBoundsDefinition, RangeControlDefinition } from '../body/control/RangeControlDefinition.ts';
|
|
5
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
6
|
+
import { LeafNodeDefinition } from './LeafNodeDefinition.ts';
|
|
7
|
+
import { ParentNodeDefinition } from './NodeDefinition.ts';
|
|
8
|
+
declare const RANGE_VALUE_TYPES: readonly ["decimal", "int"];
|
|
9
|
+
export type RangeValueType = (typeof RANGE_VALUE_TYPES)[number];
|
|
10
|
+
export interface RangeLeafNodeDefinition<V extends ValueType = ValueType> extends LeafNodeDefinition<V> {
|
|
11
|
+
readonly bodyElement: RangeControlDefinition;
|
|
12
|
+
}
|
|
13
|
+
declare class RangeNodeBoundsDefinition<V extends RangeValueType = RangeValueType> {
|
|
14
|
+
readonly min: NonNullable<RuntimeValue<V>>;
|
|
15
|
+
readonly max: NonNullable<RuntimeValue<V>>;
|
|
16
|
+
readonly step: NonNullable<RuntimeValue<V>>;
|
|
17
|
+
static from<V extends RangeValueType>(bounds: RangeControlBoundsDefinition, bind: BindDefinition<V>): RangeNodeBoundsDefinition<V>;
|
|
18
|
+
constructor(min: NonNullable<RuntimeValue<V>>, max: NonNullable<RuntimeValue<V>>, step: NonNullable<RuntimeValue<V>>);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @todo We should really consider making `LeafNodeDefinition` an abstract base
|
|
22
|
+
* class, and each node's definition an explicit concrete subclass of that. It
|
|
23
|
+
* would simplify a lot of things, reduce redundancy (and drift!) between
|
|
24
|
+
* various like `*Definition` types, and allow us to reason more clearly about
|
|
25
|
+
* what parse-product-input is used to construct each primary instance node.
|
|
26
|
+
* Furthermore, it would give us a great deal more flexibility to revisit some
|
|
27
|
+
* of the weaker parts of our current data model (e.g. splitting up selects).
|
|
28
|
+
*
|
|
29
|
+
* I explored this refactor as part of the prerequisite work to support range
|
|
30
|
+
* controls. I eventually backed out because it involved more churn than I felt
|
|
31
|
+
* comfortable with, but I do think we should keep an eye out for other
|
|
32
|
+
* opportunities to take on the churn.
|
|
33
|
+
*/
|
|
34
|
+
export declare class RangeNodeDefinition<V extends RangeValueType = RangeValueType> extends LeafNodeDefinition<V> implements RangeLeafNodeDefinition<V> {
|
|
35
|
+
readonly bind: BindDefinition<V>;
|
|
36
|
+
readonly bodyElement: RangeControlDefinition;
|
|
37
|
+
static from<V extends ValueType>(parent: ParentNodeDefinition, bind: BindDefinition<V>, bodyElement: RangeControlDefinition, node: StaticLeafElement): RangeNodeDefinition<Extract<V, RangeValueType>>;
|
|
38
|
+
readonly bounds: RangeNodeBoundsDefinition<V>;
|
|
39
|
+
private constructor();
|
|
40
|
+
}
|
|
41
|
+
export type AnyRangeNodeDefinition = RangeNodeDefinition<'decimal'> | RangeNodeDefinition<'int'>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { StaticElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
2
|
+
import { NamespaceDeclarationMap } from '../../lib/names/NamespaceDeclarationMap.ts';
|
|
3
|
+
import { QualifiedName } from '../../lib/names/QualifiedName.ts';
|
|
4
|
+
import { RepeatElementDefinition } from '../body/RepeatElementDefinition.ts';
|
|
5
|
+
import { RepeatCountControlExpression } from '../expression/RepeatCountControlExpression.ts';
|
|
6
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
7
|
+
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
8
|
+
import { ChildNodeDefinition, ParentNodeDefinition } from './NodeDefinition.ts';
|
|
9
|
+
export type RepeatInstanceNodes = readonly [StaticElement, ...StaticElement[]];
|
|
10
|
+
export interface ControlledRepeatDefinition extends RepeatDefinition {
|
|
11
|
+
readonly count: RepeatCountControlExpression;
|
|
12
|
+
}
|
|
13
|
+
export interface UncontrolledRepeatDefinition extends RepeatDefinition {
|
|
14
|
+
readonly count: null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Represents a definition of the combined concepts colloquially called a
|
|
18
|
+
* "repeat", as defined by a form, where those concepts include:
|
|
19
|
+
*
|
|
20
|
+
* - A {@link RepeatElementDefinition}—corresponding to a `<repeat>` {@link https://getodk.github.io/xforms-spec/#body-elements | body element}—which is associated with the nodeset referencing the "repeat template" and
|
|
21
|
+
* all "repeat instances" (see below points describing both concepts in more detail). The presence of such a body element determines whether to produce a repeat definition (rather than e.g. a {@link SubtreeDefinition}).
|
|
22
|
+
*
|
|
23
|
+
* - A "repeat template", defined by a form either
|
|
24
|
+
* explicitly,
|
|
25
|
+
* or derived from the structure of the first form-defined "repeat instance"
|
|
26
|
+
* (as described in the next point).
|
|
27
|
+
*
|
|
28
|
+
* - A sequence of one or more model instance nodes, each representing a "repeat instance"
|
|
29
|
+
* defined by the form. These nodes contribute to the definition in the following ways:
|
|
30
|
+
*
|
|
31
|
+
* - If an explicit "repeat template" is not defined for
|
|
32
|
+
* the "repeat", one is derived from the **structure** (but not the values!)
|
|
33
|
+
* of the first such model instance node.
|
|
34
|
+
*
|
|
35
|
+
* - If the "repeat" is {@link ControlledRepeatDefinition | controlled} (i.e. by either a `jr:count` or `jr:noAddRemove` {@link https://getodk.github.io/xforms-spec/#body-attributes | attribute} on the associated {@link RepeatElementDefinition}
|
|
36
|
+
*
|
|
37
|
+
* (For construction of this
|
|
38
|
+
* definition, all other referenced instance nodes are **consumed** in the
|
|
39
|
+
* process of building the repeat definition's subtree of a
|
|
40
|
+
* {@link RootDefinition}, ensuring that one repeat definition is produced for
|
|
41
|
+
* all applicable nodes; they are later referenced for construction of a
|
|
42
|
+
* form's {@link PrimaryInstance | instance state}.)
|
|
43
|
+
*
|
|
44
|
+
* Combined, these concepts produce the details required to instantiate the
|
|
45
|
+
* {@link RepeatRange} and {@link RepeatInstance} instance state nodes
|
|
46
|
+
* associated with a defined repeat.
|
|
47
|
+
*/
|
|
48
|
+
export declare class RepeatDefinition extends DescendentNodeDefinition<'repeat', RepeatElementDefinition> {
|
|
49
|
+
static from(parent: ParentNodeDefinition, bind: BindDefinition, bodyElement: RepeatElementDefinition, instanceNodes: RepeatInstanceNodes): AnyRepeatDefinition;
|
|
50
|
+
readonly type = "repeat";
|
|
51
|
+
readonly children: readonly ChildNodeDefinition[];
|
|
52
|
+
readonly count: RepeatCountControlExpression | null;
|
|
53
|
+
readonly template: StaticElement;
|
|
54
|
+
readonly namespaceDeclarations: NamespaceDeclarationMap;
|
|
55
|
+
readonly qualifiedName: QualifiedName;
|
|
56
|
+
private constructor();
|
|
57
|
+
isControlled(): this is ControlledRepeatDefinition;
|
|
58
|
+
isUncontrolled(): this is UncontrolledRepeatDefinition;
|
|
59
|
+
omitTemplate(instanceNodes: readonly StaticElement[]): readonly StaticElement[];
|
|
60
|
+
toJSON(): object;
|
|
61
|
+
}
|
|
62
|
+
export type AnyRepeatDefinition = ControlledRepeatDefinition | UncontrolledRepeatDefinition;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NamedNodeDefinition } from '../../lib/names/NamespaceDeclarationMap.ts';
|
|
2
|
+
import { QualifiedName } from '../../lib/names/QualifiedName.ts';
|
|
3
|
+
import { RootDefinition } from './RootDefinition.ts';
|
|
4
|
+
interface RootAttributeSource {
|
|
5
|
+
readonly qualifiedName: QualifiedName;
|
|
6
|
+
readonly value: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* @todo This class is named and typed to emphasize its intentionally narrow
|
|
10
|
+
* usage and purpose. It **intentionally** avoids addressing the much broader
|
|
11
|
+
* set of concerns around modeling attributes in primary instance/submissions.
|
|
12
|
+
*/
|
|
13
|
+
export declare class RootAttributeDefinition implements NamedNodeDefinition {
|
|
14
|
+
private readonly serializedXML;
|
|
15
|
+
readonly parent: RootDefinition;
|
|
16
|
+
readonly qualifiedName: QualifiedName;
|
|
17
|
+
readonly value: string;
|
|
18
|
+
constructor(root: RootDefinition, source: RootAttributeSource);
|
|
19
|
+
serializeAttributeXML(): string;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StaticElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
2
|
+
import { QualifiedName } from '../../lib/names/QualifiedName.ts';
|
|
3
|
+
import { RootAttributeDefinition } from './RootAttributeDefinition.ts';
|
|
4
|
+
import { RootDefinition } from './RootDefinition.ts';
|
|
5
|
+
/**
|
|
6
|
+
* @todo This can be trivially expanded to a narrowly general case when we
|
|
7
|
+
* prioritize work to
|
|
8
|
+
* {@link https://github.com/getodk/web-forms/issues/285 | support attributes}
|
|
9
|
+
* (as modeled form nodes on par with elements). It's been deferred here to
|
|
10
|
+
* avoid expanding scope of an already fairly large yak shave.
|
|
11
|
+
*
|
|
12
|
+
* @todo There's a **much more expansive** general case just waiting for a good
|
|
13
|
+
* opportuntity to prioritize it. E.g. a `NamedNodeMap<T>`, where T is any
|
|
14
|
+
* generalized concept of a named node. This expansive generalization would have
|
|
15
|
+
* a ton of value in a variety of known performance optimization
|
|
16
|
+
* targets/solutions (i.e. optimizing the most redundant, suboptimal, frequently
|
|
17
|
+
* performed aspects of any typical XPath expression in a typical XForm).
|
|
18
|
+
*
|
|
19
|
+
* @see {@link QualifiedName} for more detail.
|
|
20
|
+
*/
|
|
21
|
+
export declare class RootAttributeMap extends Map<QualifiedName, RootAttributeDefinition> {
|
|
22
|
+
static from(root: RootDefinition, instanceNode: StaticElement): RootAttributeMap;
|
|
23
|
+
private constructor();
|
|
24
|
+
}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
+
import { StaticElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
2
|
+
import { NamespaceDeclarationMap } from '../../lib/names/NamespaceDeclarationMap.ts';
|
|
3
|
+
import { QualifiedName } from '../../lib/names/QualifiedName.ts';
|
|
1
4
|
import { BodyClassList } from '../body/BodyDefinition.ts';
|
|
2
5
|
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
3
|
-
import { BindDefinition } from './BindDefinition.ts';
|
|
4
|
-
import { FormSubmissionDefinition } from './FormSubmissionDefinition.ts';
|
|
5
6
|
import { ModelDefinition } from './ModelDefinition.ts';
|
|
6
|
-
import { ChildNodeDefinition,
|
|
7
|
-
|
|
7
|
+
import { ChildNodeDefinition, ParentNodeDefinition, NodeDefinition } from './NodeDefinition.ts';
|
|
8
|
+
import { RootAttributeMap } from './RootAttributeMap.ts';
|
|
9
|
+
import { SubmissionDefinition } from './SubmissionDefinition.ts';
|
|
10
|
+
export declare class RootDefinition extends NodeDefinition<'root'> {
|
|
8
11
|
protected readonly form: XFormDefinition;
|
|
9
12
|
protected readonly model: ModelDefinition;
|
|
10
|
-
readonly submission:
|
|
13
|
+
readonly submission: SubmissionDefinition;
|
|
11
14
|
readonly classes: BodyClassList;
|
|
12
15
|
readonly type = "root";
|
|
13
|
-
readonly
|
|
14
|
-
readonly nodeset: string;
|
|
15
|
-
readonly nodeName: string;
|
|
16
|
+
readonly qualifiedName: QualifiedName;
|
|
16
17
|
readonly bodyElement: null;
|
|
17
18
|
readonly root: this;
|
|
18
19
|
readonly parent: null;
|
|
20
|
+
readonly template: StaticElement;
|
|
21
|
+
readonly namespaceDeclarations: NamespaceDeclarationMap;
|
|
22
|
+
readonly attributes: RootAttributeMap;
|
|
19
23
|
readonly children: readonly ChildNodeDefinition[];
|
|
20
|
-
readonly instances: null;
|
|
21
|
-
readonly node: Element;
|
|
22
|
-
readonly defaultValue: null;
|
|
23
24
|
readonly isTranslated = false;
|
|
24
|
-
constructor(form: XFormDefinition, model: ModelDefinition, submission:
|
|
25
|
-
buildSubtree(parent: ParentNodeDefinition): readonly ChildNodeDefinition[];
|
|
26
|
-
toJSON(): Omit<this, "form" | "toJSON" | "bind" | "
|
|
25
|
+
constructor(form: XFormDefinition, model: ModelDefinition, submission: SubmissionDefinition, classes: BodyClassList);
|
|
26
|
+
buildSubtree(parent: ParentNodeDefinition, node: StaticElement): readonly ChildNodeDefinition[];
|
|
27
|
+
toJSON(): Omit<this, "form" | "toJSON" | "bind" | "root" | "model" | "bodyElement" | "buildSubtree">;
|
|
27
28
|
}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import { XFormsSecondaryInstanceMap } from '@getodk/xpath';
|
|
1
|
+
import { XFORMS_KNOWN_ATTRIBUTE, XFORMS_LOCAL_NAME, XFormsSecondaryInstanceMap } from '@getodk/xpath';
|
|
2
2
|
import { EngineXPathNode } from '../../../integration/xpath/adapter/kind.ts';
|
|
3
|
+
import { StaticDocument } from '../../../integration/xpath/static-dom/StaticDocument.ts';
|
|
4
|
+
import { StaticElement } from '../../../integration/xpath/static-dom/StaticElement.ts';
|
|
3
5
|
import { XFormDOM } from '../../XFormDOM.ts';
|
|
4
|
-
import { SecondaryInstanceRootDefinition } from './SecondaryInstanceRootDefinition.ts';
|
|
5
6
|
import { ExternalSecondaryInstanceResourceLoadOptions } from './sources/ExternalSecondaryInstanceResource.ts';
|
|
7
|
+
export interface SecondaryInstanceDefinition extends StaticDocument {
|
|
8
|
+
readonly rootDocument: SecondaryInstanceDefinition;
|
|
9
|
+
readonly root: SecondaryInstanceRootDefinition;
|
|
10
|
+
}
|
|
11
|
+
export interface SecondaryInstanceRootDefinition extends StaticElement {
|
|
12
|
+
readonly [XFORMS_LOCAL_NAME]: 'instance';
|
|
13
|
+
readonly [XFORMS_KNOWN_ATTRIBUTE]: 'id';
|
|
14
|
+
readonly rootDocument: SecondaryInstanceDefinition;
|
|
15
|
+
readonly root: SecondaryInstanceRootDefinition;
|
|
16
|
+
getAttributeValue(localName: 'id'): string;
|
|
17
|
+
getAttributeValue(localName: string): string | null;
|
|
18
|
+
}
|
|
6
19
|
export declare class SecondaryInstancesDefinition extends Map<string, SecondaryInstanceRootDefinition> implements XFormsSecondaryInstanceMap<EngineXPathNode> {
|
|
7
20
|
/**
|
|
8
21
|
* @package Only to be used for testing
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { StaticDocument } from '../../../integration/xpath/static-dom/StaticDocument.ts';
|
|
2
|
+
import { SecondaryInstanceDefinition } from './SecondaryInstancesDefinition.ts';
|
|
3
|
+
type AssertSecondaryInstanceDefinition = (doc: StaticDocument) => asserts doc is SecondaryInstanceDefinition;
|
|
4
|
+
export declare const assertSecondaryInstanceDefinition: AssertSecondaryInstanceDefinition;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { StaticElementOptions } from '../../../integration/xpath/static-dom/StaticElement.ts';
|
|
2
|
+
import { SecondaryInstanceDefinition } from './SecondaryInstancesDefinition.ts';
|
|
3
|
+
type SecondaryInstanceRoot = StaticElementOptions | '';
|
|
4
|
+
export declare const defineSecondaryInstance: (instanceId: string, secondaryInstanceRoot: SecondaryInstanceRoot) => SecondaryInstanceDefinition;
|
|
5
|
+
export {};
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { JRResourceURL } from '../../../../../../common/src/jr-resources/JRResourceURL.ts';
|
|
2
2
|
import { DOMSecondaryInstanceElement } from '../../../XFormDOM.ts';
|
|
3
|
-
import { SecondaryInstanceDefinition } from '../
|
|
3
|
+
import { SecondaryInstanceDefinition } from '../SecondaryInstancesDefinition.ts';
|
|
4
4
|
import { SecondaryInstanceSource } from './SecondaryInstanceSource.ts';
|
|
5
5
|
export declare class BlankSecondaryInstanceSource extends SecondaryInstanceSource<'blank'> {
|
|
6
6
|
constructor(instanceId: string, resourceURL: JRResourceURL, domElement: DOMSecondaryInstanceElement);
|
|
7
|
-
/**
|
|
8
|
-
* @todo there is really no sense in using the DOM for this, other than it was
|
|
9
|
-
* quicker/more ergonomic than constructing the requisite {@link StaticNode}
|
|
10
|
-
* structures directly. Pretty good sign those constructor signatures could
|
|
11
|
-
* use some TLC!
|
|
12
|
-
*/
|
|
13
7
|
parseDefinition(): SecondaryInstanceDefinition;
|
|
14
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SecondaryInstanceDefinition } from '../
|
|
1
|
+
import { SecondaryInstanceDefinition } from '../SecondaryInstancesDefinition.ts';
|
|
2
2
|
import { ExternalSecondaryInstanceSource } from './ExternalSecondaryInstanceSource.ts';
|
|
3
3
|
export declare class CSVExternalSecondaryInstanceSource extends ExternalSecondaryInstanceSource<'csv'> {
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SecondaryInstanceDefinition } from '../
|
|
1
|
+
import { SecondaryInstanceDefinition } from '../SecondaryInstancesDefinition.ts';
|
|
2
2
|
import { ExternalSecondaryInstanceSource } from './ExternalSecondaryInstanceSource.ts';
|
|
3
3
|
export declare class GeoJSONExternalSecondaryInstanceSource extends ExternalSecondaryInstanceSource<'geojson'> {
|
|
4
4
|
parseDefinition(): SecondaryInstanceDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DOMSecondaryInstanceElement } from '../../../XFormDOM.ts';
|
|
2
|
-
import { SecondaryInstanceDefinition } from '../
|
|
2
|
+
import { SecondaryInstanceDefinition } from '../SecondaryInstancesDefinition.ts';
|
|
3
3
|
import { SecondaryInstanceSource } from './SecondaryInstanceSource.ts';
|
|
4
4
|
export declare class InternalSecondaryInstanceSource extends SecondaryInstanceSource<'internal'> {
|
|
5
5
|
constructor(instanceId: string, resourceURL: null, domElement: DOMSecondaryInstanceElement);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JRResourceURL } from '../../../../../../common/src/jr-resources/JRResourceURL.ts';
|
|
2
2
|
import { DOMSecondaryInstanceElement } from '../../../XFormDOM.ts';
|
|
3
|
-
import { SecondaryInstanceDefinition } from '../
|
|
3
|
+
import { SecondaryInstanceDefinition } from '../SecondaryInstancesDefinition.ts';
|
|
4
4
|
export type ExternalSecondaryInstanceSourceFormat = 'csv' | 'geojson' | 'xml';
|
|
5
5
|
export type SecondaryInstanceSourceFormat = ExternalSecondaryInstanceSourceFormat | 'internal' | 'blank';
|
|
6
6
|
export declare abstract class SecondaryInstanceSource<Format extends SecondaryInstanceSourceFormat = SecondaryInstanceSourceFormat> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SecondaryInstanceDefinition } from '../
|
|
1
|
+
import { SecondaryInstanceDefinition } from '../SecondaryInstancesDefinition.ts';
|
|
2
2
|
import { ExternalSecondaryInstanceSource } from './ExternalSecondaryInstanceSource.ts';
|
|
3
3
|
export declare class XMLExternalSecondaryInstanceSource extends ExternalSecondaryInstanceSource<'xml'> {
|
|
4
4
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SubmissionMeta } from '../../client/submission/SubmissionMeta.ts';
|
|
2
2
|
import { XFormDOM } from '../XFormDOM.ts';
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class SubmissionDefinition implements SubmissionMeta {
|
|
4
4
|
readonly submissionAction: URL | null;
|
|
5
5
|
readonly submissionMethod = "post";
|
|
6
6
|
readonly encryptionKey: string | null;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import { StaticElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
2
|
+
import { NamespaceDeclarationMap } from '../../lib/names/NamespaceDeclarationMap.ts';
|
|
3
|
+
import { QualifiedName } from '../../lib/names/QualifiedName.ts';
|
|
1
4
|
import { AnyBodyElementDefinition, AnyGroupElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
5
|
import { BindDefinition } from './BindDefinition.ts';
|
|
3
6
|
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
4
|
-
import { ChildNodeDefinition,
|
|
5
|
-
export declare class SubtreeDefinition extends DescendentNodeDefinition<'subtree', AnyGroupElementDefinition | null>
|
|
6
|
-
readonly
|
|
7
|
+
import { ChildNodeDefinition, ParentNodeDefinition } from './NodeDefinition.ts';
|
|
8
|
+
export declare class SubtreeDefinition extends DescendentNodeDefinition<'subtree', AnyGroupElementDefinition | null> {
|
|
9
|
+
readonly template: StaticElement;
|
|
7
10
|
readonly type = "subtree";
|
|
8
|
-
readonly
|
|
11
|
+
readonly namespaceDeclarations: NamespaceDeclarationMap;
|
|
12
|
+
readonly qualifiedName: QualifiedName;
|
|
9
13
|
readonly children: readonly ChildNodeDefinition[];
|
|
10
|
-
|
|
11
|
-
readonly defaultValue: null;
|
|
12
|
-
constructor(parent: ParentNodeDefinition, bind: BindDefinition, bodyElement: AnyBodyElementDefinition | null, node: Element);
|
|
14
|
+
constructor(parent: ParentNodeDefinition, bind: BindDefinition, bodyElement: AnyBodyElementDefinition | null, template: StaticElement);
|
|
13
15
|
toJSON(): Omit<this, "parent" | "toJSON" | "bind" | "root" | "bodyElement">;
|
|
14
16
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AnyNodeDefinition } from './NodeDefinition.ts';
|
|
2
|
+
import { RootDefinition } from './RootDefinition.ts';
|
|
3
|
+
export type NodesetReference = string;
|
|
4
|
+
export type NodeDefinitionMap = ReadonlyMap<NodesetReference, AnyNodeDefinition>;
|
|
5
|
+
export declare const nodeDefinitionMap: (root: RootDefinition) => NodeDefinitionMap;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StaticDocument } from '../../integration/xpath/static-dom/StaticDocument.ts';
|
|
2
|
+
import { ModelDefinition } from '../model/ModelDefinition.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Parses incoming instance XML input into a {@link StaticDocument}, preserving
|
|
5
|
+
* the form definition's default namespace URI (when the instance XML does not
|
|
6
|
+
* explicitly declare a default namespace).
|
|
7
|
+
*
|
|
8
|
+
* @todo This is a hack! A proper solution will involve extending namespace
|
|
9
|
+
* resolution (i.e. probably {@link NamespaceDeclarationMap}) from
|
|
10
|
+
* {@link RootDefinition} on down throughout the instance's {@link StaticNode}
|
|
11
|
+
* tree. The same will probably be the case for parsing (XML) external secondary
|
|
12
|
+
* instances as well, so at that point we can also stop using this specialized
|
|
13
|
+
* name!
|
|
14
|
+
*
|
|
15
|
+
* @todo Aside from this being a hack, it's not very robust because it makes
|
|
16
|
+
* assumptions which are _likely but definitely not guaranteed_!
|
|
17
|
+
*
|
|
18
|
+
* - Instance XML (probably) doeesn't declare a default namespace
|
|
19
|
+
* - Instance XML **definitely** declares non-default namespaces
|
|
20
|
+
*/
|
|
21
|
+
export declare const parseInstanceXML: (model: ModelDefinition, instanceXML: string) => StaticDocument;
|