@getodk/xforms-engine 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/AttributeNode.d.ts +4 -3
- package/dist/client/InputNode.d.ts +8 -4
- package/dist/client/MarkdownNode.d.ts +3 -0
- package/dist/client/NoteNode.d.ts +6 -2
- package/dist/client/form/FormInstanceConfig.d.ts +4 -0
- package/dist/client/form/LoadFormResult.d.ts +5 -14
- package/dist/client/form/ResetFormInstance.d.ts +13 -0
- package/dist/entrypoints/FormResult/BaseFormResult.d.ts +1 -0
- package/dist/entrypoints/FormResult/BaseInstantiableFormResult.d.ts +2 -0
- package/dist/entrypoints/FormResult/FormFailureResult.d.ts +2 -0
- package/dist/entrypoints/createPotentiallyClientOwnedReactiveScope.d.ts +19 -0
- package/dist/index.js +22150 -25908
- package/dist/index.js.map +1 -1
- package/dist/instance/Attribute.d.ts +11 -23
- package/dist/instance/Group.d.ts +3 -0
- package/dist/instance/InputControl.d.ts +3 -0
- package/dist/instance/ModelValue.d.ts +4 -0
- package/dist/instance/Note.d.ts +4 -0
- package/dist/instance/PrimaryInstance.d.ts +7 -1
- package/dist/instance/RangeControl.d.ts +4 -0
- package/dist/instance/RankControl.d.ts +5 -1
- package/dist/instance/Root.d.ts +3 -0
- package/dist/instance/SelectControl.d.ts +5 -1
- package/dist/instance/TriggerControl.d.ts +4 -0
- package/dist/instance/UploadControl.d.ts +3 -0
- package/dist/instance/abstract/DescendantNode.d.ts +5 -4
- package/dist/instance/abstract/InstanceNode.d.ts +4 -3
- package/dist/instance/hierarchy.d.ts +2 -1
- package/dist/instance/internal-api/AttributeContext.d.ts +1 -0
- package/dist/instance/internal-api/InstanceConfig.d.ts +2 -1
- package/dist/instance/internal-api/InstanceValueContext.d.ts +1 -0
- package/dist/instance/markdown/MarkdownNode.d.ts +14 -9
- package/dist/instance/repeat/RepeatInstance.d.ts +2 -0
- package/dist/integration/xpath/adapter/XFormsXPathNode.d.ts +1 -1
- package/dist/integration/xpath/adapter/kind.d.ts +5 -3
- package/dist/integration/xpath/adapter/traversal.d.ts +3 -3
- package/dist/integration/xpath/static-dom/StaticAttribute.d.ts +1 -0
- package/dist/integration/xpath/static-dom/StaticDocument.d.ts +2 -0
- package/dist/lib/codecs/{Geopoint/Geopoint.d.ts → geolocation/Geolocation.d.ts} +11 -15
- package/dist/lib/codecs/geolocation/Geopoint.d.ts +7 -0
- package/dist/lib/codecs/geolocation/Geoshape.d.ts +7 -0
- package/dist/lib/codecs/geolocation/Geotrace.d.ts +7 -0
- package/dist/lib/codecs/geolocation/createGeolocationValueCodec.d.ts +3 -0
- package/dist/lib/codecs/getSharedValueCodec.d.ts +7 -5
- package/dist/lib/reactivity/text/createTextRange.d.ts +0 -2
- package/dist/parse/XFormDOM.d.ts +7 -1
- package/dist/parse/body/appearance/inputAppearanceParser.d.ts +1 -1
- package/dist/parse/model/ActionDefinition.d.ts +1 -1
- package/dist/parse/model/AttributeDefinition.d.ts +2 -0
- package/dist/parse/model/BindPreloadDefinition.d.ts +2 -1
- package/dist/parse/model/ModelActionMap.d.ts +3 -2
- package/dist/parse/model/ModelDefinition.d.ts +3 -5
- package/dist/parse/model/SecondaryInstance/sources/CSVExternalSecondaryInstance.d.ts +0 -17
- package/dist/parse/model/SecondaryInstance/sources/external-instance-csv-parser.d.ts +8 -0
- package/dist/parse/model/TranslationDefinitionMap.d.ts +4 -0
- package/dist/solid.js +21608 -25366
- package/dist/solid.js.map +1 -1
- package/package.json +2 -2
- package/src/client/AttributeNode.ts +4 -3
- package/src/client/InputNode.ts +11 -3
- package/src/client/MarkdownNode.ts +3 -0
- package/src/client/NoteNode.ts +9 -1
- package/src/client/form/FormInstanceConfig.ts +6 -0
- package/src/client/form/LoadFormResult.ts +5 -17
- package/src/client/form/ResetFormInstance.ts +17 -0
- package/src/entrypoints/FormInstance.ts +2 -0
- package/src/entrypoints/FormResult/BaseFormResult.ts +1 -0
- package/src/entrypoints/FormResult/BaseInstantiableFormResult.ts +10 -1
- package/src/entrypoints/FormResult/FormFailureResult.ts +3 -0
- package/src/entrypoints/createPotentiallyClientOwnedReactiveScope.ts +30 -0
- package/src/entrypoints/loadForm.ts +1 -31
- package/src/instance/Attribute.ts +38 -54
- package/src/instance/Group.ts +12 -4
- package/src/instance/InputControl.ts +15 -9
- package/src/instance/ModelValue.ts +13 -4
- package/src/instance/Note.ts +13 -4
- package/src/instance/PrimaryInstance.ts +29 -6
- package/src/instance/RangeControl.ts +13 -4
- package/src/instance/RankControl.ts +14 -5
- package/src/instance/Root.ts +12 -4
- package/src/instance/SelectControl.ts +14 -5
- package/src/instance/TriggerControl.ts +13 -4
- package/src/instance/UploadControl.ts +13 -3
- package/src/instance/abstract/DescendantNode.ts +4 -3
- package/src/instance/abstract/InstanceNode.ts +5 -3
- package/src/instance/attachments/buildAttributes.ts +26 -2
- package/src/instance/children/childrenInitOptions.ts +2 -1
- package/src/instance/hierarchy.ts +2 -0
- package/src/instance/internal-api/AttributeContext.ts +1 -0
- package/src/instance/internal-api/InstanceConfig.ts +3 -0
- package/src/instance/internal-api/InstanceValueContext.ts +1 -0
- package/src/instance/markdown/MarkdownNode.ts +19 -7
- package/src/instance/repeat/RepeatInstance.ts +11 -3
- package/src/instance/text/markdownFormat.ts +4 -3
- package/src/integration/xpath/adapter/XFormsXPathNode.ts +1 -0
- package/src/integration/xpath/adapter/engineDOMAdapter.ts +2 -2
- package/src/integration/xpath/adapter/kind.ts +6 -1
- package/src/integration/xpath/adapter/names.ts +1 -0
- package/src/integration/xpath/adapter/traversal.ts +5 -6
- package/src/integration/xpath/static-dom/StaticAttribute.ts +1 -0
- package/src/integration/xpath/static-dom/StaticDocument.ts +2 -0
- package/src/lib/codecs/{Geopoint/Geopoint.ts → geolocation/Geolocation.ts} +43 -24
- package/src/lib/codecs/geolocation/Geopoint.ts +15 -0
- package/src/lib/codecs/geolocation/Geoshape.ts +36 -0
- package/src/lib/codecs/geolocation/Geotrace.ts +36 -0
- package/src/lib/codecs/geolocation/createGeolocationValueCodec.ts +18 -0
- package/src/lib/codecs/getSharedValueCodec.ts +37 -11
- package/src/lib/reactivity/createInstanceValueState.ts +90 -34
- package/src/lib/reactivity/text/createTextRange.ts +71 -45
- package/src/parse/XFormDOM.ts +22 -2
- package/src/parse/model/ActionDefinition.ts +6 -6
- package/src/parse/model/AttributeDefinition.ts +7 -0
- package/src/parse/model/BindDefinition.ts +1 -1
- package/src/parse/model/BindPreloadDefinition.ts +21 -14
- package/src/parse/model/ModelActionMap.ts +30 -13
- package/src/parse/model/ModelDefinition.ts +5 -10
- package/src/parse/model/RootDefinition.ts +2 -1
- package/src/parse/model/SecondaryInstance/sources/CSVExternalSecondaryInstance.ts +2 -184
- package/src/parse/model/SecondaryInstance/sources/external-instance-csv-parser.ts +185 -0
- package/src/parse/model/TranslationDefinitionMap.ts +23 -0
- package/dist/lib/codecs/Geopoint/GeopointValueCodec.d.ts +0 -5
- package/dist/parse/model/generateItextChunks.d.ts +0 -5
- package/src/lib/codecs/Geopoint/GeopointValueCodec.ts +0 -20
- package/src/parse/model/generateItextChunks.ts +0 -61
|
@@ -1,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;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { XFormsXPathDocument } from '../adapter/XFormsXPathNode.ts';
|
|
2
|
+
import { StaticAttribute } from './StaticAttribute.ts';
|
|
2
3
|
import { StaticElementOptions, StaticElement } from './StaticElement.ts';
|
|
3
4
|
import { StaticParentNode } from './StaticParentNode.ts';
|
|
4
5
|
interface StaticDocumentOptions {
|
|
@@ -12,6 +13,7 @@ export declare class StaticDocument extends StaticParentNode<'document'> impleme
|
|
|
12
13
|
readonly nodeset: string;
|
|
13
14
|
readonly children: readonly [root: StaticElement];
|
|
14
15
|
readonly childElements: readonly [root: StaticElement];
|
|
16
|
+
readonly attributes: readonly StaticAttribute[];
|
|
15
17
|
constructor(options: StaticDocumentOptions);
|
|
16
18
|
getXPathValue(): string;
|
|
17
19
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This abstract class defines the minimal behavior for a default geopoint.
|
|
3
|
-
* It can be expanded later to support units (e.g., degrees or meters),
|
|
4
|
-
* which would also serve as documentation to clarify what each value represents.
|
|
5
|
-
*/
|
|
6
1
|
declare abstract class SemanticValue<Semantic extends string, Value extends number | null> {
|
|
7
2
|
readonly value: Value;
|
|
8
3
|
abstract readonly semantic: Semantic;
|
|
@@ -20,29 +15,30 @@ declare class Altitude<Value extends number | null = number> extends SemanticVal
|
|
|
20
15
|
declare class Accuracy<Value extends number | null = number> extends SemanticValue<'accuracy', Value> {
|
|
21
16
|
readonly semantic = "accuracy";
|
|
22
17
|
}
|
|
23
|
-
export interface
|
|
18
|
+
export interface LocationPoint {
|
|
24
19
|
readonly latitude: number;
|
|
25
20
|
readonly longitude: number;
|
|
26
21
|
readonly altitude: number | null;
|
|
27
22
|
readonly accuracy: number | null;
|
|
28
23
|
}
|
|
29
|
-
|
|
30
|
-
export type GeopointInputValue = GeopointRuntimeValue | string;
|
|
31
|
-
type GeopointTuple = readonly [
|
|
24
|
+
type LocationPointTuple = readonly [
|
|
32
25
|
latitude: Latitude,
|
|
33
26
|
longitude: Longitude,
|
|
34
27
|
altitude: Altitude<null> | Altitude<number>,
|
|
35
28
|
accuracy: Accuracy
|
|
36
29
|
] | readonly [latitude: Latitude, longitude: Longitude, altitude: Altitude] | readonly [latitude: Latitude, longitude: Longitude];
|
|
37
|
-
export declare
|
|
30
|
+
export declare const SEGMENT_SEPARATOR = ";";
|
|
31
|
+
export declare class Geolocation {
|
|
38
32
|
private readonly internalValue;
|
|
39
|
-
constructor(coordinates:
|
|
40
|
-
getTuple():
|
|
41
|
-
getRuntimeValue():
|
|
33
|
+
constructor(coordinates: LocationPoint);
|
|
34
|
+
getTuple(): LocationPointTuple;
|
|
35
|
+
getRuntimeValue(): LocationPoint | null;
|
|
42
36
|
private isValidDegrees;
|
|
43
37
|
private isValidNumber;
|
|
44
38
|
private static isNullLocation;
|
|
45
|
-
static parseString(value: string):
|
|
46
|
-
static toCoordinatesString(value:
|
|
39
|
+
static parseString(value: string): LocationPoint | null;
|
|
40
|
+
static toCoordinatesString(value: LocationPoint | string | null): string;
|
|
41
|
+
static isClosedShape(points: LocationPoint[]): boolean;
|
|
42
|
+
static getSegments(value: string): string[] | null;
|
|
47
43
|
}
|
|
48
44
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Geolocation, LocationPoint } from './Geolocation.ts';
|
|
2
|
+
export type GeopointRuntimeValue = LocationPoint | null;
|
|
3
|
+
export type GeopointInputValue = GeopointRuntimeValue | string;
|
|
4
|
+
export declare class Geopoint extends Geolocation {
|
|
5
|
+
static parseStringToGeopoint(value: string): GeopointRuntimeValue;
|
|
6
|
+
static parseGeopointToString(value: GeopointInputValue): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Geolocation, LocationPoint } from './Geolocation.ts';
|
|
2
|
+
export type GeoshapeRuntimeValue = LocationPoint[] | null;
|
|
3
|
+
export type GeoshapeInputValue = GeoshapeRuntimeValue | string;
|
|
4
|
+
export declare class Geoshape extends Geolocation {
|
|
5
|
+
static parseStringToGeoshape(value: string): GeoshapeRuntimeValue;
|
|
6
|
+
static parseGeoshapeString(points: GeoshapeInputValue): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Geolocation, LocationPoint } from './Geolocation.ts';
|
|
2
|
+
export type GeotraceRuntimeValue = LocationPoint[] | null;
|
|
3
|
+
export type GeotraceInputValue = GeotraceRuntimeValue | string;
|
|
4
|
+
export declare class Geotrace extends Geolocation {
|
|
5
|
+
static parseStringToGeotrace(value: string): GeotraceRuntimeValue;
|
|
6
|
+
static parseGeotraceString(points: GeotraceInputValue): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ValueType } from '../../../client';
|
|
2
|
+
import { CodecDecoder, CodecEncoder, ValueCodec } from '../ValueCodec.ts';
|
|
3
|
+
export declare function createGeolocationValueCodec<V extends ValueType, RuntimeValue extends RuntimeInputValue, RuntimeInputValue = RuntimeValue>(valueType: V, encodeValue: CodecEncoder<RuntimeInputValue>, decodeValue: CodecDecoder<RuntimeValue>): ValueCodec<V, RuntimeValue, RuntimeInputValue>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ValueType } from '../../client/ValueType.ts';
|
|
2
2
|
import { DatetimeInputValue, DatetimeRuntimeValue } from './DateValueCodec.ts';
|
|
3
3
|
import { DecimalInputValue, DecimalRuntimeValue } from './DecimalValueCodec.ts';
|
|
4
|
-
import { GeopointInputValue, GeopointRuntimeValue } from './
|
|
4
|
+
import { GeopointInputValue, GeopointRuntimeValue } from './geolocation/Geopoint.ts';
|
|
5
|
+
import { GeoshapeInputValue, GeoshapeRuntimeValue } from './geolocation/Geoshape.ts';
|
|
6
|
+
import { GeotraceInputValue, GeotraceRuntimeValue } from './geolocation/Geotrace.ts';
|
|
5
7
|
import { IntInputValue, IntRuntimeValue } from './IntValueCodec.ts';
|
|
6
8
|
import { ValueCodec } from './ValueCodec.ts';
|
|
7
9
|
interface RuntimeValuesByType {
|
|
@@ -13,8 +15,8 @@ interface RuntimeValuesByType {
|
|
|
13
15
|
readonly time: string;
|
|
14
16
|
readonly dateTime: string;
|
|
15
17
|
readonly geopoint: GeopointRuntimeValue;
|
|
16
|
-
readonly geotrace:
|
|
17
|
-
readonly geoshape:
|
|
18
|
+
readonly geotrace: GeotraceRuntimeValue;
|
|
19
|
+
readonly geoshape: GeoshapeRuntimeValue;
|
|
18
20
|
readonly binary: string;
|
|
19
21
|
readonly barcode: string;
|
|
20
22
|
readonly intent: string;
|
|
@@ -29,8 +31,8 @@ interface RuntimeInputValuesByType {
|
|
|
29
31
|
readonly time: string;
|
|
30
32
|
readonly dateTime: string;
|
|
31
33
|
readonly geopoint: GeopointInputValue;
|
|
32
|
-
readonly geotrace:
|
|
33
|
-
readonly geoshape:
|
|
34
|
+
readonly geotrace: GeotraceInputValue;
|
|
35
|
+
readonly geoshape: GeoshapeInputValue;
|
|
34
36
|
readonly binary: string;
|
|
35
37
|
readonly barcode: string;
|
|
36
38
|
readonly intent: string;
|
|
@@ -9,8 +9,6 @@ type ComputedFormTextRange<Role extends TextRole> = Accessor<TextRange<Role, 'fo
|
|
|
9
9
|
*
|
|
10
10
|
* - The form's current language (e.g. `<label ref="jr:itext('text-id')" />`)
|
|
11
11
|
* - Direct `<output>` references within the label's children
|
|
12
|
-
*
|
|
13
|
-
* @todo This does not yet handle itext translations **with** outputs!
|
|
14
12
|
*/
|
|
15
13
|
export declare const createTextRange: <Role extends TextRole>(context: EvaluationContext, role: Role, definition: TextRangeDefinition<Role>) => ComputedFormTextRange<Role>;
|
|
16
14
|
export {};
|
package/dist/parse/XFormDOM.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { KnownAttributeLocalNamedElement } from '../../../common/types/dom.ts';
|
|
2
|
+
export declare const SET_VALUE_LOCAL_NAME = "setvalue";
|
|
3
|
+
export declare const SET_GEOPOINT_LOCAL_NAME = "odk:setgeopoint";
|
|
2
4
|
interface DOMBindElement extends KnownAttributeLocalNamedElement<'bind', 'nodeset'> {
|
|
3
5
|
}
|
|
4
|
-
interface DOMSetValueElement extends KnownAttributeLocalNamedElement<'setvalue', 'event'> {
|
|
6
|
+
export interface DOMSetValueElement extends KnownAttributeLocalNamedElement<'setvalue', 'event'> {
|
|
7
|
+
}
|
|
8
|
+
export interface DOMSetGeopointElement extends KnownAttributeLocalNamedElement<'odk:setgeopoint', 'event'> {
|
|
5
9
|
}
|
|
6
10
|
export interface DOMItextTranslationElement extends KnownAttributeLocalNamedElement<'translation', 'lang'> {
|
|
7
11
|
}
|
|
@@ -18,6 +22,7 @@ interface XFormDOMOptions {
|
|
|
18
22
|
export declare class XFormDOM {
|
|
19
23
|
protected readonly sourceXML: string;
|
|
20
24
|
static from(sourceXML: string): XFormDOM;
|
|
25
|
+
isInstanceID: (nodeset: string) => boolean | null;
|
|
21
26
|
protected readonly normalizedXML: string;
|
|
22
27
|
readonly xformDocument: XMLDocument;
|
|
23
28
|
readonly html: Element;
|
|
@@ -26,6 +31,7 @@ export declare class XFormDOM {
|
|
|
26
31
|
readonly model: Element;
|
|
27
32
|
readonly binds: readonly DOMBindElement[];
|
|
28
33
|
readonly setValues: readonly DOMSetValueElement[];
|
|
34
|
+
readonly setGeopoints: readonly DOMSetGeopointElement[];
|
|
29
35
|
readonly primaryInstance: Element;
|
|
30
36
|
readonly primaryInstanceRoot: Element;
|
|
31
37
|
readonly itextTranslationElements: readonly DOMItextTranslationElement[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TokenListParser, ParsedTokenList } from '../../../lib/TokenListParser.ts';
|
|
2
|
-
export declare const inputAppearanceParser: TokenListParser<"multiline" | "numbers" | "url" | "thousands-sep" | "no-calendar" | "month-year" | "
|
|
2
|
+
export declare const inputAppearanceParser: TokenListParser<"year" | "multiline" | "numbers" | "url" | "thousands-sep" | "no-calendar" | "month-year" | "ethiopian" | "coptic" | "islamic" | "bikram-sambat" | "myanmar" | "persian" | "placement-map" | "maps" | "hidden-answer" | "annotate" | "draw" | "signature" | "new-front" | "new" | "front" | "printer" | "masked", "year" | "multiline" | "numbers" | "url" | "thousands-sep" | "no-calendar" | "month-year" | "ethiopian" | "coptic" | "islamic" | "bikram-sambat" | "myanmar" | "persian" | "placement-map" | "maps" | "hidden-answer" | "annotate" | "draw" | "signature" | "new-front" | "new" | "front" | "printer" | "masked">;
|
|
3
3
|
export type InputAppearanceDefinition = ParsedTokenList<typeof inputAppearanceParser>;
|
|
@@ -3,7 +3,7 @@ import { XFormEvent } from './Event.ts';
|
|
|
3
3
|
import { ModelDefinition } from './ModelDefinition.ts';
|
|
4
4
|
export declare class ActionDefinition {
|
|
5
5
|
readonly element: Element;
|
|
6
|
-
static getRef(model: ModelDefinition,
|
|
6
|
+
static getRef(model: ModelDefinition, element: Element): string | null;
|
|
7
7
|
static getValue(element: Element): string;
|
|
8
8
|
static isKnownEvent: (event: XFormEvent) => event is XFormEvent;
|
|
9
9
|
static getEvents(element: Element): XFormEvent[];
|
|
@@ -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
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PartiallyKnownString } from '../../../../common/types/string/PartiallyKnownString.ts';
|
|
2
2
|
import { AttributeContext } from '../../instance/internal-api/AttributeContext.ts';
|
|
3
3
|
import { InstanceValueContext } from '../../instance/internal-api/InstanceValueContext.ts';
|
|
4
|
+
import { BindDefinition } from './BindDefinition.ts';
|
|
4
5
|
import { BindElement } from './BindElement.ts';
|
|
5
6
|
import { XFormEvent } from './Event.ts';
|
|
6
7
|
type PartiallyKnownPreloadParameter<Known extends string> = PartiallyKnownString<NonNullable<Known>>;
|
|
@@ -27,10 +28,10 @@ interface PreloadInput<Type extends PreloadType> {
|
|
|
27
28
|
* - {@link parameter}, an associated `jr:preloadParams` value
|
|
28
29
|
*/
|
|
29
30
|
export declare class BindPreloadDefinition<Type extends PreloadType> implements PreloadInput<Type> {
|
|
30
|
-
static from(bindElement: BindElement): AnyBindPreloadDefinition | null;
|
|
31
31
|
readonly type: Type;
|
|
32
32
|
readonly parameter: PreloadParameter<Type>;
|
|
33
33
|
readonly event: XFormEvent;
|
|
34
|
+
static from(definition: BindDefinition, bindElement: BindElement): AnyBindPreloadDefinition | null;
|
|
34
35
|
getValue(context: AttributeContext | InstanceValueContext): string | undefined;
|
|
35
36
|
private constructor();
|
|
36
37
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ActionDefinition } from './ActionDefinition.ts';
|
|
2
2
|
import { ModelDefinition } from './ModelDefinition.ts';
|
|
3
|
-
export declare class ModelActionMap extends Map<string, ActionDefinition> {
|
|
3
|
+
export declare class ModelActionMap extends Map<string, ActionDefinition[]> {
|
|
4
4
|
static fromModel(model: ModelDefinition): ModelActionMap;
|
|
5
5
|
static getKey(ref: string): string;
|
|
6
6
|
protected constructor(model: ModelDefinition);
|
|
7
|
-
get(ref: string): ActionDefinition | undefined;
|
|
7
|
+
get(ref: string): ActionDefinition[] | undefined;
|
|
8
|
+
private addAll;
|
|
8
9
|
add(action: ActionDefinition): void;
|
|
9
10
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ActiveLanguage } from '../../client/FormLanguage.ts';
|
|
2
2
|
import { StaticDocument } from '../../integration/xpath/static-dom/StaticDocument.ts';
|
|
3
|
-
import { TextChunkExpression } from '../expression/TextChunkExpression.ts';
|
|
4
3
|
import { XFormDefinition } from '../XFormDefinition.ts';
|
|
5
|
-
import { ChunkExpressionsByItextId } from './generateItextChunks.ts';
|
|
6
4
|
import { ItextTranslationsDefinition } from './ItextTranslationsDefinition.ts';
|
|
7
5
|
import { ModelActionMap } from './ModelActionMap.ts';
|
|
8
6
|
import { ModelBindMap } from './ModelBindMap.ts';
|
|
@@ -18,14 +16,14 @@ export declare class ModelDefinition {
|
|
|
18
16
|
readonly nodes: NodeDefinitionMap;
|
|
19
17
|
readonly instance: StaticDocument;
|
|
20
18
|
readonly itextTranslations: ItextTranslationsDefinition;
|
|
21
|
-
readonly
|
|
19
|
+
readonly itextElements: Map<string, Map<string, Element>>;
|
|
22
20
|
readonly xformsRevalidateListeners: Map<string, XformsRevalidateListener>;
|
|
23
21
|
constructor(form: XFormDefinition);
|
|
24
22
|
getNodeDefinition(nodeset: string): AnyNodeDefinition;
|
|
25
23
|
getRootDefinition(instance: StaticDocument): RootDefinition;
|
|
26
24
|
registerXformsRevalidateListener(ref: string, listener: XformsRevalidateListener): void;
|
|
27
25
|
triggerXformsRevalidateListeners(): void;
|
|
28
|
-
|
|
29
|
-
toJSON(): Omit<this, "form" | "toJSON" | "getNodeDefinition" | "getRootDefinition" | "registerXformsRevalidateListener" | "triggerXformsRevalidateListeners" | "
|
|
26
|
+
getItextElement(activeLanguage: ActiveLanguage, itextId: string): Element | undefined;
|
|
27
|
+
toJSON(): Omit<this, "form" | "toJSON" | "getNodeDefinition" | "getRootDefinition" | "registerXformsRevalidateListener" | "triggerXformsRevalidateListeners" | "getItextElement">;
|
|
30
28
|
}
|
|
31
29
|
export {};
|
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
import { SecondaryInstanceDefinition } from '../SecondaryInstancesDefinition.ts';
|
|
2
2
|
import { ExternalSecondaryInstanceSource } from './ExternalSecondaryInstanceSource.ts';
|
|
3
3
|
export declare class CSVExternalSecondaryInstanceSource extends ExternalSecondaryInstanceSource<'csv'> {
|
|
4
|
-
/**
|
|
5
|
-
* Based on
|
|
6
|
-
* {@link https://github.com/getodk/central-frontend/blob/42c9277709e593480d1462e28b4be5f1364532b7/src/util/csv.js#L79} (and {@link https://github.com/getodk/central-frontend/blob/42c9277709e593480d1462e28b4be5f1364532b7/src/util/csv.js#L13}).
|
|
7
|
-
*
|
|
8
|
-
* The most significant deviations at time of writing:
|
|
9
|
-
*
|
|
10
|
-
* - we have already retrieved the CSV resource, so we are parsing the raw CSV data directly.
|
|
11
|
-
* - we have no need for asynchronous/streaming parsing at this point in the
|
|
12
|
-
* form initialization process, so we can dispense with those details of the
|
|
13
|
-
* {@link papa | papaparse} API/config.
|
|
14
|
-
*/
|
|
15
|
-
private parseCSVHeader;
|
|
16
|
-
/**
|
|
17
|
-
* Largely based on {@link https://github.com/getodk/central-frontend/blob/42c9277709e593480d1462e28b4be5f1364532b7/src/util/csv.js#L170}
|
|
18
|
-
*/
|
|
19
|
-
private parseCSVRows;
|
|
20
|
-
private toItems;
|
|
21
4
|
parseDefinition(): SecondaryInstanceDefinition;
|
|
22
5
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JRResourceURL } from '../../../../../../common/src/jr-resources/JRResourceURL';
|
|
2
|
+
interface CSVExternalSecondaryInstanceItemColumn {
|
|
3
|
+
readonly columnName: string;
|
|
4
|
+
readonly cellValue: string;
|
|
5
|
+
}
|
|
6
|
+
type CSVExternalSecondaryInstanceItem = readonly CSVExternalSecondaryInstanceItemColumn[];
|
|
7
|
+
export declare const parseItems: (resourceURL: JRResourceURL, data: string) => readonly CSVExternalSecondaryInstanceItem[];
|
|
8
|
+
export {};
|