case-editor-tools 1.0.0-beta.34 → 1.0.0-beta.38

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.
Files changed (32) hide show
  1. package/constants/key-definitions.d.ts +2 -0
  2. package/constants/key-definitions.js +5 -1
  3. package/constants/key-definitions.js.map +1 -1
  4. package/expression-utils/studyEngineExpressions.d.ts +3 -0
  5. package/expression-utils/studyEngineExpressions.js +5 -0
  6. package/expression-utils/studyEngineExpressions.js.map +1 -1
  7. package/{item-editor-c6933791.js → item-editor-59f51ecc.js} +4 -1
  8. package/{item-editor-c6933791.js.map → item-editor-59f51ecc.js.map} +1 -1
  9. package/package.json +4 -4
  10. package/surveys/index.js +1 -1
  11. package/surveys/responseTypeGenerators/optionGroupComponents.js +3 -0
  12. package/surveys/responseTypeGenerators/optionGroupComponents.js.map +1 -1
  13. package/surveys/survey-editor/item-editor.d.ts +2 -1
  14. package/surveys/survey-editor/item-editor.js +1 -1
  15. package/surveys/survey-editor/survey-editor.js +1 -1
  16. package/surveys/survey-engine-expressions.d.ts +3 -0
  17. package/surveys/survey-engine-expressions.js +5 -0
  18. package/surveys/survey-engine-expressions.js.map +1 -1
  19. package/surveys/survey-items.d.ts +3 -1
  20. package/surveys/survey-items.js +73 -4
  21. package/surveys/survey-items.js.map +1 -1
  22. package/surveys/types/group.js +1 -1
  23. package/surveys/types/index.js +1 -1
  24. package/surveys/types/item-properties.d.ts +26 -1
  25. package/surveys/types/survey-definition.js +1 -1
  26. package/surveys/utils/optionDefGenerators.d.ts +13 -1
  27. package/surveys/utils/optionDefGenerators.js +35 -1
  28. package/surveys/utils/optionDefGenerators.js.map +1 -1
  29. package/surveys/utils/simple-generators.js +2 -2
  30. package/surveys/utils/simple-question-editor.d.ts +2 -2
  31. package/surveys/utils/simple-question-editor.js +3 -2
  32. package/surveys/utils/simple-question-editor.js.map +1 -1
@@ -10,5 +10,7 @@ export declare const sliderCategoricalKey = "scc";
10
10
  export declare const inputKey = "ic";
11
11
  export declare const numericInputKey = "num";
12
12
  export declare const datePickerKey = "date";
13
+ export declare const timeInputKey = "time";
13
14
  export declare const matrixKey = "mat";
14
15
  export declare const clozeKey = "cloze";
16
+ export declare const consentKey = "con";
@@ -14,10 +14,13 @@ const sliderCategoricalKey = "scc";
14
14
  const inputKey = "ic";
15
15
  const numericInputKey = "num";
16
16
  const datePickerKey = "date";
17
+ const timeInputKey = "time";
17
18
  const matrixKey = "mat";
18
- const clozeKey = "cloze";
19
+ const clozeKey = "cloze";
20
+ const consentKey = "con";
19
21
 
20
22
  exports.clozeKey = clozeKey;
23
+ exports.consentKey = consentKey;
21
24
  exports.datePickerKey = datePickerKey;
22
25
  exports.dropDownKey = dropDownKey;
23
26
  exports.inputKey = inputKey;
@@ -31,4 +34,5 @@ exports.responsiveBipolarLikertArrayKey = responsiveBipolarLikertArrayKey;
31
34
  exports.responsiveSingleChoiceArrayKey = responsiveSingleChoiceArrayKey;
32
35
  exports.singleChoiceKey = singleChoiceKey;
33
36
  exports.sliderCategoricalKey = sliderCategoricalKey;
37
+ exports.timeInputKey = timeInputKey;
34
38
  //# sourceMappingURL=key-definitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"key-definitions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"key-definitions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -86,6 +86,9 @@ export declare const StudyEngine: {
86
86
  none: (itemKey: string, ...optionKeys: string[]) => Expression;
87
87
  all: (itemKey: string, ...optionKeys: string[]) => Expression;
88
88
  };
