@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
package/dist/instance/Group.d.ts
CHANGED
|
@@ -2,10 +2,11 @@ import { XPathNodeKindKey } from '@getodk/xpath';
|
|
|
2
2
|
import { Accessor } from 'solid-js';
|
|
3
3
|
import { GroupDefinition, GroupNode, GroupNodeAppearances } from '../client/GroupNode.ts';
|
|
4
4
|
import { FormNodeID } from '../client/identity.ts';
|
|
5
|
-
import {
|
|
5
|
+
import { InstanceState } from '../client/serialization/InstanceState.ts';
|
|
6
6
|
import { TextRange } from '../client/TextRange.ts';
|
|
7
7
|
import { AncestorNodeValidationState } from '../client/validation.ts';
|
|
8
8
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
9
|
+
import { StaticElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
9
10
|
import { MaterializedChildren } from '../lib/reactivity/materializeCurrentStateChildren.ts';
|
|
10
11
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
11
12
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
@@ -13,7 +14,7 @@ import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeSt
|
|
|
13
14
|
import { DescendantNodeSharedStateSpec, DescendantNode } from './abstract/DescendantNode.ts';
|
|
14
15
|
import { GeneralChildNode, GeneralParentNode } from './hierarchy.ts';
|
|
15
16
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
16
|
-
import {
|
|
17
|
+
import { ClientReactiveSerializableParentNode } from './internal-api/serialization/ClientReactiveSerializableParentNode.ts';
|
|
17
18
|
interface GroupStateSpec extends DescendantNodeSharedStateSpec {
|
|
18
19
|
readonly label: Accessor<TextRange<'label'> | null>;
|
|
19
20
|
readonly hint: null;
|
|
@@ -21,17 +22,18 @@ interface GroupStateSpec extends DescendantNodeSharedStateSpec {
|
|
|
21
22
|
readonly valueOptions: null;
|
|
22
23
|
readonly value: null;
|
|
23
24
|
}
|
|
24
|
-
export declare class Group extends DescendantNode<GroupDefinition, GroupStateSpec, GeneralParentNode, GeneralChildNode> implements GroupNode, XFormsXPathElement, EvaluationContext,
|
|
25
|
+
export declare class Group extends DescendantNode<GroupDefinition, GroupStateSpec, GeneralParentNode, GeneralChildNode> implements GroupNode, XFormsXPathElement, EvaluationContext, ClientReactiveSerializableParentNode<GeneralChildNode> {
|
|
25
26
|
private readonly childrenState;
|
|
26
27
|
readonly [XPathNodeKindKey] = "element";
|
|
27
28
|
protected readonly state: SharedNodeState<GroupStateSpec>;
|
|
28
29
|
protected engineState: EngineState<GroupStateSpec>;
|
|
29
30
|
readonly nodeType = "group";
|
|
30
31
|
readonly appearances: GroupNodeAppearances;
|
|
32
|
+
readonly nodeOptions: null;
|
|
31
33
|
readonly currentState: MaterializedChildren<CurrentState<GroupStateSpec>, GeneralChildNode>;
|
|
32
34
|
readonly validationState: AncestorNodeValidationState;
|
|
33
|
-
readonly
|
|
34
|
-
constructor(parent: GeneralParentNode, definition: GroupDefinition);
|
|
35
|
+
readonly instanceState: InstanceState;
|
|
36
|
+
constructor(parent: GeneralParentNode, instanceNode: StaticElement | null, definition: GroupDefinition);
|
|
35
37
|
getChildren(): readonly GeneralChildNode[];
|
|
36
38
|
}
|
|
37
39
|
export {};
|
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
2
|
import { Accessor } from 'solid-js';
|
|
3
|
-
import { InputDefinition, InputNode, InputNodeAppearances, InputNodeInputValue } from '../client/InputNode.ts';
|
|
3
|
+
import { InputDefinition, InputNode, InputNodeAppearances, InputNodeInputValue, InputNodeOptions } from '../client/InputNode.ts';
|
|
4
4
|
import { TextRange } from '../client/TextRange.ts';
|
|
5
5
|
import { ValueType } from '../client/ValueType.ts';
|
|
6
6
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
7
|
+
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
7
8
|
import { RuntimeInputValue, RuntimeValue } from '../lib/codecs/getSharedValueCodec.ts';
|
|
8
9
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
9
10
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
10
11
|
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
11
|
-
import { Root } from './Root.ts';
|
|
12
12
|
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
13
13
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
14
14
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
15
|
+
import { ClientReactiveSerializableValueNode } from './internal-api/serialization/ClientReactiveSerializableValueNode.ts';
|
|
15
16
|
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
16
|
-
import {
|
|
17
|
+
import { Root } from './Root.ts';
|
|
17
18
|
export type AnyInputDefinition = {
|
|
18
19
|
[V in ValueType]: InputDefinition<V>;
|
|
19
20
|
}[ValueType];
|
|
20
21
|
interface InputControlStateSpec<V extends ValueType> extends ValueNodeStateSpec<RuntimeValue<V>> {
|
|
21
22
|
readonly label: Accessor<TextRange<'label'> | null>;
|
|
22
23
|
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
24
|
+
readonly valueOptions: null;
|
|
23
25
|
}
|
|
24
|
-
export declare class InputControl<V extends ValueType = ValueType> extends ValueNode<V, InputDefinition<V>, RuntimeValue<V>, RuntimeInputValue<V>> implements InputNode<V>, XFormsXPathElement, EvaluationContext, ValidationContext,
|
|
25
|
-
static from(parent: GeneralParentNode, definition: InputDefinition): AnyInputControl;
|
|
26
|
+
export declare class InputControl<V extends ValueType = ValueType> extends ValueNode<V, InputDefinition<V>, RuntimeValue<V>, RuntimeInputValue<V>> implements InputNode<V>, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSerializableValueNode {
|
|
27
|
+
static from(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: InputDefinition): AnyInputControl;
|
|
26
28
|
readonly [XPathNodeKindKey] = "element";
|
|
27
29
|
protected readonly state: SharedNodeState<InputControlStateSpec<V>>;
|
|
28
30
|
protected readonly engineState: EngineState<InputControlStateSpec<V>>;
|
|
29
31
|
readonly nodeType = "input";
|
|
30
32
|
readonly appearances: InputNodeAppearances;
|
|
33
|
+
readonly nodeOptions: InputNodeOptions<V>;
|
|
31
34
|
readonly currentState: CurrentState<InputControlStateSpec<V>>;
|
|
32
|
-
constructor(parent: GeneralParentNode, definition: InputDefinition<V>);
|
|
35
|
+
constructor(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: InputDefinition<V>);
|
|
33
36
|
setValue(value: InputNodeInputValue<V>): Root;
|
|
34
37
|
}
|
|
35
38
|
export type AnyInputControl = InputControl<'barcode'> | InputControl<'binary'> | InputControl<'boolean'> | InputControl<'date'> | InputControl<'dateTime'> | InputControl<'decimal'> | InputControl<'geopoint'> | InputControl<'geoshape'> | InputControl<'geotrace'> | InputControl<'int'> | InputControl<'intent'> | InputControl<'string'> | InputControl<'time'>;
|
|
@@ -2,6 +2,7 @@ import { XPathNodeKindKey } from '@getodk/xpath';
|
|
|
2
2
|
import { ModelValueDefinition, ModelValueNode } from '../client/ModelValueNode.ts';
|
|
3
3
|
import { ValueType } from '../client/ValueType.ts';
|
|
4
4
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
5
|
+
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
5
6
|
import { RuntimeInputValue, RuntimeValue } from '../lib/codecs/getSharedValueCodec.ts';
|
|
6
7
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
7
8
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
@@ -10,20 +11,22 @@ import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
|
10
11
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
11
12
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
12
13
|
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
13
|
-
import {
|
|
14
|
+
import { ClientReactiveSerializableValueNode } from './internal-api/serialization/ClientReactiveSerializableValueNode.ts';
|
|
14
15
|
interface ModelValueStateSpec<V extends ValueType> extends ValueNodeStateSpec<RuntimeValue<V>> {
|
|
15
16
|
readonly label: null;
|
|
16
17
|
readonly hint: null;
|
|
18
|
+
readonly valueOptions: null;
|
|
17
19
|
}
|
|
18
|
-
export declare class ModelValue<V extends ValueType = ValueType> extends ValueNode<V, ModelValueDefinition<V>, RuntimeValue<V>, RuntimeInputValue<V>> implements ModelValueNode<V>, XFormsXPathElement, EvaluationContext, ValidationContext,
|
|
19
|
-
static from(parent: GeneralParentNode, definition: ModelValueDefinition): AnyModelValue;
|
|
20
|
+
export declare class ModelValue<V extends ValueType = ValueType> extends ValueNode<V, ModelValueDefinition<V>, RuntimeValue<V>, RuntimeInputValue<V>> implements ModelValueNode<V>, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSerializableValueNode {
|
|
21
|
+
static from(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: ModelValueDefinition): AnyModelValue;
|
|
20
22
|
readonly [XPathNodeKindKey] = "element";
|
|
21
23
|
protected readonly state: SharedNodeState<ModelValueStateSpec<V>>;
|
|
22
24
|
protected readonly engineState: EngineState<ModelValueStateSpec<V>>;
|
|
23
25
|
readonly nodeType = "model-value";
|
|
24
26
|
readonly appearances: null;
|
|
27
|
+
readonly nodeOptions: null;
|
|
25
28
|
readonly currentState: CurrentState<ModelValueStateSpec<V>>;
|
|
26
|
-
constructor(parent: GeneralParentNode, definition: ModelValueDefinition<V>);
|
|
29
|
+
constructor(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: ModelValueDefinition<V>);
|
|
27
30
|
}
|
|
28
31
|
export type AnyModelValue = ModelValue<'barcode'> | ModelValue<'binary'> | ModelValue<'boolean'> | ModelValue<'date'> | ModelValue<'dateTime'> | ModelValue<'decimal'> | ModelValue<'geopoint'> | ModelValue<'geoshape'> | ModelValue<'geotrace'> | ModelValue<'int'> | ModelValue<'intent'> | ModelValue<'string'> | ModelValue<'time'>;
|
|
29
32
|
export {};
|
package/dist/instance/Note.d.ts
CHANGED
|
@@ -1,48 +1,37 @@
|
|
|
1
1
|
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
2
|
import { Accessor } from 'solid-js';
|
|
3
|
-
import { NoteNode, NoteNodeAppearances } from '../client/NoteNode.ts';
|
|
4
|
-
import { SubmissionState } from '../client/submission/SubmissionState.ts';
|
|
3
|
+
import { NoteNode, NoteNodeAppearances, NoteValue } from '../client/NoteNode.ts';
|
|
5
4
|
import { TextRange } from '../client/TextRange.ts';
|
|
6
|
-
import {
|
|
5
|
+
import { ValueType } from '../client/ValueType.ts';
|
|
7
6
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
7
|
+
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
8
|
+
import { NoteInputValue, NoteRuntimeValue } from '../lib/codecs/NoteCodec.ts';
|
|
8
9
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
9
10
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
10
11
|
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
11
12
|
import { ComputedNoteText } from '../lib/reactivity/text/createNoteText.ts';
|
|
12
|
-
import { SimpleAtomicState } from '../lib/reactivity/types.ts';
|
|
13
13
|
import { NoteNodeDefinition } from '../parse/model/NoteNodeDefinition.ts';
|
|
14
|
-
import {
|
|
14
|
+
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
15
15
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
16
16
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
17
|
-
import {
|
|
17
|
+
import { ClientReactiveSerializableValueNode } from './internal-api/serialization/ClientReactiveSerializableValueNode.ts';
|
|
18
18
|
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
19
|
-
|
|
20
|
-
interface NoteStateSpec extends DescendantNodeStateSpec<string> {
|
|
19
|
+
interface NoteStateSpec<V extends ValueType> extends ValueNodeStateSpec<NoteValue<V>> {
|
|
21
20
|
readonly readonly: Accessor<true>;
|
|
22
21
|
readonly noteText: ComputedNoteText;
|
|
23
22
|
readonly label: Accessor<TextRange<'label', 'form'> | null>;
|
|
24
23
|
readonly hint: Accessor<TextRange<'hint', 'form'> | null>;
|
|
25
|
-
readonly children: null;
|
|
26
|
-
readonly value: SimpleAtomicState<string>;
|
|
27
24
|
readonly valueOptions: null;
|
|
28
25
|
}
|
|
29
|
-
export declare class Note extends
|
|
30
|
-
private readonly validation;
|
|
26
|
+
export declare class Note<V extends ValueType = ValueType> extends ValueNode<V, NoteNodeDefinition<V>, NoteRuntimeValue<V>, NoteInputValue<V>> implements NoteNode, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSerializableValueNode {
|
|
31
27
|
readonly [XPathNodeKindKey] = "element";
|
|
32
|
-
protected readonly state: SharedNodeState<NoteStateSpec
|
|
33
|
-
protected readonly engineState: EngineState<NoteStateSpec
|
|
28
|
+
protected readonly state: SharedNodeState<NoteStateSpec<V>>;
|
|
29
|
+
protected readonly engineState: EngineState<NoteStateSpec<V>>;
|
|
34
30
|
readonly nodeType = "note";
|
|
35
31
|
readonly appearances: NoteNodeAppearances;
|
|
36
|
-
readonly
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
readonly contextNode: this;
|
|
40
|
-
readonly encodeValue: (value: string) => string;
|
|
41
|
-
readonly decodeValue: (value: string) => string;
|
|
42
|
-
constructor(parent: GeneralParentNode, definition: NoteNodeDefinition);
|
|
43
|
-
getXPathValue(): string;
|
|
44
|
-
getViolation(): AnyViolation | null;
|
|
45
|
-
isBlank(): boolean;
|
|
46
|
-
getChildren(): readonly [];
|
|
32
|
+
readonly nodeOptions: null;
|
|
33
|
+
readonly currentState: CurrentState<NoteStateSpec<V>>;
|
|
34
|
+
constructor(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: NoteNodeDefinition<V>);
|
|
47
35
|
}
|
|
36
|
+
export type AnyNote = Note<'barcode'> | Note<'binary'> | Note<'boolean'> | Note<'date'> | Note<'dateTime'> | Note<'decimal'> | Note<'geopoint'> | Note<'geoshape'> | Note<'geotrace'> | Note<'int'> | Note<'intent'> | Note<'string'> | Note<'time'>;
|
|
48
37
|
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
2
|
import { Accessor } from 'solid-js';
|
|
3
|
+
import { FormInstanceInitializationMode } from '../client/form/FormInstance.ts';
|
|
3
4
|
import { ActiveLanguage, FormLanguage, FormLanguages } from '../client/FormLanguage.ts';
|
|
4
5
|
import { FormNodeID } from '../client/identity.ts';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { InstancePayload } from '../client/serialization/InstancePayload.ts';
|
|
7
|
+
import { InstancePayloadOptions, InstancePayloadType } from '../client/serialization/InstancePayloadOptions.ts';
|
|
8
|
+
import { InstanceState } from '../client/serialization/InstanceState.ts';
|
|
8
9
|
import { AncestorNodeValidationState } from '../client/validation.ts';
|
|
9
10
|
import { XFormsXPathDocument } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
10
11
|
import { EngineXPathEvaluator } from '../integration/xpath/EngineXPathEvaluator.ts';
|
|
12
|
+
import { StaticDocument } from '../integration/xpath/static-dom/StaticDocument.ts';
|
|
11
13
|
import { MaterializedChildren } from '../lib/reactivity/materializeCurrentStateChildren.ts';
|
|
12
14
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
13
15
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
@@ -18,10 +20,11 @@ import { ModelDefinition } from '../parse/model/ModelDefinition.ts';
|
|
|
18
20
|
import { RootDefinition } from '../parse/model/RootDefinition.ts';
|
|
19
21
|
import { SecondaryInstancesDefinition } from '../parse/model/SecondaryInstance/SecondaryInstancesDefinition.ts';
|
|
20
22
|
import { InstanceNode } from './abstract/InstanceNode.ts';
|
|
23
|
+
import { InitialInstanceState } from './input/InitialInstanceState.ts';
|
|
21
24
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
22
25
|
import { InstanceConfig } from './internal-api/InstanceConfig.ts';
|
|
23
26
|
import { PrimaryInstanceDocument } from './internal-api/PrimaryInstanceDocument.ts';
|
|
24
|
-
import {
|
|
27
|
+
import { ClientReactiveSerializableInstance } from './internal-api/serialization/ClientReactiveSerializableInstance.ts';
|
|
25
28
|
import { TranslationContext } from './internal-api/TranslationContext.ts';
|
|
26
29
|
import { Root } from './Root.ts';
|
|
27
30
|
interface PrimaryInstanceStateSpec {
|
|
@@ -36,9 +39,33 @@ interface PrimaryInstanceStateSpec {
|
|
|
36
39
|
readonly value: null;
|
|
37
40
|
readonly activeLanguage: Accessor<ActiveLanguage>;
|
|
38
41
|
}
|
|
39
|
-
|
|
42
|
+
interface PrimaryInstanceStateInputByMode {
|
|
43
|
+
readonly create: null;
|
|
44
|
+
readonly edit: InitialInstanceState;
|
|
45
|
+
readonly restore: InitialInstanceState;
|
|
46
|
+
}
|
|
47
|
+
export type PrimaryInstanceInitialState<Mode extends FormInstanceInitializationMode> = PrimaryInstanceStateInputByMode[Mode];
|
|
48
|
+
export interface BasePrimaryInstanceOptions {
|
|
49
|
+
readonly scope: ReactiveScope;
|
|
50
|
+
readonly model: ModelDefinition;
|
|
51
|
+
readonly secondaryInstances: SecondaryInstancesDefinition;
|
|
52
|
+
}
|
|
53
|
+
export interface ModelessPrimaryInstanceOptions extends BasePrimaryInstanceOptions {
|
|
54
|
+
readonly config: InstanceConfig;
|
|
55
|
+
}
|
|
56
|
+
export interface PrimaryInstanceOptions<Mode extends FormInstanceInitializationMode> extends ModelessPrimaryInstanceOptions {
|
|
57
|
+
readonly mode: Mode;
|
|
58
|
+
readonly initialState: PrimaryInstanceInitialState<Mode>;
|
|
59
|
+
}
|
|
60
|
+
export declare class PrimaryInstance<Mode extends FormInstanceInitializationMode = FormInstanceInitializationMode> extends InstanceNode<RootDefinition, PrimaryInstanceStateSpec, null, Root> implements PrimaryInstanceDocument, XFormsXPathDocument, TranslationContext, EvaluationContext, ClientReactiveSerializableInstance {
|
|
61
|
+
/**
|
|
62
|
+
* @todo this will be populated as we introduce other initialization modes!
|
|
63
|
+
*/
|
|
64
|
+
readonly initializationMode: FormInstanceInitializationMode;
|
|
65
|
+
readonly model: ModelDefinition;
|
|
40
66
|
protected readonly state: SharedNodeState<PrimaryInstanceStateSpec>;
|
|
41
67
|
protected readonly engineState: EngineState<PrimaryInstanceStateSpec>;
|
|
68
|
+
readonly instanceNode: StaticDocument;
|
|
42
69
|
readonly getChildren: Accessor<readonly Root[]>;
|
|
43
70
|
readonly hasReadonlyAncestor: () => boolean;
|
|
44
71
|
readonly isReadonly: () => boolean;
|
|
@@ -48,17 +75,18 @@ export declare class PrimaryInstance extends InstanceNode<RootDefinition, Primar
|
|
|
48
75
|
readonly [XPathNodeKindKey] = "document";
|
|
49
76
|
readonly nodeType = "primary-instance";
|
|
50
77
|
readonly appearances: null;
|
|
78
|
+
readonly nodeOptions: null;
|
|
51
79
|
readonly classes: BodyClassList;
|
|
52
80
|
readonly root: Root;
|
|
53
81
|
readonly currentState: MaterializedChildren<CurrentState<PrimaryInstanceStateSpec>, Root>;
|
|
54
82
|
readonly validationState: AncestorNodeValidationState;
|
|
55
|
-
readonly
|
|
83
|
+
readonly instanceState: InstanceState;
|
|
56
84
|
readonly languages: FormLanguages;
|
|
57
85
|
readonly getActiveLanguage: Accessor<ActiveLanguage>;
|
|
58
86
|
readonly isAttached: Accessor<boolean>;
|
|
59
87
|
readonly evaluator: EngineXPathEvaluator;
|
|
60
88
|
readonly contextNode: this;
|
|
61
|
-
constructor(
|
|
89
|
+
constructor(options: PrimaryInstanceOptions<Mode>);
|
|
62
90
|
/**
|
|
63
91
|
* @todo Note that this method's signature is intentionally derived from
|
|
64
92
|
* {@link RootNode.setLanguage}, but its return type differs! The design
|
|
@@ -79,6 +107,6 @@ export declare class PrimaryInstance extends InstanceNode<RootDefinition, Primar
|
|
|
79
107
|
* philosophical reasoning behind the existing signature convention.
|
|
80
108
|
*/
|
|
81
109
|
setLanguage(language: FormLanguage): FormLanguage;
|
|
82
|
-
|
|
110
|
+
prepareInstancePayload<PayloadType extends InstancePayloadType = 'monolithic'>(options?: InstancePayloadOptions<PayloadType>): Promise<InstancePayload<PayloadType>>;
|
|
83
111
|
}
|
|
84
112
|
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
|
+
import { Accessor } from 'solid-js';
|
|
3
|
+
import { RangeInputValue, RangeNode, RangeNodeAppearances, RangeValue } from '../client/RangeNode.ts';
|
|
4
|
+
import { TextRange } from '../client/TextRange.ts';
|
|
5
|
+
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
6
|
+
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
7
|
+
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
8
|
+
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
9
|
+
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
10
|
+
import { AnyRangeNodeDefinition, RangeNodeDefinition, RangeValueType } from '../parse/model/RangeNodeDefinition.ts';
|
|
11
|
+
import { Root } from './Root.ts';
|
|
12
|
+
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
13
|
+
import { GeneralParentNode } from './hierarchy.ts';
|
|
14
|
+
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
15
|
+
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
16
|
+
import { ClientReactiveSerializableValueNode } from './internal-api/serialization/ClientReactiveSerializableValueNode.ts';
|
|
17
|
+
interface RangeControlStateSpec<V extends RangeValueType> extends ValueNodeStateSpec<RangeValue<V>> {
|
|
18
|
+
readonly label: Accessor<TextRange<'label'> | null>;
|
|
19
|
+
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
20
|
+
readonly valueOptions: null;
|
|
21
|
+
}
|
|
22
|
+
export declare class RangeControl<V extends RangeValueType = RangeValueType> extends ValueNode<V, RangeNodeDefinition<V>, RangeValue<V>, RangeInputValue<V>> implements RangeNode<V>, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSerializableValueNode {
|
|
23
|
+
static from(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: AnyRangeNodeDefinition): AnyRangeControl;
|
|
24
|
+
readonly [XPathNodeKindKey] = "element";
|
|
25
|
+
protected readonly state: SharedNodeState<RangeControlStateSpec<V>>;
|
|
26
|
+
protected readonly engineState: EngineState<RangeControlStateSpec<V>>;
|
|
27
|
+
readonly nodeType = "range";
|
|
28
|
+
readonly appearances: RangeNodeAppearances;
|
|
29
|
+
readonly nodeOptions: null;
|
|
30
|
+
readonly currentState: CurrentState<RangeControlStateSpec<V>>;
|
|
31
|
+
constructor(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: RangeNodeDefinition<V>);
|
|
32
|
+
setValue(value: RangeInputValue<V>): Root;
|
|
33
|
+
}
|
|
34
|
+
export type AnyRangeControl = RangeControl<'decimal'> | RangeControl<'int'>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
|
+
import { Accessor } from 'solid-js';
|
|
3
|
+
import { RankDefinition, RankNode, RankValueOptions } from '../client/RankNode.ts';
|
|
4
|
+
import { TextRange } from '../client/TextRange.ts';
|
|
5
|
+
import { ValueType } from '../client/ValueType.ts';
|
|
6
|
+
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
7
|
+
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
8
|
+
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
9
|
+
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
10
|
+
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
11
|
+
import { UnknownAppearanceDefinition } from '../parse/body/appearance/unknownAppearanceParser.ts';
|
|
12
|
+
import { Root } from './Root.ts';
|
|
13
|
+
import { ValueNodeStateSpec, ValueNode } from './abstract/ValueNode.ts';
|
|
14
|
+
import { GeneralParentNode } from './hierarchy.ts';
|
|
15
|
+
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
16
|
+
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
17
|
+
import { ClientReactiveSerializableValueNode } from './internal-api/serialization/ClientReactiveSerializableValueNode.ts';
|
|
18
|
+
export type AnyRankDefinition = {
|
|
19
|
+
[V in ValueType]: RankDefinition<V>;
|
|
20
|
+
}[ValueType];
|
|
21
|
+
interface RankControlStateSpec extends ValueNodeStateSpec<readonly string[]> {
|
|
22
|
+
readonly label: Accessor<TextRange<'label'> | null>;
|
|
23
|
+
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
24
|
+
readonly valueOptions: Accessor<RankValueOptions>;
|
|
25
|
+
}
|
|
26
|
+
export declare class RankControl extends ValueNode<'string', RankDefinition<'string'>, readonly string[], readonly string[]> implements RankNode, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSerializableValueNode {
|
|
27
|
+
static from(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: RankDefinition): RankControl;
|
|
28
|
+
private readonly mapOptionsByValue;
|
|
29
|
+
protected readonly getInstanceValue: Accessor<string>;
|
|
30
|
+
readonly [XPathNodeKindKey] = "element";
|
|
31
|
+
protected readonly state: SharedNodeState<RankControlStateSpec>;
|
|
32
|
+
protected readonly engineState: EngineState<RankControlStateSpec>;
|
|
33
|
+
readonly nodeType = "rank";
|
|
34
|
+
readonly appearances: UnknownAppearanceDefinition;
|
|
35
|
+
readonly nodeOptions: null;
|
|
36
|
+
readonly currentState: CurrentState<RankControlStateSpec>;
|
|
37
|
+
private constructor();
|
|
38
|
+
getValueLabel(value: string): TextRange<'item-label'> | null;
|
|
39
|
+
setValues(valuesInOrder: readonly string[]): Root;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
package/dist/instance/Root.d.ts
CHANGED
|
@@ -3,10 +3,9 @@ import { Accessor } from 'solid-js';
|
|
|
3
3
|
import { ActiveLanguage, FormLanguage, FormLanguages } from '../client/FormLanguage.ts';
|
|
4
4
|
import { FormNodeID } from '../client/identity.ts';
|
|
5
5
|
import { RootNode } from '../client/RootNode.ts';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { SubmissionState } from '../client/submission/SubmissionState.ts';
|
|
6
|
+
import { InstancePayload } from '../client/serialization/InstancePayload.ts';
|
|
7
|
+
import { InstancePayloadOptions, InstancePayloadType } from '../client/serialization/InstancePayloadOptions.ts';
|
|
8
|
+
import { InstanceState } from '../client/serialization/InstanceState.ts';
|
|
10
9
|
import { AncestorNodeValidationState } from '../client/validation.ts';
|
|
11
10
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
12
11
|
import { MaterializedChildren } from '../lib/reactivity/materializeCurrentStateChildren.ts';
|
|
@@ -18,7 +17,7 @@ import { RootDefinition } from '../parse/model/RootDefinition.ts';
|
|
|
18
17
|
import { DescendantNode } from './abstract/DescendantNode.ts';
|
|
19
18
|
import { GeneralChildNode } from './hierarchy.ts';
|
|
20
19
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
21
|
-
import {
|
|
20
|
+
import { ClientReactiveSerializableParentNode } from './internal-api/serialization/ClientReactiveSerializableParentNode.ts';
|
|
22
21
|
import { TranslationContext } from './internal-api/TranslationContext.ts';
|
|
23
22
|
import { PrimaryInstance } from './PrimaryInstance.ts';
|
|
24
23
|
interface RootStateSpec {
|
|
@@ -33,7 +32,7 @@ interface RootStateSpec {
|
|
|
33
32
|
readonly value: null;
|
|
34
33
|
readonly activeLanguage: Accessor<ActiveLanguage>;
|
|
35
34
|
}
|
|
36
|
-
export declare class Root extends DescendantNode<RootDefinition, RootStateSpec, PrimaryInstance, GeneralChildNode> implements RootNode, XFormsXPathElement, EvaluationContext, TranslationContext,
|
|
35
|
+
export declare class Root extends DescendantNode<RootDefinition, RootStateSpec, PrimaryInstance, GeneralChildNode> implements RootNode, XFormsXPathElement, EvaluationContext, TranslationContext, ClientReactiveSerializableParentNode<GeneralChildNode> {
|
|
37
36
|
private readonly childrenState;
|
|
38
37
|
readonly [XPathNodeKindKey] = "element";
|
|
39
38
|
protected readonly state: SharedNodeState<RootStateSpec>;
|
|
@@ -47,15 +46,15 @@ export declare class Root extends DescendantNode<RootDefinition, RootStateSpec,
|
|
|
47
46
|
readonly isRequired: () => boolean;
|
|
48
47
|
readonly nodeType = "root";
|
|
49
48
|
readonly appearances: null;
|
|
49
|
+
readonly nodeOptions: null;
|
|
50
50
|
readonly classes: BodyClassList;
|
|
51
51
|
readonly currentState: MaterializedChildren<CurrentState<RootStateSpec>, GeneralChildNode>;
|
|
52
52
|
readonly validationState: AncestorNodeValidationState;
|
|
53
|
-
readonly
|
|
54
|
-
get submissionDefinition(): SubmissionDefinition;
|
|
53
|
+
readonly instanceState: InstanceState;
|
|
55
54
|
readonly languages: FormLanguages;
|
|
56
55
|
constructor(parent: PrimaryInstance);
|
|
57
56
|
getChildren(): readonly GeneralChildNode[];
|
|
58
57
|
setLanguage(language: FormLanguage): Root;
|
|
59
|
-
|
|
58
|
+
prepareInstancePayload<PayloadType extends InstancePayloadType = 'monolithic'>(options?: InstancePayloadOptions<PayloadType>): Promise<InstancePayload<PayloadType>>;
|
|
60
59
|
}
|
|
61
60
|
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
|
+
import { Accessor } from 'solid-js';
|
|
3
|
+
import { SelectDefinition, SelectItem, SelectNode, SelectNodeAppearances, SelectValueOptions } from '../client/SelectNode.ts';
|
|
4
|
+
import { TextRange } from '../client/TextRange.ts';
|
|
5
|
+
import { ValueType } from '../client/ValueType.ts';
|
|
6
|
+
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
7
|
+
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
8
|
+
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
9
|
+
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
10
|
+
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
11
|
+
import { SelectType } from '../parse/body/control/SelectControlDefinition.ts';
|
|
12
|
+
import { Root } from './Root.ts';
|
|
13
|
+
import { ValueNodeStateSpec, ValueNode } from './abstract/ValueNode.ts';
|
|
14
|
+
import { GeneralParentNode } from './hierarchy.ts';
|
|
15
|
+
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
16
|
+
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
17
|
+
import { ClientReactiveSerializableValueNode } from './internal-api/serialization/ClientReactiveSerializableValueNode.ts';
|
|
18
|
+
export type AnySelectDefinition = {
|
|
19
|
+
[V in ValueType]: SelectDefinition<V>;
|
|
20
|
+
}[ValueType];
|
|
21
|
+
interface SelectControlStateSpec extends ValueNodeStateSpec<readonly string[]> {
|
|
22
|
+
readonly label: Accessor<TextRange<'label'> | null>;
|
|
23
|
+
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
24
|
+
readonly valueOptions: Accessor<SelectValueOptions>;
|
|
25
|
+
}
|
|
26
|
+
export declare class SelectControl extends ValueNode<'string', SelectDefinition<'string'>, readonly string[], readonly string[]> implements SelectNode, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSerializableValueNode {
|
|
27
|
+
static from(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: SelectDefinition): SelectControl;
|
|
28
|
+
private readonly mapOptionsByValue;
|
|
29
|
+
protected readonly getInstanceValue: Accessor<string>;
|
|
30
|
+
readonly [XPathNodeKindKey] = "element";
|
|
31
|
+
protected readonly state: SharedNodeState<SelectControlStateSpec>;
|
|
32
|
+
protected readonly engineState: EngineState<SelectControlStateSpec>;
|
|
33
|
+
readonly nodeType = "select";
|
|
34
|
+
readonly selectType: SelectType;
|
|
35
|
+
readonly appearances: SelectNodeAppearances;
|
|
36
|
+
readonly nodeOptions: null;
|
|
37
|
+
readonly currentState: CurrentState<SelectControlStateSpec>;
|
|
38
|
+
private constructor();
|
|
39
|
+
/**
|
|
40
|
+
* Filters {@link values} to include only those values which are currently
|
|
41
|
+
* available in the mapping produced by {@link mapOptionsByValue}, i.e. within
|
|
42
|
+
* a potentially filtered itemset.
|
|
43
|
+
*
|
|
44
|
+
* Note: this method effectively produces an intersection of
|
|
45
|
+
* {@link sourceValues} and {@link values}. **Importantly**, ordering of the
|
|
46
|
+
* results is deterministic, preserving the order of values as yielded _by
|
|
47
|
+
* {@link sourceValues}_.
|
|
48
|
+
*
|
|
49
|
+
* At time of writing, there are several tests (in `@getodk/scenario`, ported
|
|
50
|
+
* from JavaRosa) which expect the values of a `<select>` to match the order
|
|
51
|
+
* they appear in the control's (potentially filtered) `<itemset>` (or list of
|
|
52
|
+
* `<item>`s, for forms defining those inline).
|
|
53
|
+
*
|
|
54
|
+
* @todo The `<odk:rank>` control, having semantics very similar to
|
|
55
|
+
* `<select>`, will likely perform similar filtering logic. However, one of
|
|
56
|
+
* the important distinctions between these controls is that `<odk:rank>`
|
|
57
|
+
* exists explicitly to control the order of values. It's quite likely that
|
|
58
|
+
* would be achieved by invoking the same logic with the parameter order
|
|
59
|
+
* reversed.
|
|
60
|
+
*/
|
|
61
|
+
private filterValues;
|
|
62
|
+
getValueOption(value: string): SelectItem | null;
|
|
63
|
+
isSelected(value: string): boolean;
|
|
64
|
+
selectValue(value: string | null): Root;
|
|
65
|
+
selectValues(values: readonly string[]): Root;
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
2
|
import { Accessor } from 'solid-js';
|
|
3
3
|
import { FormNodeID } from '../client/identity.ts';
|
|
4
|
-
import {
|
|
4
|
+
import { InstanceState } from '../client/serialization/InstanceState.ts';
|
|
5
5
|
import { SubtreeDefinition, SubtreeNode } from '../client/SubtreeNode.ts';
|
|
6
6
|
import { AncestorNodeValidationState } from '../client/validation.ts';
|
|
7
7
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
8
|
+
import { StaticElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
8
9
|
import { MaterializedChildren } from '../lib/reactivity/materializeCurrentStateChildren.ts';
|
|
9
10
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
10
11
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
@@ -12,7 +13,7 @@ import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeSt
|
|
|
12
13
|
import { DescendantNodeSharedStateSpec, DescendantNode } from './abstract/DescendantNode.ts';
|
|
13
14
|
import { GeneralChildNode, GeneralParentNode } from './hierarchy.ts';
|
|
14
15
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
15
|
-
import {
|
|
16
|
+
import { ClientReactiveSerializableParentNode } from './internal-api/serialization/ClientReactiveSerializableParentNode.ts';
|
|
16
17
|
interface SubtreeStateSpec extends DescendantNodeSharedStateSpec {
|
|
17
18
|
readonly label: null;
|
|
18
19
|
readonly hint: null;
|
|
@@ -20,17 +21,18 @@ interface SubtreeStateSpec extends DescendantNodeSharedStateSpec {
|
|
|
20
21
|
readonly valueOptions: null;
|
|
21
22
|
readonly value: null;
|
|
22
23
|
}
|
|
23
|
-
export declare class Subtree extends DescendantNode<SubtreeDefinition, SubtreeStateSpec, GeneralParentNode, GeneralChildNode> implements SubtreeNode, XFormsXPathElement, EvaluationContext,
|
|
24
|
+
export declare class Subtree extends DescendantNode<SubtreeDefinition, SubtreeStateSpec, GeneralParentNode, GeneralChildNode> implements SubtreeNode, XFormsXPathElement, EvaluationContext, ClientReactiveSerializableParentNode<GeneralChildNode> {
|
|
24
25
|
private readonly childrenState;
|
|
25
26
|
readonly [XPathNodeKindKey] = "element";
|
|
26
27
|
protected readonly state: SharedNodeState<SubtreeStateSpec>;
|
|
27
28
|
protected readonly engineState: EngineState<SubtreeStateSpec>;
|
|
28
29
|
readonly nodeType = "subtree";
|
|
29
30
|
readonly appearances: null;
|
|
31
|
+
readonly nodeOptions: null;
|
|
30
32
|
readonly currentState: MaterializedChildren<CurrentState<SubtreeStateSpec>, GeneralChildNode>;
|
|
31
33
|
readonly validationState: AncestorNodeValidationState;
|
|
32
|
-
readonly
|
|
33
|
-
constructor(parent: GeneralParentNode, definition: SubtreeDefinition);
|
|
34
|
+
readonly instanceState: InstanceState;
|
|
35
|
+
constructor(parent: GeneralParentNode, instanceNode: StaticElement | null, definition: SubtreeDefinition);
|
|
34
36
|
getChildren(): readonly GeneralChildNode[];
|
|
35
37
|
}
|
|
36
38
|
export {};
|
|
@@ -2,46 +2,34 @@ import { XPathNodeKindKey } from '@getodk/xpath';
|
|
|
2
2
|
import { Accessor } from 'solid-js';
|
|
3
3
|
import { TextRange } from '../client/TextRange.ts';
|
|
4
4
|
import { TriggerNode, TriggerNodeDefinition } from '../client/TriggerNode.ts';
|
|
5
|
-
import { SubmissionState } from '../client/submission/SubmissionState.ts';
|
|
6
|
-
import { AnyViolation, LeafNodeValidationState } from '../client/validation.ts';
|
|
7
5
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
6
|
+
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
7
|
+
import { TriggerInputValue, TriggerRuntimeValue } from '../lib/codecs/TriggerCodec.ts';
|
|
8
8
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
9
9
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
10
10
|
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
11
|
-
import { SimpleAtomicState } from '../lib/reactivity/types.ts';
|
|
12
11
|
import { UnknownAppearanceDefinition } from '../parse/body/appearance/unknownAppearanceParser.ts';
|
|
13
12
|
import { Root } from './Root.ts';
|
|
14
|
-
import {
|
|
13
|
+
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
15
14
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
16
15
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
17
16
|
import { ValidationContext } from './internal-api/ValidationContext.ts';
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
interface TriggerControlStateSpec extends DescendantNodeStateSpec<boolean> {
|
|
17
|
+
import { ClientReactiveSerializableValueNode } from './internal-api/serialization/ClientReactiveSerializableValueNode.ts';
|
|
18
|
+
interface TriggerControlStateSpec extends ValueNodeStateSpec<TriggerRuntimeValue> {
|
|
21
19
|
readonly label: Accessor<TextRange<'label'> | null>;
|
|
22
20
|
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
23
|
-
readonly children: null;
|
|
24
|
-
readonly value: SimpleAtomicState<boolean>;
|
|
25
21
|
readonly valueOptions: null;
|
|
26
22
|
}
|
|
27
|
-
export declare class TriggerControl extends
|
|
28
|
-
|
|
23
|
+
export declare class TriggerControl extends ValueNode<'string', TriggerNodeDefinition<'string'>, TriggerRuntimeValue, TriggerInputValue> implements TriggerNode, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSerializableValueNode {
|
|
24
|
+
static from(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: TriggerNodeDefinition): TriggerControl;
|
|
29
25
|
readonly [XPathNodeKindKey] = "element";
|
|
30
26
|
protected readonly state: SharedNodeState<TriggerControlStateSpec>;
|
|
31
27
|
protected readonly engineState: EngineState<TriggerControlStateSpec>;
|
|
32
28
|
readonly nodeType = "trigger";
|
|
33
29
|
readonly appearances: UnknownAppearanceDefinition;
|
|
30
|
+
readonly nodeOptions: null;
|
|
34
31
|
readonly currentState: CurrentState<TriggerControlStateSpec>;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
readonly contextNode: this;
|
|
38
|
-
readonly encodeValue: (runtimeValue: boolean) => string;
|
|
39
|
-
readonly decodeValue: (instanceValue: string) => boolean;
|
|
40
|
-
constructor(parent: GeneralParentNode, definition: TriggerNodeDefinition);
|
|
41
|
-
getXPathValue(): string;
|
|
42
|
-
getViolation(): AnyViolation | null;
|
|
43
|
-
isBlank(): boolean;
|
|
44
|
-
getChildren(): readonly [];
|
|
45
|
-
setValue(value: boolean): Root;
|
|
32
|
+
private constructor();
|
|
33
|
+
setValue(value: TriggerInputValue): Root;
|
|
46
34
|
}
|
|
47
35
|
export {};
|