case-editor-tools 1.3.0 → 1.4.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.
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.3.0",
4
+ "version": "1.4.0",
5
5
  "main": "index.js",
6
6
  "license": "Apache-2.0",
7
7
  "repository": "github:case-framework/case-editor-tools",
@@ -1,5 +1,5 @@
1
1
  import { ComponentProperties, Expression, ItemGroupComponent } from "survey-engine/data_types";
2
- interface HeaderRow {
2
+ export interface HeaderRow {
3
3
  role: 'headerRow';
4
4
  key: string;
5
5
  displayCondition?: Expression;
@@ -11,7 +11,7 @@ interface HeaderRow {
11
11
  description?: Map<string, string>;
12
12
  }>;
13
13
  }
14
- interface RadioRow {
14
+ export interface RadioRow {
15
15
  role: 'radioRow';
16
16
  key: string;
17
17
  displayCondition?: Expression;
@@ -37,13 +37,12 @@ export interface ResponseRowCell {
37
37
  displayCondition?: Expression;
38
38
  }>;
39
39
  }
40
- interface ResponseRow {
40
+ export interface ResponseRow {
41
41
  role: 'responseRow';
42
42
  key: string;
43
43
  displayCondition?: Expression;
44
44
  disabled?: Expression;
45
45
  cells: Array<ResponseRowCell>;
46
46
  }
47
- declare type MatrixRow = HeaderRow | RadioRow | ResponseRow;
47
+ export declare type MatrixRow = HeaderRow | RadioRow | ResponseRow;
48
48
  export declare const initMatrixQuestion: (key: string, rows: Array<MatrixRow>, order?: Expression) => ItemGroupComponent;
49
- export {};
@@ -1,14 +1,14 @@
1
1
  import { ItemGroupComponent, Expression, ItemComponent, SurveyItem, ExpressionArg, ResponseComponent } from "survey-engine/data_types";
2
2
  import { ClozeQuestionProps, ConsentQuestionProps, DateInputQuestionProps, GenericQuestionProps, MultiLineTextInput, NumericInputQuestionProps, OptionDef, ResponsiveBipolarLikertArrayQuestionProps, ResponsiveMatrixQuestionProps, ResponsiveSingleChoiceArrayQuestionProps, TextInputQuestionProps, TimeInputQuestionProps } from "./types/item-properties";
3
3
  import { LikertGroupRow } from "./responseTypeGenerators/likertGroupComponents";
4
- interface OptionQuestionProps extends GenericQuestionProps {
4
+ export interface OptionQuestionProps extends GenericQuestionProps {
5
5
  responseOptions: Array<OptionDef>;
6
6
  }
7
- interface DropDownQuestionProps extends GenericQuestionProps {
7
+ export interface DropDownQuestionProps extends GenericQuestionProps {
8
8
  responseOptions: Array<OptionDef>;
9
9
  placeholder?: Map<string, string>;
10
10
  }
11
- interface LikertGroupQuestionProps extends GenericQuestionProps {
11
+ export interface LikertGroupQuestionProps extends GenericQuestionProps {
12
12
  rows: Array<LikertGroupRow>;
13
13
  scaleOptions: Array<{
14
14
  key: string;
@@ -1,6 +1,6 @@
1
1
  import { SurveyItem } from "survey-engine/data_types";
2
2
  import { SurveyEditor } from "../survey-editor/survey-editor";
3
- export declare type SurveyAvailableFor = 'public' | 'temporary_participants' | 'active_participants';
3
+ export declare type SurveyAvailableFor = 'public' | 'temporary_participants' | 'active_participants' | 'participants_if_assigned';
4
4
  export interface SurveyProps {
5
5
  surveyKey: string;
6
6
  name: Map<string, string>;
@@ -1,16 +1,16 @@
1
1
  import { Expression, ItemComponent } from "survey-engine/data_types";
2
2
  import { StyledTextComponentProp } from "../types/item-properties";
3
- interface CommonProps {
3
+ export interface CommonProps {
4
4
  key?: string;
5
5
  content?: Map<string, string> | StyledTextComponentProp[];
6
6
  displayCondition?: Expression;
7
7
  }
8
- interface TextProps extends CommonProps {
8
+ export interface TextProps extends CommonProps {
9
9
  content: Map<string, string>;
10
10
  variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'li';
11
11
  className?: string;
12
12
  }
13
- interface MarkdownProps extends CommonProps {
13
+ export interface MarkdownProps extends CommonProps {
14
14
  content: Map<string, string>;
15
15
  className?: string;
16
16
  }
@@ -21,4 +21,3 @@ export declare const ComponentGenerators: {
21
21
  text: (props: TextProps) => ItemComponent;
22
22
  markdown: (props: MarkdownProps) => ItemComponent;
23
23
  };
24
- export {};
@@ -8,6 +8,7 @@ require('../survey-editor/component-editor.js');
8
8
  require('../types/item-properties.js');
9
9
 
10
10
  const text = (props) => {
11
+ var _a;
11
12
  const styles = [];
12
13
  if (props.className !== undefined) {
13
14
  styles.push({
@@ -20,7 +21,7 @@ const text = (props) => {
20
21
  });
21
22
  }
22
23
  return {
23
- key: surveys_utils_randomKeyGenerator.generateRandomKey(3),
24
+ key: (_a = props.key) !== null && _a !== void 0 ? _a : surveys_utils_randomKeyGenerator.generateRandomKey(3),
24
25
  role: 'text',
25
26
  style: styles.length > 0 ? styles : undefined,
26
27
  content: surveys_utils_simpleGenerators.generateLocStrings(props.content),
@@ -28,6 +29,7 @@ const text = (props) => {
28
29
  };
29
30
  };
30
31
  const markdown = (props) => {
32
+ var _a;
31
33
  const styles = [];
32
34
  if (props.className !== undefined) {
33
35
  styles.push({
@@ -35,7 +37,7 @@ const markdown = (props) => {
35
37
  });
36
38
  }
37
39
  return {
38
- key: surveys_utils_randomKeyGenerator.generateRandomKey(3),
40
+ key: (_a = props.key) !== null && _a !== void 0 ? _a : surveys_utils_randomKeyGenerator.generateRandomKey(3),
39
41
  role: 'markdown',
40
42
  style: styles.length > 0 ? styles : undefined,
41
43
  content: surveys_utils_simpleGenerators.generateLocStrings(props.content),
@@ -1 +1 @@
1
- {"version":3,"file":"componentGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"componentGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}