89
+ consent: {
90
+ accepted: (itemKey: string) => Expression;
91
+ };
89
92
  survey: {
90
93
  isActive: (surveyKey: string) => Expression;
91
94
  validFromOlderThan: (surveyKey: string, delta: Duration, reference?: number | Expression | undefined) => Expression;
@@ -288,6 +288,9 @@ const multipleChoiceOptionsSelected = (itemKey, ...optionKeys) => expressionUtil
288
288
  const multipleChoiceAllOfTheseSelected = (itemKey, ...optionKeys) => and(...optionKeys.map(option => expressionUtils_expressionGen.generateExpression('responseHasKeysAny', undefined, itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.multipleChoiceKey].join('.'), option)));
289
289
  const multipleChoiceOnlyOtherKeysSelected = (itemKey, ...optionKeys) => expressionUtils_expressionGen.generateExpression('responseHasOnlyKeysOtherThan', undefined, itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.multipleChoiceKey].join('.'), ...optionKeys);
290
290
  const singleChoiceOnlyOtherOptionSelected = (itemKey, ...optionKeys) => expressionUtils_expressionGen.generateExpression('responseHasOnlyKeysOtherThan', undefined, itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.singleChoiceKey].join('.'), ...optionKeys);
291
+ const consentAcceptedCondition = (itemKey) => {
292
+ return hasResponseKey(itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.consentKey].join('.'));
293
+ };
291
294
  const stopParticipation = () => UPDATE_STUDY_STATUS('inactive');
292
295
  const finishParticipation = () => UPDATE_STUDY_STATUS('finished');
