case-editor-tools 1.2.1 → 1.2.2

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/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.2.1",
4
+ "version": "1.2.2",
5
5
  "main": "index.js",
6
6
  "license": "Apache-2.0",
7
7
  "repository": "github:case-framework/case-editor-tools",
@@ -149,20 +149,21 @@ const generateResponsiveMatrix = (props) => {
149
149
  if (!props.customValidations) {
150
150
  props.customValidations = [];
151
151
  }
152
+ const rowValidations = [];
153
+ props.rows.forEach(row => {
154
+ props.columns.forEach(col => {
155
+ const hasRespExp = surveys_surveyEngineExpressions.SurveyEngine.hasResponse([props.parentKey, props.itemKey].join('.'), [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.responsiveMatrix, `${row.key}-${col.key}`].join('.'));
156
+ if (row.displayCondition === undefined) {
157
+ rowValidations.push(hasRespExp);
158
+ return;
159
+ }
160
+ rowValidations.push(surveys_surveyEngineExpressions.SurveyEngine.logic.or(surveys_surveyEngineExpressions.SurveyEngine.logic.not(row.displayCondition), hasRespExp));
161
+ });
162
+ });
152
163
  (_a = props.customValidations) === null || _a === void 0 ? void 0 : _a.push({
153
164
  key: 'r',
154
165
  type: 'hard',
155
- rule: surveys_utils_simpleGenerators.expWithArgs('and', ...props.rows.map(row => {
156
- return [
157
- ...props.columns.map(col => {
158
- const hasRespExp = surveys_surveyEngineExpressions.SurveyEngine.hasResponse([props.parentKey, props.itemKey].join('.'), [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.responsiveMatrix, `${row.key}-${col.key}`].join('.'));
159
- if (row.displayCondition === undefined) {
160
- return hasRespExp;
161
- }
162
- return surveys_surveyEngineExpressions.SurveyEngine.logic.or(surveys_surveyEngineExpressions.SurveyEngine.logic.not(row.displayCondition), hasRespExp);
163
- })
164
- ];
165
- }))
166
+ rule: surveys_utils_simpleGenerators.expWithArgs('and', ...rowValidations)
166
167
  });
167
168
  }
168
169
  return commonQuestionGenerator(props, rg_inner);
@@ -1 +1 @@
1
- {"version":3,"file":"survey-items.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"survey-items.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}