case-editor-tools 1.6.12 → 1.6.14

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.
@@ -1,5 +1,6 @@
1
1
  import { Expression } from "survey-engine/data_types";
2
2
  import { Duration } from "../types/duration";
3
+ declare type Month = 'January' | 'February' | 'March' | 'April' | 'May' | 'June' | 'July' | 'August' | 'September' | 'October' | 'November' | 'December';
3
4
  export declare const NativeStudyEngineExpressions: {
4
5
  checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER' | 'MERGE' | 'CUSTOM' | 'LEAVE') => Expression;
5
6
  checkEventKey: (equalsKey: string) => Expression;
@@ -66,6 +67,7 @@ export declare const NativeStudyEngineExpressions: {
66
67
  neg: (value: Expression | number) => Expression;
67
68
  timestampWithOffset: (delta: Duration, reference?: number | Expression) => Expression;
68
69
  getISOWeekForTs: (ts: number | Expression) => Expression;
70
+ getTsForNextStartOfMonth: (month: Month | Expression, reference?: number | Expression) => Expression;
69
71
  getTsForNextISOWeek: (ISOWeek: number | Expression, reference?: number | Expression) => Expression;
70
72
  parseValueAsNum: (valueRef: Expression | string | number) => Expression;
71
73
  generateRandomNumber: (min: number, max: number) => Expression;
@@ -251,8 +253,10 @@ export declare const StudyEngine: {
251
253
  neg: (value: Expression | number) => Expression;
252
254
  timestampWithOffset: (delta: Duration, reference?: number | Expression) => Expression;
253
255
  getISOWeekForTs: (ts: number | Expression) => Expression;
256
+ getTsForNextStartOfMonth: (month: Month | Expression, reference?: number | Expression) => Expression;
254
257
  getTsForNextISOWeek: (ISOWeek: number | Expression, reference?: number | Expression) => Expression;
255
258
  parseValueAsNum: (valueRef: Expression | string | number) => Expression;
256
259
  generateRandomNumber: (min: number, max: number) => Expression;
257
260
  externalEventEval: (serviceName: string, route?: string, expectFloat?: boolean) => Expression;
258
261
  };
262
+ export {};
@@ -213,6 +213,13 @@ const timestampWithOffset = (delta, reference) => expressionUtils_expressionGen.
213
213
  * @returns
214
214
  */
215
215
  const getISOWeekForTs = (ts) => expressionUtils_expressionGen.generateExpression('getISOWeekForTs', undefined, ts);
216
+ /**
217
+ * Generate a timestamp value (POSIX timestamp) for the beginning of the month for the first time that is later than the reference
218
+ * @param month which ISO week should be used for the timestamp generation
219
+ * @param reference optional - a hard coded number, or an expression that should retrieve a timestamp (e.g., surveys assigned from, or response to a date question)
220
+ * @returns
221
+ */
222
+ const getTsForNextStartOfMonth = (month, reference) => expressionUtils_expressionGen.generateExpression('getTsForNextStartOfMonth', undefined, month, reference ? reference : undefined);
216
223
  /**
217
224
  * Generate a timestamp value (POSIX timestamp) for the beginning of the week for the first time that is later than the reference and has the ISO week as defined in argument ISOWeek.
218
225
  * @param ISOWeek which ISO week should be used for the timestamp generation
@@ -560,6 +567,7 @@ const NativeStudyEngineExpressions = {
560
567
  // Other
561
568
  timestampWithOffset,
562
569
  getISOWeekForTs,
570
+ getTsForNextStartOfMonth,
563
571
  getTsForNextISOWeek,
564
572
  parseValueAsNum,
565
573
  generateRandomNumber: (min, max) => expressionUtils_expressionGen.generateExpression('generateRandomNumber', undefined, min, max),
@@ -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.6.12",
4
+ "version": "1.6.14",
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}