293
296
  /**
@@ -409,6 +412,8 @@ const StudyEngine = Object.assign(Object.assign(Object.assign({}, NativeStudyEng
409
412
  any: multipleChoiceOptionsSelected,
410
413
  none: multipleChoiceOnlyOtherKeysSelected,
411
414
  all: multipleChoiceAllOfTheseSelected,
415
+ }, consent: {
416
+ accepted: consentAcceptedCondition,
412
417
  }, survey: {
413
418
  isActive: hasSurveyKeyActive,
414
419
  validFromOlderThan: hasSurveyKeyValidFromOlderThan,
@@ -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-c6933791.js.map
542
+ //# sourceMappingURL=item-editor-59f51ecc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"item-editor-c6933791.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,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AAC,kBAAkB;AACpE,0DAA4B,GAAG,8BAA8B,CAAC,oBAAoB,CAAC;oCAClD,GAAG,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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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simplify survey and study coding for CASE.",
4
- "version": "1.0.0-beta.34",
4
+ "version": "1.0.0-beta.38",
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.61.1",
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.1",
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.0.4"
23
+ "survey-engine": "^1.1.3"
24
24
  }
25
25
  }
package/surveys/index.js CHANGED
@@ -6,7 +6,7 @@ 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-c6933791.js');
9
+ require('../item-editor-59f51ecc.js');
10
10
  require('./utils/randomKeyGenerator.js');
11
11
  require('../logger/logger.js');
12
12
  require('./utils/componentGenerators.js');
@@ -32,6 +32,9 @@ const optionDefToItemComponent = (optionDef) => {
32
32
  case 'numberInput':
33
33
  optEditor.setDType('number');
34
34
  break;
35
+ case 'timeInput':
36
+ optEditor.setDType('number');
37
+ break;
35
38
  }
36
39
  if (optionDef.displayCondition) {
37
40
  optEditor.setDisplayCondition(optionDef.displayCondition);
@@ -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-c6933791.js');
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-c6933791.js');
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');
@@ -64,6 +64,9 @@ export declare const SurveyEngine: {
64
64
  getNumValue: (itemKey: string, optionKey: string) => Expression;
65
65
  regexCheck: (itemKey: string, optionKey: string, pattern: string) => Expression;
66
66
  };
67
+ consentQuestion: {
68
+ accepted: (itemKey: string) => Expression;
69
+ };
67
70
  textInput: {
68
71
  regexCheck: (itemKey: string, pattern: string) => Expression;
69
72
  };
@@ -360,6 +360,9 @@ const textInputRegexCheck = (itemKey, pattern) => {
360
360
  const multilineTextInputRegexCheck = (itemKey, pattern) => {
361
361
  return checkResponseValueWithRegex(itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.inputKey].join('.'), pattern);
362
362
  };
363
+ const consentAcceptedCondition = (itemKey) => {
364
+ return hasResponse(itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.consentKey].join('.'));
365
+ };
363
366
  const NativeSurveyEngineExpressions = {
364
367
  getters: {
365
368
  // root data reference:
@@ -426,6 +429,8 @@ const SurveyEngine = Object.assign(Object.assign({}, NativeSurveyEngineExpressio
426
429
  getDateValue: multipleChoiceGetNumOptionValue,
427
430
  getNumValue: multipleChoiceGetNumOptionValue,
428
431
  regexCheck: mulitpleChoiceTextInputRegexCheck,
432
+ }, consentQuestion: {
433
+ accepted: consentAcceptedCondition,
429
434
  }, textInput: {
430
435
  regexCheck: textInputRegexCheck,
431
436
  }, multilineTextInput: {
@@ -1 +1 @@
1
- {"version":3,"file":"survey-engine-expressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"survey-engine-expressions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { ItemGroupComponent, Expression, ItemComponent, SurveyItem, ExpressionArg, ResponseComponent } from "survey-engine/data_types";
2
- import { ClozeQuestionProps, DateInputQuestionProps, GenericQuestionProps, MultiLineTextInput, NumericInputQuestionProps, OptionDef, ResponsiveBipolarLikertArrayQuestionProps, ResponsiveSingleChoiceArrayQuestionProps, TextInputQuestionProps } from "./types/item-properties";
2
+ import { ClozeQuestionProps, ConsentQuestionProps, DateInputQuestionProps, GenericQuestionProps, MultiLineTextInput, NumericInputQuestionProps, OptionDef, ResponsiveBipolarLikertArrayQuestionProps, ResponsiveSingleChoiceArrayQuestionProps, TextInputQuestionProps, TimeInputQuestionProps } from "./types/item-properties";
3
3
  import { LikertGroupRow } from "./responseTypeGenerators/likertGroupComponents";
4
4
  interface OptionQuestionProps extends GenericQuestionProps {
5
5
  responseOptions: Array<OptionDef>;
@@ -45,11 +45,13 @@ interface EQ5DHealthSliderProps {
45
45
  }
46
46
  export declare const initEQ5DHealthIndicatorQuestion: (props: EQ5DHealthSliderProps) => ItemGroupComponent;
47
47
  export declare const SurveyItems: {
48
+ consent: (props: ConsentQuestionProps) => SurveyItem;
48
49
  singleChoice: (props: OptionQuestionProps) => SurveyItem;
49
50
  responsiveSingleChoiceArray: (props: ResponsiveSingleChoiceArrayQuestionProps) => SurveyItem;
50
51
  responsiveBipolarLikertArray: (props: ResponsiveBipolarLikertArrayQuestionProps) => SurveyItem;
51
52
  multipleChoice: (props: OptionQuestionProps) => SurveyItem;
52
53
  dateInput: (props: DateInputQuestionProps) => SurveyItem;
54
+ timeInput: (props: TimeInputQuestionProps) => SurveyItem;
53
55
  textInput: (props: TextInputQuestionProps) => SurveyItem;
54
56
  clozeQuestion: (props: ClozeQuestionProps) => SurveyItem;
55
57
  numericInput: (props: NumericInputQuestionProps) => SurveyItem;
@@ -3,22 +3,22 @@
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-c6933791.js');
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');
10
10
  var surveys_utils_simpleGenerators = require('./utils/simple-generators.js');
11
11
  var surveys_utils_simpleQuestionEditor = require('./utils/simple-question-editor.js');
12
12
  var surveys_surveyEngineExpressions = require('./survey-engine-expressions.js');
13
+ var surveys_types_itemProperties = require('./types/item-properties.js');
13
14
  var surveys_responseTypeGenerators_optionGroupComponents = require('./responseTypeGenerators/optionGroupComponents.js');
14
15
  var surveys_responseTypeGenerators_likertGroupComponents = require('./responseTypeGenerators/likertGroupComponents.js');
15
16
  require('./utils/randomKeyGenerator.js');
16
17
  require('../logger/logger.js');
17
- require('./types/item-properties.js');
18
18
  require('../expression-utils/expressionGen.js');
19
19
 
20
20
  const commonQuestionGenerator = (props, rg_inner) => {
21
- 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);
22
22
  // QUESTION TEXT
23
23
  simpleEditor.setTitle(props.questionText, props.questionSubText, props.titleClassName);
24
24
  if (props.condition) {
@@ -159,6 +159,36 @@ const generateDatePickerInput = (props) => {
159
159
  };
160
160
  return commonQuestionGenerator(props, rg_inner);
161
161
  };
162
+ const generateTimeInput = (props) => {
163
+ const style = [];
164
+ if (props.minTime) {
165
+ style.push({
166
+ key: 'minTime', value: props.minTime,
167
+ });
168
+ }
169
+ if (props.maxTime) {
170
+ style.push({
171
+ key: 'maxTime', value: props.maxTime,
172
+ });
173
+ }
174
+ if (props.defaultValue) {
175
+ style.push({
176
+ key: 'defaultValue', value: props.defaultValue,
177
+ });
178
+ }
179
+ if (props.labelBehindInput) {
180
+ style.push({ key: 'labelPlacement', value: 'after' });
181
+ }
182
+ const rg_inner = {
183
+ key: constants_keyDefinitions.timeInputKey, role: 'timeInput',
184
+ properties: {
185
+ stepSize: props.step,
186
+ },
187
+ content: props.inputLabelText ? surveys_utils_simpleGenerators.generateLocStrings(props.inputLabelText) : undefined,
188
+ style: style.length > 0 ? style : undefined,
189
+ };
190
+ return commonQuestionGenerator(props, rg_inner);
191
+ };
162
192
  const generateTextInputQuestion = (props) => {
163
193
  const style = [];
164
194
  if (props.maxLength !== undefined) {
@@ -179,6 +209,43 @@ const generateTextInputQuestion = (props) => {
179
209
  };
180
210
  return commonQuestionGenerator(props, rg_inner);
181
211
  };
212
+ const generateConsentQuestion = (props) => {
213
+ const style = props.className ? [{ key: 'className', value: props.className }] : undefined;
214
+ const rg_inner = {
215
+ key: constants_keyDefinitions.consentKey, role: 'consent',
216
+ items: [
217
+ {
218
+ key: 'label', role: 'label',
219
+ content: !Array.isArray(props.checkBoxLabel) ? surveys_utils_simpleGenerators.generateLocStrings(props.checkBoxLabel) : undefined,
220
+ items: Array.isArray(props.checkBoxLabel) ? props.checkBoxLabel.map((item, index) => {
221
+ if (surveys_types_itemProperties.isDateDisplayComponentProp(item)) {
222
+ return surveys_utils_simpleGenerators.generateDateDisplayComp(index.toFixed(), item);
223
+ }
224
+ return {
225
+ key: index.toFixed(),
226
+ role: 'text',
227
+ content: surveys_utils_simpleGenerators.generateLocStrings(item.content),
228
+ style: item.className ? [{ key: 'className', value: item.className }] : undefined
229
+ };
230
+ }) : undefined,
231
+ },
232
+ {
233
+ key: 'title', role: 'title', content: surveys_utils_simpleGenerators.generateLocStrings(props.dialogTitle)
234
+ },
235
+ {
236
+ key: 'content', role: 'content', content: surveys_utils_simpleGenerators.generateLocStrings(props.dialogContent)
237
+ },
238
+ {
239
+ key: 'acceptBtn', role: 'acceptBtn', content: surveys_utils_simpleGenerators.generateLocStrings(props.acceptBtn)
240
+ },
241
+ {
242
+ key: 'rejectBtn', role: 'rejectBtn', content: surveys_utils_simpleGenerators.generateLocStrings(props.rejectBtn)
243
+ },
244
+ ],
245
+ style: style,
246
+ };
247
+ return commonQuestionGenerator(props, rg_inner);
248
+ };
182
249
  const generateMultilineInput = (props) => {
183
250
  const rg_inner = {
184
251
  key: constants_keyDefinitions.inputKey, role: 'multilineTextInput',
@@ -208,7 +275,7 @@ const generateCustomQuestion = (props) => {
208
275
  const rg_inner = Object.assign(Object.assign({}, item), { role: role });
209
276
  items.push(rg_inner);
210
277
  });
211
- const simpleEditor = new surveys_utils_simpleQuestionEditor.SimpleQuestionEditor(props.parentKey, props.itemKey, props.version ? props.version : 1);
278
+ const simpleEditor = new surveys_utils_simpleQuestionEditor.SimpleQuestionEditor(props.parentKey, props.itemKey, props.version ? props.version : 1, props.confidentialMode);
212
279
  // QUESTION TEXT
213
280
  simpleEditor.setTitle(props.questionText, props.questionSubText, props.titleClassName);
214
281
  if (props.condition) {
@@ -278,11 +345,13 @@ const initEQ5DHealthIndicatorQuestion = (props) => {
278
345
  return groupEdit.getComponent();
279
346
  };
280
347
  const SurveyItems = {
348
+ consent: generateConsentQuestion,
281
349
  singleChoice: generateSingleChoiceQuestion,
282
350
  responsiveSingleChoiceArray: generateResponsiveSingleChoiceArrayQuestion,
283
351
  responsiveBipolarLikertArray: generateResponsiveBipolarLikertArray,
284
352
  multipleChoice: generateMultipleChoiceQuestion,
285
353
  dateInput: generateDatePickerInput,
354
+ timeInput: generateTimeInput,
286
355
  textInput: generateTextInputQuestion,
287
356
  // eq5dSlider: todo,
288
357
  clozeQuestion: generateClozeQuestion,
@@ -1 +1 @@
1
- {"version":3,"file":"survey-items.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"survey-items.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,7 +3,7 @@
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-c6933791.js');
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');
@@ -7,7 +7,7 @@ var surveys_types_item = require('./item.js');
7
7
  var surveys_types_itemProperties = require('./item-properties.js');
8
8
  var surveys_types_surveyDefinition = require('./survey-definition.js');
9
9
  require('../../logger/logger.js');
10
- require('../../item-editor-c6933791.js');
10
+ require('../../item-editor-59f51ecc.js');
11
11
  require('../survey-editor/component-editor.js');
12
12
  require('../utils/randomKeyGenerator.js');
13
13
  require('../utils/simple-generators.js');
@@ -1,4 +1,4 @@
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>;
@@ -45,6 +45,7 @@ export interface GenericQuestionProps {
45
45
  isRequired?: boolean;
46
46
  footnoteText?: Map<string, string>;
47
47
  customValidations?: Array<Validation>;
48
+ confidentialMode?: ConfidentialMode;
48
49
  }
49
50
  /**
50
51
  * Numeric Input
@@ -74,6 +75,18 @@ export interface DateInputProps {
74
75
  };
75
76
  }
76
77
  export declare type DateInputQuestionProps = DateInputProps & GenericQuestionProps;
78
+ /**
79
+ * Time Input
80
+ */
81
+ export interface TimeInputProps {
82
+ inputLabelText?: Map<string, string>;
83
+ labelBehindInput?: boolean;
84
+ defaultValue?: string;
85
+ minTime?: string;
86
+ maxTime?: string;
87
+ step?: number;
88
+ }
89
+ export declare type TimeInputQuestionProps = TimeInputProps & GenericQuestionProps;
77
90
  /**
78
91
  * Text Input
79
92
  */
