@getodk/xforms-engine 0.16.0 → 0.16.1
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/index.js +272 -211
- 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 +3 -0
- 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/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/parse/model/AttributeDefinition.d.ts +2 -0
- package/dist/solid.js +272 -211
- package/dist/solid.js.map +1 -1
- package/package.json +2 -2
- package/src/client/AttributeNode.ts +4 -3
- package/src/instance/Attribute.ts +38 -54
- package/src/instance/Group.ts +12 -4
- package/src/instance/InputControl.ts +12 -4
- package/src/instance/ModelValue.ts +13 -4
- package/src/instance/Note.ts +13 -4
- package/src/instance/PrimaryInstance.ts +12 -4
- 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 +5 -1
- package/src/instance/children/childrenInitOptions.ts +2 -1
- package/src/instance/hierarchy.ts +2 -0
- package/src/instance/repeat/RepeatInstance.ts +11 -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/lib/reactivity/createInstanceValueState.ts +29 -3
- package/src/parse/model/AttributeDefinition.ts +7 -0
|
@@ -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';
|
|
@@ -66,6 +67,7 @@ export declare class PrimaryInstance<Mode extends FormInstanceInitializationMode
|
|
|
66
67
|
readonly attachments: InstanceAttachmentsState;
|
|
67
68
|
protected readonly state: SharedNodeState<PrimaryInstanceStateSpec>;
|
|
68
69
|
protected readonly engineState: EngineState<PrimaryInstanceStateSpec>;
|
|
70
|
+
readonly attributeState: AttributeState;
|
|
69
71
|
readonly instanceNode: StaticDocument;
|
|
70
72
|
readonly getChildren: Accessor<readonly Root[]>;
|
|
71
73
|
readonly hasReadonlyAncestor: () => boolean;
|
|
@@ -88,6 +90,7 @@ export declare class PrimaryInstance<Mode extends FormInstanceInitializationMode
|
|
|
88
90
|
readonly evaluator: EngineXPathEvaluator;
|
|
89
91
|
readonly contextNode: this;
|
|
90
92
|
constructor(options: PrimaryInstanceOptions<Mode>);
|
|
93
|
+
getAttributes(): readonly Attribute[];
|
|
91
94
|
/**
|
|
92
95
|
* @todo Note that this method's signature is intentionally derived from
|
|
93
96
|
* {@link RootNode.setLanguage}, but its return type differs! The design
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EngineXPathAttribute, EngineXPathDocument, EngineXPathElement, EngineXPathNode,
|
|
1
|
+
import { EngineXPathAttribute, EngineXPathDocument, EngineXPathElement, EngineXPathNode, XFormsXPathChildNode } from './kind.ts';
|
|
2
2
|
export declare const getContainingEngineXPathDocument: (node: EngineXPathNode) => EngineXPathDocument;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const getAttributes: (node: EngineXPathNode) => readonly EngineXPathAttribute[];
|
|
4
4
|
/**
|
|
5
5
|
* @todo We've now laid most of the groundwork necessary to implement this
|
|
6
6
|
* properly. At time of writing it has still been deferred because:
|
|
@@ -15,7 +15,7 @@ export declare const getEngineXPathAttributes: (node: EngineXPathNode) => readon
|
|
|
15
15
|
* are somehow wrong (or become wrong).
|
|
16
16
|
*/
|
|
17
17
|
export declare const getNamespaceDeclarations: () => readonly [];
|
|
18
|
-
export declare const getParentNode: (node: EngineXPathNode) =>
|
|
18
|
+
export declare const getParentNode: (node: EngineXPathNode) => EngineXPathNode | null;
|
|
19
19
|
export declare const getChildNodes: (node: EngineXPathNode) => readonly XFormsXPathChildNode[];
|
|
20
20
|
export declare const getChildElements: (node: EngineXPathNode) => readonly EngineXPathElement[];
|
|
21
21
|
export declare const getPreviousSiblingNode: (node: EngineXPathNode) => XFormsXPathChildNode | null;
|
|
@@ -19,6 +19,7 @@ export declare class StaticAttribute extends StaticNode<'attribute'> implements
|
|
|
19
19
|
readonly nodeset: string;
|
|
20
20
|
readonly attributes: readonly [];
|
|
21
21
|
readonly children: null;
|
|
22
|
+
readonly childElements: never[];
|
|
22
23
|
readonly value: string;
|
|
23
24
|
constructor(parent: StaticElement, options: StaticAttributeOptions);
|
|
24
25
|
getXPathValue(): string;
|
|
@@ -11,6 +11,7 @@ export declare class AttributeDefinition extends NodeDefinition<'attribute'> imp
|
|
|
11
11
|
private readonly serializedXML;
|
|
12
12
|
readonly value: string;
|
|
13
13
|
readonly type = "attribute";
|
|
14
|
+
readonly valueType = "string";
|
|
14
15
|
readonly namespaceDeclarations: NamespaceDeclarationMap;
|
|
15
16
|
readonly bodyElement: null;
|
|
16
17
|
readonly root: RootDefinition;
|
|
@@ -21,4 +22,5 @@ export declare class AttributeDefinition extends NodeDefinition<'attribute'> imp
|
|
|
21
22
|
readonly qualifiedName: QualifiedName;
|
|
22
23
|
constructor(model: ModelDefinition, bind: BindDefinition, template: StaticAttribute);
|
|
23
24
|
serializeAttributeXML(): string;
|
|
25
|
+
toJSON(): Omit<this, "parent" | "toJSON" | "bind" | "root" | "bodyElement" | "serializeAttributeXML">;
|
|
24
26
|
}
|