@getodk/xforms-engine 0.1.0 → 0.2.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/.vite/manifest.json +1 -0
- package/dist/XFormDOM.d.ts +1 -0
- package/dist/XFormDataType.d.ts +2 -1
- package/dist/XFormDefinition.d.ts +1 -0
- package/dist/body/BodyDefinition.d.ts +27 -9
- package/dist/body/BodyElementDefinition.d.ts +5 -4
- package/dist/body/RepeatElementDefinition.d.ts +19 -0
- package/dist/body/UnsupportedBodyElementDefinition.d.ts +3 -2
- package/dist/body/appearance/inputAppearanceParser.d.ts +4 -0
- package/dist/body/appearance/selectAppearanceParser.d.ts +4 -0
- package/dist/body/appearance/structureElementAppearanceParser.d.ts +4 -0
- package/dist/body/control/ControlDefinition.d.ts +5 -2
- package/dist/body/control/InputDefinition.d.ts +6 -0
- package/dist/body/control/select/ItemDefinition.d.ts +4 -3
- package/dist/body/control/select/ItemsetDefinition.d.ts +4 -3
- package/dist/body/control/select/ItemsetNodesetContext.d.ts +3 -2
- package/dist/body/control/select/ItemsetNodesetExpression.d.ts +2 -1
- package/dist/body/control/select/ItemsetValueExpression.d.ts +2 -1
- package/dist/body/control/select/SelectDefinition.d.ts +16 -5
- package/dist/body/group/BaseGroupDefinition.d.ts +6 -10
- package/dist/body/group/LogicalGroupDefinition.d.ts +1 -0
- package/dist/body/group/PresentationGroupDefinition.d.ts +3 -2
- package/dist/body/group/StructuralGroupDefinition.d.ts +1 -0
- package/dist/body/text/HintDefinition.d.ts +4 -4
- package/dist/body/text/LabelDefinition.d.ts +9 -7
- package/dist/body/text/TextElementDefinition.d.ts +9 -8
- package/dist/body/text/TextElementOutputPart.d.ts +2 -1
- package/dist/body/text/TextElementPart.d.ts +5 -4
- package/dist/body/text/TextElementReferencePart.d.ts +2 -1
- package/dist/body/text/TextElementStaticPart.d.ts +2 -1
- package/dist/client/BaseNode.d.ts +9 -3
- package/dist/client/EngineConfig.d.ts +2 -1
- package/dist/client/GroupNode.d.ts +10 -6
- package/dist/client/NodeAppearances.d.ts +15 -0
- package/dist/client/RepeatInstanceNode.d.ts +10 -6
- package/dist/client/RepeatRangeNode.d.ts +11 -7
- package/dist/client/RootNode.d.ts +24 -4
- package/dist/client/SelectNode.d.ts +10 -6
- package/dist/client/StringNode.d.ts +9 -5
- package/dist/client/SubtreeNode.d.ts +6 -4
- package/dist/client/TextRange.d.ts +2 -1
- package/dist/client/hierarchy.d.ts +9 -8
- package/dist/client/index.d.ts +3 -2
- package/dist/expression/DependencyContext.d.ts +2 -1
- package/dist/expression/DependentExpression.d.ts +3 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1882 -1757
- package/dist/index.js.map +1 -1
- package/dist/instance/Group.d.ts +15 -15
- package/dist/instance/RepeatInstance.d.ts +39 -15
- package/dist/instance/RepeatRange.d.ts +98 -20
- package/dist/instance/Root.d.ts +25 -39
- package/dist/instance/SelectField.d.ts +17 -17
- package/dist/instance/StringField.d.ts +17 -17
- package/dist/instance/Subtree.d.ts +13 -13
- package/dist/instance/abstract/DescendantNode.d.ts +26 -18
- package/dist/instance/abstract/InstanceNode.d.ts +44 -46
- package/dist/instance/children.d.ts +2 -1
- package/dist/instance/hierarchy.d.ts +8 -7
- package/dist/instance/index.d.ts +4 -3
- package/dist/instance/internal-api/EvaluationContext.d.ts +10 -8
- package/dist/instance/internal-api/InstanceConfig.d.ts +3 -2
- package/dist/instance/internal-api/SubscribableDependency.d.ts +2 -1
- package/dist/instance/internal-api/TranslationContext.d.ts +2 -1
- package/dist/instance/internal-api/ValueContext.d.ts +6 -5
- package/dist/instance/resource.d.ts +3 -2
- package/dist/instance/text/TextChunk.d.ts +4 -3
- package/dist/instance/text/TextRange.d.ts +2 -1
- package/dist/lib/TokenListParser.d.ts +84 -0
- package/dist/lib/dom/query.d.ts +8 -2
- package/dist/lib/reactivity/createChildrenState.d.ts +4 -3
- package/dist/lib/reactivity/createComputedExpression.d.ts +4 -3
- package/dist/lib/reactivity/createSelectItems.d.ts +4 -3
- package/dist/lib/reactivity/createValueState.d.ts +3 -2
- package/dist/lib/reactivity/materializeCurrentStateChildren.d.ts +6 -4
- package/dist/lib/reactivity/node-state/createClientState.d.ts +7 -6
- package/dist/lib/reactivity/node-state/createCurrentState.d.ts +5 -4
- package/dist/lib/reactivity/node-state/createEngineState.d.ts +4 -3
- package/dist/lib/reactivity/node-state/createSharedNodeState.d.ts +7 -6
- package/dist/lib/reactivity/node-state/createSpecifiedPropertyDescriptor.d.ts +2 -1
- package/dist/lib/reactivity/node-state/createSpecifiedState.d.ts +3 -2
- package/dist/lib/reactivity/node-state/representations.d.ts +2 -1
- package/dist/lib/reactivity/scope.d.ts +2 -1
- package/dist/lib/reactivity/text/createFieldHint.d.ts +4 -3
- package/dist/lib/reactivity/text/createNodeLabel.d.ts +4 -3
- package/dist/lib/reactivity/text/createTextRange.d.ts +6 -5
- package/dist/lib/reactivity/types.d.ts +2 -1
- package/dist/lib/xpath/analysis.d.ts +2 -1
- package/dist/model/BindComputation.d.ts +2 -1
- package/dist/model/BindDefinition.d.ts +6 -5
- package/dist/model/DescendentNodeDefinition.d.ts +6 -6
- package/dist/model/ModelBindMap.d.ts +4 -3
- package/dist/model/ModelDefinition.d.ts +2 -1
- package/dist/model/NodeDefinition.d.ts +20 -19
- package/dist/model/RepeatInstanceDefinition.d.ts +7 -7
- package/dist/model/{RepeatSequenceDefinition.d.ts → RepeatRangeDefinition.d.ts} +7 -6
- package/dist/model/RepeatTemplateDefinition.d.ts +8 -8
- package/dist/model/RootDefinition.d.ts +8 -5
- package/dist/model/SubtreeDefinition.d.ts +5 -4
- package/dist/model/ValueNodeDefinition.d.ts +5 -5
- package/dist/solid.js +1873 -1751
- package/dist/solid.js.map +1 -1
- package/package.json +14 -18
- package/src/XFormDOM.ts +81 -8
- package/src/body/BodyDefinition.ts +38 -23
- package/src/body/RepeatElementDefinition.ts +70 -0
- package/src/body/appearance/inputAppearanceParser.ts +39 -0
- package/src/body/appearance/selectAppearanceParser.ts +38 -0
- package/src/body/appearance/structureElementAppearanceParser.ts +7 -0
- package/src/body/control/ControlDefinition.ts +4 -0
- package/src/body/control/InputDefinition.ts +13 -0
- package/src/body/control/select/SelectDefinition.ts +14 -5
- package/src/body/group/BaseGroupDefinition.ts +11 -49
- package/src/body/text/LabelDefinition.ts +15 -1
- package/src/body/text/TextElementDefinition.ts +5 -5
- package/src/client/BaseNode.ts +9 -1
- package/src/client/GroupNode.ts +6 -2
- package/src/client/NodeAppearances.ts +22 -0
- package/src/client/RepeatInstanceNode.ts +4 -0
- package/src/client/RepeatRangeNode.ts +6 -2
- package/src/client/RootNode.ts +22 -0
- package/src/client/SelectNode.ts +4 -0
- package/src/client/StringNode.ts +4 -0
- package/src/client/SubtreeNode.ts +1 -0
- package/src/instance/Group.ts +14 -9
- package/src/instance/RepeatInstance.ts +59 -15
- package/src/instance/RepeatRange.ts +133 -15
- package/src/instance/Root.ts +20 -64
- package/src/instance/SelectField.ts +7 -7
- package/src/instance/StringField.ts +8 -7
- package/src/instance/Subtree.ts +10 -7
- package/src/instance/abstract/DescendantNode.ts +45 -43
- package/src/instance/abstract/InstanceNode.ts +69 -86
- package/src/instance/children.ts +17 -7
- package/src/instance/index.ts +1 -1
- package/src/instance/internal-api/EvaluationContext.ts +5 -6
- package/src/instance/internal-api/ValueContext.ts +2 -2
- package/src/lib/TokenListParser.ts +156 -0
- package/src/lib/dom/query.ts +13 -0
- package/src/lib/reactivity/createChildrenState.ts +51 -6
- package/src/lib/reactivity/createComputedExpression.ts +1 -1
- package/src/lib/reactivity/createSelectItems.ts +4 -6
- package/src/lib/reactivity/createValueState.ts +6 -6
- package/src/lib/reactivity/materializeCurrentStateChildren.ts +3 -1
- package/src/model/DescendentNodeDefinition.ts +1 -2
- package/src/model/ModelDefinition.ts +1 -1
- package/src/model/NodeDefinition.ts +12 -12
- package/src/model/RepeatInstanceDefinition.ts +8 -13
- package/src/model/{RepeatSequenceDefinition.ts → RepeatRangeDefinition.ts} +6 -6
- package/src/model/RepeatTemplateDefinition.ts +10 -15
- package/src/model/RootDefinition.ts +6 -12
- package/src/model/SubtreeDefinition.ts +3 -3
- package/src/model/ValueNodeDefinition.ts +2 -3
- package/dist/body/RepeatDefinition.d.ts +0 -15
- package/dist/body/group/RepeatGroupDefinition.d.ts +0 -12
- package/src/body/RepeatDefinition.ts +0 -54
- package/src/body/group/RepeatGroupDefinition.ts +0 -91
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AnySyntaxNode } from '@getodk/xpath/static/grammar/SyntaxNode.js';
|
|
2
|
+
|
|
2
3
|
export type SingleChildNode = Extract<AnySyntaxNode, {
|
|
3
4
|
readonly children: readonly [AnySyntaxNode];
|
|
4
5
|
}>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DependentExpression } from '../expression/DependentExpression.ts';
|
|
2
|
-
import
|
|
2
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
3
|
+
|
|
3
4
|
declare const defaultBindComputationExpressions: {
|
|
4
5
|
readonly calculate: null;
|
|
5
6
|
readonly constraint: "true()";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { XFormDataType } from '../XFormDataType.ts';
|
|
2
|
+
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
3
3
|
import { DependencyContext } from '../expression/DependencyContext.ts';
|
|
4
|
-
import
|
|
4
|
+
import { DependentExpression } from '../expression/DependentExpression.ts';
|
|
5
5
|
import { BindComputation } from './BindComputation.ts';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import { BindElement } from './BindElement.ts';
|
|
7
|
+
import { ModelDefinition } from './ModelDefinition.ts';
|
|
8
|
+
|
|
8
9
|
export declare class BindDefinition extends DependencyContext {
|
|
9
10
|
readonly form: XFormDefinition;
|
|
10
11
|
protected readonly model: ModelDefinition;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { AnyBodyElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
3
|
+
import { ModelNode, NodeChildren, NodeDefaultValue, NodeDefinition, NodeDefinitionType, NodeInstances, NodeParent } from './NodeDefinition.ts';
|
|
4
|
+
import { RootDefinition } from './RootDefinition.ts';
|
|
5
|
+
|
|
6
6
|
export type DescendentNodeType = Exclude<NodeDefinitionType, 'root'>;
|
|
7
|
-
type DescendentNodeBodyElement = AnyBodyElementDefinition
|
|
7
|
+
type DescendentNodeBodyElement = AnyBodyElementDefinition;
|
|
8
8
|
export declare abstract class DescendentNodeDefinition<Type extends DescendentNodeType, BodyElement extends DescendentNodeBodyElement | null = DescendentNodeBodyElement | null> implements NodeDefinition<Type> {
|
|
9
9
|
readonly parent: NodeParent<Type>;
|
|
10
10
|
readonly bind: BindDefinition;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
2
2
|
import { BindDefinition } from './BindDefinition.ts';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { BindNodeset } from './BindElement.ts';
|
|
4
|
+
import { ModelDefinition } from './ModelDefinition.ts';
|
|
5
|
+
|
|
5
6
|
type TopologicalSortIndex = number;
|
|
6
7
|
export type SortedNodesetIndexes = ReadonlyMap<BindNodeset, TopologicalSortIndex>;
|
|
7
8
|
export declare class ModelBindMap extends Map<BindNodeset, BindDefinition> {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
2
2
|
import { ModelBindMap } from './ModelBindMap.ts';
|
|
3
3
|
import { RootDefinition } from './RootDefinition.ts';
|
|
4
|
+
|
|
4
5
|
export declare class ModelDefinition {
|
|
5
6
|
readonly form: XFormDefinition;
|
|
6
7
|
readonly binds: ModelBindMap;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { AnyBodyElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
|
+
import { RepeatElementDefinition } from '../body/RepeatElementDefinition.ts';
|
|
3
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
4
|
+
import { RepeatInstanceDefinition } from './RepeatInstanceDefinition.ts';
|
|
5
|
+
import { RepeatRangeDefinition } from './RepeatRangeDefinition.ts';
|
|
6
|
+
import { RepeatTemplateDefinition } from './RepeatTemplateDefinition.ts';
|
|
7
|
+
import { RootDefinition } from './RootDefinition.ts';
|
|
8
|
+
import { SubtreeDefinition } from './SubtreeDefinition.ts';
|
|
9
|
+
import { ValueNodeDefinition } from './ValueNodeDefinition.ts';
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* Corresponds to the model/entry DOM root node, i.e.:
|
|
12
13
|
*
|
|
@@ -15,12 +16,12 @@ import type { ValueNodeDefinition } from './ValueNodeDefinition.ts';
|
|
|
15
16
|
*/
|
|
16
17
|
export type RootNodeType = 'root';
|
|
17
18
|
/**
|
|
18
|
-
* Corresponds to a sequence of model/entry DOM subtrees which in turn
|
|
19
|
+
* Corresponds to a range/sequence of model/entry DOM subtrees which in turn
|
|
19
20
|
* corresponds to a <repeat> in the form body definition.
|
|
20
21
|
*/
|
|
21
|
-
export type
|
|
22
|
+
export type RepeatRangeType = 'repeat-range';
|
|
22
23
|
/**
|
|
23
|
-
* Corresponds to a template definition for a repeat
|
|
24
|
+
* Corresponds to a template definition for a repeat range, which either has
|
|
24
25
|
* an explicit `jr:template=""` attribute in the form definition or is inferred
|
|
25
26
|
* as a template from the form's first element matched by a <repeat nodeset>.
|
|
26
27
|
*/
|
|
@@ -28,7 +29,7 @@ export type RepeatTemplateType = 'repeat-template';
|
|
|
28
29
|
/**
|
|
29
30
|
* Corresponds to a single instance of a model/entry DOM subtree which
|
|
30
31
|
* in turn corresponds to a <repeat> in the form body definition, and a
|
|
31
|
-
* 'repeat-
|
|
32
|
+
* 'repeat-range' definition.
|
|
32
33
|
*/
|
|
33
34
|
export type RepeatInstanceType = 'repeat-instance';
|
|
34
35
|
/**
|
|
@@ -44,21 +45,21 @@ export type SubtreeNodeType = 'subtree';
|
|
|
44
45
|
* - Any attribute corresponding to a bind's `nodeset` expression
|
|
45
46
|
*/
|
|
46
47
|
export type ValueNodeType = 'value-node';
|
|
47
|
-
export type NodeDefinitionType = RootNodeType |
|
|
48
|
+
export type NodeDefinitionType = RootNodeType | RepeatRangeType | RepeatTemplateType | RepeatInstanceType | SubtreeNodeType | ValueNodeType;
|
|
48
49
|
export type ParentNodeDefinition = RootDefinition | RepeatTemplateDefinition | RepeatInstanceDefinition | SubtreeDefinition;
|
|
49
|
-
export type ChildNodeDefinition =
|
|
50
|
+
export type ChildNodeDefinition = RepeatRangeDefinition | SubtreeDefinition | ValueNodeDefinition;
|
|
50
51
|
export type ChildNodeInstanceDefinition = RepeatTemplateDefinition | RepeatInstanceDefinition | SubtreeDefinition | ValueNodeDefinition;
|
|
51
52
|
export type NodeChildren<Type extends NodeDefinitionType> = Type extends ParentNodeDefinition['type'] ? readonly ChildNodeDefinition[] : null;
|
|
52
|
-
export type NodeInstances<Type extends NodeDefinitionType> = Type extends 'repeat-
|
|
53
|
+
export type NodeInstances<Type extends NodeDefinitionType> = Type extends 'repeat-range' ? readonly RepeatInstanceDefinition[] : null;
|
|
53
54
|
export type NodeParent<Type extends NodeDefinitionType> = Type extends ChildNodeDefinition['type'] | ChildNodeInstanceDefinition['type'] ? ParentNodeDefinition : null;
|
|
54
|
-
export type ModelNode<Type extends NodeDefinitionType> = Type extends 'repeat-
|
|
55
|
+
export type ModelNode<Type extends NodeDefinitionType> = Type extends 'repeat-range' ? null : Element;
|
|
55
56
|
export type NodeDefaultValue<Type extends NodeDefinitionType> = Type extends 'value-node' ? string : null;
|
|
56
57
|
export interface NodeDefinition<Type extends NodeDefinitionType> {
|
|
57
58
|
readonly type: Type;
|
|
58
59
|
readonly bind: BindDefinition;
|
|
59
60
|
readonly nodeset: string;
|
|
60
61
|
readonly nodeName: string;
|
|
61
|
-
readonly bodyElement: AnyBodyElementDefinition |
|
|
62
|
+
readonly bodyElement: AnyBodyElementDefinition | RepeatElementDefinition | null;
|
|
62
63
|
readonly isTranslated: boolean;
|
|
63
64
|
readonly dependencyExpressions: ReadonlySet<string>;
|
|
64
65
|
readonly root: RootDefinition;
|
|
@@ -68,7 +69,7 @@ export interface NodeDefinition<Type extends NodeDefinitionType> {
|
|
|
68
69
|
readonly node: ModelNode<Type>;
|
|
69
70
|
readonly defaultValue: NodeDefaultValue<Type>;
|
|
70
71
|
}
|
|
71
|
-
export type AnyNodeDefinition = RootDefinition |
|
|
72
|
+
export type AnyNodeDefinition = RootDefinition | RepeatRangeDefinition | RepeatTemplateDefinition | RepeatInstanceDefinition | SubtreeDefinition | ValueNodeDefinition;
|
|
72
73
|
export type TypedNodeDefinition<Type> = Extract<AnyNodeDefinition, {
|
|
73
74
|
readonly type: Type;
|
|
74
75
|
}>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RepeatElementDefinition } from '../body/RepeatElementDefinition.ts';
|
|
2
2
|
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { ChildNodeDefinition, NodeDefinition } from './NodeDefinition.ts';
|
|
4
|
+
import { RepeatRangeDefinition } from './RepeatRangeDefinition.ts';
|
|
5
|
+
|
|
6
|
+
export declare class RepeatInstanceDefinition extends DescendentNodeDefinition<'repeat-instance', RepeatElementDefinition> implements NodeDefinition<'repeat-instance'> {
|
|
7
7
|
readonly node: Element;
|
|
8
8
|
readonly type = "repeat-instance";
|
|
9
9
|
readonly nodeName: string;
|
|
10
10
|
readonly children: readonly ChildNodeDefinition[];
|
|
11
11
|
readonly instances: null;
|
|
12
12
|
readonly defaultValue: null;
|
|
13
|
-
constructor(
|
|
14
|
-
toJSON(): Omit<this, "toJSON" | "parent" | "bind" | "root" | "bodyElement"
|
|
13
|
+
constructor(range: RepeatRangeDefinition, node: Element);
|
|
14
|
+
toJSON(): Omit<this, "toJSON" | "parent" | "bind" | "root" | "bodyElement">;
|
|
15
15
|
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { RepeatElementDefinition } from '../body/RepeatElementDefinition.ts';
|
|
2
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
3
3
|
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
4
|
-
import
|
|
4
|
+
import { NodeDefinition, ParentNodeDefinition } from './NodeDefinition.ts';
|
|
5
5
|
import { RepeatInstanceDefinition } from './RepeatInstanceDefinition.ts';
|
|
6
6
|
import { RepeatTemplateDefinition } from './RepeatTemplateDefinition.ts';
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
export declare class RepeatRangeDefinition extends DescendentNodeDefinition<'repeat-range', RepeatElementDefinition> implements NodeDefinition<'repeat-range'> {
|
|
8
9
|
static createTemplateElement(instanceElement: Element): Element;
|
|
9
10
|
static createInstanceElement(templateElement: Element): Element;
|
|
10
|
-
readonly type = "repeat-
|
|
11
|
+
readonly type = "repeat-range";
|
|
11
12
|
readonly template: RepeatTemplateDefinition;
|
|
12
13
|
readonly children: null;
|
|
13
14
|
readonly instances: RepeatInstanceDefinition[];
|
|
14
15
|
readonly node: null;
|
|
15
16
|
readonly nodeName: string;
|
|
16
17
|
readonly defaultValue: null;
|
|
17
|
-
constructor(parent: ParentNodeDefinition, bind: BindDefinition, bodyElement:
|
|
18
|
+
constructor(parent: ParentNodeDefinition, bind: BindDefinition, bodyElement: RepeatElementDefinition, modelNodes: readonly [Element, ...Element[]]);
|
|
18
19
|
toJSON(): Omit<this, "toJSON" | "parent" | "bind" | "root" | "bodyElement">;
|
|
19
20
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { JAVAROSA_NAMESPACE_URI } from '../../../common/src/constants/xmlns.ts';
|
|
2
|
-
import
|
|
2
|
+
import { RepeatElementDefinition } from '../body/RepeatElementDefinition.ts';
|
|
3
3
|
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import { ChildNodeDefinition, NodeDefinition } from './NodeDefinition.ts';
|
|
5
|
+
import { RepeatRangeDefinition } from './RepeatRangeDefinition.ts';
|
|
6
|
+
|
|
6
7
|
interface ExplicitRepeatTemplateElement extends Element {
|
|
7
8
|
getAttributeNS(namespaceURI: typeof JAVAROSA_NAMESPACE_URI, name: 'template'): string;
|
|
8
9
|
getAttributeNS(namespaceURI: string | null, name: string): string | null;
|
|
@@ -13,17 +14,16 @@ interface ParsedRepeatNodes {
|
|
|
13
14
|
readonly template: RepeatTemplateDefinition;
|
|
14
15
|
readonly instanceNodes: readonly Element[];
|
|
15
16
|
}
|
|
16
|
-
export declare class RepeatTemplateDefinition extends DescendentNodeDefinition<'repeat-template',
|
|
17
|
-
protected readonly sequence: RepeatSequenceDefinition;
|
|
17
|
+
export declare class RepeatTemplateDefinition extends DescendentNodeDefinition<'repeat-template', RepeatElementDefinition> implements NodeDefinition<'repeat-template'> {
|
|
18
18
|
protected readonly templateNode: ExplicitRepeatTemplateElement;
|
|
19
|
-
static parseModelNodes(
|
|
19
|
+
static parseModelNodes(range: RepeatRangeDefinition, modelNodes: readonly [Element, ...Element[]]): ParsedRepeatNodes;
|
|
20
20
|
readonly type = "repeat-template";
|
|
21
21
|
readonly node: Element;
|
|
22
22
|
readonly nodeName: string;
|
|
23
23
|
readonly children: readonly ChildNodeDefinition[];
|
|
24
24
|
readonly instances: null;
|
|
25
25
|
readonly defaultValue: null;
|
|
26
|
-
protected constructor(
|
|
27
|
-
toJSON(): Omit<this, "toJSON" | "parent" | "bind" | "root" | "bodyElement"
|
|
26
|
+
protected constructor(range: RepeatRangeDefinition, templateNode: ExplicitRepeatTemplateElement);
|
|
27
|
+
toJSON(): Omit<this, "toJSON" | "parent" | "bind" | "root" | "bodyElement">;
|
|
28
28
|
}
|
|
29
29
|
export {};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
2
|
+
import { BodyClassList } from '../body/BodyDefinition.ts';
|
|
3
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
4
|
+
import { ModelDefinition } from './ModelDefinition.ts';
|
|
5
|
+
import { ChildNodeDefinition, NodeDefinition, ParentNodeDefinition } from './NodeDefinition.ts';
|
|
6
|
+
|
|
5
7
|
export declare class RootDefinition implements NodeDefinition<'root'> {
|
|
6
8
|
protected readonly form: XFormDefinition;
|
|
7
9
|
protected readonly model: ModelDefinition;
|
|
10
|
+
readonly classes: BodyClassList;
|
|
8
11
|
readonly type = "root";
|
|
9
12
|
readonly bind: BindDefinition;
|
|
10
13
|
readonly nodeset: string;
|
|
@@ -18,7 +21,7 @@ export declare class RootDefinition implements NodeDefinition<'root'> {
|
|
|
18
21
|
readonly defaultValue: null;
|
|
19
22
|
readonly isTranslated = false;
|
|
20
23
|
readonly dependencyExpressions: ReadonlySet<string>;
|
|
21
|
-
constructor(form: XFormDefinition, model: ModelDefinition);
|
|
24
|
+
constructor(form: XFormDefinition, model: ModelDefinition, classes: BodyClassList);
|
|
22
25
|
buildSubtree(parent: ParentNodeDefinition): readonly ChildNodeDefinition[];
|
|
23
26
|
toJSON(): Omit<this, "model" | "toJSON" | "form" | "bind" | "root" | "bodyElement" | "buildSubtree">;
|
|
24
27
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { AnyBodyElementDefinition, AnyGroupElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
3
3
|
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
4
|
-
import
|
|
5
|
-
|
|
4
|
+
import { ChildNodeDefinition, NodeDefinition, ParentNodeDefinition } from './NodeDefinition.ts';
|
|
5
|
+
|
|
6
|
+
export declare class SubtreeDefinition extends DescendentNodeDefinition<'subtree', AnyGroupElementDefinition | null> implements NodeDefinition<'subtree'> {
|
|
6
7
|
readonly node: Element;
|
|
7
8
|
readonly type = "subtree";
|
|
8
9
|
readonly nodeName: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import type { BindDefinition } from './BindDefinition.ts';
|
|
1
|
+
import { AnyBodyElementDefinition, ControlElementDefinition } from '../body/BodyDefinition.ts';
|
|
2
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
4
3
|
import { DescendentNodeDefinition } from './DescendentNodeDefinition.ts';
|
|
5
|
-
import
|
|
6
|
-
|
|
4
|
+
import { NodeDefinition, ParentNodeDefinition } from './NodeDefinition.ts';
|
|
5
|
+
|
|
6
|
+
export declare class ValueNodeDefinition extends DescendentNodeDefinition<'value-node', ControlElementDefinition | null> implements NodeDefinition<'value-node'> {
|
|
7
7
|
readonly node: Element;
|
|
8
8
|
readonly type = "value-node";
|
|
9
9
|
readonly nodeName: string;
|