@f1studio/form-spec 5.0.0-alpha.139 → 5.0.0-alpha.140
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/FormSpec.FS/FormSpec.d.ts +5 -4
- package/FormSpec.FS/FormSpec.d.ts.map +1 -1
- package/FormSpec.FS/FormSpecValues.d.ts +0 -5
- package/FormSpec.FS/FormSpecValues.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts +1 -1
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts.map +1 -1
- package/FormSpec.FS/Interop/Facade/BlueprintFilledForm.d.ts +106 -0
- package/FormSpec.FS/Interop/Facade/BlueprintFilledForm.d.ts.map +1 -0
- package/FormSpec.FS/Interop/Facade/FormAnswersGate.d.ts +105 -0
- package/FormSpec.FS/Interop/Facade/FormAnswersGate.d.ts.map +1 -0
- package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts +26 -13
- package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts +1 -2
- package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts.map +1 -1
- package/FormSpec.FS/Interop/FormSpec.Values.Api.Option.d.ts +5 -3
- package/FormSpec.FS/Interop/FormSpec.Values.Api.Option.d.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js +1 -1
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Designer.js +1 -1
- package/FormSpec.TS/FormSpec.FS/Designer.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Designer.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpec.js +13 -8
- package/FormSpec.TS/FormSpec.FS/FormSpec.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpec.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js +5 -5
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecValues.js +2 -21
- package/FormSpec.TS/FormSpec.FS/FormSpecValues.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecValues.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Helpers.js +12 -12
- package/FormSpec.TS/FormSpec.FS/Helpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Helpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.js +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js +12 -8
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js +2 -2
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/Facade/BlueprintFilledForm.js +184 -0
- package/FormSpec.TS/FormSpec.FS/Interop/Facade/BlueprintFilledForm.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Interop/Facade/BlueprintFilledForm.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Interop/Facade/FormAnswersGate.js +752 -0
- package/FormSpec.TS/FormSpec.FS/Interop/Facade/FormAnswersGate.js.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Interop/Facade/FormAnswersGate.ts.map +1 -0
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js +317 -81
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js +5 -10
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.js +20 -10
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Migrator.js +1 -1
- package/FormSpec.TS/FormSpec.FS/Migrator.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Migrator.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayExecutor.js +3 -3
- package/FormSpec.TS/FormSpec.FS/PathwayExecutor.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayExecutor.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayValidator.js +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayValidator.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayValidator.ts.map +1 -1
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.js.map +1 -0
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.ts.map +1 -0
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.js.map +1 -0
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.ts.map +1 -0
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Extra.js.map +1 -0
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Extra.ts.map +1 -0
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Types.js.map +1 -0
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Types.ts.map +1 -0
- package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
- package/FormSpec.TS/plugins/signature/src/SignatureField.js +1 -1
- package/FormSpec.TS/plugins/signature/src/SignatureField.js.map +1 -1
- package/FormSpec.TS/plugins/signature/src/SignatureField.ts.map +1 -1
- package/README.md +7 -7
- package/Thoth.Json/packages/Thoth.Json/Decode.d.ts.map +1 -0
- package/Thoth.Json/packages/Thoth.Json/Encode.d.ts.map +1 -0
- package/Thoth.Json/packages/Thoth.Json/Extra.d.ts.map +1 -0
- package/Thoth.Json/packages/Thoth.Json/Types.d.ts.map +1 -0
- package/package.json +9 -1
- package/src/FormSpec.FS/BlueprintValidation.ts +1 -1
- package/src/FormSpec.FS/Designer.ts +1 -1
- package/src/FormSpec.FS/FormSpec.ts +10 -8
- package/src/FormSpec.FS/FormSpecHelpers.ts +5 -5
- package/src/FormSpec.FS/FormSpecValues.ts +2 -25
- package/src/FormSpec.FS/Helpers.ts +12 -12
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRFieldTypeMapper.ts +1 -1
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRStepsBuilder.ts +1 -1
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts +1 -1
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts +14 -9
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts +1 -1
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.ts +3 -3
- package/src/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts +3 -3
- package/src/FormSpec.FS/Interop/Facade/BlueprintFilledForm.ts +244 -0
- package/src/FormSpec.FS/Interop/Facade/FormAnswersGate.ts +508 -0
- package/src/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts +376 -128
- package/src/FormSpec.FS/Interop/FormSpec.Api.Option.ts +6 -8
- package/src/FormSpec.FS/Interop/FormSpec.Values.Api.Option.ts +17 -13
- package/src/FormSpec.FS/Migrator.ts +1 -1
- package/src/FormSpec.FS/PathwayExecutor.ts +3 -3
- package/src/FormSpec.FS/PathwayValidator.ts +1 -1
- package/src/plugins/signature/src/SignatureField.ts +1 -1
- package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Decode.js.map +0 -1
- package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Decode.ts.map +0 -1
- package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Encode.js.map +0 -1
- package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Encode.ts.map +0 -1
- package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Extra.js.map +0 -1
- package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Extra.ts.map +0 -1
- package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Types.js.map +0 -1
- package/FormSpec.TS/libs/Thoth.Json/packages/Thoth.Json/Types.ts.map +0 -1
- package/libs/Thoth.Json/packages/Thoth.Json/Decode.d.ts.map +0 -1
- package/libs/Thoth.Json/packages/Thoth.Json/Encode.d.ts.map +0 -1
- package/libs/Thoth.Json/packages/Thoth.Json/Extra.d.ts.map +0 -1
- package/libs/Thoth.Json/packages/Thoth.Json/Types.d.ts.map +0 -1
- /package/FormSpec.TS/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Decode.js +0 -0
- /package/FormSpec.TS/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Encode.js +0 -0
- /package/FormSpec.TS/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Extra.js +0 -0
- /package/FormSpec.TS/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Types.js +0 -0
- /package/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Decode.d.ts +0 -0
- /package/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Encode.d.ts +0 -0
- /package/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Extra.d.ts +0 -0
- /package/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Types.d.ts +0 -0
- /package/src/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Decode.ts +0 -0
- /package/src/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Encode.ts +0 -0
- /package/src/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Extra.ts +0 -0
- /package/src/{libs/Thoth.Json → Thoth.Json}/packages/Thoth.Json/Types.ts +0 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { bind, Option, unwrap } from "@fable-org/fable-library-js/Option.js";
|
|
2
|
+
import { Shared_FieldValue_$union, Shared_PluginDataProperty, Shared_MatrixAnswer, Shared_FieldAnswer, Shared_MatrixItemKey, Shared_FieldKey } from "../../FormSpec.js";
|
|
3
|
+
import { parse } from "@fable-org/fable-library-js/Guid.js";
|
|
4
|
+
import { toList, minElement, toArray, FSharpSet } from "@fable-org/fable-library-js/Set.js";
|
|
5
|
+
import { map } from "@fable-org/fable-library-js/Array.js";
|
|
6
|
+
import { toArray as toArray_2, ofArray, tryHead } from "@fable-org/fable-library-js/List.js";
|
|
7
|
+
import { createObj } from "@fable-org/fable-library-js/Util.js";
|
|
8
|
+
import { toArray as toArray_1 } from "@fable-org/fable-library-js/Map.js";
|
|
9
|
+
|
|
10
|
+
export type Brand$1<T> = void;
|
|
11
|
+
|
|
12
|
+
export type Branded$1<Tag> = string;
|
|
13
|
+
|
|
14
|
+
export interface FieldKeyBrand {
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface MatrixItemKeyBrand {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface PluginPropKeyBrand {
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type BlueprintFilledFormFieldValueAnswerKind =
|
|
27
|
+
| "single"
|
|
28
|
+
| "multiple"
|
|
29
|
+
| "matrix"
|
|
30
|
+
| "pluginData"
|
|
31
|
+
|
|
32
|
+
export interface IFieldAnswer {
|
|
33
|
+
description: string,
|
|
34
|
+
documentation?: string,
|
|
35
|
+
fieldKey: Branded$1<FieldKeyBrand>,
|
|
36
|
+
value: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface IPluginDataProperty {
|
|
40
|
+
dataType: string,
|
|
41
|
+
description?: string,
|
|
42
|
+
displayName?: string,
|
|
43
|
+
name: string,
|
|
44
|
+
propertyKey: Branded$1<PluginPropKeyBrand>,
|
|
45
|
+
unit?: string,
|
|
46
|
+
value: string
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type PluginDataType =
|
|
50
|
+
| "string"
|
|
51
|
+
| "int"
|
|
52
|
+
| "float"
|
|
53
|
+
| "bool"
|
|
54
|
+
| "datetime"
|
|
55
|
+
|
|
56
|
+
export interface ITypedPluginDataProperty {
|
|
57
|
+
dataType: PluginDataType,
|
|
58
|
+
description?: string,
|
|
59
|
+
displayName?: string,
|
|
60
|
+
name: string,
|
|
61
|
+
propertyKey: Branded$1<PluginPropKeyBrand>,
|
|
62
|
+
unit?: string,
|
|
63
|
+
value: string
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ISingleValue {
|
|
67
|
+
description: string,
|
|
68
|
+
fieldKey: Branded$1<FieldKeyBrand>,
|
|
69
|
+
kind: BlueprintFilledFormFieldValueAnswerKind,
|
|
70
|
+
value: string
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface IMultipleValue {
|
|
74
|
+
description: string,
|
|
75
|
+
fieldKey: Branded$1<FieldKeyBrand>,
|
|
76
|
+
kind: BlueprintFilledFormFieldValueAnswerKind,
|
|
77
|
+
values: IFieldAnswer[]
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface IMatrixValue {
|
|
81
|
+
description: string,
|
|
82
|
+
fieldKey: Branded$1<FieldKeyBrand>,
|
|
83
|
+
kind: BlueprintFilledFormFieldValueAnswerKind,
|
|
84
|
+
values: any
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface IPluginDataValue {
|
|
88
|
+
kind: BlueprintFilledFormFieldValueAnswerKind,
|
|
89
|
+
properties: ITypedPluginDataProperty[]
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Create a single-value field answer
|
|
94
|
+
*/
|
|
95
|
+
export function BlueprintFilledForm_single(fieldKey: Branded$1<FieldKeyBrand>, description: string, value: string, documentation: Option<string>): ISingleValue {
|
|
96
|
+
return {
|
|
97
|
+
description: description,
|
|
98
|
+
documentation: unwrap(documentation),
|
|
99
|
+
fieldKey: fieldKey,
|
|
100
|
+
kind: "single",
|
|
101
|
+
value: value,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Create a multi-select field answer
|
|
107
|
+
*/
|
|
108
|
+
export function BlueprintFilledForm_multiple(fieldKey: Branded$1<FieldKeyBrand>, description: string, values: IFieldAnswer[], documentation: Option<string>): IMultipleValue {
|
|
109
|
+
return {
|
|
110
|
+
description: description,
|
|
111
|
+
documentation: unwrap(documentation),
|
|
112
|
+
fieldKey: fieldKey,
|
|
113
|
+
kind: "multiple",
|
|
114
|
+
values: values,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Create a matrix/likert answer
|
|
120
|
+
*/
|
|
121
|
+
export function BlueprintFilledForm_matrix(fieldKey: Branded$1<FieldKeyBrand>, description: string, values: any, documentation: Option<string>): IMatrixValue {
|
|
122
|
+
return {
|
|
123
|
+
description: description,
|
|
124
|
+
documentation: unwrap(documentation),
|
|
125
|
+
fieldKey: fieldKey,
|
|
126
|
+
kind: "matrix",
|
|
127
|
+
values: values,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Create a plugin data field value
|
|
133
|
+
*/
|
|
134
|
+
export function BlueprintFilledForm_pluginData(properties: ITypedPluginDataProperty[]): IPluginDataValue {
|
|
135
|
+
return {
|
|
136
|
+
kind: "pluginData",
|
|
137
|
+
properties: properties,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Create a single field answer record
|
|
143
|
+
*/
|
|
144
|
+
export function BlueprintFilledForm_answer(fieldKey: Branded$1<FieldKeyBrand>, description: string, value: string, documentation: Option<string>): { description: string, documentation?: string, fieldKey: Branded$1<FieldKeyBrand>, value: string } {
|
|
145
|
+
return {
|
|
146
|
+
description: description,
|
|
147
|
+
documentation: unwrap(documentation),
|
|
148
|
+
fieldKey: fieldKey,
|
|
149
|
+
value: value,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Create a typed plugin data property
|
|
155
|
+
*/
|
|
156
|
+
export function BlueprintFilledForm_pluginProp(key: Branded$1<PluginPropKeyBrand>, name: string, dataType: PluginDataType, value: string): { dataType: PluginDataType, description?: Option<any>, displayName?: Option<any>, name: string, propertyKey: Branded$1<PluginPropKeyBrand>, unit?: Option<any>, value: string } {
|
|
157
|
+
return {
|
|
158
|
+
dataType: dataType,
|
|
159
|
+
name: name,
|
|
160
|
+
propertyKey: key,
|
|
161
|
+
value: value,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function Convert_domainKeyToTs(_arg: Shared_FieldKey): Branded$1<FieldKeyBrand> {
|
|
166
|
+
const guid: string = _arg.fields[0];
|
|
167
|
+
return guid;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export function Convert_tsKeyToDomain(tsKey: Branded$1<FieldKeyBrand>): Shared_FieldKey {
|
|
171
|
+
return new Shared_FieldKey(parse(tsKey));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function Convert_domainMatrixItemKeyToTs(_arg: Shared_MatrixItemKey): Branded$1<MatrixItemKeyBrand> {
|
|
175
|
+
const guid: string = _arg.fields[0];
|
|
176
|
+
return guid;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function Convert_fieldAnswerToTs(fa: Shared_FieldAnswer): { description: string, documentation?: string, fieldKey: Branded$1<FieldKeyBrand>, value: string } {
|
|
180
|
+
const guid: string = fa.FieldKey.fields[0];
|
|
181
|
+
return {
|
|
182
|
+
description: fa.Description,
|
|
183
|
+
documentation: unwrap(fa.Documentation),
|
|
184
|
+
fieldKey: guid,
|
|
185
|
+
value: fa.Value,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export function Convert_fieldValueToTs(fv: Shared_FieldValue_$union): any {
|
|
190
|
+
switch (fv.tag) {
|
|
191
|
+
case /* Multiple */ 1: {
|
|
192
|
+
const fas: FSharpSet<Shared_FieldAnswer> = fv.fields[0];
|
|
193
|
+
const answers: IFieldAnswer[] = map<Shared_FieldAnswer, IFieldAnswer>(Convert_fieldAnswerToTs, toArray<Shared_FieldAnswer>(fas));
|
|
194
|
+
const firstFk: Shared_FieldKey = minElement<Shared_FieldAnswer>(fas).FieldKey;
|
|
195
|
+
return {
|
|
196
|
+
description: "",
|
|
197
|
+
documentation: unwrap(bind<Shared_FieldAnswer, string>((fa_2: Shared_FieldAnswer): Option<string> => fa_2.Documentation, tryHead<Shared_FieldAnswer>(toList<Shared_FieldAnswer>(fas)))),
|
|
198
|
+
fieldKey: Convert_domainKeyToTs(firstFk),
|
|
199
|
+
kind: "multiple",
|
|
200
|
+
values: answers,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
case /* Matrix */ 2: {
|
|
204
|
+
const ma: Shared_MatrixAnswer = fv.fields[0];
|
|
205
|
+
const valuesObj: any = createObj(ofArray<[string, any]>(map<[Shared_MatrixItemKey, string], [string, any]>((tupledArg: [Shared_MatrixItemKey, string]): [string, any] => ([tupledArg[0].fields[0], tupledArg[1]] as [string, any]), toArray_1<Shared_MatrixItemKey, string>(ma.Values))));
|
|
206
|
+
return {
|
|
207
|
+
description: ma.Description,
|
|
208
|
+
documentation: unwrap(ma.Documentation),
|
|
209
|
+
fieldKey: Convert_domainKeyToTs(ma.FieldKey),
|
|
210
|
+
kind: "matrix",
|
|
211
|
+
values: valuesObj,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
case /* PluginData */ 3:
|
|
215
|
+
return {
|
|
216
|
+
kind: "pluginData",
|
|
217
|
+
properties: map<Shared_PluginDataProperty, ITypedPluginDataProperty>((p: Shared_PluginDataProperty): { dataType: PluginDataType, description?: string, displayName?: string, name: string, propertyKey: Branded$1<PluginPropKeyBrand>, unit?: string, value: string } => {
|
|
218
|
+
let matchValue: string;
|
|
219
|
+
const guid: string = p.PropertyKey.fields[0];
|
|
220
|
+
return {
|
|
221
|
+
dataType: (matchValue = p.DataType.toLowerCase(), (matchValue === "string") ? "string" : ((matchValue === "int") ? "int" : ((matchValue === "float") ? "float" : ((matchValue === "bool") ? "bool" : ((matchValue === "datetime") ? "datetime" : "string"))))),
|
|
222
|
+
description: unwrap(p.Description),
|
|
223
|
+
displayName: unwrap(p.DisplayName),
|
|
224
|
+
name: p.Name,
|
|
225
|
+
propertyKey: guid,
|
|
226
|
+
unit: unwrap(p.Unit),
|
|
227
|
+
value: p.Value,
|
|
228
|
+
};
|
|
229
|
+
}, toArray_2<Shared_PluginDataProperty>(fv.fields[0])),
|
|
230
|
+
};
|
|
231
|
+
default: {
|
|
232
|
+
const fa: Shared_FieldAnswer = fv.fields[0];
|
|
233
|
+
return {
|
|
234
|
+
description: fa.Description,
|
|
235
|
+
documentation: unwrap(fa.Documentation),
|
|
236
|
+
fieldKey: Convert_domainKeyToTs(fa.FieldKey),
|
|
237
|
+
kind: "single",
|
|
238
|
+
value: fa.Value,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
//# sourceMappingURL=BlueprintFilledForm.ts.map
|