@getodk/xforms-engine 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/AttributeNode.d.ts +4 -3
- package/dist/client/InputNode.d.ts +8 -4
- package/dist/client/MarkdownNode.d.ts +3 -0
- package/dist/client/NoteNode.d.ts +6 -2
- package/dist/client/form/FormInstanceConfig.d.ts +4 -0
- package/dist/client/form/LoadFormResult.d.ts +5 -14
- package/dist/client/form/ResetFormInstance.d.ts +13 -0
- package/dist/entrypoints/FormResult/BaseFormResult.d.ts +1 -0
- package/dist/entrypoints/FormResult/BaseInstantiableFormResult.d.ts +2 -0
- package/dist/entrypoints/FormResult/FormFailureResult.d.ts +2 -0
- package/dist/entrypoints/createPotentiallyClientOwnedReactiveScope.d.ts +19 -0
- package/dist/index.js +22150 -25908
- package/dist/index.js.map +1 -1
- package/dist/instance/Attribute.d.ts +11 -23
- package/dist/instance/Group.d.ts +3 -0
- package/dist/instance/InputControl.d.ts +3 -0
- package/dist/instance/ModelValue.d.ts +4 -0
- package/dist/instance/Note.d.ts +4 -0
- package/dist/instance/PrimaryInstance.d.ts +7 -1
- package/dist/instance/RangeControl.d.ts +4 -0
- package/dist/instance/RankControl.d.ts +5 -1
- package/dist/instance/Root.d.ts +3 -0
- package/dist/instance/SelectControl.d.ts +5 -1
- package/dist/instance/TriggerControl.d.ts +4 -0
- package/dist/instance/UploadControl.d.ts +3 -0
- package/dist/instance/abstract/DescendantNode.d.ts +5 -4
- package/dist/instance/abstract/InstanceNode.d.ts +4 -3
- package/dist/instance/hierarchy.d.ts +2 -1
- package/dist/instance/internal-api/AttributeContext.d.ts +1 -0
- package/dist/instance/internal-api/InstanceConfig.d.ts +2 -1
- package/dist/instance/internal-api/InstanceValueContext.d.ts +1 -0
- package/dist/instance/markdown/MarkdownNode.d.ts +14 -9
- package/dist/instance/repeat/RepeatInstance.d.ts +2 -0
- package/dist/integration/xpath/adapter/XFormsXPathNode.d.ts +1 -1
- package/dist/integration/xpath/adapter/kind.d.ts +5 -3
- package/dist/integration/xpath/adapter/traversal.d.ts +3 -3
- package/dist/integration/xpath/static-dom/StaticAttribute.d.ts +1 -0
- package/dist/integration/xpath/static-dom/StaticDocument.d.ts +2 -0
- package/dist/lib/codecs/{Geopoint/Geopoint.d.ts → geolocation/Geolocation.d.ts} +11 -15
- package/dist/lib/codecs/geolocation/Geopoint.d.ts +7 -0
- package/dist/lib/codecs/geolocation/Geoshape.d.ts +7 -0
- package/dist/lib/codecs/geolocation/Geotrace.d.ts +7 -0
- package/dist/lib/codecs/geolocation/createGeolocationValueCodec.d.ts +3 -0
- package/dist/lib/codecs/getSharedValueCodec.d.ts +7 -5
- package/dist/lib/reactivity/text/createTextRange.d.ts +0 -2
- package/dist/parse/XFormDOM.d.ts +7 -1
- package/dist/parse/body/appearance/inputAppearanceParser.d.ts +1 -1
- package/dist/parse/model/ActionDefinition.d.ts +1 -1
- package/dist/parse/model/AttributeDefinition.d.ts +2 -0
- package/dist/parse/model/BindPreloadDefinition.d.ts +2 -1
- package/dist/parse/model/ModelActionMap.d.ts +3 -2
- package/dist/parse/model/ModelDefinition.d.ts +3 -5
- package/dist/parse/model/SecondaryInstance/sources/CSVExternalSecondaryInstance.d.ts +0 -17
- package/dist/parse/model/SecondaryInstance/sources/external-instance-csv-parser.d.ts +8 -0
- package/dist/parse/model/TranslationDefinitionMap.d.ts +4 -0
- package/dist/solid.js +21608 -25366
- package/dist/solid.js.map +1 -1
- package/package.json +2 -2
- package/src/client/AttributeNode.ts +4 -3
- package/src/client/InputNode.ts +11 -3
- package/src/client/MarkdownNode.ts +3 -0
- package/src/client/NoteNode.ts +9 -1
- package/src/client/form/FormInstanceConfig.ts +6 -0
- package/src/client/form/LoadFormResult.ts +5 -17
- package/src/client/form/ResetFormInstance.ts +17 -0
- package/src/entrypoints/FormInstance.ts +2 -0
- package/src/entrypoints/FormResult/BaseFormResult.ts +1 -0
- package/src/entrypoints/FormResult/BaseInstantiableFormResult.ts +10 -1
- package/src/entrypoints/FormResult/FormFailureResult.ts +3 -0
- package/src/entrypoints/createPotentiallyClientOwnedReactiveScope.ts +30 -0
- package/src/entrypoints/loadForm.ts +1 -31
- package/src/instance/Attribute.ts +38 -54
- package/src/instance/Group.ts +12 -4
- package/src/instance/InputControl.ts +15 -9
- package/src/instance/ModelValue.ts +13 -4
- package/src/instance/Note.ts +13 -4
- package/src/instance/PrimaryInstance.ts +29 -6
- package/src/instance/RangeControl.ts +13 -4
- package/src/instance/RankControl.ts +14 -5
- package/src/instance/Root.ts +12 -4
- package/src/instance/SelectControl.ts +14 -5
- package/src/instance/TriggerControl.ts +13 -4
- package/src/instance/UploadControl.ts +13 -3
- package/src/instance/abstract/DescendantNode.ts +4 -3
- package/src/instance/abstract/InstanceNode.ts +5 -3
- package/src/instance/attachments/buildAttributes.ts +26 -2
- package/src/instance/children/childrenInitOptions.ts +2 -1
- package/src/instance/hierarchy.ts +2 -0
- package/src/instance/internal-api/AttributeContext.ts +1 -0
- package/src/instance/internal-api/InstanceConfig.ts +3 -0
- package/src/instance/internal-api/InstanceValueContext.ts +1 -0
- package/src/instance/markdown/MarkdownNode.ts +19 -7
- package/src/instance/repeat/RepeatInstance.ts +11 -3
- package/src/instance/text/markdownFormat.ts +4 -3
- package/src/integration/xpath/adapter/XFormsXPathNode.ts +1 -0
- package/src/integration/xpath/adapter/engineDOMAdapter.ts +2 -2
- package/src/integration/xpath/adapter/kind.ts +6 -1
- package/src/integration/xpath/adapter/names.ts +1 -0
- package/src/integration/xpath/adapter/traversal.ts +5 -6
- package/src/integration/xpath/static-dom/StaticAttribute.ts +1 -0
- package/src/integration/xpath/static-dom/StaticDocument.ts +2 -0
- package/src/lib/codecs/{Geopoint/Geopoint.ts → geolocation/Geolocation.ts} +43 -24
- package/src/lib/codecs/geolocation/Geopoint.ts +15 -0
- package/src/lib/codecs/geolocation/Geoshape.ts +36 -0
- package/src/lib/codecs/geolocation/Geotrace.ts +36 -0
- package/src/lib/codecs/geolocation/createGeolocationValueCodec.ts +18 -0
- package/src/lib/codecs/getSharedValueCodec.ts +37 -11
- package/src/lib/reactivity/createInstanceValueState.ts +90 -34
- package/src/lib/reactivity/text/createTextRange.ts +71 -45
- package/src/parse/XFormDOM.ts +22 -2
- package/src/parse/model/ActionDefinition.ts +6 -6
- package/src/parse/model/AttributeDefinition.ts +7 -0
- package/src/parse/model/BindDefinition.ts +1 -1
- package/src/parse/model/BindPreloadDefinition.ts +21 -14
- package/src/parse/model/ModelActionMap.ts +30 -13
- package/src/parse/model/ModelDefinition.ts +5 -10
- package/src/parse/model/RootDefinition.ts +2 -1
- package/src/parse/model/SecondaryInstance/sources/CSVExternalSecondaryInstance.ts +2 -184
- package/src/parse/model/SecondaryInstance/sources/external-instance-csv-parser.ts +185 -0
- package/src/parse/model/TranslationDefinitionMap.ts +23 -0
- package/dist/lib/codecs/Geopoint/GeopointValueCodec.d.ts +0 -5
- package/dist/parse/model/generateItextChunks.d.ts +0 -5
- package/src/lib/codecs/Geopoint/GeopointValueCodec.ts +0 -20
- package/src/parse/model/generateItextChunks.ts +0 -61
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
import { XPathNodeKindKey } from '@getodk/xpath';
|
|
2
2
|
import { Accessor } from 'solid-js';
|
|
3
3
|
import { AttributeNode } from '../client/AttributeNode.ts';
|
|
4
|
-
import {
|
|
4
|
+
import { InstanceState, NullValidationState } from '../client/index.ts';
|
|
5
5
|
import { XFormsXPathAttribute } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
6
|
-
import { EngineXPathEvaluator } from '../integration/xpath/EngineXPathEvaluator.ts';
|
|
7
6
|
import { StaticAttribute } from '../integration/xpath/static-dom/StaticAttribute.ts';
|
|
8
7
|
import { RuntimeInputValue, RuntimeValue } from '../lib/codecs/getSharedValueCodec.ts';
|
|
9
8
|
import { RuntimeValueSetter, RuntimeValueState } from '../lib/codecs/ValueCodec.ts';
|
|
9
|
+
import { AttributeState } from '../lib/reactivity/createAttributeState.ts';
|
|
10
10
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
11
11
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
12
12
|
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
13
|
-
import { ReactiveScope } from '../lib/reactivity/scope.ts';
|
|
14
13
|
import { SimpleAtomicState } from '../lib/reactivity/types.ts';
|
|
15
14
|
import { AttributeDefinition } from '../parse/model/AttributeDefinition.ts';
|
|
16
|
-
import {
|
|
15
|
+
import { DescendantNode, DescendantNodeStateSpec } from './abstract/DescendantNode.ts';
|
|
16
|
+
import { AnyNode } from './hierarchy.ts';
|
|
17
17
|
import { AttributeContext } from './internal-api/AttributeContext.ts';
|
|
18
|
-
import { InstanceConfig } from './internal-api/InstanceConfig.ts';
|
|
19
18
|
import { DecodeInstanceValue } from './internal-api/InstanceValueContext.ts';
|
|
20
19
|
import { ClientReactiveSerializableAttributeNode } from './internal-api/serialization/ClientReactiveSerializableAttributeNode.ts';
|
|
21
|
-
import { PrimaryInstance } from './PrimaryInstance.ts';
|
|
22
20
|
import { Root } from './Root.ts';
|
|
23
|
-
export interface AttributeStateSpec {
|
|
21
|
+
export interface AttributeStateSpec extends DescendantNodeStateSpec<string> {
|
|
22
|
+
readonly children: null;
|
|
23
|
+
readonly attributes: Accessor<Attribute[]>;
|
|
24
24
|
readonly value: SimpleAtomicState<string>;
|
|
25
25
|
readonly instanceValue: Accessor<string>;
|
|
26
26
|
readonly relevant: Accessor<boolean>;
|
|
27
27
|
}
|
|
28
|
-
export declare class Attribute implements AttributeNode, ClientReactiveSerializableAttributeNode, AttributeContext, XFormsXPathAttribute {
|
|
28
|
+
export declare class Attribute extends DescendantNode<AttributeDefinition, AttributeStateSpec, AnyNode, null> implements AttributeNode, ClientReactiveSerializableAttributeNode, AttributeContext, XFormsXPathAttribute {
|
|
29
29
|
readonly owner: AnyNode;
|
|
30
|
-
readonly definition: AttributeDefinition;
|
|
31
30
|
readonly instanceNode: StaticAttribute;
|
|
32
31
|
readonly [XPathNodeKindKey] = "attribute";
|
|
33
32
|
protected readonly state: SharedNodeState<AttributeStateSpec>;
|
|
@@ -43,22 +42,11 @@ export declare class Attribute implements AttributeNode, ClientReactiveSerializa
|
|
|
43
42
|
protected readonly getInstanceValue: Accessor<string>;
|
|
44
43
|
protected readonly valueState: RuntimeValueState<RuntimeValue<'string'>>;
|
|
45
44
|
protected readonly setValueState: RuntimeValueSetter<RuntimeInputValue<'string'>>;
|
|
46
|
-
readonly
|
|
47
|
-
readonly getActiveLanguage: Accessor<ActiveLanguage>;
|
|
48
|
-
readonly contextNode: AnyNode;
|
|
49
|
-
readonly scope: ReactiveScope;
|
|
50
|
-
readonly rootDocument: PrimaryInstance;
|
|
51
|
-
readonly instanceConfig: InstanceConfig;
|
|
52
|
-
readonly root: Root;
|
|
53
|
-
readonly isRelevant: Accessor<boolean>;
|
|
45
|
+
readonly attributeState: AttributeState;
|
|
54
46
|
readonly isAttached: Accessor<boolean>;
|
|
55
|
-
readonly
|
|
56
|
-
readonly hasReadonlyAncestor: Accessor<boolean>;
|
|
57
|
-
readonly hasNonRelevantAncestor: Accessor<boolean>;
|
|
58
|
-
readonly contextReference: () => string;
|
|
47
|
+
readonly getXPathValue: () => string;
|
|
59
48
|
constructor(owner: AnyNode, definition: AttributeDefinition, instanceNode: StaticAttribute);
|
|
60
49
|
setValue(value: string): Root;
|
|
50
|
+
getAttributes(): readonly Attribute[];
|
|
61
51
|
getChildren(): readonly [];
|
|
62
|
-
getXPathChildNodes(): readonly AnyChildNode[];
|
|
63
|
-
getXPathValue(): string;
|
|
64
52
|
}
|
package/dist/instance/Group.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ 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
9
|
import { StaticElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
10
|
+
import { AttributeState } from '../lib/reactivity/createAttributeState.ts';
|
|
10
11
|
import { MaterializedChildren } from '../lib/reactivity/materializeCurrentStateChildren.ts';
|
|
11
12
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
12
13
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
@@ -29,6 +30,7 @@ export declare class Group extends DescendantNode<GroupDefinition, GroupStateSpe
|
|
|
29
30
|
readonly [XPathNodeKindKey] = "element";
|
|
30
31
|
protected readonly state: SharedNodeState<GroupStateSpec>;
|
|
31
32
|
protected engineState: EngineState<GroupStateSpec>;
|
|
33
|
+
readonly attributeState: AttributeState;
|
|
32
34
|
readonly nodeType = "group";
|
|
33
35
|
readonly appearances: GroupNodeAppearances;
|
|
34
36
|
readonly nodeOptions: null;
|
|
@@ -37,5 +39,6 @@ export declare class Group extends DescendantNode<GroupDefinition, GroupStateSpe
|
|
|
37
39
|
readonly instanceState: InstanceState;
|
|
38
40
|
constructor(parent: GeneralParentNode, instanceNode: StaticElement | null, definition: GroupDefinition);
|
|
39
41
|
getChildren(): readonly GeneralChildNode[];
|
|
42
|
+
getAttributes(): readonly Attribute[];
|
|
40
43
|
}
|
|
41
44
|
export {};
|
|
@@ -6,6 +6,7 @@ import { ValueType } from '../client/ValueType.ts';
|
|
|
6
6
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
7
7
|
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
8
8
|
import { RuntimeInputValue, RuntimeValue } from '../lib/codecs/getSharedValueCodec.ts';
|
|
9
|
+
import { AttributeState } from '../lib/reactivity/createAttributeState.ts';
|
|
9
10
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
10
11
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
11
12
|
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
@@ -30,12 +31,14 @@ export declare class InputControl<V extends ValueType = ValueType> extends Value
|
|
|
30
31
|
readonly [XPathNodeKindKey] = "element";
|
|
31
32
|
protected readonly state: SharedNodeState<InputControlStateSpec<V>>;
|
|
32
33
|
protected readonly engineState: EngineState<InputControlStateSpec<V>>;
|
|
34
|
+
readonly attributeState: AttributeState;
|
|
33
35
|
readonly nodeType = "input";
|
|
34
36
|
readonly appearances: InputNodeAppearances;
|
|
35
37
|
readonly nodeOptions: InputNodeOptions<V>;
|
|
36
38
|
readonly currentState: CurrentState<InputControlStateSpec<V>>;
|
|
37
39
|
constructor(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: InputDefinition<V>);
|
|
38
40
|
setValue(value: InputNodeInputValue<V>): Root;
|
|
41
|
+
getAttributes(): readonly Attribute[];
|
|
39
42
|
}
|
|
40
43
|
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'>;
|
|
41
44
|
export {};
|
|
@@ -4,9 +4,11 @@ import { ValueType } from '../client/ValueType.ts';
|
|
|
4
4
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
5
5
|
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
6
6
|
import { RuntimeInputValue, RuntimeValue } from '../lib/codecs/getSharedValueCodec.ts';
|
|
7
|
+
import { AttributeState } from '../lib/reactivity/createAttributeState.ts';
|
|
7
8
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
8
9
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
9
10
|
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
11
|
+
import { Attribute } from './Attribute.ts';
|
|
10
12
|
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
11
13
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
12
14
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
@@ -22,11 +24,13 @@ export declare class ModelValue<V extends ValueType = ValueType> extends ValueNo
|
|
|
22
24
|
readonly [XPathNodeKindKey] = "element";
|
|
23
25
|
protected readonly state: SharedNodeState<ModelValueStateSpec<V>>;
|
|
24
26
|
protected readonly engineState: EngineState<ModelValueStateSpec<V>>;
|
|
27
|
+
readonly attributeState: AttributeState;
|
|
25
28
|
readonly nodeType = "model-value";
|
|
26
29
|
readonly appearances: null;
|
|
27
30
|
readonly nodeOptions: null;
|
|
28
31
|
readonly currentState: CurrentState<ModelValueStateSpec<V>>;
|
|
29
32
|
constructor(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: ModelValueDefinition<V>);
|
|
33
|
+
getAttributes(): readonly Attribute[];
|
|
30
34
|
}
|
|
31
35
|
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'>;
|
|
32
36
|
export {};
|
package/dist/instance/Note.d.ts
CHANGED
|
@@ -6,12 +6,14 @@ import { ValueType } from '../client/ValueType.ts';
|
|
|
6
6
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
7
7
|
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
8
8
|
import { NoteInputValue, NoteRuntimeValue } from '../lib/codecs/NoteCodec.ts';
|
|
9
|
+
import { AttributeState } from '../lib/reactivity/createAttributeState.ts';
|
|
9
10
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
10
11
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
11
12
|
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
12
13
|
import { ComputedNoteText } from '../lib/reactivity/text/createNoteText.ts';
|
|
13
14
|
import { NoteNodeDefinition } from '../parse/model/NoteNodeDefinition.ts';
|
|
14
15
|
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
16
|
+
import { Attribute } from './Attribute.ts';
|
|
15
17
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
16
18
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
17
19
|
import { ClientReactiveSerializableValueNode } from './internal-api/serialization/ClientReactiveSerializableValueNode.ts';
|
|
@@ -27,11 +29,13 @@ export declare class Note<V extends ValueType = ValueType> extends ValueNode<V,
|
|
|
27
29
|
readonly [XPathNodeKindKey] = "element";
|
|
28
30
|
protected readonly state: SharedNodeState<NoteStateSpec<V>>;
|
|
29
31
|
protected readonly engineState: EngineState<NoteStateSpec<V>>;
|
|
32
|
+
readonly attributeState: AttributeState;
|
|
30
33
|
readonly nodeType = "note";
|
|
31
34
|
readonly appearances: NoteNodeAppearances;
|
|
32
35
|
readonly nodeOptions: null;
|
|
33
36
|
readonly currentState: CurrentState<NoteStateSpec<V>>;
|
|
34
37
|
constructor(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: NoteNodeDefinition<V>);
|
|
38
|
+
getAttributes(): readonly Attribute[];
|
|
35
39
|
}
|
|
36
40
|
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'>;
|
|
37
41
|
export {};
|
|
@@ -10,6 +10,7 @@ import { AncestorNodeValidationState } from '../client/validation.ts';
|
|
|
10
10
|
import { XFormsXPathDocument } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
11
11
|
import { EngineXPathEvaluator } from '../integration/xpath/EngineXPathEvaluator.ts';
|
|
12
12
|
import { StaticDocument } from '../integration/xpath/static-dom/StaticDocument.ts';
|
|
13
|
+
import { AttributeState } from '../lib/reactivity/createAttributeState.ts';
|
|
13
14
|
import { MaterializedChildren } from '../lib/reactivity/materializeCurrentStateChildren.ts';
|
|
14
15
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
15
16
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
@@ -44,12 +45,13 @@ interface PrimaryInstanceStateSpec {
|
|
|
44
45
|
}
|
|
45
46
|
interface PrimaryInstanceStateInputByMode {
|
|
46
47
|
readonly create: null;
|
|
48
|
+
readonly reset: null;
|
|
47
49
|
readonly edit: InitialInstanceState;
|
|
48
50
|
readonly restore: InitialInstanceState;
|
|
49
51
|
}
|
|
50
52
|
export type PrimaryInstanceInitialState<Mode extends FormInstanceInitializationMode> = PrimaryInstanceStateInputByMode[Mode];
|
|
51
53
|
export interface BasePrimaryInstanceOptions {
|
|
52
|
-
|
|
54
|
+
scope: ReactiveScope;
|
|
53
55
|
readonly model: ModelDefinition;
|
|
54
56
|
readonly secondaryInstances: SecondaryInstancesDefinition;
|
|
55
57
|
}
|
|
@@ -66,12 +68,14 @@ export declare class PrimaryInstance<Mode extends FormInstanceInitializationMode
|
|
|
66
68
|
readonly attachments: InstanceAttachmentsState;
|
|
67
69
|
protected readonly state: SharedNodeState<PrimaryInstanceStateSpec>;
|
|
68
70
|
protected readonly engineState: EngineState<PrimaryInstanceStateSpec>;
|
|
71
|
+
readonly attributeState: AttributeState;
|
|
69
72
|
readonly instanceNode: StaticDocument;
|
|
70
73
|
readonly getChildren: Accessor<readonly Root[]>;
|
|
71
74
|
readonly hasReadonlyAncestor: () => boolean;
|
|
72
75
|
readonly isReadonly: () => boolean;
|
|
73
76
|
readonly hasNonRelevantAncestor: () => boolean;
|
|
74
77
|
readonly isRelevant: () => boolean;
|
|
78
|
+
private geolocationProvider;
|
|
75
79
|
private readonly setActiveLanguage;
|
|
76
80
|
readonly [XPathNodeKindKey] = "document";
|
|
77
81
|
readonly nodeType = "primary-instance";
|
|
@@ -88,6 +92,7 @@ export declare class PrimaryInstance<Mode extends FormInstanceInitializationMode
|
|
|
88
92
|
readonly evaluator: EngineXPathEvaluator;
|
|
89
93
|
readonly contextNode: this;
|
|
90
94
|
constructor(options: PrimaryInstanceOptions<Mode>);
|
|
95
|
+
getAttributes(): readonly Attribute[];
|
|
91
96
|
/**
|
|
92
97
|
* @todo Note that this method's signature is intentionally derived from
|
|
93
98
|
* {@link RootNode.setLanguage}, but its return type differs! The design
|
|
@@ -109,5 +114,6 @@ export declare class PrimaryInstance<Mode extends FormInstanceInitializationMode
|
|
|
109
114
|
*/
|
|
110
115
|
setLanguage(language: FormLanguage): FormLanguage;
|
|
111
116
|
prepareInstancePayload<PayloadType extends InstancePayloadType = 'monolithic'>(options?: InstancePayloadOptions<PayloadType>): Promise<InstancePayload<PayloadType>>;
|
|
117
|
+
getBackgroundGeopoint(): Promise<string>;
|
|
112
118
|
}
|
|
113
119
|
export {};
|
|
@@ -4,10 +4,12 @@ import { RangeInputValue, RangeNode, RangeNodeAppearances, RangeValue } from '..
|
|
|
4
4
|
import { TextRange } from '../client/TextRange.ts';
|
|
5
5
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
6
6
|
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
7
|
+
import { AttributeState } from '../lib/reactivity/createAttributeState.ts';
|
|
7
8
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
8
9
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
9
10
|
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
10
11
|
import { AnyRangeNodeDefinition, RangeNodeDefinition, RangeValueType } from '../parse/model/RangeNodeDefinition.ts';
|
|
12
|
+
import { Attribute } from './Attribute.ts';
|
|
11
13
|
import { Root } from './Root.ts';
|
|
12
14
|
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
13
15
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
@@ -24,12 +26,14 @@ export declare class RangeControl<V extends RangeValueType = RangeValueType> ext
|
|
|
24
26
|
readonly [XPathNodeKindKey] = "element";
|
|
25
27
|
protected readonly state: SharedNodeState<RangeControlStateSpec<V>>;
|
|
26
28
|
protected readonly engineState: EngineState<RangeControlStateSpec<V>>;
|
|
29
|
+
readonly attributeState: AttributeState;
|
|
27
30
|
readonly nodeType = "range";
|
|
28
31
|
readonly appearances: RangeNodeAppearances;
|
|
29
32
|
readonly nodeOptions: null;
|
|
30
33
|
readonly currentState: CurrentState<RangeControlStateSpec<V>>;
|
|
31
34
|
constructor(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: RangeNodeDefinition<V>);
|
|
32
35
|
setValue(value: RangeInputValue<V>): Root;
|
|
36
|
+
getAttributes(): readonly Attribute[];
|
|
33
37
|
}
|
|
34
38
|
export type AnyRangeControl = RangeControl<'decimal'> | RangeControl<'int'>;
|
|
35
39
|
export {};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { XPathNodeKindKey, XPathChoiceNode } from '@getodk/xpath';
|
|
2
2
|
import { Accessor } from 'solid-js';
|
|
3
3
|
import { RankDefinition, RankNode, RankValueOptions } from '../client/RankNode.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
7
|
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
8
|
+
import { AttributeState } from '../lib/reactivity/createAttributeState.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 { UnknownAppearanceDefinition } from '../parse/body/appearance/unknownAppearanceParser.ts';
|
|
13
|
+
import { Attribute } from './Attribute.ts';
|
|
12
14
|
import { Root } from './Root.ts';
|
|
13
15
|
import { ValueNodeStateSpec, ValueNode } from './abstract/ValueNode.ts';
|
|
14
16
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
@@ -30,11 +32,13 @@ export declare class RankControl extends ValueNode<'string', RankDefinition<'str
|
|
|
30
32
|
readonly [XPathNodeKindKey] = "element";
|
|
31
33
|
protected readonly state: SharedNodeState<RankControlStateSpec>;
|
|
32
34
|
protected readonly engineState: EngineState<RankControlStateSpec>;
|
|
35
|
+
readonly attributeState: AttributeState;
|
|
33
36
|
readonly nodeType = "rank";
|
|
34
37
|
readonly appearances: UnknownAppearanceDefinition;
|
|
35
38
|
readonly nodeOptions: null;
|
|
36
39
|
readonly currentState: CurrentState<RankControlStateSpec>;
|
|
37
40
|
private constructor();
|
|
41
|
+
getAttributes(): readonly Attribute[];
|
|
38
42
|
getValueLabel(value: string): TextRange<'item-label'> | null;
|
|
39
43
|
setValues(valuesInOrder: readonly string[]): Root;
|
|
40
44
|
getChoiceName(value: string): string | null;
|
package/dist/instance/Root.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { InstancePayloadOptions, InstancePayloadType } from '../client/serializa
|
|
|
8
8
|
import { InstanceState } from '../client/serialization/InstanceState.ts';
|
|
9
9
|
import { AncestorNodeValidationState } from '../client/validation.ts';
|
|
10
10
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
11
|
+
import { AttributeState } from '../lib/reactivity/createAttributeState.ts';
|
|
11
12
|
import { MaterializedChildren } from '../lib/reactivity/materializeCurrentStateChildren.ts';
|
|
12
13
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
13
14
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
@@ -39,6 +40,7 @@ export declare class Root extends DescendantNode<RootDefinition, RootStateSpec,
|
|
|
39
40
|
readonly [XPathNodeKindKey] = "element";
|
|
40
41
|
protected readonly state: SharedNodeState<RootStateSpec>;
|
|
41
42
|
protected readonly engineState: EngineState<RootStateSpec>;
|
|
43
|
+
readonly attributeState: AttributeState;
|
|
42
44
|
readonly hasReadonlyAncestor: () => boolean;
|
|
43
45
|
readonly isSelfReadonly: () => boolean;
|
|
44
46
|
readonly isReadonly: () => boolean;
|
|
@@ -56,6 +58,7 @@ export declare class Root extends DescendantNode<RootDefinition, RootStateSpec,
|
|
|
56
58
|
readonly languages: FormLanguages;
|
|
57
59
|
constructor(parent: PrimaryInstance);
|
|
58
60
|
getChildren(): readonly GeneralChildNode[];
|
|
61
|
+
getAttributes(): readonly Attribute[];
|
|
59
62
|
setLanguage(language: FormLanguage): Root;
|
|
60
63
|
prepareInstancePayload<PayloadType extends InstancePayloadType = 'monolithic'>(options?: InstancePayloadOptions<PayloadType>): Promise<InstancePayload<PayloadType>>;
|
|
61
64
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { XPathNodeKindKey, XPathChoiceNode } from '@getodk/xpath';
|
|
2
2
|
import { Accessor } from 'solid-js';
|
|
3
3
|
import { SelectDefinition, SelectItem, SelectNode, SelectNodeAppearances, SelectValueOptions } from '../client/SelectNode.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
7
|
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
8
|
+
import { AttributeState } from '../lib/reactivity/createAttributeState.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 { SelectType } from '../parse/body/control/SelectControlDefinition.ts';
|
|
13
|
+
import { Attribute } from './Attribute.ts';
|
|
12
14
|
import { Root } from './Root.ts';
|
|
13
15
|
import { ValueNodeStateSpec, ValueNode } from './abstract/ValueNode.ts';
|
|
14
16
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
@@ -31,6 +33,7 @@ export declare class SelectControl extends ValueNode<'string', SelectDefinition<
|
|
|
31
33
|
readonly [XPathNodeKindKey] = "element";
|
|
32
34
|
protected readonly state: SharedNodeState<SelectControlStateSpec>;
|
|
33
35
|
protected readonly engineState: EngineState<SelectControlStateSpec>;
|
|
36
|
+
readonly attributeState: AttributeState;
|
|
34
37
|
readonly nodeType = "select";
|
|
35
38
|
readonly selectType: SelectType;
|
|
36
39
|
readonly appearances: SelectNodeAppearances;
|
|
@@ -65,5 +68,6 @@ export declare class SelectControl extends ValueNode<'string', SelectDefinition<
|
|
|
65
68
|
selectValue(value: string | null): Root;
|
|
66
69
|
selectValues(values: readonly string[]): Root;
|
|
67
70
|
getChoiceName(value: string): string | null;
|
|
71
|
+
getAttributes(): readonly Attribute[];
|
|
68
72
|
}
|
|
69
73
|
export {};
|
|
@@ -5,10 +5,12 @@ import { TriggerNode, TriggerNodeDefinition } from '../client/TriggerNode.ts';
|
|
|
5
5
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
6
6
|
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
7
7
|
import { TriggerInputValue, TriggerRuntimeValue } from '../lib/codecs/TriggerCodec.ts';
|
|
8
|
+
import { AttributeState } from '../lib/reactivity/createAttributeState.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 { UnknownAppearanceDefinition } from '../parse/body/appearance/unknownAppearanceParser.ts';
|
|
13
|
+
import { Attribute } from './Attribute.ts';
|
|
12
14
|
import { Root } from './Root.ts';
|
|
13
15
|
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
14
16
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
@@ -25,11 +27,13 @@ export declare class TriggerControl extends ValueNode<'string', TriggerNodeDefin
|
|
|
25
27
|
readonly [XPathNodeKindKey] = "element";
|
|
26
28
|
protected readonly state: SharedNodeState<TriggerControlStateSpec>;
|
|
27
29
|
protected readonly engineState: EngineState<TriggerControlStateSpec>;
|
|
30
|
+
readonly attributeState: AttributeState;
|
|
28
31
|
readonly nodeType = "trigger";
|
|
29
32
|
readonly appearances: UnknownAppearanceDefinition;
|
|
30
33
|
readonly nodeOptions: null;
|
|
31
34
|
readonly currentState: CurrentState<TriggerControlStateSpec>;
|
|
32
35
|
private constructor();
|
|
36
|
+
getAttributes(): readonly Attribute[];
|
|
33
37
|
setValue(value: TriggerInputValue): Root;
|
|
34
38
|
}
|
|
35
39
|
export {};
|
|
@@ -7,6 +7,7 @@ import { InstanceAttachmentFileName, InstanceState } from '../client/index.ts';
|
|
|
7
7
|
import { AnyViolation, LeafNodeValidationState } from '../client/validation.ts';
|
|
8
8
|
import { XFormsXPathElement } from '../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
9
9
|
import { StaticLeafElement } from '../integration/xpath/static-dom/StaticElement.ts';
|
|
10
|
+
import { AttributeState } from '../lib/reactivity/createAttributeState.ts';
|
|
10
11
|
import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
|
|
11
12
|
import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
|
|
12
13
|
import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
|
|
@@ -43,6 +44,7 @@ export declare class UploadControl extends DescendantNode<UploadDefinition<'bina
|
|
|
43
44
|
readonly getXPathValue: () => InstanceAttachmentFileName;
|
|
44
45
|
protected readonly state: SharedNodeState<UploadControlStateSpec>;
|
|
45
46
|
protected readonly engineState: EngineState<UploadControlStateSpec>;
|
|
47
|
+
readonly attributeState: AttributeState;
|
|
46
48
|
readonly decodeInstanceValue: DecodeInstanceValue;
|
|
47
49
|
readonly nodeType = "upload";
|
|
48
50
|
readonly valueType = "binary";
|
|
@@ -55,6 +57,7 @@ export declare class UploadControl extends DescendantNode<UploadDefinition<'bina
|
|
|
55
57
|
getViolation(): AnyViolation | null;
|
|
56
58
|
isBlank(): boolean;
|
|
57
59
|
getChildren(): readonly [];
|
|
60
|
+
getAttributes(): readonly Attribute[];
|
|
58
61
|
setValue(value: InstanceAttachmentRuntimeValue): Root;
|
|
59
62
|
}
|
|
60
63
|
export {};
|
|
@@ -6,9 +6,10 @@ import { InstanceNodeType } from '../../client/node-types.ts';
|
|
|
6
6
|
import { PrimaryInstanceXPathChildNode } from '../../integration/xpath/adapter/kind.ts';
|
|
7
7
|
import { XFormsXPathPrimaryInstanceDescendantNode, XFormsXPathPrimaryInstanceDescendantNodeKind } from '../../integration/xpath/adapter/XFormsXPathNode.ts';
|
|
8
8
|
import { EngineXPathEvaluator } from '../../integration/xpath/EngineXPathEvaluator.ts';
|
|
9
|
+
import { StaticAttribute } from '../../integration/xpath/static-dom/StaticAttribute.ts';
|
|
9
10
|
import { StaticElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
10
11
|
import { AnyNodeDefinition } from '../../parse/model/NodeDefinition.ts';
|
|
11
|
-
import { AnyChildNode,
|
|
12
|
+
import { AnyChildNode, AnyNode } from '../hierarchy.ts';
|
|
12
13
|
import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
|
|
13
14
|
import { Root } from '../Root.ts';
|
|
14
15
|
import { InstanceNodeStateSpec, InstanceNode } from './InstanceNode.ts';
|
|
@@ -31,9 +32,9 @@ interface DescendantNodeOptions {
|
|
|
31
32
|
* beginning to form in {@link DescendantNodeInitOptions} (not to be confused
|
|
32
33
|
* with the current module-local {@link DescendantNodeOptions}).
|
|
33
34
|
*/
|
|
34
|
-
export declare abstract class DescendantNode<Definition extends DescendantNodeDefinition, Spec extends DescendantNodeStateSpec<any>, Parent extends
|
|
35
|
+
export declare abstract class DescendantNode<Definition extends DescendantNodeDefinition, Spec extends DescendantNodeStateSpec<any>, Parent extends AnyNode, Child extends AnyChildNode | null = null> extends InstanceNode<Definition, Spec, Parent, Child> implements BaseNode, XFormsXPathPrimaryInstanceDescendantNode, EvaluationContext {
|
|
35
36
|
readonly parent: Parent;
|
|
36
|
-
readonly instanceNode: StaticElement | null;
|
|
37
|
+
readonly instanceNode: StaticAttribute | StaticElement | null;
|
|
37
38
|
readonly definition: Definition;
|
|
38
39
|
/**
|
|
39
40
|
* Partial implementation of {@link isAttached}, used to check whether `this`
|
|
@@ -65,7 +66,7 @@ export declare abstract class DescendantNode<Definition extends DescendantNodeDe
|
|
|
65
66
|
readonly evaluator: EngineXPathEvaluator;
|
|
66
67
|
readonly contextNode: PrimaryInstanceXPathChildNode;
|
|
67
68
|
readonly getActiveLanguage: Accessor<ActiveLanguage>;
|
|
68
|
-
constructor(parent: Parent, instanceNode: StaticElement | null, definition: Definition, options?: DescendantNodeOptions);
|
|
69
|
+
constructor(parent: Parent, instanceNode: StaticAttribute | StaticElement | null, definition: Definition, options?: DescendantNodeOptions);
|
|
69
70
|
/**
|
|
70
71
|
* @package
|
|
71
72
|
*
|
|
@@ -22,7 +22,7 @@ import { AnyNodeDefinition } from '../../parse/model/NodeDefinition.ts';
|
|
|
22
22
|
import { Attribute } from '../Attribute.ts';
|
|
23
23
|
import { PrimaryInstance } from '../PrimaryInstance.ts';
|
|
24
24
|
import { Root } from '../Root.ts';
|
|
25
|
-
import { AnyChildNode,
|
|
25
|
+
import { AnyChildNode, AnyNode } from '../hierarchy.ts';
|
|
26
26
|
import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
|
|
27
27
|
import { InstanceConfig } from '../internal-api/InstanceConfig.ts';
|
|
28
28
|
export type EngineInstanceNodeType = ClientInstanceNodeType | 'primary-instance';
|
|
@@ -51,7 +51,7 @@ export type InstanceNodeCurrentState<Spec extends InstanceNodeStateSpec<any>, Ch
|
|
|
51
51
|
readonly children: [Child] extends [AnyChildNode] ? readonly Child[] : null;
|
|
52
52
|
};
|
|
53
53
|
interface ComputableReferenceNode {
|
|
54
|
-
readonly parent:
|
|
54
|
+
readonly parent: AnyNode | null;
|
|
55
55
|
readonly definition: AnyNodeDefinition;
|
|
56
56
|
}
|
|
57
57
|
type ComputeInstanceNodeReference = <This extends ComputableReferenceNode>(this: This, parent: This['parent'], definition: This['definition']) => string;
|
|
@@ -59,7 +59,7 @@ export interface InstanceNodeOptions {
|
|
|
59
59
|
readonly computeReference?: () => string;
|
|
60
60
|
readonly scope?: ReactiveScope;
|
|
61
61
|
}
|
|
62
|
-
export declare abstract class InstanceNode<Definition extends AnyNodeDefinition, Spec extends InstanceNodeStateSpec<any>, Parent extends
|
|
62
|
+
export declare abstract class InstanceNode<Definition extends AnyNodeDefinition, Spec extends InstanceNodeStateSpec<any>, Parent extends AnyNode | null, Child extends AnyChildNode | null = null> implements BaseEngineNode, XFormsXPathPrimaryInstanceNode, EvaluationContext {
|
|
63
63
|
readonly instanceConfig: InstanceConfig;
|
|
64
64
|
readonly parent: Parent;
|
|
65
65
|
readonly instanceNode: StaticAttribute | StaticDocument | StaticElement | null;
|
|
@@ -130,5 +130,6 @@ export declare abstract class InstanceNode<Definition extends AnyNodeDefinition,
|
|
|
130
130
|
*/
|
|
131
131
|
getXPathChildNodes(): readonly AnyChildNode[];
|
|
132
132
|
getXPathValue(): string;
|
|
133
|
+
abstract getAttributes(): readonly Attribute[];
|
|
133
134
|
}
|
|
134
135
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Attribute } from './Attribute.ts';
|
|
1
2
|
import { Group } from './Group.ts';
|
|
2
3
|
import { AnyInputControl } from './InputControl.ts';
|
|
3
4
|
import { AnyModelValue } from './ModelValue.ts';
|
|
@@ -13,7 +14,7 @@ import { SelectControl } from './SelectControl.ts';
|
|
|
13
14
|
import { TriggerControl } from './TriggerControl.ts';
|
|
14
15
|
import { UploadControl } from './UploadControl.ts';
|
|
15
16
|
export type RepeatRange = RepeatRangeControlled | RepeatRangeUncontrolled;
|
|
16
|
-
export type AnyNode = PrimaryInstance | Root | Group | RepeatRange | RepeatInstance | AnyNote | AnyModelValue | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | UploadControl;
|
|
17
|
+
export type AnyNode = PrimaryInstance | Root | Group | RepeatRange | RepeatInstance | Attribute | AnyNote | AnyModelValue | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | UploadControl;
|
|
17
18
|
export type AnyParentNode = PrimaryInstance | Root | Group | RepeatRange | RepeatInstance;
|
|
18
19
|
export type GeneralParentNode = Root | Group | RepeatInstance;
|
|
19
20
|
export type AnyChildNode = Root | Group | RepeatRange | RepeatInstance | AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | UploadControl;
|
|
@@ -10,6 +10,7 @@ import { InstanceConfig } from './InstanceConfig.ts';
|
|
|
10
10
|
export interface InstanceAttributeContextDocument {
|
|
11
11
|
readonly initializationMode: FormInstanceInitializationMode;
|
|
12
12
|
readonly isAttached: Accessor<boolean>;
|
|
13
|
+
getBackgroundGeopoint: Accessor<Promise<string>>;
|
|
13
14
|
}
|
|
14
15
|
export type DecodeInstanceValue = (value: string) => string;
|
|
15
16
|
interface InstanceAttributeContextDefinitionBind {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InstanceAttachmentFileNameFactory } from '../../client/attachments/InstanceAttachmentsConfig.ts';
|
|
2
|
-
import { PreloadProperties } from '../../client/form/FormInstanceConfig.ts';
|
|
2
|
+
import { GeolocationProvider, PreloadProperties } from '../../client/form/FormInstanceConfig.ts';
|
|
3
3
|
import { OpaqueReactiveObjectFactory } from '../../client/OpaqueReactiveObjectFactory.ts';
|
|
4
4
|
export interface InstanceConfig {
|
|
5
5
|
/**
|
|
@@ -8,4 +8,5 @@ export interface InstanceConfig {
|
|
|
8
8
|
readonly clientStateFactory: OpaqueReactiveObjectFactory;
|
|
9
9
|
readonly computeAttachmentName: InstanceAttachmentFileNameFactory;
|
|
10
10
|
readonly preloadProperties: PreloadProperties;
|
|
11
|
+
readonly geolocationProvider: GeolocationProvider | undefined;
|
|
11
12
|
}
|
|
@@ -10,6 +10,7 @@ import { InstanceConfig } from './InstanceConfig.ts';
|
|
|
10
10
|
export interface InstanceValueContextDocument {
|
|
11
11
|
readonly initializationMode: FormInstanceInitializationMode;
|
|
12
12
|
readonly isAttached: Accessor<boolean>;
|
|
13
|
+
getBackgroundGeopoint: Accessor<Promise<string>>;
|
|
13
14
|
}
|
|
14
15
|
export type DecodeInstanceValue = (value: string) => string;
|
|
15
16
|
interface InstanceValueContextDefinitionBind {
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { AnchorMarkdownNode, ChildMarkdownNode as ClientChildMarkdownNode, HtmlMarkdownNode as ClientHtmlMarkdownNode, ParentMarkdownNode as ClientParentMarkdownNode, StyledMarkdownNode as ClientStyledMarkdownNode, ElementName,
|
|
2
|
-
declare abstract class
|
|
3
|
-
readonly
|
|
1
|
+
import { AnchorMarkdownNode, ChildMarkdownNode as ClientChildMarkdownNode, HtmlMarkdownNode as ClientHtmlMarkdownNode, MarkdownNode as ClientMarkdownNode, ParentMarkdownNode as ClientParentMarkdownNode, StyledMarkdownNode as ClientStyledMarkdownNode, ElementName, MarkdownProperty } from '../../client';
|
|
2
|
+
declare abstract class MarkdownNode {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
6
|
+
declare abstract class ParentMarkdownNode extends MarkdownNode implements ClientParentMarkdownNode {
|
|
7
|
+
readonly children: ClientMarkdownNode[];
|
|
4
8
|
readonly role = "parent";
|
|
5
9
|
abstract elementName: ElementName;
|
|
6
|
-
constructor(children:
|
|
10
|
+
constructor(children: ClientMarkdownNode[]);
|
|
7
11
|
}
|
|
8
12
|
export declare class Heading1 extends ParentMarkdownNode {
|
|
9
13
|
readonly elementName = "h1";
|
|
@@ -44,14 +48,15 @@ export declare class ListItem extends ParentMarkdownNode {
|
|
|
44
48
|
export declare class Anchor extends ParentMarkdownNode implements AnchorMarkdownNode {
|
|
45
49
|
readonly elementName = "a";
|
|
46
50
|
readonly url: string;
|
|
47
|
-
constructor(children:
|
|
51
|
+
constructor(children: ClientMarkdownNode[], url: string);
|
|
48
52
|
}
|
|
49
53
|
declare abstract class StyledMarkdownNode implements ClientParentMarkdownNode {
|
|
50
|
-
readonly
|
|
54
|
+
readonly id: string;
|
|
55
|
+
readonly children: ClientMarkdownNode[];
|
|
51
56
|
readonly role = "parent";
|
|
52
57
|
abstract elementName: ElementName;
|
|
53
58
|
readonly properties: MarkdownProperty | undefined;
|
|
54
|
-
constructor(children:
|
|
59
|
+
constructor(children: ClientMarkdownNode[], properties: MarkdownProperty | undefined);
|
|
55
60
|
}
|
|
56
61
|
export declare class Paragraph extends StyledMarkdownNode implements ClientStyledMarkdownNode {
|
|
57
62
|
readonly elementName = "p";
|
|
@@ -62,12 +67,12 @@ export declare class Span extends StyledMarkdownNode implements ClientStyledMark
|
|
|
62
67
|
export declare class Div extends StyledMarkdownNode implements ClientStyledMarkdownNode {
|
|
63
68
|
readonly elementName = "div";
|
|
64
69
|
}
|
|
65
|
-
export declare class ChildMarkdownNode implements ClientChildMarkdownNode {
|
|
70
|
+
export declare class ChildMarkdownNode extends MarkdownNode implements ClientChildMarkdownNode {
|
|
66
71
|
readonly role = "child";
|
|
67
72
|
readonly value: string;
|
|
68
73
|
constructor(value: string);
|
|
69
74
|
}
|
|
70
|
-
export declare class Html implements ClientHtmlMarkdownNode {
|
|
75
|
+
export declare class Html extends MarkdownNode implements ClientHtmlMarkdownNode {
|
|
71
76
|
readonly role = "html";
|
|
72
77
|
readonly unsafeHtml: string;
|
|
73
78
|
constructor(unsafeHtml: string);
|
|
@@ -30,6 +30,7 @@ interface RepeatInstanceOptions {
|
|
|
30
30
|
export declare class RepeatInstance extends DescendantNode<AnyRepeatDefinition, RepeatInstanceStateSpec, RepeatRange, GeneralChildNode> implements RepeatInstanceNode, XFormsXPathElement, EvaluationContext, ClientReactiveSerializableTemplatedNode {
|
|
31
31
|
readonly parent: RepeatRange;
|
|
32
32
|
private readonly childrenState;
|
|
33
|
+
private readonly attributeState;
|
|
33
34
|
private readonly currentIndex;
|
|
34
35
|
readonly [XPathNodeKindKey] = "element";
|
|
35
36
|
protected readonly state: SharedNodeState<RepeatInstanceStateSpec>;
|
|
@@ -66,5 +67,6 @@ export declare class RepeatInstance extends DescendantNode<AnyRepeatDefinition,
|
|
|
66
67
|
readonly instanceState: InstanceState;
|
|
67
68
|
constructor(parent: RepeatRange, instanceNode: StaticElement | null, options: RepeatInstanceOptions);
|
|
68
69
|
getChildren(): readonly GeneralChildNode[];
|
|
70
|
+
getAttributes(): readonly Attribute[];
|
|
69
71
|
}
|
|
70
72
|
export {};
|
|
@@ -64,7 +64,7 @@ export type XFormsXPathPrimaryInstanceNodeKind = XPathDocumentKind | XFormsXPath
|
|
|
64
64
|
export interface XFormsXPathPrimaryInstanceNode extends XFormsXPathNode {
|
|
65
65
|
readonly [XPathNodeKindKey]: XFormsXPathPrimaryInstanceNodeKind;
|
|
66
66
|
}
|
|
67
|
-
export type XFormsXPathPrimaryInstanceDescendantNodeKind = XFormsXPathNodeRangeKind | XPathElementKind | XPathTextKind;
|
|
67
|
+
export type XFormsXPathPrimaryInstanceDescendantNodeKind = XFormsXPathNodeRangeKind | XPathAttributeKind | XPathElementKind | XPathTextKind;
|
|
68
68
|
export interface XFormsXPathPrimaryInstanceDescendantNode extends XFormsXPathNode {
|
|
69
69
|
readonly [XPathNodeKindKey]: XFormsXPathPrimaryInstanceDescendantNodeKind;
|
|
70
70
|
}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { XPathNodeKind } from '@getodk/xpath';
|
|
2
|
+
import { Attribute } from '../../../instance/Attribute.ts';
|
|
2
3
|
import { AnyChildNode, AnyNode, AnyParentNode } from '../../../instance/hierarchy.ts';
|
|
3
4
|
import { PrimaryInstance } from '../../../instance/PrimaryInstance.ts';
|
|
4
5
|
import { StaticAttribute } from '../static-dom/StaticAttribute.ts';
|
|
5
6
|
import { StaticDocument } from '../static-dom/StaticDocument.ts';
|
|
6
7
|
import { StaticElement } from '../static-dom/StaticElement.ts';
|
|
7
8
|
import { StaticText } from '../static-dom/StaticText.ts';
|
|
8
|
-
import { XFormsXPathComment, XFormsXPathDocument, XFormsXPathElement, XFormsXPathPrimaryInstanceNode } from './XFormsXPathNode.ts';
|
|
9
|
+
import { XFormsXPathAttribute, XFormsXPathComment, XFormsXPathDocument, XFormsXPathElement, XFormsXPathPrimaryInstanceNode } from './XFormsXPathNode.ts';
|
|
9
10
|
export type PrimaryInstanceXPathNode = Extract<AnyNode, XFormsXPathPrimaryInstanceNode>;
|
|
10
11
|
export type PrimaryInstanceXPathElement = Extract<AnyChildNode, XFormsXPathElement>;
|
|
12
|
+
export type PrimaryInstanceXPathAttribute = Extract<Attribute, XFormsXPathAttribute>;
|
|
11
13
|
export type PrimaryInstanceXPathComment = Extract<AnyChildNode, XFormsXPathComment>;
|
|
12
|
-
export type PrimaryInstanceXPathChildNode = PrimaryInstanceXPathElement | PrimaryInstanceXPathComment;
|
|
14
|
+
export type PrimaryInstanceXPathChildNode = PrimaryInstanceXPathElement | PrimaryInstanceXPathAttribute | PrimaryInstanceXPathComment;
|
|
13
15
|
export type EngineXPathDocument = PrimaryInstance | StaticDocument;
|
|
14
16
|
export type EngineXPathElement = PrimaryInstanceXPathElement | StaticElement;
|
|
15
17
|
export type EngineXPathComment = PrimaryInstanceXPathComment;
|
|
16
|
-
export type EngineXPathAttribute = StaticAttribute;
|
|
18
|
+
export type EngineXPathAttribute = PrimaryInstanceXPathAttribute | StaticAttribute;
|
|
17
19
|
export type EngineXPathText = StaticText;
|
|
18
20
|
export type XFormsXPathChildNode = EngineXPathElement | EngineXPathText | EngineXPathComment;
|
|
19
21
|
type XPathAdapterParentNode = XFormsXPathDocument | XFormsXPathElement;
|