case-editor-tools 1.0.3 → 1.0.5
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/expression-utils/studyEngineExpressions.d.ts +1 -0
- package/expression-utils/studyEngineExpressions.js +4 -0
- package/expression-utils/studyEngineExpressions.js.map +1 -1
- package/package.json +1 -1
- package/surveys/utils/optionDefGenerators.d.ts +6 -0
- package/surveys/utils/optionDefGenerators.js +6 -0
- package/surveys/utils/optionDefGenerators.js.map +1 -1
|
@@ -103,6 +103,7 @@ export declare const StudyEngine: {
|
|
|
103
103
|
validUntilSoonerThan: (surveyKey: string, delta: Duration, reference?: number | Expression | undefined) => Expression;
|
|
104
104
|
};
|
|
105
105
|
prefillRules: {
|
|
106
|
+
PREFILL_SLOT_WITH_VALUE: (itemKey: string, slotKey: string, value: string | number) => Expression;
|
|
106
107
|
GET_LAST_SURVEY_ITEM: (surveyKey: string, itemKey: string, submittedLaterThan?: Duration | undefined) => Expression;
|
|
107
108
|
};
|
|
108
109
|
contextRules: {
|
|
@@ -304,6 +304,9 @@ const setReportSummary = (reportKey, content, asTranslationKey) => {
|
|
|
304
304
|
};
|
|
305
305
|
// ##################
|
|
306
306
|
// Prefill rule methods:
|
|
307
|
+
const PREFILL_SLOT_WITH_VALUE = (itemKey, slotKey, value) => {
|
|
308
|
+
return expressionUtils_expressionGen.generateExpression('PREFILL_SLOT_WITH_VALUE', undefined, itemKey, slotKey, value);
|
|
309
|
+
};
|
|
307
310
|
const GET_LAST_SURVEY_ITEM = (surveyKey, itemKey, submittedLaterThan) => {
|
|
308
311
|
return expressionUtils_expressionGen.generateExpression('GET_LAST_SURVEY_ITEM', undefined, surveyKey, itemKey, submittedLaterThan ? types_duration.durationObjectToSeconds(submittedLaterThan) : undefined);
|
|
309
312
|
};
|
|
@@ -464,6 +467,7 @@ const StudyEngine = Object.assign(Object.assign(Object.assign({}, NativeStudyEng
|
|
|
464
467
|
validFromOlderThan: hasSurveyKeyValidFromOlderThan,
|
|
465
468
|
validUntilSoonerThan: hasSurveyKeyValidUntilSoonerThan,
|
|
466
469
|
}, prefillRules: {
|
|
470
|
+
PREFILL_SLOT_WITH_VALUE,
|
|
467
471
|
GET_LAST_SURVEY_ITEM,
|
|
468
472
|
}, contextRules: {
|
|
469
473
|
previousResponses: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"studyEngineExpressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"studyEngineExpressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "case-editor-tools",
|
|
3
3
|
"description": "Javascript tools to simplify survey and study coding for CASE.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.5",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": "github:case-framework/case-editor-tools",
|
|
@@ -18,6 +18,7 @@ export declare const SingleChoiceOptionTypes: {
|
|
|
18
18
|
textInput: (props: TextInputProps & {
|
|
19
19
|
key: string;
|
|
20
20
|
displayCondition?: Expression;
|
|
21
|
+
alignText?: 'start' | 'center' | 'end';
|
|
21
22
|
}) => OptionDef;
|
|
22
23
|
timeInput: (props: TimeInputProps & {
|
|
23
24
|
key: string;
|
|
@@ -26,6 +27,7 @@ export declare const SingleChoiceOptionTypes: {
|
|
|
26
27
|
numberInput: (props: NumericInputProps & {
|
|
27
28
|
key: string;
|
|
28
29
|
displayCondition?: Expression;
|
|
30
|
+
alignText?: 'start' | 'center' | 'end';
|
|
29
31
|
}) => OptionDef;
|
|
30
32
|
cloze: (props: ClozeProps & {
|
|
31
33
|
key: string;
|
|
@@ -39,6 +41,7 @@ export declare const MultipleChoiceOptionTypes: {
|
|
|
39
41
|
textInput: (props: TextInputProps & {
|
|
40
42
|
key: string;
|
|
41
43
|
displayCondition?: Expression;
|
|
44
|
+
alignText?: 'start' | 'center' | 'end';
|
|
42
45
|
}) => OptionDef;
|
|
43
46
|
timeInput: (props: TimeInputProps & {
|
|
44
47
|
key: string;
|
|
@@ -47,6 +50,7 @@ export declare const MultipleChoiceOptionTypes: {
|
|
|
47
50
|
numberInput: (props: NumericInputProps & {
|
|
48
51
|
key: string;
|
|
49
52
|
displayCondition?: Expression;
|
|
53
|
+
alignText?: 'start' | 'center' | 'end';
|
|
50
54
|
}) => OptionDef;
|
|
51
55
|
cloze: (props: ClozeProps & {
|
|
52
56
|
key: string;
|
|
@@ -60,6 +64,7 @@ export declare const ClozeItemTypes: {
|
|
|
60
64
|
textInput: (props: TextInputProps & {
|
|
61
65
|
key: string;
|
|
62
66
|
displayCondition?: Expression;
|
|
67
|
+
alignText?: 'start' | 'center' | 'end';
|
|
63
68
|
}) => OptionDef;
|
|
64
69
|
dateInput: (props: DateInputProps & {
|
|
65
70
|
key: string;
|
|
@@ -73,6 +78,7 @@ export declare const ClozeItemTypes: {
|
|
|
73
78
|
numberInput: (props: NumericInputProps & {
|
|
74
79
|
key: string;
|
|
75
80
|
displayCondition?: Expression;
|
|
81
|
+
alignText?: 'start' | 'center' | 'end';
|
|
76
82
|
}) => OptionDef;
|
|
77
83
|
dropDown: (props: {
|
|
78
84
|
key: string;
|
|
@@ -66,6 +66,9 @@ const textInput = (props) => {
|
|
|
66
66
|
if (props.inputMaxWidth !== undefined) {
|
|
67
67
|
style.push({ key: 'inputMaxWidth', value: props.inputMaxWidth });
|
|
68
68
|
}
|
|
69
|
+
if (props.alignText) {
|
|
70
|
+
style.push({ key: 'alignInputText', value: props.alignText });
|
|
71
|
+
}
|
|
69
72
|
return {
|
|
70
73
|
key: props.key,
|
|
71
74
|
role: 'input',
|
|
@@ -85,6 +88,9 @@ const numberInput = (props) => {
|
|
|
85
88
|
if (props.labelBehindInput) {
|
|
86
89
|
style.push({ key: 'labelPlacement', value: 'after' });
|
|
87
90
|
}
|
|
91
|
+
if (props.alignText) {
|
|
92
|
+
style.push({ key: 'alignText', value: props.alignText });
|
|
93
|
+
}
|
|
88
94
|
return {
|
|
89
95
|
key: props.key,
|
|
90
96
|
role: 'numberInput',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optionDefGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"optionDefGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|