case-editor-tools 1.6.13 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -410,7 +410,7 @@ const SET_LINKING_CODE = (forKey, value) => {
410
410
  return expressionUtils_expressionGen.generateExpression('SET_LINKING_CODE', undefined, forKey, value);
411
411
  };
412
412
  /**
413
- * Delete a linking code for a specific key or all linling codes if no key is specified
413
+ * Delete a linking code for a specific key or all linking codes if no key is specified
414
414
  * @param forKey
415
415
  * @returns
416
416
  */
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.6.13",
4
+ "version": "1.7.0",
5
5
  "main": "index.js",
6
6
  "license": "Apache-2.0",
7
7
  "repository": "github:case-framework/case-editor-tools",
@@ -40,6 +40,7 @@ export interface ResponseRowCell {
40
40
  export interface ResponseRow {
41
41
  role: 'responseRow';
42
42
  key: string;
43
+ content?: Map<string, string>;
43
44
  displayCondition?: Expression;
44
45
  disabled?: Expression;
45
46
  cells: Array<ResponseRowCell>;
@@ -61,6 +61,9 @@ const initMatrixQuestion = (key, rows, order) => {
61
61
  });
62
62
  break;
63
63
  case 'responseRow':
64
+ if (rowDef.content) {
65
+ rowEditor.setContent(surveys_utils_simpleGenerators.generateLocStrings(rowDef.content));
66
+ }
64
67
  rowDef.cells.forEach(cell => {
65
68
  const cellEditor = new surveys_surveyEditor_componentEditor.ComponentEditor(undefined, {
66
69
  key: cell.key,
@@ -1 +1 @@
1
- {"version":3,"file":"matrixGroupComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"matrixGroupComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,6 +5,7 @@ export declare class StudyRules {
5
5
  private timerRules?;
6
6
  private mergeRules?;
7
7
  private leaveRules?;
8
- constructor(enterRules?: Expression[], submitRules?: Expression[], timerRules?: Expression[], mergeRules?: Expression[]);
8
+ private customRules?;
9
+ constructor(enterRules?: Expression[], submitRules?: Expression[], timerRules?: Expression[], mergeRules?: Expression[], customRules?: Expression[]);
9
10
  get(): Expression[];
10
11
  }
@@ -10,11 +10,12 @@ require('../index-8e5154bb.js');
10
10
  require('../logger/logger.js');
11
11
 
12
12
  class StudyRules {
13
- constructor(enterRules, submitRules, timerRules, mergeRules) {
13
+ constructor(enterRules, submitRules, timerRules, mergeRules, customRules) {
14
14
  this.enterRules = enterRules;
15
15
  this.submitRules = submitRules;
16
16
  this.timerRules = timerRules;
17
17
  this.mergeRules = mergeRules;
18
+ this.customRules = customRules;
18
19
  }
19
20
  get() {
20
21
  const rules = [];
@@ -33,6 +34,9 @@ class StudyRules {
33
34
  if (this.leaveRules) {
34
35
  rules.push(expressionUtils_studyEngineExpressions.StudyEngine.ifThen(expressionUtils_studyEngineExpressions.StudyEngine.checkEventType('LEAVE'), ...this.leaveRules));
35
36
  }
37
+ if (this.customRules) {
38
+ rules.push(expressionUtils_studyEngineExpressions.StudyEngine.ifThen(expressionUtils_studyEngineExpressions.StudyEngine.checkEventType('CUSTOM'), ...this.customRules));
39
+ }
36
40
  return rules;
37
41
  }
38
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"studyRules.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"studyRules.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}