case-editor-tools 1.0.0-beta.37 → 1.0.0-beta.40
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/constants/key-definitions.d.ts +1 -0
- package/constants/key-definitions.js +3 -1
- package/constants/key-definitions.js.map +1 -1
- package/expression-utils/studyEngineExpressions.d.ts +11 -0
- package/expression-utils/studyEngineExpressions.js +24 -0
- package/expression-utils/studyEngineExpressions.js.map +1 -1
- package/package.json +1 -1
- package/surveys/survey-engine-expressions.d.ts +3 -0
- package/surveys/survey-engine-expressions.js +5 -0
- package/surveys/survey-engine-expressions.js.map +1 -1
- package/surveys/survey-items.d.ts +2 -1
- package/surveys/survey-items.js +53 -3
- package/surveys/survey-items.js.map +1 -1
- package/surveys/types/item-properties.d.ts +12 -0
- package/surveys/utils/optionDefGenerators.d.ts +2 -0
- package/surveys/utils/optionDefGenerators.js +7 -0
- package/surveys/utils/optionDefGenerators.js.map +1 -1
|
@@ -16,9 +16,11 @@ const numericInputKey = "num";
|
|
|
16
16
|
const datePickerKey = "date";
|
|
17
17
|
const timeInputKey = "time";
|
|
18
18
|
const matrixKey = "mat";
|
|
19
|
-
const clozeKey = "cloze";
|
|
19
|
+
const clozeKey = "cloze";
|
|
20
|
+
const consentKey = "con";
|
|
20
21
|
|
|
21
22
|
exports.clozeKey = clozeKey;
|
|
23
|
+
exports.consentKey = consentKey;
|
|
22
24
|
exports.datePickerKey = datePickerKey;
|
|
23
25
|
exports.dropDownKey = dropDownKey;
|
|
24
26
|
exports.inputKey = inputKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-definitions.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"key-definitions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -72,6 +72,10 @@ export declare const StudyEngineActions: {
|
|
|
72
72
|
removeAll: () => Expression;
|
|
73
73
|
remove: (messageType: string) => Expression;
|
|
74
74
|
};
|
|
75
|
+
confidentialResponses: {
|
|
76
|
+
removeByKey: (key: string) => Expression;
|
|
77
|
+
removeAll: () => Expression;
|
|
78
|
+
};
|
|
75
79
|
stopParticipation: () => Expression;
|
|
76
80
|
finishParticipation: () => Expression;
|
|
77
81
|
};
|
|
@@ -86,6 +90,9 @@ export declare const StudyEngine: {
|
|
|
86
90
|
none: (itemKey: string, ...optionKeys: string[]) => Expression;
|
|
87
91
|
all: (itemKey: string, ...optionKeys: string[]) => Expression;
|
|
88
92
|
};
|
|
93
|
+
consent: {
|
|
94
|
+
accepted: (itemKey: string) => Expression;
|
|
95
|
+
};
|
|
89
96
|
survey: {
|
|
90
97
|
isActive: (surveyKey: string) => Expression;
|
|
91
98
|
validFromOlderThan: (surveyKey: string, delta: Duration, reference?: number | Expression | undefined) => Expression;
|
|
@@ -127,6 +134,10 @@ export declare const StudyEngine: {
|
|
|
127
134
|
removeAll: () => Expression;
|
|
128
135
|
remove: (messageType: string) => Expression;
|
|
129
136
|
};
|
|
137
|
+
confidentialResponses: {
|
|
138
|
+
removeByKey: (key: string) => Expression;
|
|
139
|
+
removeAll: () => Expression;
|
|
140
|
+
};
|
|
130
141
|
stopParticipation: () => Expression;
|
|
131
142
|
finishParticipation: () => Expression;
|
|
132
143
|
};
|
|
@@ -236,6 +236,21 @@ const INIT_REPORT = (reportKey) => {
|
|
|
236
236
|
const CANCEL_REPORT = (reportKey) => {
|
|
237
237
|
return expressionUtils_expressionGen.generateExpression('CANCEL_REPORT', undefined, reportKey);
|
|
238
238
|
};
|
|
239
|
+
/**
|
|
240
|
+
* Remove the confidential responses with this key for the participant
|
|
241
|
+
* @param key key of the confidential responses that should be removed
|
|
242
|
+
* @returns
|
|
243
|
+
*/
|
|
244
|
+
const REMOVE_CONFIDENTIAL_RESPONSE_BY_KEY = (key) => {
|
|
245
|
+
return expressionUtils_expressionGen.generateExpression('REMOVE_CONFIDENTIAL_RESPONSE_BY_KEY', undefined, key);
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Remove all confidential responses for the participant
|
|
249
|
+
* @returns
|
|
250
|
+
*/
|
|
251
|
+
const REMOVE_ALL_CONFIDENTIAL_RESPONSES = () => {
|
|
252
|
+
return expressionUtils_expressionGen.generateExpression('REMOVE_ALL_CONFIDENTIAL_RESPONSES', undefined);
|
|
253
|
+
};
|
|
239
254
|
/**
|
|
240
255
|
* Update one value attribute in a report. If report was not initialized, one will be added to the list.
|
|
241
256
|
* @param reportKey
|
|
@@ -288,6 +303,9 @@ const multipleChoiceOptionsSelected = (itemKey, ...optionKeys) => expressionUtil
|
|
|
288
303
|
const multipleChoiceAllOfTheseSelected = (itemKey, ...optionKeys) => and(...optionKeys.map(option => expressionUtils_expressionGen.generateExpression('responseHasKeysAny', undefined, itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.multipleChoiceKey].join('.'), option)));
|
|
289
304
|
const multipleChoiceOnlyOtherKeysSelected = (itemKey, ...optionKeys) => expressionUtils_expressionGen.generateExpression('responseHasOnlyKeysOtherThan', undefined, itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.multipleChoiceKey].join('.'), ...optionKeys);
|
|
290
305
|
const singleChoiceOnlyOtherOptionSelected = (itemKey, ...optionKeys) => expressionUtils_expressionGen.generateExpression('responseHasOnlyKeysOtherThan', undefined, itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.singleChoiceKey].join('.'), ...optionKeys);
|
|
306
|
+
const consentAcceptedCondition = (itemKey) => {
|
|
307
|
+
return hasResponseKey(itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.consentKey].join('.'));
|
|
308
|
+
};
|
|
291
309
|
const stopParticipation = () => UPDATE_STUDY_STATUS('inactive');
|
|
292
310
|
const finishParticipation = () => UPDATE_STUDY_STATUS('finished');
|
|
293
311
|
/**
|
|
@@ -397,6 +415,10 @@ const StudyEngineActions = {
|
|
|
397
415
|
removeAll: REMOVE_ALL_MESSAGES,
|
|
398
416
|
remove: REMOVE_MESSAGES_BY_TYPE,
|
|
399
417
|
},
|
|
418
|
+
confidentialResponses: {
|
|
419
|
+
removeByKey: REMOVE_CONFIDENTIAL_RESPONSE_BY_KEY,
|
|
420
|
+
removeAll: REMOVE_ALL_CONFIDENTIAL_RESPONSES,
|
|
421
|
+
},
|
|
400
422
|
// Extra methods:
|
|
401
423
|
stopParticipation,
|
|
402
424
|
finishParticipation,
|
|
@@ -409,6 +431,8 @@ const StudyEngine = Object.assign(Object.assign(Object.assign({}, NativeStudyEng
|
|
|
409
431
|
any: multipleChoiceOptionsSelected,
|
|
410
432
|
none: multipleChoiceOnlyOtherKeysSelected,
|
|
411
433
|
all: multipleChoiceAllOfTheseSelected,
|
|
434
|
+
}, consent: {
|
|
435
|
+
accepted: consentAcceptedCondition,
|
|
412
436
|
}, survey: {
|
|
413
437
|
isActive: hasSurveyKeyActive,
|
|
414
438
|
validFromOlderThan: hasSurveyKeyValidFromOlderThan,
|
|
@@ -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.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.40",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": "github:case-framework/case-editor-tools",
|
|
@@ -64,6 +64,9 @@ export declare const SurveyEngine: {
|
|
|
64
64
|
getNumValue: (itemKey: string, optionKey: string) => Expression;
|
|
65
65
|
regexCheck: (itemKey: string, optionKey: string, pattern: string) => Expression;
|
|
66
66
|
};
|
|
67
|
+
consentQuestion: {
|
|
68
|
+
accepted: (itemKey: string) => Expression;
|
|
69
|
+
};
|
|
67
70
|
textInput: {
|
|
68
71
|
regexCheck: (itemKey: string, pattern: string) => Expression;
|
|
69
72
|
};
|
|
@@ -360,6 +360,9 @@ const textInputRegexCheck = (itemKey, pattern) => {
|
|
|
360
360
|
const multilineTextInputRegexCheck = (itemKey, pattern) => {
|
|
361
361
|
return checkResponseValueWithRegex(itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.inputKey].join('.'), pattern);
|
|
362
362
|
};
|
|
363
|
+
const consentAcceptedCondition = (itemKey) => {
|
|
364
|
+
return hasResponse(itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.consentKey].join('.'));
|
|
365
|
+
};
|
|
363
366
|
const NativeSurveyEngineExpressions = {
|
|
364
367
|
getters: {
|
|
365
368
|
// root data reference:
|
|
@@ -426,6 +429,8 @@ const SurveyEngine = Object.assign(Object.assign({}, NativeSurveyEngineExpressio
|
|
|
426
429
|
getDateValue: multipleChoiceGetNumOptionValue,
|
|
427
430
|
getNumValue: multipleChoiceGetNumOptionValue,
|
|
428
431
|
regexCheck: mulitpleChoiceTextInputRegexCheck,
|
|
432
|
+
}, consentQuestion: {
|
|
433
|
+
accepted: consentAcceptedCondition,
|
|
429
434
|
}, textInput: {
|
|
430
435
|
regexCheck: textInputRegexCheck,
|
|
431
436
|
}, multilineTextInput: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"survey-engine-expressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"survey-engine-expressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ItemGroupComponent, Expression, ItemComponent, SurveyItem, ExpressionArg, ResponseComponent } from "survey-engine/data_types";
|
|
2
|
-
import { ClozeQuestionProps, DateInputQuestionProps, GenericQuestionProps, MultiLineTextInput, NumericInputQuestionProps, OptionDef, ResponsiveBipolarLikertArrayQuestionProps, ResponsiveSingleChoiceArrayQuestionProps, TextInputQuestionProps, TimeInputQuestionProps } from "./types/item-properties";
|
|
2
|
+
import { ClozeQuestionProps, ConsentQuestionProps, DateInputQuestionProps, GenericQuestionProps, MultiLineTextInput, NumericInputQuestionProps, OptionDef, ResponsiveBipolarLikertArrayQuestionProps, ResponsiveSingleChoiceArrayQuestionProps, TextInputQuestionProps, TimeInputQuestionProps } from "./types/item-properties";
|
|
3
3
|
import { LikertGroupRow } from "./responseTypeGenerators/likertGroupComponents";
|
|
4
4
|
interface OptionQuestionProps extends GenericQuestionProps {
|
|
5
5
|
responseOptions: Array<OptionDef>;
|
|
@@ -45,6 +45,7 @@ interface EQ5DHealthSliderProps {
|
|
|
45
45
|
}
|
|
46
46
|
export declare const initEQ5DHealthIndicatorQuestion: (props: EQ5DHealthSliderProps) => ItemGroupComponent;
|
|
47
47
|
export declare const SurveyItems: {
|
|
48
|
+
consent: (props: ConsentQuestionProps) => SurveyItem;
|
|
48
49
|
singleChoice: (props: OptionQuestionProps) => SurveyItem;
|
|
49
50
|
responsiveSingleChoiceArray: (props: ResponsiveSingleChoiceArrayQuestionProps) => SurveyItem;
|
|
50
51
|
responsiveBipolarLikertArray: (props: ResponsiveBipolarLikertArrayQuestionProps) => SurveyItem;
|
package/surveys/survey-items.js
CHANGED
|
@@ -10,11 +10,11 @@ var constants_keyDefinitions = require('../constants/key-definitions.js');
|
|
|
10
10
|
var surveys_utils_simpleGenerators = require('./utils/simple-generators.js');
|
|
11
11
|
var surveys_utils_simpleQuestionEditor = require('./utils/simple-question-editor.js');
|
|
12
12
|
var surveys_surveyEngineExpressions = require('./survey-engine-expressions.js');
|
|
13
|
+
var surveys_types_itemProperties = require('./types/item-properties.js');
|
|
13
14
|
var surveys_responseTypeGenerators_optionGroupComponents = require('./responseTypeGenerators/optionGroupComponents.js');
|
|
14
15
|
var surveys_responseTypeGenerators_likertGroupComponents = require('./responseTypeGenerators/likertGroupComponents.js');
|
|
15
16
|
require('./utils/randomKeyGenerator.js');
|
|
16
17
|
require('../logger/logger.js');
|
|
17
|
-
require('./types/item-properties.js');
|
|
18
18
|
require('../expression-utils/expressionGen.js');
|
|
19
19
|
|
|
20
20
|
const commonQuestionGenerator = (props, rg_inner) => {
|
|
@@ -108,7 +108,13 @@ const generateResponsiveSingleChoiceArrayQuestion = (props) => {
|
|
|
108
108
|
(_a = props.customValidations) === null || _a === void 0 ? void 0 : _a.push({
|
|
109
109
|
key: 'r',
|
|
110
110
|
type: 'hard',
|
|
111
|
-
rule: surveys_utils_simpleGenerators.expWithArgs('and', ...props.rows.map(r =>
|
|
111
|
+
rule: surveys_utils_simpleGenerators.expWithArgs('and', ...props.rows.map(r => {
|
|
112
|
+
const hasRespExp = surveys_utils_simpleGenerators.expWithArgs('responseHasKeysAny', [props.parentKey, props.itemKey].join('.'), [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.responsiveSingleChoiceArrayKey, r.key].join('.'), ...props.scaleOptions.map(o => o.key));
|
|
113
|
+
if (r.displayCondition === undefined) {
|
|
114
|
+
return hasRespExp;
|
|
115
|
+
}
|
|
116
|
+
return surveys_surveyEngineExpressions.SurveyEngine.logic.or(surveys_surveyEngineExpressions.SurveyEngine.logic.not(r.displayCondition), hasRespExp);
|
|
117
|
+
}))
|
|
112
118
|
});
|
|
113
119
|
}
|
|
114
120
|
return commonQuestionGenerator(props, rg_inner);
|
|
@@ -124,7 +130,13 @@ const generateResponsiveBipolarLikertArray = (props) => {
|
|
|
124
130
|
(_a = props.customValidations) === null || _a === void 0 ? void 0 : _a.push({
|
|
125
131
|
key: 'r',
|
|
126
132
|
type: 'hard',
|
|
127
|
-
rule: surveys_utils_simpleGenerators.expWithArgs('and', ...props.rows.map(r =>
|
|
133
|
+
rule: surveys_utils_simpleGenerators.expWithArgs('and', ...props.rows.map(r => {
|
|
134
|
+
const hasRespExp = surveys_utils_simpleGenerators.expWithArgs('responseHasKeysAny', [props.parentKey, props.itemKey].join('.'), [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.responsiveBipolarLikertArrayKey, r.key].join('.'), ...props.scaleOptions.map(o => o.key));
|
|
135
|
+
if (r.displayCondition === undefined) {
|
|
136
|
+
return hasRespExp;
|
|
137
|
+
}
|
|
138
|
+
return surveys_surveyEngineExpressions.SurveyEngine.logic.or(surveys_surveyEngineExpressions.SurveyEngine.logic.not(r.displayCondition), hasRespExp);
|
|
139
|
+
}))
|
|
128
140
|
});
|
|
129
141
|
}
|
|
130
142
|
return commonQuestionGenerator(props, rg_inner);
|
|
@@ -209,6 +221,43 @@ const generateTextInputQuestion = (props) => {
|
|
|
209
221
|
};
|
|
210
222
|
return commonQuestionGenerator(props, rg_inner);
|
|
211
223
|
};
|
|
224
|
+
const generateConsentQuestion = (props) => {
|
|
225
|
+
const style = props.className ? [{ key: 'className', value: props.className }] : undefined;
|
|
226
|
+
const rg_inner = {
|
|
227
|
+
key: constants_keyDefinitions.consentKey, role: 'consent',
|
|
228
|
+
items: [
|
|
229
|
+
{
|
|
230
|
+
key: 'label', role: 'label',
|
|
231
|
+
content: !Array.isArray(props.checkBoxLabel) ? surveys_utils_simpleGenerators.generateLocStrings(props.checkBoxLabel) : undefined,
|
|
232
|
+
items: Array.isArray(props.checkBoxLabel) ? props.checkBoxLabel.map((item, index) => {
|
|
233
|
+
if (surveys_types_itemProperties.isDateDisplayComponentProp(item)) {
|
|
234
|
+
return surveys_utils_simpleGenerators.generateDateDisplayComp(index.toFixed(), item);
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
key: index.toFixed(),
|
|
238
|
+
role: 'text',
|
|
239
|
+
content: surveys_utils_simpleGenerators.generateLocStrings(item.content),
|
|
240
|
+
style: item.className ? [{ key: 'className', value: item.className }] : undefined
|
|
241
|
+
};
|
|
242
|
+
}) : undefined,
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
key: 'title', role: 'title', content: surveys_utils_simpleGenerators.generateLocStrings(props.dialogTitle)
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
key: 'content', role: 'content', content: surveys_utils_simpleGenerators.generateLocStrings(props.dialogContent)
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
key: 'acceptBtn', role: 'acceptBtn', content: surveys_utils_simpleGenerators.generateLocStrings(props.acceptBtn)
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
key: 'rejectBtn', role: 'rejectBtn', content: surveys_utils_simpleGenerators.generateLocStrings(props.rejectBtn)
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
style: style,
|
|
258
|
+
};
|
|
259
|
+
return commonQuestionGenerator(props, rg_inner);
|
|
260
|
+
};
|
|
212
261
|
const generateMultilineInput = (props) => {
|
|
213
262
|
const rg_inner = {
|
|
214
263
|
key: constants_keyDefinitions.inputKey, role: 'multilineTextInput',
|
|
@@ -308,6 +357,7 @@ const initEQ5DHealthIndicatorQuestion = (props) => {
|
|
|
308
357
|
return groupEdit.getComponent();
|
|
309
358
|
};
|
|
310
359
|
const SurveyItems = {
|
|
360
|
+
consent: generateConsentQuestion,
|
|
311
361
|
singleChoice: generateSingleChoiceQuestion,
|
|
312
362
|
responsiveSingleChoiceArray: generateResponsiveSingleChoiceArrayQuestion,
|
|
313
363
|
responsiveBipolarLikertArray: generateResponsiveBipolarLikertArray,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"survey-items.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"survey-items.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -111,6 +111,18 @@ export interface ClozeProps {
|
|
|
111
111
|
items: Array<OptionDef>;
|
|
112
112
|
}
|
|
113
113
|
export declare type ClozeQuestionProps = ClozeProps & GenericQuestionProps;
|
|
114
|
+
/**
|
|
115
|
+
* Consent Question
|
|
116
|
+
*/
|
|
117
|
+
export interface ConsentProps {
|
|
118
|
+
checkBoxLabel: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>;
|
|
119
|
+
dialogTitle: Map<string, string>;
|
|
120
|
+
dialogContent: Map<string, string>;
|
|
121
|
+
acceptBtn: Map<string, string>;
|
|
122
|
+
rejectBtn: Map<string, string>;
|
|
123
|
+
className?: string;
|
|
124
|
+
}
|
|
125
|
+
export declare type ConsentQuestionProps = ConsentProps & GenericQuestionProps;
|
|
114
126
|
/**
|
|
115
127
|
* Response Single Choice Likert Array
|
|
116
128
|
*/
|
|
@@ -30,6 +30,7 @@ export declare const SingleChoiceOptionTypes: {
|
|
|
30
30
|
cloze: (props: ClozeProps & {
|
|
31
31
|
key: string;
|
|
32
32
|
displayCondition?: Expression;
|
|
33
|
+
className?: string;
|
|
33
34
|
}) => OptionDef;
|
|
34
35
|
};
|
|
35
36
|
export declare const MultipleChoiceOptionTypes: {
|
|
@@ -50,6 +51,7 @@ export declare const MultipleChoiceOptionTypes: {
|
|
|
50
51
|
cloze: (props: ClozeProps & {
|
|
51
52
|
key: string;
|
|
52
53
|
displayCondition?: Expression;
|
|
54
|
+
className?: string;
|
|
53
55
|
}) => OptionDef;
|
|
54
56
|
};
|
|
55
57
|
export declare const ClozeItemTypes: {
|
|
@@ -156,11 +156,18 @@ const dropDown = (props) => {
|
|
|
156
156
|
};
|
|
157
157
|
};
|
|
158
158
|
const cloze = (props) => {
|
|
159
|
+
const styles = [];
|
|
160
|
+
if (props.className !== undefined) {
|
|
161
|
+
styles.push({
|
|
162
|
+
key: 'className', value: props.className
|
|
163
|
+
});
|
|
164
|
+
}
|
|
159
165
|
return {
|
|
160
166
|
key: props.key,
|
|
161
167
|
role: 'cloze',
|
|
162
168
|
items: props.items,
|
|
163
169
|
displayCondition: props.displayCondition,
|
|
170
|
+
style: styles.length > 0 ? styles : undefined,
|
|
164
171
|
};
|
|
165
172
|
};
|
|
166
173
|
const clozeLineBreak = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optionDefGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"optionDefGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|