@getodk/xforms-engine 0.15.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 -6
- package/dist/client/BaseNode.d.ts +5 -0
- package/dist/client/form/FormInstanceConfig.d.ts +15 -0
- package/dist/index.js +654 -429
- package/dist/index.js.map +1 -1
- package/dist/instance/Attribute.d.ts +13 -19
- package/dist/instance/Group.d.ts +2 -1
- package/dist/instance/InputControl.d.ts +5 -0
- package/dist/instance/ModelValue.d.ts +4 -0
- package/dist/instance/Note.d.ts +4 -0
- package/dist/instance/PrimaryInstance.d.ts +3 -2
- package/dist/instance/RangeControl.d.ts +4 -0
- package/dist/instance/RankControl.d.ts +5 -1
- package/dist/instance/Root.d.ts +2 -1
- package/dist/instance/SelectControl.d.ts +5 -1
- package/dist/instance/TriggerControl.d.ts +4 -0
- package/dist/instance/UploadControl.d.ts +3 -2
- package/dist/instance/abstract/DescendantNode.d.ts +5 -4
- package/dist/instance/abstract/InstanceNode.d.ts +6 -5
- package/dist/instance/abstract/ValueNode.d.ts +2 -1
- package/dist/instance/attachments/buildAttributes.d.ts +6 -2
- package/dist/instance/hierarchy.d.ts +2 -2
- package/dist/instance/internal-api/AttributeContext.d.ts +6 -0
- package/dist/instance/internal-api/InstanceConfig.d.ts +2 -0
- package/dist/instance/internal-api/InstanceValueContext.d.ts +6 -0
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableAttributeNode.d.ts +0 -1
- package/dist/instance/internal-api/serialization/ClientReactiveSerializableValueNode.d.ts +4 -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/lib/codecs/items/SingleValueItemCodec.d.ts +1 -1
- package/dist/lib/reactivity/createInstanceValueState.d.ts +4 -1
- package/dist/lib/reactivity/node-state/createSharedNodeState.d.ts +2 -2
- package/dist/lib/xml-serialization.d.ts +1 -1
- package/dist/parse/XFormDOM.d.ts +3 -0
- package/dist/parse/expression/ActionComputationExpression.d.ts +4 -0
- package/dist/parse/model/ActionDefinition.d.ts +15 -0
- package/dist/parse/model/AttributeDefinition.d.ts +5 -1
- package/dist/parse/model/BindPreloadDefinition.d.ts +6 -10
- package/dist/parse/model/Event.d.ts +8 -0
- package/dist/parse/model/LeafNodeDefinition.d.ts +5 -2
- package/dist/parse/model/ModelActionMap.d.ts +9 -0
- package/dist/parse/model/ModelDefinition.d.ts +8 -1
- package/dist/parse/model/NoteNodeDefinition.d.ts +3 -2
- package/dist/parse/model/RangeNodeDefinition.d.ts +2 -1
- package/dist/parse/model/RootDefinition.d.ts +1 -0
- package/dist/solid.js +654 -429
- package/dist/solid.js.map +1 -1
- package/package.json +21 -17
- package/src/client/AttributeNode.ts +4 -6
- package/src/client/BaseNode.ts +6 -0
- package/src/client/form/FormInstanceConfig.ts +17 -0
- package/src/client/validation.ts +1 -1
- package/src/entrypoints/FormInstance.ts +1 -0
- package/src/instance/Attribute.ts +43 -59
- package/src/instance/Group.ts +5 -6
- package/src/instance/InputControl.ts +16 -1
- package/src/instance/ModelValue.ts +16 -1
- package/src/instance/Note.ts +15 -1
- package/src/instance/PrimaryInstance.ts +8 -10
- package/src/instance/RangeControl.ts +15 -1
- package/src/instance/RankControl.ts +17 -2
- package/src/instance/Root.ts +5 -6
- package/src/instance/SelectControl.ts +16 -2
- package/src/instance/TriggerControl.ts +15 -1
- package/src/instance/UploadControl.ts +9 -8
- package/src/instance/abstract/DescendantNode.ts +4 -8
- package/src/instance/abstract/InstanceNode.ts +7 -5
- package/src/instance/abstract/ValueNode.ts +2 -1
- package/src/instance/attachments/buildAttributes.ts +15 -4
- package/src/instance/children/childrenInitOptions.ts +2 -1
- package/src/instance/children/normalizeChildInitOptions.ts +1 -1
- package/src/instance/hierarchy.ts +2 -2
- package/src/instance/internal-api/AttributeContext.ts +6 -0
- package/src/instance/internal-api/InstanceConfig.ts +6 -1
- package/src/instance/internal-api/InstanceValueContext.ts +6 -0
- package/src/instance/internal-api/serialization/ClientReactiveSerializableAttributeNode.ts +0 -1
- package/src/instance/internal-api/serialization/ClientReactiveSerializableValueNode.ts +4 -0
- package/src/instance/repeat/RepeatInstance.ts +3 -4
- 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/client-reactivity/instance-state/createValueNodeInstanceState.ts +2 -1
- package/src/lib/client-reactivity/instance-state/prepareInstancePayload.ts +1 -0
- package/src/lib/codecs/NoteCodec.ts +1 -1
- package/src/lib/codecs/items/SingleValueItemCodec.ts +1 -3
- package/src/lib/reactivity/createInstanceValueState.ts +177 -52
- package/src/lib/reactivity/node-state/createSharedNodeState.ts +2 -2
- package/src/lib/xml-serialization.ts +9 -1
- package/src/parse/XFormDOM.ts +9 -0
- package/src/parse/body/GroupElementDefinition.ts +1 -1
- package/src/parse/body/control/InputControlDefinition.ts +1 -1
- package/src/parse/expression/ActionComputationExpression.ts +12 -0
- package/src/parse/model/ActionDefinition.ts +70 -0
- package/src/parse/model/AttributeDefinition.ts +10 -2
- package/src/parse/model/AttributeDefinitionMap.ts +1 -1
- package/src/parse/model/BindDefinition.ts +1 -6
- package/src/parse/model/BindPreloadDefinition.ts +44 -12
- package/src/parse/model/Event.ts +9 -0
- package/src/parse/model/LeafNodeDefinition.ts +5 -1
- package/src/parse/model/ModelActionMap.ts +37 -0
- package/src/parse/model/ModelDefinition.ts +18 -3
- package/src/parse/model/NoteNodeDefinition.ts +5 -2
- package/src/parse/model/RangeNodeDefinition.ts +5 -2
- package/src/parse/model/RootDefinition.ts +22 -4
- package/dist/lib/reactivity/createAttributeValueState.d.ts +0 -15
- package/src/lib/reactivity/createAttributeValueState.ts +0 -189
|
@@ -1,34 +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
13
|
import { SimpleAtomicState } from '../lib/reactivity/types.ts';
|
|
14
14
|
import { AttributeDefinition } from '../parse/model/AttributeDefinition.ts';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { AnyParentNode } from './hierarchy.ts';
|
|
15
|
+
import { DescendantNode, DescendantNodeStateSpec } from './abstract/DescendantNode.ts';
|
|
16
|
+
import { AnyNode } from './hierarchy.ts';
|
|
18
17
|
import { AttributeContext } from './internal-api/AttributeContext.ts';
|
|
19
18
|
import { DecodeInstanceValue } from './internal-api/InstanceValueContext.ts';
|
|
20
19
|
import { ClientReactiveSerializableAttributeNode } from './internal-api/serialization/ClientReactiveSerializableAttributeNode.ts';
|
|
21
20
|
import { Root } from './Root.ts';
|
|
22
|
-
export interface AttributeStateSpec extends
|
|
21
|
+
export interface AttributeStateSpec extends DescendantNodeStateSpec<string> {
|
|
23
22
|
readonly children: null;
|
|
24
|
-
readonly attributes:
|
|
23
|
+
readonly attributes: Accessor<Attribute[]>;
|
|
25
24
|
readonly value: SimpleAtomicState<string>;
|
|
26
25
|
readonly instanceValue: Accessor<string>;
|
|
27
|
-
readonly
|
|
28
|
-
readonly hint: null;
|
|
29
|
-
readonly valueOptions: null;
|
|
26
|
+
readonly relevant: Accessor<boolean>;
|
|
30
27
|
}
|
|
31
|
-
export declare class Attribute extends
|
|
28
|
+
export declare class Attribute extends DescendantNode<AttributeDefinition, AttributeStateSpec, AnyNode, null> implements AttributeNode, ClientReactiveSerializableAttributeNode, AttributeContext, XFormsXPathAttribute {
|
|
29
|
+
readonly owner: AnyNode;
|
|
32
30
|
readonly instanceNode: StaticAttribute;
|
|
33
31
|
readonly [XPathNodeKindKey] = "attribute";
|
|
34
32
|
protected readonly state: SharedNodeState<AttributeStateSpec>;
|
|
@@ -44,15 +42,11 @@ export declare class Attribute extends InstanceNode<AttributeDefinition, Attribu
|
|
|
44
42
|
protected readonly getInstanceValue: Accessor<string>;
|
|
45
43
|
protected readonly valueState: RuntimeValueState<RuntimeValue<'string'>>;
|
|
46
44
|
protected readonly setValueState: RuntimeValueSetter<RuntimeInputValue<'string'>>;
|
|
47
|
-
readonly
|
|
48
|
-
readonly getActiveLanguage: Accessor<ActiveLanguage>;
|
|
49
|
-
readonly root: Root;
|
|
50
|
-
readonly isRelevant: Accessor<boolean>;
|
|
45
|
+
readonly attributeState: AttributeState;
|
|
51
46
|
readonly isAttached: Accessor<boolean>;
|
|
52
|
-
readonly
|
|
53
|
-
|
|
54
|
-
readonly hasNonRelevantAncestor: Accessor<boolean>;
|
|
55
|
-
constructor(parent: AnyParentNode, definition: AttributeDefinition, instanceNode: StaticAttribute);
|
|
47
|
+
readonly getXPathValue: () => string;
|
|
48
|
+
constructor(owner: AnyNode, definition: AttributeDefinition, instanceNode: StaticAttribute);
|
|
56
49
|
setValue(value: string): Root;
|
|
50
|
+
getAttributes(): readonly Attribute[];
|
|
57
51
|
getChildren(): readonly [];
|
|
58
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';
|
|
@@ -26,10 +27,10 @@ interface GroupStateSpec extends DescendantNodeSharedStateSpec {
|
|
|
26
27
|
}
|
|
27
28
|
export declare class Group extends DescendantNode<GroupDefinition, GroupStateSpec, GeneralParentNode, GeneralChildNode> implements GroupNode, XFormsXPathElement, EvaluationContext, ClientReactiveSerializableParentNode<GeneralChildNode> {
|
|
28
29
|
private readonly childrenState;
|
|
29
|
-
private readonly attributeState;
|
|
30
30
|
readonly [XPathNodeKindKey] = "element";
|
|
31
31
|
protected readonly state: SharedNodeState<GroupStateSpec>;
|
|
32
32
|
protected engineState: EngineState<GroupStateSpec>;
|
|
33
|
+
readonly attributeState: AttributeState;
|
|
33
34
|
readonly nodeType = "group";
|
|
34
35
|
readonly appearances: GroupNodeAppearances;
|
|
35
36
|
readonly nodeOptions: null;
|
|
@@ -6,10 +6,12 @@ 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';
|
|
12
13
|
import { ValueNode, ValueNodeStateSpec } from './abstract/ValueNode.ts';
|
|
14
|
+
import { Attribute } from './Attribute.ts';
|
|
13
15
|
import { GeneralParentNode } from './hierarchy.ts';
|
|
14
16
|
import { EvaluationContext } from './internal-api/EvaluationContext.ts';
|
|
15
17
|
import { ClientReactiveSerializableValueNode } from './internal-api/serialization/ClientReactiveSerializableValueNode.ts';
|
|
@@ -21,6 +23,7 @@ export type AnyInputDefinition = {
|
|
|
21
23
|
interface InputControlStateSpec<V extends ValueType> extends ValueNodeStateSpec<RuntimeValue<V>> {
|
|
22
24
|
readonly label: Accessor<TextRange<'label'> | null>;
|
|
23
25
|
readonly hint: Accessor<TextRange<'hint'> | null>;
|
|
26
|
+
readonly attributes: Accessor<readonly Attribute[]>;
|
|
24
27
|
readonly valueOptions: null;
|
|
25
28
|
}
|
|
26
29
|
export declare class InputControl<V extends ValueType = ValueType> extends ValueNode<V, InputDefinition<V>, RuntimeValue<V>, RuntimeInputValue<V>> implements InputNode<V>, XFormsXPathElement, EvaluationContext, ValidationContext, ClientReactiveSerializableValueNode {
|
|
@@ -28,12 +31,14 @@ export declare class InputControl<V extends ValueType = ValueType> extends Value
|
|
|
28
31
|
readonly [XPathNodeKindKey] = "element";
|
|
29
32
|
protected readonly state: SharedNodeState<InputControlStateSpec<V>>;
|
|
30
33
|
protected readonly engineState: EngineState<InputControlStateSpec<V>>;
|
|
34
|
+
readonly attributeState: AttributeState;
|
|
31
35
|
readonly nodeType = "input";
|
|
32
36
|
readonly appearances: InputNodeAppearances;
|
|
33
37
|
readonly nodeOptions: InputNodeOptions<V>;
|
|
34
38
|
readonly currentState: CurrentState<InputControlStateSpec<V>>;
|
|
35
39
|
constructor(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: InputDefinition<V>);
|
|
36
40
|
setValue(value: InputNodeInputValue<V>): Root;
|
|
41
|
+
getAttributes(): readonly Attribute[];
|
|
37
42
|
}
|
|
38
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'>;
|
|
39
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;
|
|
@@ -87,8 +89,8 @@ export declare class PrimaryInstance<Mode extends FormInstanceInitializationMode
|
|
|
87
89
|
readonly isAttached: Accessor<boolean>;
|
|
88
90
|
readonly evaluator: EngineXPathEvaluator;
|
|
89
91
|
readonly contextNode: this;
|
|
90
|
-
private readonly attributeState;
|
|
91
92
|
constructor(options: PrimaryInstanceOptions<Mode>);
|
|
93
|
+
getAttributes(): readonly Attribute[];
|
|
92
94
|
/**
|
|
93
95
|
* @todo Note that this method's signature is intentionally derived from
|
|
94
96
|
* {@link RootNode.setLanguage}, but its return type differs! The design
|
|
@@ -110,6 +112,5 @@ export declare class PrimaryInstance<Mode extends FormInstanceInitializationMode
|
|
|
110
112
|
*/
|
|
111
113
|
setLanguage(language: FormLanguage): FormLanguage;
|
|
112
114
|
prepareInstancePayload<PayloadType extends InstancePayloadType = 'monolithic'>(options?: InstancePayloadOptions<PayloadType>): Promise<InstancePayload<PayloadType>>;
|
|
113
|
-
getAttributes(): readonly Attribute[];
|
|
114
115
|
}
|
|
115
116
|
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';
|
|
@@ -36,10 +37,10 @@ interface RootStateSpec {
|
|
|
36
37
|
}
|
|
37
38
|
export declare class Root extends DescendantNode<RootDefinition, RootStateSpec, PrimaryInstance, GeneralChildNode> implements RootNode, XFormsXPathElement, EvaluationContext, TranslationContext, ClientReactiveSerializableParentNode<GeneralChildNode> {
|
|
38
39
|
private readonly childrenState;
|
|
39
|
-
private readonly attributeState;
|
|
40
40
|
readonly [XPathNodeKindKey] = "element";
|
|
41
41
|
protected readonly state: SharedNodeState<RootStateSpec>;
|
|
42
42
|
protected readonly engineState: EngineState<RootStateSpec>;
|
|
43
|
+
readonly attributeState: AttributeState;
|
|
43
44
|
readonly hasReadonlyAncestor: () => boolean;
|
|
44
45
|
readonly isSelfReadonly: () => boolean;
|
|
45
46
|
readonly isReadonly: () => boolean;
|
|
@@ -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';
|
|
@@ -39,11 +40,11 @@ export declare class UploadControl extends DescendantNode<UploadDefinition<'bina
|
|
|
39
40
|
static from(parent: GeneralParentNode, instanceNode: StaticLeafElement | null, definition: UploadDefinition): UploadControl;
|
|
40
41
|
private readonly validation;
|
|
41
42
|
private readonly instanceAttachment;
|
|
42
|
-
private readonly attributeState;
|
|
43
43
|
readonly [XPathNodeKindKey] = "element";
|
|
44
44
|
readonly getXPathValue: () => InstanceAttachmentFileName;
|
|
45
45
|
protected readonly state: SharedNodeState<UploadControlStateSpec>;
|
|
46
46
|
protected readonly engineState: EngineState<UploadControlStateSpec>;
|
|
47
|
+
readonly attributeState: AttributeState;
|
|
47
48
|
readonly decodeInstanceValue: DecodeInstanceValue;
|
|
48
49
|
readonly nodeType = "upload";
|
|
49
50
|
readonly valueType = "binary";
|
|
@@ -56,7 +57,7 @@ export declare class UploadControl extends DescendantNode<UploadDefinition<'bina
|
|
|
56
57
|
getViolation(): AnyViolation | null;
|
|
57
58
|
isBlank(): boolean;
|
|
58
59
|
getChildren(): readonly [];
|
|
59
|
-
setValue(value: InstanceAttachmentRuntimeValue): Root;
|
|
60
60
|
getAttributes(): readonly Attribute[];
|
|
61
|
+
setValue(value: InstanceAttachmentRuntimeValue): Root;
|
|
61
62
|
}
|
|
62
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;
|
|
@@ -124,11 +124,12 @@ export declare abstract class InstanceNode<Definition extends AnyNodeDefinition,
|
|
|
124
124
|
* (though for those nodes it will always be empty). This affords consistency
|
|
125
125
|
* and efficiency of interface for those internal uses.
|
|
126
126
|
*/
|
|
127
|
-
abstract getChildren(this: AnyInstanceNode):
|
|
127
|
+
abstract getChildren(this: AnyInstanceNode): readonly AnyChildNode[];
|
|
128
128
|
/**
|
|
129
129
|
* @todo Values as text nodes(?)
|
|
130
130
|
*/
|
|
131
|
-
getXPathChildNodes():
|
|
131
|
+
getXPathChildNodes(): readonly AnyChildNode[];
|
|
132
132
|
getXPathValue(): string;
|
|
133
|
+
abstract getAttributes(): readonly Attribute[];
|
|
133
134
|
}
|
|
134
135
|
export {};
|
|
@@ -14,6 +14,7 @@ import { SharedNodeState } from '../../lib/reactivity/node-state/createSharedNod
|
|
|
14
14
|
import { SimpleAtomicState } from '../../lib/reactivity/types.ts';
|
|
15
15
|
import { SharedValidationState } from '../../lib/reactivity/validation/createValidation.ts';
|
|
16
16
|
import { LeafNodeDefinition } from '../../parse/model/LeafNodeDefinition.ts';
|
|
17
|
+
import { Attribute } from '../Attribute.ts';
|
|
17
18
|
import { GeneralParentNode } from '../hierarchy.ts';
|
|
18
19
|
import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
|
|
19
20
|
import { DecodeInstanceValue, InstanceValueContext } from '../internal-api/InstanceValueContext.ts';
|
|
@@ -23,7 +24,7 @@ import { DescendantNodeStateSpec, DescendantNode } from './DescendantNode.ts';
|
|
|
23
24
|
export type ValueNodeDefinition<V extends ValueType> = LeafNodeDefinition<V>;
|
|
24
25
|
export interface ValueNodeStateSpec<RuntimeValue> extends DescendantNodeStateSpec<RuntimeValue> {
|
|
25
26
|
readonly children: null;
|
|
26
|
-
readonly attributes:
|
|
27
|
+
readonly attributes: Accessor<readonly Attribute[]>;
|
|
27
28
|
readonly value: SimpleAtomicState<RuntimeValue>;
|
|
28
29
|
readonly instanceValue: Accessor<string>;
|
|
29
30
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { Attribute } from '../Attribute';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { AnyNode } from '../hierarchy.ts';
|
|
3
|
+
import { InputControl } from '../InputControl.ts';
|
|
4
|
+
import { ModelValue } from '../ModelValue.ts';
|
|
5
|
+
import { Note } from '../Note.ts';
|
|
6
|
+
import { RangeControl } from '../RangeControl.ts';
|
|
7
|
+
export declare function buildAttributes(owner: AnyNode | InputControl<any> | ModelValue<any> | Note<any> | RangeControl<any>): Attribute[];
|
|
@@ -14,9 +14,9 @@ import { SelectControl } from './SelectControl.ts';
|
|
|
14
14
|
import { TriggerControl } from './TriggerControl.ts';
|
|
15
15
|
import { UploadControl } from './UploadControl.ts';
|
|
16
16
|
export type RepeatRange = RepeatRangeControlled | RepeatRangeUncontrolled;
|
|
17
|
-
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;
|
|
18
18
|
export type AnyParentNode = PrimaryInstance | Root | Group | RepeatRange | RepeatInstance;
|
|
19
19
|
export type GeneralParentNode = Root | Group | RepeatInstance;
|
|
20
|
-
export type AnyChildNode = Root | Group | RepeatRange | RepeatInstance | AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | UploadControl
|
|
20
|
+
export type AnyChildNode = Root | Group | RepeatRange | RepeatInstance | AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | UploadControl;
|
|
21
21
|
export type GeneralChildNode = Group | RepeatRange | AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | UploadControl;
|
|
22
22
|
export type AnyValueNode = AnyModelValue | AnyNote | AnyInputControl | AnyRangeControl | RankControl | SelectControl | TriggerControl | UploadControl;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
1
2
|
import { FormInstanceInitializationMode } from '../../client/index.ts';
|
|
2
3
|
import { StaticAttribute } from '../../integration/xpath/static-dom/StaticAttribute.ts';
|
|
3
4
|
import { ReactiveScope } from '../../lib/reactivity/scope.ts';
|
|
4
5
|
import { BindComputationExpression } from '../../parse/expression/BindComputationExpression.ts';
|
|
5
6
|
import { AnyBindPreloadDefinition } from '../../parse/model/BindPreloadDefinition.ts';
|
|
7
|
+
import { ModelDefinition } from '../../parse/model/ModelDefinition.ts';
|
|
6
8
|
import { EvaluationContext } from './EvaluationContext.ts';
|
|
9
|
+
import { InstanceConfig } from './InstanceConfig.ts';
|
|
7
10
|
export interface InstanceAttributeContextDocument {
|
|
8
11
|
readonly initializationMode: FormInstanceInitializationMode;
|
|
12
|
+
readonly isAttached: Accessor<boolean>;
|
|
9
13
|
}
|
|
10
14
|
export type DecodeInstanceValue = (value: string) => string;
|
|
11
15
|
interface InstanceAttributeContextDefinitionBind {
|
|
@@ -16,12 +20,14 @@ interface InstanceAttributeContextDefinitionBind {
|
|
|
16
20
|
export interface InstanceAttributeContextDefinition {
|
|
17
21
|
readonly bind: InstanceAttributeContextDefinitionBind;
|
|
18
22
|
readonly template: StaticAttribute;
|
|
23
|
+
readonly model: ModelDefinition;
|
|
19
24
|
}
|
|
20
25
|
export interface AttributeContext extends EvaluationContext {
|
|
21
26
|
readonly scope: ReactiveScope;
|
|
22
27
|
readonly rootDocument: InstanceAttributeContextDocument;
|
|
23
28
|
readonly definition: InstanceAttributeContextDefinition;
|
|
24
29
|
readonly instanceNode: StaticAttribute;
|
|
30
|
+
readonly instanceConfig: InstanceConfig;
|
|
25
31
|
readonly decodeInstanceValue: DecodeInstanceValue;
|
|
26
32
|
isReadonly(): boolean;
|
|
27
33
|
isRelevant(): boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InstanceAttachmentFileNameFactory } from '../../client/attachments/InstanceAttachmentsConfig.ts';
|
|
2
|
+
import { PreloadProperties } from '../../client/form/FormInstanceConfig.ts';
|
|
2
3
|
import { OpaqueReactiveObjectFactory } from '../../client/OpaqueReactiveObjectFactory.ts';
|
|
3
4
|
export interface InstanceConfig {
|
|
4
5
|
/**
|
|
@@ -6,4 +7,5 @@ export interface InstanceConfig {
|
|
|
6
7
|
*/
|
|
7
8
|
readonly clientStateFactory: OpaqueReactiveObjectFactory;
|
|
8
9
|
readonly computeAttachmentName: InstanceAttachmentFileNameFactory;
|
|
10
|
+
readonly preloadProperties: PreloadProperties;
|
|
9
11
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import { Accessor } from 'solid-js';
|
|
1
2
|
import { FormInstanceInitializationMode } from '../../client/index.ts';
|
|
2
3
|
import { StaticLeafElement } from '../../integration/xpath/static-dom/StaticElement.ts';
|
|
3
4
|
import { ReactiveScope } from '../../lib/reactivity/scope.ts';
|
|
4
5
|
import { BindComputationExpression } from '../../parse/expression/BindComputationExpression.ts';
|
|
5
6
|
import { AnyBindPreloadDefinition } from '../../parse/model/BindPreloadDefinition.ts';
|
|
7
|
+
import { ModelDefinition } from '../../parse/model/ModelDefinition.ts';
|
|
6
8
|
import { EvaluationContext } from './EvaluationContext.ts';
|
|
9
|
+
import { InstanceConfig } from './InstanceConfig.ts';
|
|
7
10
|
export interface InstanceValueContextDocument {
|
|
8
11
|
readonly initializationMode: FormInstanceInitializationMode;
|
|
12
|
+
readonly isAttached: Accessor<boolean>;
|
|
9
13
|
}
|
|
10
14
|
export type DecodeInstanceValue = (value: string) => string;
|
|
11
15
|
interface InstanceValueContextDefinitionBind {
|
|
@@ -16,12 +20,14 @@ interface InstanceValueContextDefinitionBind {
|
|
|
16
20
|
export interface InstanceValueContextDefinition {
|
|
17
21
|
readonly bind: InstanceValueContextDefinitionBind;
|
|
18
22
|
readonly template: StaticLeafElement;
|
|
23
|
+
readonly model: ModelDefinition;
|
|
19
24
|
}
|
|
20
25
|
export interface InstanceValueContext extends EvaluationContext {
|
|
21
26
|
readonly scope: ReactiveScope;
|
|
22
27
|
readonly rootDocument: InstanceValueContextDocument;
|
|
23
28
|
readonly definition: InstanceValueContextDefinition;
|
|
24
29
|
readonly instanceNode: StaticLeafElement | null;
|
|
30
|
+
readonly instanceConfig: InstanceConfig;
|
|
25
31
|
readonly decodeInstanceValue: DecodeInstanceValue;
|
|
26
32
|
isReadonly(): boolean;
|
|
27
33
|
isRelevant(): boolean;
|
package/dist/instance/internal-api/serialization/ClientReactiveSerializableAttributeNode.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { InstanceState } from '../../../client/serialization/InstanceState.ts';
|
|
|
2
2
|
import { QualifiedName } from '../../../lib/names/QualifiedName.ts';
|
|
3
3
|
export type SerializedInstanceValue = string;
|
|
4
4
|
interface ClientReactiveSerializableAttributeNodeCurrentState {
|
|
5
|
-
get relevant(): boolean;
|
|
6
5
|
get instanceValue(): SerializedInstanceValue;
|
|
7
6
|
}
|
|
8
7
|
interface ClientReactiveSerializableAttributeNodeDefinition {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { InstanceState } from '../../../client/serialization/InstanceState.ts';
|
|
2
2
|
import { QualifiedName } from '../../../lib/names/QualifiedName.ts';
|
|
3
|
+
import { BindDefinition } from '../../../parse/model/BindDefinition.ts';
|
|
4
|
+
import { Attribute } from '../../Attribute.ts';
|
|
3
5
|
import { ClientReactiveSerializableChildNode, ClientReactiveSerializableParentNode } from './ClientReactiveSerializableParentNode.ts';
|
|
4
6
|
export type SerializedInstanceValue = string;
|
|
5
7
|
interface ClientReactiveSerializableValueNodeCurrentState {
|
|
@@ -8,9 +10,11 @@ interface ClientReactiveSerializableValueNodeCurrentState {
|
|
|
8
10
|
* @todo Consider moving into {@link InstanceState}
|
|
9
11
|
*/
|
|
10
12
|
get instanceValue(): SerializedInstanceValue;
|
|
13
|
+
get attributes(): readonly Attribute[];
|
|
11
14
|
}
|
|
12
15
|
interface ClientReactiveSerializableValueNodeDefinition {
|
|
13
16
|
readonly qualifiedName: QualifiedName;
|
|
17
|
+
readonly bind: BindDefinition;
|
|
14
18
|
}
|
|
15
19
|
export interface ClientReactiveSerializableValueNode {
|
|
16
20
|
readonly definition: ClientReactiveSerializableValueNodeDefinition;
|