@@ -98,6 +111,18 @@ export interface ClozeProps {
98
111
  items: Array<OptionDef>;
99
112
  }
100
113
  export declare type ClozeQuestionProps = ClozeProps & GenericQuestionProps;
114
+ /**
115
+ * Consent Question
116
+ */
117
+ export interface ConsentProps {
118
+ checkBoxLabel: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>;
119
+ dialogTitle: Map<string, string>;
120
+ dialogContent: Map<string, string>;
121
+ acceptBtn: Map<string, string>;
122
+ rejectBtn: Map<string, string>;
123
+ className?: string;
124
+ }
125
+ export declare type ConsentQuestionProps = ConsentProps & GenericQuestionProps;
101
126
  /**
102
127
  * Response Single Choice Likert Array
103
128
  */
@@ -3,7 +3,7 @@
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-c6933791.js');
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');
@@ -1,5 +1,5 @@
1
1
  import { Expression } from "survey-engine/data_types";
2
- import { ClozeProps, DateInputProps, NumericInputProps, OptionDef, StyledTextComponentProp, TextInputProps } from "../types/item-properties";
2
+ import { ClozeProps, DateInputProps, NumericInputProps, OptionDef, StyledTextComponentProp, TextInputProps, TimeInputProps } from "../types/item-properties";
3
3
  interface CommonProps {
4
4
  key?: string;
5
5
  content?: Map<string, string> | StyledTextComponentProp[];
@@ -19,6 +19,10 @@ export declare const SingleChoiceOptionTypes: {
19
19
  key: string;
20
20
  displayCondition?: Expression;
21
21
  }) => OptionDef;
