case-editor-tools 1.0.0-beta.31 → 1.0.0-beta.35
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 +40 -8
- package/expression-utils/studyEngineExpressions.js +75 -18
- package/expression-utils/studyEngineExpressions.js.map +1 -1
- package/{item-editor-c6933791.js → item-editor-59f51ecc.js} +4 -1
- package/{item-editor-c6933791.js.map → item-editor-59f51ecc.js.map} +1 -1
- package/package.json +4 -4
- package/surveys/index.js +2 -1
- package/surveys/index.js.map +1 -1
- package/surveys/responseTypeGenerators/likertGroupComponents.js +3 -0
- package/surveys/responseTypeGenerators/likertGroupComponents.js.map +1 -1
- package/surveys/responseTypeGenerators/matrixGroupComponent.js +1 -0
- package/surveys/responseTypeGenerators/matrixGroupComponent.js.map +1 -1
- package/surveys/responseTypeGenerators/optionGroupComponents.js +1 -0
- package/surveys/responseTypeGenerators/optionGroupComponents.js.map +1 -1
- package/surveys/survey-editor/item-editor.d.ts +2 -1
- package/surveys/survey-editor/item-editor.js +1 -1
- package/surveys/survey-editor/survey-editor.js +1 -1
- package/surveys/survey-items.js +4 -3
- package/surveys/survey-items.js.map +1 -1
- package/surveys/types/group.js +2 -1
- package/surveys/types/group.js.map +1 -1
- package/surveys/types/index.js +3 -1
- package/surveys/types/index.js.map +1 -1
- package/surveys/types/item-properties.d.ts +12 -2
- package/surveys/types/item-properties.js +7 -0
- package/surveys/types/item-properties.js.map +1 -1
- package/surveys/types/survey-definition.js +2 -1
- package/surveys/types/survey-definition.js.map +1 -1
- package/surveys/utils/componentGenerators.js +1 -0
- package/surveys/utils/componentGenerators.js.map +1 -1
- package/surveys/utils/simple-generators.d.ts +3 -2
- package/surveys/utils/simple-generators.js +29 -0
- package/surveys/utils/simple-generators.js.map +1 -1
- package/surveys/utils/simple-question-editor.d.ts +4 -4
- package/surveys/utils/simple-question-editor.js +4 -2
- package/surveys/utils/simple-question-editor.js.map +1 -1
- package/types/studyRules.d.ts +2 -1
- package/types/studyRules.js +5 -1
- package/types/studyRules.js.map +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Expression } from "survey-engine/data_types";
|
|
2
2
|
import { Duration } from "../types/duration";
|
|
3
3
|
export declare const NativeStudyEngineExpressions: {
|
|
4
|
-
checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER') => Expression;
|
|
4
|
+
checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER' | 'MERGE') => Expression;
|
|
5
5
|
checkSurveyResponseKey: (surveyKey: string) => Expression;
|
|
6
6
|
responseHasKeysAny: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
|
|
7
7
|
responseHasOnlyKeysOtherThan: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
|
|
@@ -22,6 +22,18 @@ export declare const NativeStudyEngineExpressions: {
|
|
|
22
22
|
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
|
|
23
23
|
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
24
24
|
getMessageNextTime: (messageType: string) => Expression;
|
|
25
|
+
incomingParticipantState: {
|
|
26
|
+
getStudyEntryTime: () => Expression;
|
|
27
|
+
hasSurveyKeyAssigned: (surveyKey: string) => Expression;
|
|
28
|
+
getSurveyKeyAssignedFrom: (surveyKey: string) => Expression;
|
|
29
|
+
getSurveyKeyAssignedUntil: (surveyKey: string) => Expression;
|
|
30
|
+
hasStudyStatus: (status: string) => Expression;
|
|
31
|
+
hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
|
|
32
|
+
hasParticipantFlagKey: (key: string) => Expression;
|
|
33
|
+
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
|
|
34
|
+
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
35
|
+
getMessageNextTime: (messageType: string) => Expression;
|
|
36
|
+
};
|
|
25
37
|
};
|
|
26
38
|
eq: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
27
39
|
lt: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
@@ -47,9 +59,13 @@ export declare const StudyEngineActions: {
|
|
|
47
59
|
remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
|
|
48
60
|
};
|
|
49
61
|
reports: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
init: (reportKey: string) => Expression;
|
|
63
|
+
cancel: (reportKey: string) => Expression;
|
|
64
|
+
updateData: (reportKey: string, attributeKey: string, value: number | string | Expression, dtype?: "string" | "date" | "float" | "int" | "rawMessage" | undefined) => Expression;
|
|
65
|
+
removeData: (reportKey: string, attributeKey: string) => Expression;
|
|
66
|
+
setReportIcon: (reportKey: string, icon: string) => Expression;
|
|
67
|
+
setReportMessage: (reportKey: string, content: string, asTranslationKey?: boolean | undefined) => Expression;
|
|
68
|
+
setReportSummary: (reportKey: string, content: string, asTranslationKey?: boolean | undefined) => Expression;
|
|
53
69
|
};
|
|
54
70
|
messages: {
|
|
55
71
|
add: (messageType: string, scheduledFor: number | Expression) => Expression;
|
|
@@ -98,9 +114,13 @@ export declare const StudyEngine: {
|
|
|
98
114
|
remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
|
|
99
115
|
};
|
|
100
116
|
reports: {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
117
|
+
init: (reportKey: string) => Expression;
|
|
118
|
+
cancel: (reportKey: string) => Expression;
|
|
119
|
+
updateData: (reportKey: string, attributeKey: string, value: number | string | Expression, dtype?: "string" | "date" | "float" | "int" | "rawMessage" | undefined) => Expression;
|
|
120
|
+
removeData: (reportKey: string, attributeKey: string) => Expression;
|
|
121
|
+
setReportIcon: (reportKey: string, icon: string) => Expression;
|
|
122
|
+
setReportMessage: (reportKey: string, content: string, asTranslationKey?: boolean | undefined) => Expression;
|
|
123
|
+
setReportSummary: (reportKey: string, content: string, asTranslationKey?: boolean | undefined) => Expression;
|
|
104
124
|
};
|
|
105
125
|
messages: {
|
|
106
126
|
add: (messageType: string, scheduledFor: number | Expression) => Expression;
|
|
@@ -110,7 +130,7 @@ export declare const StudyEngine: {
|
|
|
110
130
|
stopParticipation: () => Expression;
|
|
111
131
|
finishParticipation: () => Expression;
|
|
112
132
|
};
|
|
113
|
-
checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER') => Expression;
|
|
133
|
+
checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER' | 'MERGE') => Expression;
|
|
114
134
|
checkSurveyResponseKey: (surveyKey: string) => Expression;
|
|
115
135
|
responseHasKeysAny: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
|
|
116
136
|
responseHasOnlyKeysOtherThan: (itemKey: string, responseSlotKey: string, ...optionKeys: string[]) => Expression;
|
|
@@ -131,6 +151,18 @@ export declare const StudyEngine: {
|
|
|
131
151
|
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
|
|
132
152
|
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
133
153
|
getMessageNextTime: (messageType: string) => Expression;
|
|
154
|
+
incomingParticipantState: {
|
|
155
|
+
getStudyEntryTime: () => Expression;
|
|
156
|
+
hasSurveyKeyAssigned: (surveyKey: string) => Expression;
|
|
157
|
+
getSurveyKeyAssignedFrom: (surveyKey: string) => Expression;
|
|
158
|
+
getSurveyKeyAssignedUntil: (surveyKey: string) => Expression;
|
|
159
|
+
hasStudyStatus: (status: string) => Expression;
|
|
160
|
+
hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
|
|
161
|
+
hasParticipantFlagKey: (key: string) => Expression;
|
|
162
|
+
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string | undefined) => Expression;
|
|
163
|
+
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
164
|
+
getMessageNextTime: (messageType: string) => Expression;
|
|
165
|
+
};
|
|
134
166
|
};
|
|
135
167
|
eq: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
136
168
|
lt: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
@@ -11,7 +11,7 @@ const and = (...args) => expressionUtils_expressionGen.generateExpression('and',
|
|
|
11
11
|
const not = (arg) => expressionUtils_expressionGen.generateExpression('not', undefined, arg);
|
|
12
12
|
/**
|
|
13
13
|
* Check if the current event has the given type
|
|
14
|
-
* @param equalsType string with the possible values: 'ENTER', 'SUBMIT', 'TIMER
|
|
14
|
+
* @param equalsType string with the possible values: 'ENTER', 'SUBMIT', 'TIMER', 'MERGE'
|
|
15
15
|
* @returns if event type matches the argument, return true otherwise false
|
|
16
16
|
*/
|
|
17
17
|
const checkEventType = (equalsType) => expressionUtils_expressionGen.generateExpression('checkEventType', undefined, equalsType);
|
|
@@ -80,30 +80,35 @@ const checkConditionForOldResponses = (condition, checkType, surveyKey, querySin
|
|
|
80
80
|
* @returns timestamp
|
|
81
81
|
*/
|
|
82
82
|
const getStudyEntryTime = () => expressionUtils_expressionGen.generateExpression('getStudyEntryTime');
|
|
83
|
+
const getStudyEntryTimeForIncoming = () => expressionUtils_expressionGen.generateExpression('incomingState:getStudyEntryTime');
|
|
83
84
|
/**
|
|
84
85
|
* Determines if a specific survey key is currently assigned to the participant.
|
|
85
86
|
* @param surveyKey - string - key of the survey to check for.
|
|
86
87
|
* @returns true if the participant has a survey with this surveyKey assigned, otherwise false.
|
|
87
88
|
*/
|
|
88
89
|
const hasSurveyKeyAssigned = (surveyKey) => expressionUtils_expressionGen.generateExpression('hasSurveyKeyAssigned', undefined, surveyKey);
|
|
90
|
+
const hasSurveyKeyAssignedForIncoming = (surveyKey) => expressionUtils_expressionGen.generateExpression('incomingState:hasSurveyKeyAssigned', undefined, surveyKey);
|
|
89
91
|
/**
|
|
90
92
|
* Method to access the timestamp for a surveyKey is assigned from
|
|
91
93
|
* @param surveyKey - string - key of the survey to check for.
|
|
92
94
|
* @returns timestamp
|
|
93
95
|
*/
|
|
94
96
|
const getSurveyKeyAssignedFrom = (surveyKey) => expressionUtils_expressionGen.generateExpression('getSurveyKeyAssignedFrom', undefined, surveyKey);
|
|
97
|
+
const getSurveyKeyAssignedFromForIncoming = (surveyKey) => expressionUtils_expressionGen.generateExpression('incomingState:getSurveyKeyAssignedFrom', undefined, surveyKey);
|
|
95
98
|
/**
|
|
96
99
|
* Method to access the timestamp for a surveyKey is assigned until
|
|
97
100
|
* @param surveyKey - string - key of the survey to check for.
|
|
98
101
|
* @returns timestamp
|
|
99
102
|
*/
|
|
100
103
|
const getSurveyKeyAssignedUntil = (surveyKey) => expressionUtils_expressionGen.generateExpression('getSurveyKeyAssignedUntil', undefined, surveyKey);
|
|
104
|
+
const getSurveyKeyAssignedUntilForIncoming = (surveyKey) => expressionUtils_expressionGen.generateExpression('incomingState:getSurveyKeyAssignedUntil', undefined, surveyKey);
|
|
101
105
|
/**
|
|
102
106
|
* Check if a participant has a specific study status
|
|
103
107
|
* @param status - string
|
|
104
108
|
* @returns true/false
|
|
105
109
|
*/
|
|
106
110
|
const hasStudyStatus = (status) => expressionUtils_expressionGen.generateExpression('getSurveyKeyAssignedUntil', undefined, status);
|
|
111
|
+
const hasStudyStatusForIncoming = (status) => expressionUtils_expressionGen.generateExpression('incomingState:getSurveyKeyAssignedUntil', undefined, status);
|
|
107
112
|
/**
|
|
108
113
|
* Check if a participant flag with specific value is present
|
|
109
114
|
* @param key look up this flag
|
|
@@ -111,24 +116,28 @@ const hasStudyStatus = (status) => expressionUtils_expressionGen.generateExpress
|
|
|
111
116
|
* @returns return true if key - value pair (with case sensitive matching for both key and value) is present. If any of the two is different, or participant flags is empty, it returns false.
|
|
112
117
|
*/
|
|
113
118
|
const hasParticipantFlagKeyAndValue = (key, value) => expressionUtils_expressionGen.generateExpression('hasParticipantFlag', undefined, key, value);
|
|
119
|
+
const hasParticipantFlagKeyAndValueForIncoming = (key, value) => expressionUtils_expressionGen.generateExpression('incomingState:hasParticipantFlag', undefined, key, value);
|
|
114
120
|
/**
|
|
115
121
|
* Check if a participant flag is present
|
|
116
122
|
* @param key look up this flag
|
|
117
123
|
* @returns return true if key is present. If any of the two is different, or participant flags is empty, it returns false.
|
|
118
124
|
*/
|
|
119
125
|
const hasParticipantFlagKey = (key) => expressionUtils_expressionGen.generateExpression('hasParticipantFlagKey', undefined, key);
|
|
126
|
+
const hasParticipantFlagKeyForIncoming = (key) => expressionUtils_expressionGen.generateExpression('incomingState:hasParticipantFlagKey', undefined, key);
|
|
120
127
|
/**
|
|
121
128
|
* Checks if the participant has a message type assigned (at least one)
|
|
122
129
|
* @param messageType
|
|
123
130
|
* @returns return true if a message with the given message type is assigned
|
|
124
131
|
*/
|
|
125
132
|
const hasMessageTypeAssigned = (messageType) => expressionUtils_expressionGen.generateExpression('hasMessageTypeAssigned', undefined, messageType);
|
|
133
|
+
const hasMessageTypeAssignedForIncoming = (messageType) => expressionUtils_expressionGen.generateExpression('incomingState:hasMessageTypeAssigned', undefined, messageType);
|
|
126
134
|
/**
|
|
127
135
|
* Retrieve the timestamp (scheduledFor) for a particular message type. Return 0 if not assigned.
|
|
128
136
|
* @param messageType
|
|
129
137
|
* @returns timestamp value or zero
|
|
130
138
|
*/
|
|
131
139
|
const getMessageNextTime = (messageType) => expressionUtils_expressionGen.generateExpression('getMessageNextTime', undefined, messageType);
|
|
140
|
+
const getMessageNextTimeForIncoming = (messageType) => expressionUtils_expressionGen.generateExpression('incomingState:getMessageNextTime', undefined, messageType);
|
|
132
141
|
/**
|
|
133
142
|
* Check if the last submission is older than the reference timestamp
|
|
134
143
|
* @param reference look up this flag
|
|
@@ -136,6 +145,7 @@ const getMessageNextTime = (messageType) => expressionUtils_expressionGen.genera
|
|
|
136
145
|
* @returns boolean
|
|
137
146
|
*/
|
|
138
147
|
const lastSubmissionDateOlderThan = (reference, surveyKey) => expressionUtils_expressionGen.generateExpression('lastSubmissionDateOlderThan', undefined, reference, surveyKey);
|
|
148
|
+
const lastSubmissionDateOlderThanForIncoming = (reference, surveyKey) => expressionUtils_expressionGen.generateExpression('incomingState:lastSubmissionDateOlderThan', undefined, reference, surveyKey);
|
|
139
149
|
const eq = (val1, val2) => expressionUtils_expressionGen.generateExpression('eq', undefined, val1, val2);
|
|
140
150
|
const lt = (val1, val2) => expressionUtils_expressionGen.generateExpression('lt', undefined, val1, val2);
|
|
141
151
|
const lte = (val1, val2) => expressionUtils_expressionGen.generateExpression('lte', undefined, val1, val2);
|
|
@@ -203,12 +213,6 @@ const REMOVE_ALL_MESSAGES = () => expressionUtils_expressionGen.generateExpressi
|
|
|
203
213
|
* @returns
|
|
204
214
|
*/
|
|
205
215
|
const REMOVE_MESSAGES_BY_TYPE = (messageType) => expressionUtils_expressionGen.generateExpression('REMOVE_MESSAGES_BY_TYPE', undefined, messageType);
|
|
206
|
-
/**
|
|
207
|
-
* When submitting the response, item response with the given key would be added to the report array
|
|
208
|
-
* @param itemKey find and add this item to the report array
|
|
209
|
-
* @returns
|
|
210
|
-
*/
|
|
211
|
-
const ADD_REPORT = (itemKey) => expressionUtils_expressionGen.generateExpression('ADD_REPORT', undefined, itemKey);
|
|
212
216
|
const REMOVE_SURVEY_BY_KEY = (surveyKey, selector) => {
|
|
213
217
|
if (selector === 'all') {
|
|
214
218
|
return expressionUtils_expressionGen.generateExpression('REMOVE_SURVEYS_BY_KEY', undefined, surveyKey);
|
|
@@ -217,14 +221,49 @@ const REMOVE_SURVEY_BY_KEY = (surveyKey, selector) => {
|
|
|
217
221
|
return expressionUtils_expressionGen.generateExpression('REMOVE_SURVEY_BY_KEY', undefined, surveyKey, selector);
|
|
218
222
|
}
|
|
219
223
|
};
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
/**
|
|
225
|
+
* Initialises or resets a report for the current event
|
|
226
|
+
* @param reportKey key to be used for the report
|
|
227
|
+
*/
|
|
228
|
+
const INIT_REPORT = (reportKey) => {
|
|
229
|
+
return expressionUtils_expressionGen.generateExpression('INIT_REPORT', undefined, reportKey);
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* Remove the report from the list of reports to be added at the end of the event
|
|
233
|
+
* @param reportKey key of the report that should be removed
|
|
234
|
+
* @returns
|
|
235
|
+
*/
|
|
236
|
+
const CANCEL_REPORT = (reportKey) => {
|
|
237
|
+
return expressionUtils_expressionGen.generateExpression('CANCEL_REPORT', undefined, reportKey);
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* Update one value attribute in a report. If report was not initialized, one will be added to the list.
|
|
241
|
+
* @param reportKey
|
|
242
|
+
* @param attributeKey update / create this attribute in the report
|
|
243
|
+
* @param value this should be the value for the given attribute
|
|
244
|
+
* @param dtype optional dtype to set info for the app how to render this data.
|
|
245
|
+
* @returns
|
|
246
|
+
*/
|
|
247
|
+
const UPDATE_REPORT_DATA = (reportKey, attributeKey, value, dtype) => {
|
|
248
|
+
return expressionUtils_expressionGen.generateExpression('UPDATE_REPORT_DATA', undefined, reportKey, attributeKey, value, dtype);
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Method to remove one attribute (key and value) from the report
|
|
252
|
+
* @param reportKey
|
|
253
|
+
* @param attributeKey
|
|
254
|
+
* @returns
|
|
255
|
+
*/
|
|
256
|
+
const REMOVE_REPORT_DATA = (reportKey, attributeKey) => {
|
|
257
|
+
return expressionUtils_expressionGen.generateExpression('REMOVE_REPORT_DATA', undefined, reportKey, attributeKey);
|
|
258
|
+
};
|
|
259
|
+
const setReportIcon = (reportKey, icon) => {
|
|
260
|
+
return UPDATE_REPORT_DATA(reportKey, 'icon', icon);
|
|
261
|
+
};
|
|
262
|
+
const setReportMessage = (reportKey, content, asTranslationKey) => {
|
|
263
|
+
return UPDATE_REPORT_DATA(reportKey, 'message', content, asTranslationKey ? undefined : 'rawMessage');
|
|
264
|
+
};
|
|
265
|
+
const setReportSummary = (reportKey, content, asTranslationKey) => {
|
|
266
|
+
return UPDATE_REPORT_DATA(reportKey, 'summary', content, asTranslationKey ? undefined : 'rawMessage');
|
|
228
267
|
};
|
|
229
268
|
// ##################
|
|
230
269
|
// Prefill rule methods:
|
|
@@ -304,6 +343,19 @@ const NativeStudyEngineExpressions = {
|
|
|
304
343
|
lastSubmissionDateOlderThan,
|
|
305
344
|
hasMessageTypeAssigned,
|
|
306
345
|
getMessageNextTime,
|
|
346
|
+
incomingParticipantState: {
|
|
347
|
+
// for merge event
|
|
348
|
+
getStudyEntryTime: getStudyEntryTimeForIncoming,
|
|
349
|
+
hasSurveyKeyAssigned: hasSurveyKeyAssignedForIncoming,
|
|
350
|
+
getSurveyKeyAssignedFrom: getSurveyKeyAssignedFromForIncoming,
|
|
351
|
+
getSurveyKeyAssignedUntil: getSurveyKeyAssignedUntilForIncoming,
|
|
352
|
+
hasStudyStatus: hasStudyStatusForIncoming,
|
|
353
|
+
hasParticipantFlagKeyAndValue: hasParticipantFlagKeyAndValueForIncoming,
|
|
354
|
+
hasParticipantFlagKey: hasParticipantFlagKeyForIncoming,
|
|
355
|
+
lastSubmissionDateOlderThan: lastSubmissionDateOlderThanForIncoming,
|
|
356
|
+
hasMessageTypeAssigned: hasMessageTypeAssignedForIncoming,
|
|
357
|
+
getMessageNextTime: getMessageNextTimeForIncoming,
|
|
358
|
+
}
|
|
307
359
|
},
|
|
308
360
|
// logical and comparision
|
|
309
361
|
eq,
|
|
@@ -331,9 +383,14 @@ const StudyEngineActions = {
|
|
|
331
383
|
remove: REMOVE_SURVEY_BY_KEY,
|
|
332
384
|
},
|
|
333
385
|
reports: {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
386
|
+
init: INIT_REPORT,
|
|
387
|
+
cancel: CANCEL_REPORT,
|
|
388
|
+
updateData: UPDATE_REPORT_DATA,
|
|
389
|
+
removeData: REMOVE_REPORT_DATA,
|
|
390
|
+
// Extra methods:
|
|
391
|
+
setReportIcon,
|
|
392
|
+
setReportMessage,
|
|
393
|
+
setReportSummary,
|
|
337
394
|
},
|
|
338
395
|
messages: {
|
|
339
396
|
add: ADD_MESSAGE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"studyEngineExpressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"studyEngineExpressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -122,6 +122,9 @@ class ItemEditor {
|
|
|
122
122
|
setKey(newKey) {
|
|
123
123
|
this.surveyItem.key = newKey;
|
|
124
124
|
}
|
|
125
|
+
setConfidentialMode(confidentialMode) {
|
|
126
|
+
this.surveyItem.confidentialMode = confidentialMode;
|
|
127
|
+
}
|
|
125
128
|
addToFollows(key) {
|
|
126
129
|
if (!this.surveyItem.follows) {
|
|
127
130
|
this.surveyItem.follows = [];
|
|
@@ -536,4 +539,4 @@ class ItemEditor {
|
|
|
536
539
|
|
|
537
540
|
exports.ItemEditor = ItemEditor;
|
|
538
541
|
exports.isSurveyGroupItem = isSurveyGroupItem;
|
|
539
|
-
//# sourceMappingURL=item-editor-
|
|
542
|
+
//# sourceMappingURL=item-editor-59f51ecc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-editor-
|
|
1
|
+
{"version":3,"file":"item-editor-59f51ecc.js","sources":["../node_modules/survey-engine/data_types/expression.js","../node_modules/survey-engine/data_types/survey-item.js","../node_modules/survey-engine/data_types/survey-item-component.js","../node_modules/survey-engine/data_types/response.js","../node_modules/survey-engine/data_types/index.js"],"sourcesContent":["'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst isExpression = (value) => {\r\n return typeof (value) === 'object' && value.name !== undefined && value.name.length > 0;\r\n};\r\nconst expressionArgParser = (arg) => {\r\n switch (arg.dtype) {\r\n case 'num':\r\n return arg.num;\r\n case 'str':\r\n return arg.str;\r\n case 'exp':\r\n return arg.exp;\r\n default:\r\n return arg.str;\r\n }\r\n};\n\nexports.expressionArgParser = expressionArgParser;\nexports.isExpression = isExpression;\n//# sourceMappingURL=expression.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst isSurveyGroupItem = (item) => {\r\n const items = item.items;\r\n return items !== undefined && items.length > 0;\r\n};\n\nexports.isSurveyGroupItem = isSurveyGroupItem;\n//# sourceMappingURL=survey-item.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst isItemGroupComponent = (item) => {\r\n const items = item.items;\r\n return items !== undefined && items.length > 0;\r\n};\n\nexports.isItemGroupComponent = isItemGroupComponent;\n//# sourceMappingURL=survey-item-component.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst isSurveyGroupItemResponse = (item) => {\r\n const items = item.items;\r\n return items !== undefined && items.length > 0;\r\n};\n\nexports.isSurveyGroupItemResponse = isSurveyGroupItemResponse;\n//# sourceMappingURL=response.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar data_types_expression = require('./expression.js');\nvar data_types_surveyItem = require('./survey-item.js');\nvar data_types_surveyItemComponent = require('./survey-item-component.js');\nvar data_types_response = require('./response.js');\n\n\n\nexports.expressionArgParser = data_types_expression.expressionArgParser;\nexports.isExpression = data_types_expression.isExpression;\nexports.isSurveyGroupItem = data_types_surveyItem.isSurveyGroupItem;\nexports.isItemGroupComponent = data_types_surveyItemComponent.isItemGroupComponent;\nexports.isSurveyGroupItemResponse = data_types_response.isSurveyGroupItemResponse;\n//# sourceMappingURL=index.js.map\n"],"names":["isSurveyGroupItem","isItemGroupComponent","require$$0","require$$1","require$$2","require$$3"],"mappings":";;;;;;;;;;AAEA,MAAM,CAAC,cAAc,CAAC,UAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D;AACA,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK;AAChC,IAAI,OAAO,QAAQ,KAAK,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;AAC5F,CAAC,CAAC;AACF,MAAM,mBAAmB,GAAG,CAAC,GAAG,KAAK;AACrC,IAAI,QAAQ,GAAG,CAAC,KAAK;AACrB,QAAQ,KAAK,KAAK;AAClB,YAAY,OAAO,GAAG,CAAC,GAAG,CAAC;AAC3B,QAAQ,KAAK,KAAK;AAClB,YAAY,OAAO,GAAG,CAAC,GAAG,CAAC;AAC3B,QAAQ,KAAK,KAAK;AAClB,YAAY,OAAO,GAAG,CAAC,GAAG,CAAC;AAC3B,QAAQ;AACR,YAAY,OAAO,GAAG,CAAC,GAAG,CAAC;AAC3B,KAAK;AACL,CAAC,CAAC;AACF;8BAC2B,GAAG,oBAAoB;uBAC9B,GAAG;;;;ACnBvB,MAAM,CAAC,cAAc,CAAC,UAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D;AACA,MAAMA,mBAAiB,GAAG,CAAC,IAAI,KAAK;AACpC,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;AAC7B,IAAI,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AACnD,CAAC,CAAC;AACF;4BACyB,GAAGA;;;;ACP5B,MAAM,CAAC,cAAc,CAAC,mBAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D;AACA,MAAMC,sBAAoB,GAAG,CAAC,IAAI,KAAK;AACvC,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;AAC7B,IAAI,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AACnD,CAAC,CAAC;AACF;wCAC4B,GAAGA;;;;ACP/B,MAAM,CAAC,cAAc,CAAC,QAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D;AACA,MAAM,yBAAyB,GAAG,CAAC,IAAI,KAAK;AAC5C,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;AAC7B,IAAI,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AACnD,CAAC,CAAC;AACF;kCACiC,GAAG;;ACPpC,MAAM,CAAC,cAAc,CAAC,UAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D;AACA,IAAI,qBAAqB,GAAGC,UAA0B,CAAC;AACvD,IAAI,qBAAqB,GAAGC,UAA2B,CAAC;AACxD,IAAI,8BAA8B,GAAGC,mBAAqC,CAAC;AAC3E,IAAI,mBAAmB,GAAGC,QAAwB,CAAC;AACnD;AACA;AACA;8BAC2B,GAAG,qBAAqB,CAAC,oBAAoB;uBACpD,GAAG,qBAAqB,CAAC,aAAa;oDACjC,GAAG,qBAAqB,CAAC,kBAAkB;AACpE,0DAA4B,GAAG,8BAA8B,CAAC,oBAAoB,CAAC;oCAClD,GAAG,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
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.35",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": "github:case-framework/case-editor-tools",
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
10
10
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
11
|
-
"rollup": "^2.
|
|
11
|
+
"rollup": "^2.67.0",
|
|
12
12
|
"rollup-plugin-copy": "^3.4.0",
|
|
13
13
|
"rollup-plugin-delete": "^2.0.0",
|
|
14
14
|
"rollup-plugin-multi-input": "^1.3.1",
|
|
15
15
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
16
|
-
"rollup-plugin-typescript2": "^0.31.
|
|
16
|
+
"rollup-plugin-typescript2": "^0.31.2",
|
|
17
17
|
"typescript": "^4.4.4"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "rollup -c"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"survey-engine": "^1.
|
|
23
|
+
"survey-engine": "^1.1.3"
|
|
24
24
|
}
|
|
25
25
|
}
|
package/surveys/index.js
CHANGED
|
@@ -6,11 +6,12 @@ var surveys_surveyItems = require('./survey-items.js');
|
|
|
6
6
|
var surveys_utils_optionDefGenerators = require('./utils/optionDefGenerators.js');
|
|
7
7
|
var surveys_surveyEngineExpressions = require('./survey-engine-expressions.js');
|
|
8
8
|
require('./survey-editor/component-editor.js');
|
|
9
|
-
require('../item-editor-
|
|
9
|
+
require('../item-editor-59f51ecc.js');
|
|
10
10
|
require('./utils/randomKeyGenerator.js');
|
|
11
11
|
require('../logger/logger.js');
|
|
12
12
|
require('./utils/componentGenerators.js');
|
|
13
13
|
require('./utils/simple-generators.js');
|
|
14
|
+
require('./types/item-properties.js');
|
|
14
15
|
require('../types/duration.js');
|
|
15
16
|
require('../constants/key-definitions.js');
|
|
16
17
|
require('./utils/simple-question-editor.js');
|
package/surveys/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var surveys_surveyEditor_componentEditor = require('../survey-editor/component-editor.js');
|
|
6
6
|
var surveys_utils_randomKeyGenerator = require('../utils/randomKeyGenerator.js');
|
|
7
7
|
var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
|
|
8
|
+
require('../types/item-properties.js');
|
|
8
9
|
|
|
9
10
|
const initLikertScaleGroup = (key, rows, scaleOptions, stackOnSmallScreen, displayCondition) => {
|
|
10
11
|
const groupEdit = new surveys_surveyEditor_componentEditor.ComponentEditor(undefined, {
|
|
@@ -163,6 +164,7 @@ const initResponsiveSingleChoiceArray = (rgKey, props, displayCondition) => {
|
|
|
163
164
|
groupEdit.addItemComponent({
|
|
164
165
|
key: row.key,
|
|
165
166
|
role: 'row',
|
|
167
|
+
displayCondition: row.displayCondition,
|
|
166
168
|
style: rowStyles.length > 0 ? rowStyles : undefined,
|
|
167
169
|
content: !Array.isArray(row.content) ? surveys_utils_simpleGenerators.generateLocStrings(row.content) : undefined,
|
|
168
170
|
items: Array.isArray(row.content) ? row.content.map((cont, index) => {
|
|
@@ -300,6 +302,7 @@ const initResponsiveBipolarLikertArray = (rgKey, props, displayCondition) => {
|
|
|
300
302
|
groupEdit.addItemComponent({
|
|
301
303
|
key: row.key,
|
|
302
304
|
role: 'row',
|
|
305
|
+
displayCondition: row.displayCondition,
|
|
303
306
|
style: rowStyles.length > 0 ? rowStyles : undefined,
|
|
304
307
|
items: [
|
|
305
308
|
startLabel, endLabel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"likertGroupComponents.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"likertGroupComponents.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var surveys_surveyEditor_componentEditor = require('../survey-editor/component-editor.js');
|
|
6
6
|
var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
|
|
7
|
+
require('../types/item-properties.js');
|
|
7
8
|
require('../utils/randomKeyGenerator.js');
|
|
8
9
|
|
|
9
10
|
const initMatrixQuestion = (key, rows, order) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrixGroupComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"matrixGroupComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var surveys_surveyEditor_componentEditor = require('../survey-editor/component-editor.js');
|
|
6
6
|
var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
|
|
7
|
+
require('../types/item-properties.js');
|
|
7
8
|
require('../utils/randomKeyGenerator.js');
|
|
8
9
|
|
|
9
10
|
const optionDefToItemComponent = (optionDef) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optionGroupComponents.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"optionGroupComponents.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SurveyItem, SurveyItemTypes, Expression, Validation, ItemComponent, ItemGroupComponent } from "survey-engine/data_types";
|
|
1
|
+
import { SurveyItem, SurveyItemTypes, Expression, Validation, ItemComponent, ItemGroupComponent, ConfidentialMode } from "survey-engine/data_types";
|
|
2
2
|
import { NewItemProps, NewComponentProps } from "./data-types";
|
|
3
3
|
interface ItemEditorInt {
|
|
4
4
|
getItem: () => SurveyItem;
|
|
@@ -36,6 +36,7 @@ export declare class ItemEditor implements ItemEditorInt {
|
|
|
36
36
|
getItem(): SurveyItem;
|
|
37
37
|
getItemJSON(pretty?: boolean): string;
|
|
38
38
|
setKey(newKey: string): void;
|
|
39
|
+
setConfidentialMode(confidentialMode?: ConfidentialMode): void;
|
|
39
40
|
addToFollows(key: string): void;
|
|
40
41
|
removeFromFollows(key: string): void;
|
|
41
42
|
clearFollows(): void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var surveys_surveyEditor_itemEditor = require('../../item-editor-
|
|
5
|
+
var surveys_surveyEditor_itemEditor = require('../../item-editor-59f51ecc.js');
|
|
6
6
|
require('./component-editor.js');
|
|
7
7
|
require('../utils/randomKeyGenerator.js');
|
|
8
8
|
require('../../logger/logger.js');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var surveys_surveyEditor_itemEditor = require('../../item-editor-
|
|
5
|
+
var surveys_surveyEditor_itemEditor = require('../../item-editor-59f51ecc.js');
|
|
6
6
|
var logger_logger = require('../../logger/logger.js');
|
|
7
7
|
require('./component-editor.js');
|
|
8
8
|
require('../utils/randomKeyGenerator.js');
|
package/surveys/survey-items.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var surveys_surveyEditor_componentEditor = require('./survey-editor/component-editor.js');
|
|
6
|
-
var surveys_surveyEditor_itemEditor = require('../item-editor-
|
|
6
|
+
var surveys_surveyEditor_itemEditor = require('../item-editor-59f51ecc.js');
|
|
7
7
|
var surveys_utils_componentGenerators = require('./utils/componentGenerators.js');
|
|
8
8
|
var types_duration = require('../types/duration.js');
|
|
9
9
|
var constants_keyDefinitions = require('../constants/key-definitions.js');
|
|
@@ -14,10 +14,11 @@ var surveys_responseTypeGenerators_optionGroupComponents = require('./responseTy
|
|
|
14
14
|
var surveys_responseTypeGenerators_likertGroupComponents = require('./responseTypeGenerators/likertGroupComponents.js');
|
|
15
15
|
require('./utils/randomKeyGenerator.js');
|
|
16
16
|
require('../logger/logger.js');
|
|
17
|
+
require('./types/item-properties.js');
|
|
17
18
|
require('../expression-utils/expressionGen.js');
|
|
18
19
|
|
|
19
20
|
const commonQuestionGenerator = (props, rg_inner) => {
|
|
20
|
-
const simpleEditor = new surveys_utils_simpleQuestionEditor.SimpleQuestionEditor(props.parentKey, props.itemKey, props.version ? props.version : 1);
|
|
21
|
+
const simpleEditor = new surveys_utils_simpleQuestionEditor.SimpleQuestionEditor(props.parentKey, props.itemKey, props.version ? props.version : 1, props.confidentialMode);
|
|
21
22
|
// QUESTION TEXT
|
|
22
23
|
simpleEditor.setTitle(props.questionText, props.questionSubText, props.titleClassName);
|
|
23
24
|
if (props.condition) {
|
|
@@ -207,7 +208,7 @@ const generateCustomQuestion = (props) => {
|
|
|
207
208
|
const rg_inner = Object.assign(Object.assign({}, item), { role: role });
|
|
208
209
|
items.push(rg_inner);
|
|
209
210
|
});
|
|
210
|
-
const simpleEditor = new surveys_utils_simpleQuestionEditor.SimpleQuestionEditor(props.parentKey, props.itemKey, props.version ? props.version : 1);
|
|
211
|
+
const simpleEditor = new surveys_utils_simpleQuestionEditor.SimpleQuestionEditor(props.parentKey, props.itemKey, props.version ? props.version : 1, props.confidentialMode);
|
|
211
212
|
// QUESTION TEXT
|
|
212
213
|
simpleEditor.setTitle(props.questionText, props.questionSubText, props.titleClassName);
|
|
213
214
|
if (props.condition) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"survey-items.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"survey-items.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/surveys/types/group.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var logger_logger = require('../../logger/logger.js');
|
|
6
|
-
var surveys_surveyEditor_itemEditor = require('../../item-editor-
|
|
6
|
+
var surveys_surveyEditor_itemEditor = require('../../item-editor-59f51ecc.js');
|
|
7
7
|
var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
|
|
8
8
|
require('../survey-editor/component-editor.js');
|
|
9
9
|
require('../utils/randomKeyGenerator.js');
|
|
10
|
+
require('./item-properties.js');
|
|
10
11
|
|
|
11
12
|
class Group {
|
|
12
13
|
constructor(parentKey, groupKey, selectionMethod) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"group.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/surveys/types/index.js
CHANGED
|
@@ -4,9 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var surveys_types_group = require('./group.js');
|
|
6
6
|
var surveys_types_item = require('./item.js');
|
|
7
|
+
var surveys_types_itemProperties = require('./item-properties.js');
|
|
7
8
|
var surveys_types_surveyDefinition = require('./survey-definition.js');
|
|
8
9
|
require('../../logger/logger.js');
|
|
9
|
-
require('../../item-editor-
|
|
10
|
+
require('../../item-editor-59f51ecc.js');
|
|
10
11
|
require('../survey-editor/component-editor.js');
|
|
11
12
|
require('../utils/randomKeyGenerator.js');
|
|
12
13
|
require('../utils/simple-generators.js');
|
|
@@ -16,5 +17,6 @@ require('../survey-editor/survey-editor.js');
|
|
|
16
17
|
|
|
17
18
|
exports.Group = surveys_types_group.Group;
|
|
18
19
|
exports.Item = surveys_types_item.Item;
|
|
20
|
+
exports.isDateDisplayComponentProp = surveys_types_itemProperties.isDateDisplayComponentProp;
|
|
19
21
|
exports.SurveyDefinition = surveys_types_surveyDefinition.SurveyDefinition;
|
|
20
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { ComponentProperties, Expression, ItemComponent, Validation } from "survey-engine/data_types";
|
|
1
|
+
import { ComponentProperties, ConfidentialMode, Expression, ItemComponent, Validation } from "survey-engine/data_types";
|
|
2
2
|
import { Duration } from "../../types/duration";
|
|
3
3
|
export interface StyledTextComponentProp {
|
|
4
4
|
content: Map<string, string>;
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
|
+
export interface DateDisplayComponentProp {
|
|
8
|
+
languageCodes: string[];
|
|
9
|
+
date: Expression;
|
|
10
|
+
dateFormat: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const isDateDisplayComponentProp: (value: DateDisplayComponentProp | any) => value is DateDisplayComponentProp;
|
|
7
14
|
export interface OptionDef {
|
|
8
15
|
key: string;
|
|
9
16
|
role: string;
|
|
@@ -22,7 +29,7 @@ export interface GenericQuestionProps {
|
|
|
22
29
|
parentKey: string;
|
|
23
30
|
itemKey: string;
|
|
24
31
|
version?: number;
|
|
25
|
-
questionText: Map<string, string> | Array<StyledTextComponentProp>;
|
|
32
|
+
questionText: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>;
|
|
26
33
|
questionSubText?: Map<string, string>;
|
|
27
34
|
titleClassName?: string;
|
|
28
35
|
helpGroupContent?: Array<{
|
|
@@ -38,6 +45,7 @@ export interface GenericQuestionProps {
|
|
|
38
45
|
isRequired?: boolean;
|
|
39
46
|
footnoteText?: Map<string, string>;
|
|
40
47
|
customValidations?: Array<Validation>;
|
|
48
|
+
confidentialMode?: ConfidentialMode;
|
|
41
49
|
}
|
|
42
50
|
/**
|
|
43
51
|
* Numeric Input
|
|
@@ -103,6 +111,7 @@ export interface ResponsiveSingleChoiceArrayProps {
|
|
|
103
111
|
}>;
|
|
104
112
|
rows: Array<{
|
|
105
113
|
key: string;
|
|
114
|
+
displayCondition?: Expression;
|
|
106
115
|
content: Map<string, string> | StyledTextComponentProp[];
|
|
107
116
|
horizontalModeProps?: {
|
|
108
117
|
labelPlacement?: 'none' | 'top' | 'bottom';
|
|
@@ -152,6 +161,7 @@ export interface ResponsiveBipolarLikertArrayProps {
|
|
|
152
161
|
key: string;
|
|
153
162
|
startLabel: Map<string, string> | StyledTextComponentProp[];
|
|
154
163
|
endLabel: Map<string, string> | StyledTextComponentProp[];
|
|
164
|
+
displayCondition?: Expression;
|
|
155
165
|
withLabelRowModeProps?: {
|
|
156
166
|
className?: string;
|
|
157
167
|
};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const isDateDisplayComponentProp = (value) => {
|
|
6
|
+
return typeof (value) === 'object' && value.date !== undefined && value.dateFormat !== undefined && value.languageCodes !== undefined;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
exports.isDateDisplayComponentProp = isDateDisplayComponentProp;
|
|
3
10
|
//# sourceMappingURL=item-properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-properties.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"item-properties.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var logger_logger = require('../../logger/logger.js');
|
|
6
|
-
var surveys_surveyEditor_itemEditor = require('../../item-editor-
|
|
6
|
+
var surveys_surveyEditor_itemEditor = require('../../item-editor-59f51ecc.js');
|
|
7
7
|
var surveys_surveyEditor_surveyEditor = require('../survey-editor/survey-editor.js');
|
|
8
8
|
var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
|
|
9
9
|
require('../survey-editor/component-editor.js');
|
|
10
10
|
require('../utils/randomKeyGenerator.js');
|
|
11
|
+
require('./item-properties.js');
|
|
11
12
|
|
|
12
13
|
class SurveyDefinition {
|
|
13
14
|
constructor(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"survey-definition.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"survey-definition.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var surveys_utils_randomKeyGenerator = require('./randomKeyGenerator.js');
|
|
6
6
|
var surveys_utils_simpleGenerators = require('./simple-generators.js');
|
|
7
7
|
require('../survey-editor/component-editor.js');
|
|
8
|
+
require('../types/item-properties.js');
|
|
8
9
|
|
|
9
10
|
const text = (props) => {
|
|
10
11
|
const styles = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"componentGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LocalizedString, ItemComponent, ExpressionName, Expression, ItemGroupComponent, SurveySingleItem } from "survey-engine/data_types";
|
|
2
|
-
import { StyledTextComponentProp } from "../types/item-properties";
|
|
2
|
+
import { DateDisplayComponentProp, StyledTextComponentProp } from "../types/item-properties";
|
|
3
3
|
export declare const generateLocStrings: (translations: Map<string, string>) => LocalizedString[];
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const generateDateDisplayComp: (key: string, item: DateDisplayComponentProp) => ItemComponent;
|
|
5
|
+
export declare const generateTitleComponent: (content: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>, description?: Map<string, string> | undefined, className?: string | undefined) => ItemComponent;
|
|
5
6
|
export declare const generateHelpGroupComponent: (items: Array<{
|
|
6
7
|
content: Map<string, string>;
|
|
7
8
|
style?: Array<{
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var surveys_surveyEditor_componentEditor = require('../survey-editor/component-editor.js');
|
|
6
|
+
var surveys_types_itemProperties = require('../types/item-properties.js');
|
|
6
7
|
var surveys_utils_randomKeyGenerator = require('./randomKeyGenerator.js');
|
|
7
8
|
|
|
8
9
|
const generateLocStrings = (translations) => {
|
|
@@ -17,11 +18,38 @@ const generateLocStrings = (translations) => {
|
|
|
17
18
|
});
|
|
18
19
|
return locString;
|
|
19
20
|
};
|
|
21
|
+
const generateDateDisplayComp = (key, item) => {
|
|
22
|
+
// console.log(translations);
|
|
23
|
+
const styleArray = [
|
|
24
|
+
{ key: 'dateFormat', value: item.dateFormat }
|
|
25
|
+
];
|
|
26
|
+
if (item.className) {
|
|
27
|
+
styleArray.push({ key: 'className', value: item.className });
|
|
28
|
+
}
|
|
29
|
+
const locString = new Array();
|
|
30
|
+
const dateExp = item.date;
|
|
31
|
+
item.languageCodes.forEach((code) => {
|
|
32
|
+
const translatedItem = {
|
|
33
|
+
code: code,
|
|
34
|
+
parts: [{ exp: dateExp }]
|
|
35
|
+
};
|
|
36
|
+
locString.push(translatedItem);
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
key: key,
|
|
40
|
+
role: 'dateDisplay',
|
|
41
|
+
content: locString,
|
|
42
|
+
style: styleArray,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
20
45
|
const generateTitleComponent = (content, description, className) => {
|
|
21
46
|
let items = undefined;
|
|
22
47
|
let currentContent = undefined;
|
|
23
48
|
if (Array.isArray(content)) {
|
|
24
49
|
items = content.map((item, index) => {
|
|
50
|
+
if (surveys_types_itemProperties.isDateDisplayComponentProp(item)) {
|
|
51
|
+
return generateDateDisplayComp(index.toFixed(), item);
|
|
52
|
+
}
|
|
25
53
|
return {
|
|
26
54
|
key: index.toFixed(),
|
|
27
55
|
role: 'text',
|
|
@@ -95,6 +123,7 @@ const generatePageBreak = (parentKey, key) => {
|
|
|
95
123
|
};
|
|
96
124
|
|
|
97
125
|
exports.expWithArgs = expWithArgs;
|
|
126
|
+
exports.generateDateDisplayComp = generateDateDisplayComp;
|
|
98
127
|
exports.generateHelpGroupComponent = generateHelpGroupComponent;
|
|
99
128
|
exports.generateLocStrings = generateLocStrings;
|
|
100
129
|
exports.generatePageBreak = generatePageBreak;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-generators.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"simple-generators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Expression, ItemComponent } from "survey-engine/data_types";
|
|
1
|
+
import { ConfidentialMode, Expression, ItemComponent } from "survey-engine/data_types";
|
|
2
2
|
import { ItemEditor } from "../survey-editor/item-editor";
|
|
3
|
-
import { StyledTextComponentProp } from "../types/item-properties";
|
|
3
|
+
import { DateDisplayComponentProp, StyledTextComponentProp } from "../types/item-properties";
|
|
4
4
|
export declare class SimpleQuestionEditor {
|
|
5
5
|
editor: ItemEditor;
|
|
6
6
|
key: string;
|
|
7
|
-
constructor(parentKey: string, key: string, version: number);
|
|
7
|
+
constructor(parentKey: string, key: string, version: number, confidentialMode?: ConfidentialMode);
|
|
8
8
|
getItem(): import("survey-engine/data_types").SurveyItem;
|
|
9
|
-
setTitle(title: Map<string, string> | Array<StyledTextComponentProp>, description?: Map<string, string>, className?: string): void;
|
|
9
|
+
setTitle(title: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>, description?: Map<string, string>, className?: string): void;
|
|
10
10
|
setCondition(exp: Expression): void;
|
|
11
11
|
addDisplayComponent(comp: ItemComponent, atPosition?: number): void;
|
|
12
12
|
addHasResponseValidation(): void;
|
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var constants_keyDefinitions = require('../../constants/key-definitions.js');
|
|
6
|
-
var surveys_surveyEditor_itemEditor = require('../../item-editor-
|
|
6
|
+
var surveys_surveyEditor_itemEditor = require('../../item-editor-59f51ecc.js');
|
|
7
7
|
var surveys_utils_simpleGenerators = require('./simple-generators.js');
|
|
8
8
|
require('../survey-editor/component-editor.js');
|
|
9
9
|
require('./randomKeyGenerator.js');
|
|
10
10
|
require('../../logger/logger.js');
|
|
11
|
+
require('../types/item-properties.js');
|
|
11
12
|
|
|
12
13
|
class SimpleQuestionEditor {
|
|
13
|
-
constructor(parentKey, key, version) {
|
|
14
|
+
constructor(parentKey, key, version, confidentialMode) {
|
|
14
15
|
const itemKey = [parentKey, key].join('.');
|
|
15
16
|
this.key = itemKey;
|
|
16
17
|
this.editor = new surveys_surveyEditor_itemEditor.ItemEditor(undefined, { itemKey: itemKey, isGroup: false });
|
|
17
18
|
this.editor.setVersion(version);
|
|
19
|
+
this.editor.setConfidentialMode(confidentialMode);
|
|
18
20
|
}
|
|
19
21
|
getItem() {
|
|
20
22
|
return this.editor.getItem();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-question-editor.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"simple-question-editor.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/types/studyRules.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare class StudyRules {
|
|
|
3
3
|
private enterRules?;
|
|
4
4
|
private submitRules?;
|
|
5
5
|
private timerRules?;
|
|
6
|
-
|
|
6
|
+
private mergeRules?;
|
|
7
|
+
constructor(enterRules?: Expression[], submitRules?: Expression[], timerRules?: Expression[], mergeRules?: Expression[]);
|
|
7
8
|
get(): Expression[];
|
|
8
9
|
}
|
package/types/studyRules.js
CHANGED
|
@@ -8,10 +8,11 @@ require('./duration.js');
|
|
|
8
8
|
require('../expression-utils/expressionGen.js');
|
|
9
9
|
|
|
10
10
|
class StudyRules {
|
|
11
|
-
constructor(enterRules, submitRules, timerRules) {
|
|
11
|
+
constructor(enterRules, submitRules, timerRules, mergeRules) {
|
|
12
12
|
this.enterRules = enterRules;
|
|
13
13
|
this.submitRules = submitRules;
|
|
14
14
|
this.timerRules = timerRules;
|
|
15
|
+
this.mergeRules = mergeRules;
|
|
15
16
|
}
|
|
16
17
|
get() {
|
|
17
18
|
const rules = [];
|
|
@@ -24,6 +25,9 @@ class StudyRules {
|
|
|
24
25
|
if (this.timerRules) {
|
|
25
26
|
rules.push(expressionUtils_studyEngineExpressions.StudyEngine.ifThen(expressionUtils_studyEngineExpressions.StudyEngine.checkEventType('TIMER'), ...this.timerRules));
|
|
26
27
|
}
|
|
28
|
+
if (this.mergeRules) {
|
|
29
|
+
rules.push(expressionUtils_studyEngineExpressions.StudyEngine.ifThen(expressionUtils_studyEngineExpressions.StudyEngine.checkEventType('MERGE'), ...this.mergeRules));
|
|
30
|
+
}
|
|
27
31
|
return rules;
|
|
28
32
|
}
|
|
29
33
|
}
|
package/types/studyRules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"studyRules.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"studyRules.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|