case-editor-tools 1.0.0-beta.33 → 1.0.0-beta.37
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/constants/key-definitions.d.ts +1 -0
- package/constants/key-definitions.js +2 -0
- package/constants/key-definitions.js.map +1 -1
- package/{item-editor-c6933791.js → item-editor-59f51ecc.js} +4 -1
- package/{item-editor-c6933791.js.map → item-editor-59f51ecc.js.map} +1 -1
- package/package.json +4 -4
- package/surveys/index.js +2 -1
- package/surveys/index.js.map +1 -1
- package/surveys/responseTypeGenerators/likertGroupComponents.js +1 -0
- package/surveys/responseTypeGenerators/likertGroupComponents.js.map +1 -1
- package/surveys/responseTypeGenerators/matrixGroupComponent.js +1 -0
- package/surveys/responseTypeGenerators/matrixGroupComponent.js.map +1 -1
- package/surveys/responseTypeGenerators/optionGroupComponents.js +4 -0
- package/surveys/responseTypeGenerators/optionGroupComponents.js.map +1 -1
- package/surveys/survey-editor/item-editor.d.ts +2 -1
- package/surveys/survey-editor/item-editor.js +1 -1
- package/surveys/survey-editor/survey-editor.js +1 -1
- package/surveys/survey-items.d.ts +2 -1
- package/surveys/survey-items.js +35 -3
- package/surveys/survey-items.js.map +1 -1
- package/surveys/types/group.js +2 -1
- package/surveys/types/group.js.map +1 -1
- package/surveys/types/index.js +3 -1
- package/surveys/types/index.js.map +1 -1
- package/surveys/types/item-properties.d.ts +22 -2
- package/surveys/types/item-properties.js +7 -0
- package/surveys/types/item-properties.js.map +1 -1
- package/surveys/types/survey-definition.js +2 -1
- package/surveys/types/survey-definition.js.map +1 -1
- package/surveys/utils/componentGenerators.js +1 -0
- package/surveys/utils/componentGenerators.js.map +1 -1
- package/surveys/utils/optionDefGenerators.d.ts +13 -1
- package/surveys/utils/optionDefGenerators.js +35 -1
- package/surveys/utils/optionDefGenerators.js.map +1 -1
- package/surveys/utils/simple-generators.d.ts +3 -2
- package/surveys/utils/simple-generators.js +29 -0
- package/surveys/utils/simple-generators.js.map +1 -1
- package/surveys/utils/simple-question-editor.d.ts +4 -4
- package/surveys/utils/simple-question-editor.js +4 -2
- package/surveys/utils/simple-question-editor.js.map +1 -1
|
@@ -10,5 +10,6 @@ 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";
|
|
@@ -14,6 +14,7 @@ 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
19
|
const clozeKey = "cloze";
|
|
19
20
|
|
|
@@ -31,4 +32,5 @@ exports.responsiveBipolarLikertArrayKey = responsiveBipolarLikertArrayKey;
|
|
|
31
32
|
exports.responsiveSingleChoiceArrayKey = responsiveSingleChoiceArrayKey;
|
|
32
33
|
exports.singleChoiceKey = singleChoiceKey;
|
|
33
34
|
exports.sliderCategoricalKey = sliderCategoricalKey;
|
|
35
|
+
exports.timeInputKey = timeInputKey;
|
|
34
36
|
//# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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-
|
|
542
|
+
//# sourceMappingURL=item-editor-59f51ecc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-editor-
|
|
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":"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"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "case-editor-tools",
|
|
3
3
|
"description": "Javascript tools to simplify survey and study coding for CASE.",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.37",
|
|
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.
|
|
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.
|
|
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.
|
|
23
|
+
"survey-engine": "^1.1.3"
|
|
24
24
|
}
|
|
25
25
|
}
|
package/surveys/index.js
CHANGED
|
@@ -6,11 +6,12 @@ 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-
|
|
9
|
+
require('../item-editor-59f51ecc.js');
|
|
10
10
|
require('./utils/randomKeyGenerator.js');
|
|
11
11
|
require('../logger/logger.js');
|
|
12
12
|
require('./utils/componentGenerators.js');
|
|
13
13
|
require('./utils/simple-generators.js');
|
|
14
|
+
require('./types/item-properties.js');
|
|
14
15
|
require('../types/duration.js');
|
|
15
16
|
require('../constants/key-definitions.js');
|
|
16
17
|
require('./utils/simple-question-editor.js');
|
package/surveys/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var surveys_surveyEditor_componentEditor = require('../survey-editor/component-editor.js');
|
|
6
6
|
var surveys_utils_randomKeyGenerator = require('../utils/randomKeyGenerator.js');
|
|
7
7
|
var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
|
|
8
|
+
require('../types/item-properties.js');
|
|
8
9
|
|
|
9
10
|
const initLikertScaleGroup = (key, rows, scaleOptions, stackOnSmallScreen, displayCondition) => {
|
|
10
11
|
const groupEdit = new surveys_surveyEditor_componentEditor.ComponentEditor(undefined, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"likertGroupComponents.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"likertGroupComponents.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var surveys_surveyEditor_componentEditor = require('../survey-editor/component-editor.js');
|
|
6
6
|
var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
|
|
7
|
+
require('../types/item-properties.js');
|
|
7
8
|
require('../utils/randomKeyGenerator.js');
|
|
8
9
|
|
|
9
10
|
const initMatrixQuestion = (key, rows, order) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrixGroupComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"matrixGroupComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var surveys_surveyEditor_componentEditor = require('../survey-editor/component-editor.js');
|
|
6
6
|
var surveys_utils_simpleGenerators = require('../utils/simple-generators.js');
|
|
7
|
+
require('../types/item-properties.js');
|
|
7
8
|
require('../utils/randomKeyGenerator.js');
|
|
8
9
|
|
|
9
10
|
const optionDefToItemComponent = (optionDef) => {
|
|
@@ -31,6 +32,9 @@ const optionDefToItemComponent = (optionDef) => {
|
|
|
31
32
|
case 'numberInput':
|
|
32
33
|
optEditor.setDType('number');
|
|
33
34
|
break;
|
|
35
|
+
case 'timeInput':
|
|
36
|
+
optEditor.setDType('number');
|
|
37
|
+
break;
|
|
34
38
|
}
|
|
35
39
|
if (optionDef.displayCondition) {
|
|
36
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-
|
|
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-
|
|
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');
|
|
@@ -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, 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>;
|
|
@@ -50,6 +50,7 @@ export declare const SurveyItems: {
|
|
|
50
50
|
responsiveBipolarLikertArray: (props: ResponsiveBipolarLikertArrayQuestionProps) => SurveyItem;
|
|
51
51
|
multipleChoice: (props: OptionQuestionProps) => SurveyItem;
|
|
52
52
|
dateInput: (props: DateInputQuestionProps) => SurveyItem;
|
|
53
|
+
timeInput: (props: TimeInputQuestionProps) => SurveyItem;
|
|
53
54
|
textInput: (props: TextInputQuestionProps) => SurveyItem;
|
|
54
55
|
clozeQuestion: (props: ClozeQuestionProps) => SurveyItem;
|
|
55
56
|
numericInput: (props: NumericInputQuestionProps) => SurveyItem;
|
package/surveys/survey-items.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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-
|
|
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');
|
|
@@ -14,10 +14,11 @@ var surveys_responseTypeGenerators_optionGroupComponents = require('./responseTy
|
|
|
14
14
|
var surveys_responseTypeGenerators_likertGroupComponents = require('./responseTypeGenerators/likertGroupComponents.js');
|
|
15
15
|
require('./utils/randomKeyGenerator.js');
|
|
16
16
|
require('../logger/logger.js');
|
|
17
|
+
require('./types/item-properties.js');
|
|
17
18
|
require('../expression-utils/expressionGen.js');
|
|
18
19
|
|
|
19
20
|
const commonQuestionGenerator = (props, rg_inner) => {
|
|
20
|
-
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);
|
|
21
22
|
// QUESTION TEXT
|
|
22
23
|
simpleEditor.setTitle(props.questionText, props.questionSubText, props.titleClassName);
|
|
23
24
|
if (props.condition) {
|
|
@@ -158,6 +159,36 @@ const generateDatePickerInput = (props) => {
|
|
|
158
159
|
};
|
|
159
160
|
return commonQuestionGenerator(props, rg_inner);
|
|
160
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
|
+
};
|
|
161
192
|
const generateTextInputQuestion = (props) => {
|
|
162
193
|
const style = [];
|
|
163
194
|
if (props.maxLength !== undefined) {
|
|
@@ -207,7 +238,7 @@ const generateCustomQuestion = (props) => {
|
|
|
207
238
|
const rg_inner = Object.assign(Object.assign({}, item), { role: role });
|
|
208
239
|
items.push(rg_inner);
|
|
209
240
|
});
|
|
210
|
-
const simpleEditor = new surveys_utils_simpleQuestionEditor.SimpleQuestionEditor(props.parentKey, props.itemKey, props.version ? props.version : 1);
|
|
241
|
+
const simpleEditor = new surveys_utils_simpleQuestionEditor.SimpleQuestionEditor(props.parentKey, props.itemKey, props.version ? props.version : 1, props.confidentialMode);
|
|
211
242
|
// QUESTION TEXT
|
|
212
243
|
simpleEditor.setTitle(props.questionText, props.questionSubText, props.titleClassName);
|
|
213
244
|
if (props.condition) {
|
|
@@ -282,6 +313,7 @@ const SurveyItems = {
|
|
|
282
313
|
responsiveBipolarLikertArray: generateResponsiveBipolarLikertArray,
|
|
283
314
|
multipleChoice: generateMultipleChoiceQuestion,
|
|
284
315
|
dateInput: generateDatePickerInput,
|
|
316
|
+
timeInput: generateTimeInput,
|
|
285
317
|
textInput: generateTextInputQuestion,
|
|
286
318
|
// eq5dSlider: todo,
|
|
287
319
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/surveys/types/group.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
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-
|
|
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');
|
|
10
|
+
require('./item-properties.js');
|
|
10
11
|
|
|
11
12
|
class Group {
|
|
12
13
|
constructor(parentKey, groupKey, selectionMethod) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"group.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/surveys/types/index.js
CHANGED
|
@@ -4,9 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var surveys_types_group = require('./group.js');
|
|
6
6
|
var surveys_types_item = require('./item.js');
|
|
7
|
+
var surveys_types_itemProperties = require('./item-properties.js');
|
|
7
8
|
var surveys_types_surveyDefinition = require('./survey-definition.js');
|
|
8
9
|
require('../../logger/logger.js');
|
|
9
|
-
require('../../item-editor-
|
|
10
|
+
require('../../item-editor-59f51ecc.js');
|
|
10
11
|
require('../survey-editor/component-editor.js');
|
|
11
12
|
require('../utils/randomKeyGenerator.js');
|
|
12
13
|
require('../utils/simple-generators.js');
|
|
@@ -16,5 +17,6 @@ require('../survey-editor/survey-editor.js');
|
|
|
16
17
|
|
|
17
18
|
exports.Group = surveys_types_group.Group;
|
|
18
19
|
exports.Item = surveys_types_item.Item;
|
|
20
|
+
exports.isDateDisplayComponentProp = surveys_types_itemProperties.isDateDisplayComponentProp;
|
|
19
21
|
exports.SurveyDefinition = surveys_types_surveyDefinition.SurveyDefinition;
|
|
20
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,16 @@
|
|
|
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>;
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
|
+
export interface DateDisplayComponentProp {
|
|
8
|
+
languageCodes: string[];
|
|
9
|
+
date: Expression;
|
|
10
|
+
dateFormat: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const isDateDisplayComponentProp: (value: DateDisplayComponentProp | any) => value is DateDisplayComponentProp;
|
|
7
14
|
export interface OptionDef {
|
|
8
15
|
key: string;
|
|
9
16
|
role: string;
|
|
@@ -22,7 +29,7 @@ export interface GenericQuestionProps {
|
|
|
22
29
|
parentKey: string;
|
|
23
30
|
itemKey: string;
|
|
24
31
|
version?: number;
|
|
25
|
-
questionText: Map<string, string> | Array<StyledTextComponentProp>;
|
|
32
|
+
questionText: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>;
|
|
26
33
|
questionSubText?: Map<string, string>;
|
|
27
34
|
titleClassName?: string;
|
|
28
35
|
helpGroupContent?: Array<{
|
|
@@ -38,6 +45,7 @@ export interface GenericQuestionProps {
|
|
|
38
45
|
isRequired?: boolean;
|
|
39
46
|
footnoteText?: Map<string, string>;
|
|
40
47
|
customValidations?: Array<Validation>;
|
|
48
|
+
confidentialMode?: ConfidentialMode;
|
|
41
49
|
}
|
|
42
50
|
/**
|
|
43
51
|
* Numeric Input
|
|
@@ -67,6 +75,18 @@ export interface DateInputProps {
|
|
|
67
75
|
};
|
|
68
76
|
}
|
|
69
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;
|
|
70
90
|
/**
|
|
71
91
|
* Text Input
|
|
72
92
|
*/
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const isDateDisplayComponentProp = (value) => {
|
|
6
|
+
return typeof (value) === 'object' && value.date !== undefined && value.dateFormat !== undefined && value.languageCodes !== undefined;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
exports.isDateDisplayComponentProp = isDateDisplayComponentProp;
|
|
3
10
|
//# sourceMappingURL=item-properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-properties.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"item-properties.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -3,11 +3,12 @@
|
|
|
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-
|
|
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');
|
|
10
10
|
require('../utils/randomKeyGenerator.js');
|
|
11
|
+
require('./item-properties.js');
|
|
11
12
|
|
|
12
13
|
class SurveyDefinition {
|
|
13
14
|
constructor(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"survey-definition.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"survey-definition.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var surveys_utils_randomKeyGenerator = require('./randomKeyGenerator.js');
|
|
6
6
|
var surveys_utils_simpleGenerators = require('./simple-generators.js');
|
|
7
7
|
require('../survey-editor/component-editor.js');
|
|
8
|
+
require('../types/item-properties.js');
|
|
8
9
|
|
|
9
10
|
const text = (props) => {
|
|
10
11
|
const styles = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"componentGenerators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LocalizedString, ItemComponent, ExpressionName, Expression, ItemGroupComponent, SurveySingleItem } from "survey-engine/data_types";
|
|
2
|
-
import { StyledTextComponentProp } from "../types/item-properties";
|
|
2
|
+
import { DateDisplayComponentProp, StyledTextComponentProp } from "../types/item-properties";
|
|
3
3
|
export declare const generateLocStrings: (translations: Map<string, string>) => LocalizedString[];
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const generateDateDisplayComp: (key: string, item: DateDisplayComponentProp) => ItemComponent;
|
|
5
|
+
export declare const generateTitleComponent: (content: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>, description?: Map<string, string> | undefined, className?: string | undefined) => ItemComponent;
|
|
5
6
|
export declare const generateHelpGroupComponent: (items: Array<{
|
|
6
7
|
content: Map<string, string>;
|
|
7
8
|
style?: Array<{
|
|
@@ -3,6 +3,7 @@
|
|
|
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_types_itemProperties = require('../types/item-properties.js');
|
|
6
7
|
var surveys_utils_randomKeyGenerator = require('./randomKeyGenerator.js');
|
|
7
8
|
|
|
8
9
|
const generateLocStrings = (translations) => {
|
|
@@ -17,11 +18,38 @@ const generateLocStrings = (translations) => {
|
|
|
17
18
|
});
|
|
18
19
|
return locString;
|
|
19
20
|
};
|
|
21
|
+
const generateDateDisplayComp = (key, item) => {
|
|
22
|
+
// console.log(translations);
|
|
23
|
+
const styleArray = [
|
|
24
|
+
{ key: 'dateFormat', value: item.dateFormat }
|
|
25
|
+
];
|
|
26
|
+
if (item.className) {
|
|
27
|
+
styleArray.push({ key: 'className', value: item.className });
|
|
28
|
+
}
|
|
29
|
+
const locString = new Array();
|
|
30
|
+
const dateExp = item.date;
|
|
31
|
+
item.languageCodes.forEach((code) => {
|
|
32
|
+
const translatedItem = {
|
|
33
|
+
code: code,
|
|
34
|
+
parts: [{ dtype: 'exp', exp: dateExp }]
|
|
35
|
+
};
|
|
36
|
+
locString.push(translatedItem);
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
key: key,
|
|
40
|
+
role: 'dateDisplay',
|
|
41
|
+
content: locString,
|
|
42
|
+
style: styleArray,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
20
45
|
const generateTitleComponent = (content, description, className) => {
|
|
21
46
|
let items = undefined;
|
|
22
47
|
let currentContent = undefined;
|
|
23
48
|
if (Array.isArray(content)) {
|
|
24
49
|
items = content.map((item, index) => {
|
|
50
|
+
if (surveys_types_itemProperties.isDateDisplayComponentProp(item)) {
|
|
51
|
+
return generateDateDisplayComp(index.toFixed(), item);
|
|
52
|
+
}
|
|
25
53
|
return {
|
|
26
54
|
key: index.toFixed(),
|
|
27
55
|
role: 'text',
|
|
@@ -95,6 +123,7 @@ const generatePageBreak = (parentKey, key) => {
|
|
|
95
123
|
};
|
|
96
124
|
|
|
97
125
|
exports.expWithArgs = expWithArgs;
|
|
126
|
+
exports.generateDateDisplayComp = generateDateDisplayComp;
|
|
98
127
|
exports.generateHelpGroupComponent = generateHelpGroupComponent;
|
|
99
128
|
exports.generateLocStrings = generateLocStrings;
|
|
100
129
|
exports.generatePageBreak = generatePageBreak;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-generators.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"simple-generators.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
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
|
-
import { StyledTextComponentProp } from "../types/item-properties";
|
|
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
|
-
setTitle(title: Map<string, string> | Array<StyledTextComponentProp>, description?: Map<string, string>, className?: string): void;
|
|
9
|
+
setTitle(title: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>, description?: Map<string, string>, className?: string): void;
|
|
10
10
|
setCondition(exp: Expression): void;
|
|
11
11
|
addDisplayComponent(comp: ItemComponent, atPosition?: number): void;
|
|
12
12
|
addHasResponseValidation(): void;
|
|
@@ -3,18 +3,20 @@
|
|
|
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-
|
|
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');
|
|
10
10
|
require('../../logger/logger.js');
|
|
11
|
+
require('../types/item-properties.js');
|
|
11
12
|
|
|
12
13
|
class SimpleQuestionEditor {
|
|
13
|
-
constructor(parentKey, key, version) {
|
|
14
|
+
constructor(parentKey, key, version, confidentialMode) {
|
|
14
15
|
const itemKey = [parentKey, key].join('.');
|
|
15
16
|
this.key = itemKey;
|
|
16
17
|
this.editor = new surveys_surveyEditor_itemEditor.ItemEditor(undefined, { itemKey: itemKey, isGroup: false });
|
|
17
18
|
this.editor.setVersion(version);
|
|
19
|
+
this.editor.setConfidentialMode(confidentialMode);
|
|
18
20
|
}
|
|
19
21
|
getItem() {
|
|
20
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|