22
+ timeInput: (props: TimeInputProps & {
23
+ key: string;
24
+ displayCondition?: Expression;
25
+ }) => OptionDef;
22
26
  numberInput: (props: NumericInputProps & {
23
27
  key: string;
24
28
  displayCondition?: Expression;
@@ -35,6 +39,10 @@ export declare const MultipleChoiceOptionTypes: {
35
39
  key: string;
36
40
  displayCondition?: Expression;
37
41
  }) => OptionDef;
42
+ timeInput: (props: TimeInputProps & {
43
+ key: string;
44
+ displayCondition?: Expression;
45
+ }) => OptionDef;
38
46
  numberInput: (props: NumericInputProps & {
39
47
  key: string;
40
48
  displayCondition?: Expression;
@@ -55,6 +63,10 @@ export declare const ClozeItemTypes: {
55
63
  key: string;
56
64
  displayCondition?: Expression;
57
65
  }) => OptionDef;
66
+ timeInput: (props: TimeInputProps & {
67
+ key: string;
68
+ displayCondition?: Expression;
69
+ }) => OptionDef;
58
70
  clozeLineBreak: () => OptionDef;
59
71
  numberInput: (props: NumericInputProps & {
60
72
  key: string;
@@ -116,6 +116,37 @@ const dateInput = (props) => {
116
116
  displayCondition: props.displayCondition,
117
117
  };
118
118
  };
119
+ const timeInput = (props) => {
120
+ const style = [];
121
+ if (props.minTime) {
122
+ style.push({
123
+ key: 'minTime', value: props.minTime,
124
+ });
125
+ }
126
+ if (props.maxTime) {
127
+ style.push({
128
+ key: 'maxTime', value: props.maxTime,
129
+ });
130
+ }
131
+ if (props.defaultValue) {
132
+ style.push({
133
+ key: 'defaultValue', value: props.defaultValue,
134
+ });
135
+ }
136
+ if (props.labelBehindInput) {
137
+ style.push({ key: 'labelPlacement', value: 'after' });
138
+ }
139
+ return {
140
+ key: props.key,
141
+ role: 'timeInput',
142
+ optionProps: {
143
+ stepSize: props.step,
144
+ },
145
+ content: props.inputLabelText,
146
+ displayCondition: props.displayCondition,
147
+ style: style.length > 0 ? style : undefined,
148
+ };
149
+ };
119
150
  const dropDown = (props) => {
120
151
  return {
121
152
  key: props.key,
@@ -142,6 +173,7 @@ const SingleChoiceOptionTypes = {
142
173
  option,
143
174
  textInput,
144
175
  //dateInput,
176
+ timeInput,
145
177
  numberInput,
146
178
  cloze,
147
179
  };
@@ -149,7 +181,8 @@ const MultipleChoiceOptionTypes = {
149
181
  option,
150
182
  subtitle: multipleChoiceOptionSubtitle,
151
183
  textInput,
152
- // dateInput,
184
+ // dateInput
185
+ timeInput,
153
186
  numberInput,
154
187
  cloze,
155
188
  };
@@ -158,6 +191,7 @@ const ClozeItemTypes = {
158
191
  markdown,
159
192
  textInput,
160
193
  dateInput,
194
+ timeInput,
161
195
  clozeLineBreak,
162
196
  numberInput,
163
197
  dropDown,
@@ -1 +1 @@
1
- {"version":3,"file":"optionDefGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"optionDefGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -31,7 +31,7 @@ const generateDateDisplayComp = (key, item) => {
31
31
  item.languageCodes.forEach((code) => {
32
32
  const translatedItem = {
33
33
  code: code,
34
- parts: [{ exp: dateExp }]
34
+ parts: [{ dtype: 'exp', exp: dateExp }]
35
35
  };
36
36
  locString.push(translatedItem);
37
37
  });
@@ -39,7 +39,7 @@ const generateDateDisplayComp = (key, item) => {
39
39
  key: key,
40
40
  role: 'dateDisplay',
41
41
  content: locString,
42
- style: item.className ? [{ key: 'className', value: item.className }] : undefined
42
+ style: styleArray,
43
43
  };
44
44
  };
45
45
  const generateTitleComponent = (content, description, className) => {
@@ -1,10 +1,10 @@
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
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
9
  setTitle(title: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>, description?: Map<string, string>, className?: string): void;
10
10
  setCondition(exp: Expression): void;
@@ -3,7 +3,7 @@
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-c6933791.js');
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');
@@ -11,11 +11,12 @@ require('../../logger/logger.js');
11
11
  require('../types/item-properties.js');
12
12
 
13
13
  class SimpleQuestionEditor {
14
- constructor(parentKey, key, version) {
14
+ constructor(parentKey, key, version, confidentialMode) {
15
15
  const itemKey = [parentKey, key].join('.');
16
16
  this.key = itemKey;
17
17
  this.editor = new surveys_surveyEditor_itemEditor.ItemEditor(undefined, { itemKey: itemKey, isGroup: false });
18
18
  this.editor.setVersion(version);
19
+ this.editor.setConfidentialMode(confidentialMode);
19
20
  }
20
21
  getItem() {
21
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}