case-editor-tools 1.0.0-beta.18 → 1.0.0-beta.19
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/expression-utils/expressionGen.d.ts +1 -1
- package/expression-utils/studyEngineExpressions.d.ts +1 -1
- package/{item-editor-7f825952.js → item-editor-c6933791.js} +61 -44
- package/item-editor-c6933791.js.map +1 -0
- package/package.json +4 -4
- package/surveys/index.js +1 -1
- package/surveys/responseTypeGenerators/likertGroupComponents.d.ts +1 -1
- package/surveys/responseTypeGenerators/matrixGroupComponent.d.ts +1 -1
- package/surveys/responseTypeGenerators/optionGroupComponents.d.ts +1 -1
- package/surveys/survey-editor/component-editor.d.ts +1 -1
- package/surveys/survey-editor/data-types.d.ts +1 -1
- package/surveys/survey-editor/item-editor.d.ts +1 -1
- package/surveys/survey-editor/item-editor.js +1 -1
- package/surveys/survey-editor/survey-editor.d.ts +6 -1
- package/surveys/survey-editor/survey-editor.js +9 -3
- package/surveys/survey-editor/survey-editor.js.map +1 -1
- package/surveys/survey-engine-expressions.d.ts +1 -1
- package/surveys/survey-items.d.ts +1 -1
- package/surveys/survey-items.js +1 -1
- package/surveys/types/group.d.ts +1 -1
- package/surveys/types/group.js +1 -1
- package/surveys/types/index.js +1 -1
- package/surveys/types/item-properties.d.ts +1 -1
- package/surveys/types/item.d.ts +1 -1
- package/surveys/types/survey-definition.d.ts +5 -2
- package/surveys/types/survey-definition.js +3 -1
- package/surveys/types/survey-definition.js.map +1 -1
- package/surveys/utils/componentGenerators.d.ts +1 -1
- package/surveys/utils/optionDefGenerators.d.ts +1 -1
- package/surveys/utils/simple-generators.d.ts +1 -1
- package/surveys/utils/simple-question-editor.d.ts +2 -2
- package/surveys/utils/simple-question-editor.js +1 -1
- package/types/expression.d.ts +1 -1
- package/types/study.d.ts +1 -1
- package/types/studyRules.d.ts +1 -1
- package/item-editor-7f825952.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Expression, ExpressionName } from "survey-engine/
|
|
1
|
+
import { Expression, ExpressionName } from "survey-engine/data_types";
|
|
2
2
|
export declare const generateExpression: (name: ExpressionName, returnType?: "string" | "float" | undefined, ...args: any[]) => Expression;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Expression } from "survey-engine/
|
|
1
|
+
import { Expression } from "survey-engine/data_types";
|
|
2
2
|
import { Duration } from "../types/duration";
|
|
3
3
|
export declare const NativeStudyEngineExpressions: {
|
|
4
4
|
checkEventType: (equalsType: 'ENTER' | 'SUBMIT' | 'TIMER') => Expression;
|
|
@@ -8,57 +8,74 @@ var data_types = {};
|
|
|
8
8
|
|
|
9
9
|
var expression = {};
|
|
10
10
|
|
|
11
|
-
Object.defineProperty(expression,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
Object.defineProperty(expression, '__esModule', { value: true });
|
|
12
|
+
|
|
13
|
+
const isExpression = (value) => {
|
|
14
|
+
return typeof (value) === 'object' && value.name !== undefined && value.name.length > 0;
|
|
15
|
+
};
|
|
16
|
+
const expressionArgParser = (arg) => {
|
|
17
|
+
switch (arg.dtype) {
|
|
18
|
+
case 'num':
|
|
19
|
+
return arg.num;
|
|
20
|
+
case 'str':
|
|
21
|
+
return arg.str;
|
|
22
|
+
case 'exp':
|
|
23
|
+
return arg.exp;
|
|
24
|
+
default:
|
|
25
|
+
return arg.str;
|
|
26
|
+
}
|
|
26
27
|
};
|
|
27
28
|
|
|
29
|
+
expression.expressionArgParser = expressionArgParser;
|
|
30
|
+
expression.isExpression = isExpression;
|
|
31
|
+
|
|
28
32
|
var surveyItem = {};
|
|
29
33
|
|
|
30
|
-
Object.defineProperty(surveyItem,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
Object.defineProperty(surveyItem, '__esModule', { value: true });
|
|
35
|
+
|
|
36
|
+
const isSurveyGroupItem$1 = (item) => {
|
|
37
|
+
const items = item.items;
|
|
38
|
+
return items !== undefined && items.length > 0;
|
|
34
39
|
};
|
|
35
40
|
|
|
41
|
+
surveyItem.isSurveyGroupItem = isSurveyGroupItem$1;
|
|
42
|
+
|
|
36
43
|
var surveyItemComponent = {};
|
|
37
44
|
|
|
38
|
-
Object.defineProperty(surveyItemComponent,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
Object.defineProperty(surveyItemComponent, '__esModule', { value: true });
|
|
46
|
+
|
|
47
|
+
const isItemGroupComponent$1 = (item) => {
|
|
48
|
+
const items = item.items;
|
|
49
|
+
return items !== undefined && items.length > 0;
|
|
42
50
|
};
|
|
43
51
|
|
|
52
|
+
surveyItemComponent.isItemGroupComponent = isItemGroupComponent$1;
|
|
53
|
+
|
|
44
54
|
var response = {};
|
|
45
55
|
|
|
46
|
-
Object.defineProperty(response,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
Object.defineProperty(response, '__esModule', { value: true });
|
|
57
|
+
|
|
58
|
+
const isSurveyGroupItemResponse = (item) => {
|
|
59
|
+
const items = item.items;
|
|
60
|
+
return items !== undefined && items.length > 0;
|
|
50
61
|
};
|
|
51
62
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
response.isSurveyGroupItemResponse = isSurveyGroupItemResponse;
|
|
64
|
+
|
|
65
|
+
Object.defineProperty(data_types, '__esModule', { value: true });
|
|
66
|
+
|
|
67
|
+
var data_types_expression = expression;
|
|
68
|
+
var data_types_surveyItem = surveyItem;
|
|
69
|
+
var data_types_surveyItemComponent = surveyItemComponent;
|
|
70
|
+
var data_types_response = response;
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
data_types.expressionArgParser = data_types_expression.expressionArgParser;
|
|
75
|
+
data_types.isExpression = data_types_expression.isExpression;
|
|
76
|
+
var isSurveyGroupItem = data_types.isSurveyGroupItem = data_types_surveyItem.isSurveyGroupItem;
|
|
77
|
+
var isItemGroupComponent = data_types.isItemGroupComponent = data_types_surveyItemComponent.isItemGroupComponent;
|
|
78
|
+
data_types.isSurveyGroupItemResponse = data_types_response.isSurveyGroupItemResponse;
|
|
62
79
|
|
|
63
80
|
const initialRootComp = () => {
|
|
64
81
|
return {
|
|
@@ -282,7 +299,7 @@ class ItemEditor {
|
|
|
282
299
|
obj = currentItem.components.items[ind];
|
|
283
300
|
continue;
|
|
284
301
|
}
|
|
285
|
-
if (!
|
|
302
|
+
if (!isItemGroupComponent(obj)) {
|
|
286
303
|
obj.items = [];
|
|
287
304
|
// leaf found
|
|
288
305
|
break;
|
|
@@ -341,7 +358,7 @@ class ItemEditor {
|
|
|
341
358
|
obj = currentItem.components.items[ind];
|
|
342
359
|
continue;
|
|
343
360
|
}
|
|
344
|
-
if (!
|
|
361
|
+
if (!isItemGroupComponent(obj)) {
|
|
345
362
|
obj.items = [];
|
|
346
363
|
// leaf found
|
|
347
364
|
break;
|
|
@@ -393,7 +410,7 @@ class ItemEditor {
|
|
|
393
410
|
const parentIds = ids.slice(1, ids.length - 1);
|
|
394
411
|
let obj = responseGroup;
|
|
395
412
|
for (const currentKey of parentIds) {
|
|
396
|
-
if (!
|
|
413
|
+
if (!isItemGroupComponent(obj)) {
|
|
397
414
|
// leaf found
|
|
398
415
|
break;
|
|
399
416
|
}
|
|
@@ -434,7 +451,7 @@ class ItemEditor {
|
|
|
434
451
|
const parentIds = ids.slice(1, ids.length - 1);
|
|
435
452
|
let obj = responseGroup;
|
|
436
453
|
for (const currentKey of parentIds) {
|
|
437
|
-
if (!
|
|
454
|
+
if (!isItemGroupComponent(obj)) {
|
|
438
455
|
// leaf found
|
|
439
456
|
break;
|
|
440
457
|
}
|
|
@@ -469,7 +486,7 @@ class ItemEditor {
|
|
|
469
486
|
obj = currentItem.components.items[ind];
|
|
470
487
|
continue;
|
|
471
488
|
}
|
|
472
|
-
if (!
|
|
489
|
+
if (!isItemGroupComponent(obj)) {
|
|
473
490
|
obj.items = [];
|
|
474
491
|
// leaf found
|
|
475
492
|
break;
|
|
@@ -518,5 +535,5 @@ class ItemEditor {
|
|
|
518
535
|
}
|
|
519
536
|
|
|
520
537
|
exports.ItemEditor = ItemEditor;
|
|
521
|
-
exports.
|
|
522
|
-
//# sourceMappingURL=item-editor-
|
|
538
|
+
exports.isSurveyGroupItem = isSurveyGroupItem;
|
|
539
|
+
//# sourceMappingURL=item-editor-c6933791.js.map
|
|
@@ -0,0 +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,QA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E,IAAI,EAAE,CAAC,CAAC;AAC9D;AACA,IAAI,qBAAqB,GAAGC,UAA0B,CAAC;AACvD,IAAI,qBAAqB,GAAGC,UAA2B,CAAC;AACxD,IAAI,8BAA8B,GAAGC,mBAAqC,CAAC;AAC3E,IAAI,mBAAmB,GAAGC,QAAwB,CAAC;AACnD;AACA;AACA;8BAC2B,GAAG,qBAAqB,CAAC,oBAAoB;uBACpD,GAAG,qBAAqB,CAAC,aAAa;oDACjC,GAAG,qBAAqB,CAAC,kBAAkB;AACpE,0DAA4B,GAAG,8BAA8B,CAAC,oBAAoB,CAAC;oCAClD,GAAG,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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.19",
|
|
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
|
-
"@rollup/plugin-node-resolve": "^13.
|
|
11
|
-
"rollup": "^2.
|
|
10
|
+
"@rollup/plugin-node-resolve": "^13.1.1",
|
|
11
|
+
"rollup": "^2.61.1",
|
|
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",
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"build": "rollup -c"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"survey-engine": "^0.
|
|
23
|
+
"survey-engine": "^1.0.2"
|
|
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-
|
|
9
|
+
require('../item-editor-c6933791.js');
|
|
10
10
|
require('./utils/randomKeyGenerator.js');
|
|
11
11
|
require('../logger/logger.js');
|
|
12
12
|
require('./utils/componentGenerators.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Expression, ItemComponent, ItemGroupComponent } from "survey-engine/
|
|
1
|
+
import { Expression, ItemComponent, ItemGroupComponent } from "survey-engine/data_types";
|
|
2
2
|
import { ResponsiveBipolarLikertArrayProps, ResponsiveSingleChoiceArrayProps } from "../types";
|
|
3
3
|
export interface LikertGroupRow {
|
|
4
4
|
key: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Expression, ItemComponent, ItemGroupComponent } from "survey-engine/
|
|
1
|
+
import { Expression, ItemComponent, ItemGroupComponent } from "survey-engine/data_types";
|
|
2
2
|
import { OptionDef } from "../types";
|
|
3
3
|
export declare const optionDefToItemComponent: (optionDef: OptionDef) => ItemComponent;
|
|
4
4
|
export declare const initSingleChoiceGroup: (key: string, optionItems: OptionDef[], order?: Expression | undefined) => ItemGroupComponent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemComponent, Expression, LocalizedObject, ComponentProperties } from "survey-engine/
|
|
1
|
+
import { ItemComponent, Expression, LocalizedObject, ComponentProperties } from "survey-engine/data_types";
|
|
2
2
|
import { NewComponentProps } from "./data-types";
|
|
3
3
|
interface ComponentEditorInt {
|
|
4
4
|
getComponent: () => ItemComponent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SurveyItem, SurveyItemTypes, Expression, Validation, ItemComponent, ItemGroupComponent } from "survey-engine/
|
|
1
|
+
import { SurveyItem, SurveyItemTypes, Expression, Validation, ItemComponent, ItemGroupComponent } from "survey-engine/data_types";
|
|
2
2
|
import { NewItemProps, NewComponentProps } from "./data-types";
|
|
3
3
|
interface ItemEditorInt {
|
|
4
4
|
getItem: () => SurveyItem;
|
|
@@ -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-c6933791.js');
|
|
6
6
|
require('./component-editor.js');
|
|
7
7
|
require('../utils/randomKeyGenerator.js');
|
|
8
8
|
require('../../logger/logger.js');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Survey, LocalizedString, SurveyItem, SurveyContextDef, Expression } from "survey-engine/
|
|
1
|
+
import { Survey, LocalizedString, SurveyItem, SurveyContextDef, Expression } from "survey-engine/data_types";
|
|
2
|
+
import { SurveyAvailableFor } from "../types";
|
|
2
3
|
import { NewItemProps } from "./data-types";
|
|
3
4
|
interface SurveyEditorInt {
|
|
4
5
|
setSurveyName: (name: Array<LocalizedString>) => void;
|
|
@@ -6,6 +7,8 @@ interface SurveyEditorInt {
|
|
|
6
7
|
setSurveyDuration: (duration: Array<LocalizedString>) => void;
|
|
7
8
|
setSurveyContextRules: (contextRules: SurveyContextDef) => void;
|
|
8
9
|
setPrefillRules: (rules: Expression[]) => void;
|
|
10
|
+
setAvailableFor: (value?: SurveyAvailableFor) => void;
|
|
11
|
+
setRequireLoginBeforeSubmission: (value?: boolean) => void;
|
|
9
12
|
changeItemKey: (oldKey: string, newKey: string) => void;
|
|
10
13
|
addNewSurveyItem: (itemProps: NewItemProps, parentKey?: string, atPosition?: number) => SurveyItem | undefined;
|
|
11
14
|
updateSurveyItem: (item: SurveyItem) => void;
|
|
@@ -26,6 +29,8 @@ export declare class SurveyEditor implements SurveyEditorInt {
|
|
|
26
29
|
small: number;
|
|
27
30
|
large: number;
|
|
28
31
|
}): void;
|
|
32
|
+
setAvailableFor(value?: SurveyAvailableFor | undefined): void;
|
|
33
|
+
setRequireLoginBeforeSubmission(value?: boolean | undefined): void;
|
|
29
34
|
setSurveyContextRules(contextRules: SurveyContextDef): void;
|
|
30
35
|
setPrefillRules(rules: Expression[]): void;
|
|
31
36
|
addNewSurveyItem(newItem: NewItemProps, parentKey?: string, atPosition?: number): SurveyItem | undefined;
|
|
@@ -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-c6933791.js');
|
|
6
6
|
var logger_logger = require('../../logger/logger.js');
|
|
7
7
|
require('./component-editor.js');
|
|
8
8
|
require('../utils/randomKeyGenerator.js');
|
|
@@ -52,6 +52,12 @@ class SurveyEditor {
|
|
|
52
52
|
setMaxItemPerPage(itemLimits) {
|
|
53
53
|
this.survey.maxItemsPerPage = itemLimits;
|
|
54
54
|
}
|
|
55
|
+
setAvailableFor(value) {
|
|
56
|
+
this.survey.availableFor = value;
|
|
57
|
+
}
|
|
58
|
+
setRequireLoginBeforeSubmission(value) {
|
|
59
|
+
this.survey.requireLoginBeforeSubmission = value;
|
|
60
|
+
}
|
|
55
61
|
setSurveyContextRules(contextRules) {
|
|
56
62
|
this.survey.contextRules = Object.assign({}, contextRules);
|
|
57
63
|
}
|
|
@@ -176,7 +182,7 @@ class SurveyEditor {
|
|
|
176
182
|
obj = this.survey.current.surveyDefinition;
|
|
177
183
|
continue;
|
|
178
184
|
}
|
|
179
|
-
if (!surveys_surveyEditor_itemEditor.
|
|
185
|
+
if (!surveys_surveyEditor_itemEditor.isSurveyGroupItem(obj)) {
|
|
180
186
|
console.warn('survey item is not a group: ', obj.key);
|
|
181
187
|
return;
|
|
182
188
|
}
|
|
@@ -216,7 +222,7 @@ class SurveyEditor {
|
|
|
216
222
|
}
|
|
217
223
|
changeItemKeyForSubtree(currentItem, newKey) {
|
|
218
224
|
currentItem = Object.assign({}, currentItem);
|
|
219
|
-
if (surveys_surveyEditor_itemEditor.
|
|
225
|
+
if (surveys_surveyEditor_itemEditor.isSurveyGroupItem(currentItem)) {
|
|
220
226
|
currentItem.items = currentItem.items.map(item => {
|
|
221
227
|
const newSubkey = newKey + '.' + item.key.slice(item.key.lastIndexOf('.') + 1);
|
|
222
228
|
return this.changeItemKeyForSubtree(item, newSubkey);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"survey-editor.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"survey-editor.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemGroupComponent, Expression, ItemComponent, SurveyItem, ExpressionArg, ResponseItem } from "survey-engine/
|
|
1
|
+
import { ItemGroupComponent, Expression, ItemComponent, SurveyItem, ExpressionArg, ResponseItem } from "survey-engine/data_types";
|
|
2
2
|
import { ClozeQuestionProps, DateInputQuestionProps, GenericQuestionProps, MultiLineTextInput, NumericInputQuestionProps, OptionDef, ResponsiveBipolarLikertArrayQuestionProps, ResponsiveSingleChoiceArrayQuestionProps, TextInputQuestionProps } from "./types/item-properties";
|
|
3
3
|
import { LikertGroupRow } from "./responseTypeGenerators/likertGroupComponents";
|
|
4
4
|
interface OptionQuestionProps extends GenericQuestionProps {
|
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-c6933791.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');
|
package/surveys/types/group.d.ts
CHANGED
package/surveys/types/group.js
CHANGED
|
@@ -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-
|
|
6
|
+
var surveys_surveyEditor_itemEditor = require('../../item-editor-c6933791.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');
|
package/surveys/types/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var surveys_types_group = require('./group.js');
|
|
|
6
6
|
var surveys_types_item = require('./item.js');
|
|
7
7
|
var surveys_types_surveyDefinition = require('./survey-definition.js');
|
|
8
8
|
require('../../logger/logger.js');
|
|
9
|
-
require('../../item-editor-
|
|
9
|
+
require('../../item-editor-c6933791.js');
|
|
10
10
|
require('../survey-editor/component-editor.js');
|
|
11
11
|
require('../utils/randomKeyGenerator.js');
|
|
12
12
|
require('../utils/simple-generators.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProperties, Expression, ItemComponent, Validation } from "survey-engine/
|
|
1
|
+
import { ComponentProperties, 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>;
|
package/surveys/types/item.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { SurveyItem } from "survey-engine/
|
|
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
4
|
export interface SurveyProps {
|
|
4
5
|
surveyKey: string;
|
|
5
6
|
name: Map<string, string>;
|
|
6
7
|
description: Map<string, string>;
|
|
7
8
|
durationText: Map<string, string>;
|
|
9
|
+
availableFor?: SurveyAvailableFor;
|
|
10
|
+
requireLoginBeforeSubmission?: boolean;
|
|
8
11
|
}
|
|
9
12
|
export declare abstract class SurveyDefinition {
|
|
10
13
|
key: string;
|
|
11
14
|
editor: SurveyEditor;
|
|
12
15
|
constructor(props: SurveyProps);
|
|
13
16
|
abstract buildSurvey(): void;
|
|
14
|
-
getSurvey(): import("survey-engine/
|
|
17
|
+
getSurvey(): import("survey-engine/data_types").Survey;
|
|
15
18
|
getSurveyJSON(pretty?: boolean): string;
|
|
16
19
|
addItem(item: SurveyItem): void;
|
|
17
20
|
addSurveyItemToPath(item: SurveyItem, parentKey: string): void;
|
|
@@ -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-
|
|
6
|
+
var surveys_surveyEditor_itemEditor = require('../../item-editor-c6933791.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');
|
|
@@ -18,6 +18,8 @@ class SurveyDefinition {
|
|
|
18
18
|
this.editor.setSurveyName(surveys_utils_simpleGenerators.generateLocStrings(props.name));
|
|
19
19
|
this.editor.setSurveyDescription(surveys_utils_simpleGenerators.generateLocStrings(props.description));
|
|
20
20
|
this.editor.setSurveyDuration(surveys_utils_simpleGenerators.generateLocStrings(props.durationText));
|
|
21
|
+
this.editor.setAvailableFor(props.availableFor);
|
|
22
|
+
this.editor.setRequireLoginBeforeSubmission(props.requireLoginBeforeSubmission);
|
|
21
23
|
const rootItemEditor = new surveys_surveyEditor_itemEditor.ItemEditor(this.editor.findSurveyItem(props.surveyKey));
|
|
22
24
|
rootItemEditor.setSelectionMethod({ name: 'sequential' });
|
|
23
25
|
this.editor.updateSurveyItem(rootItemEditor.getItem());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"survey-definition.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"survey-definition.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Expression } from "survey-engine/
|
|
1
|
+
import { Expression } from "survey-engine/data_types";
|
|
2
2
|
import { ClozeProps, DateInputProps, NumericInputProps, OptionDef, StyledTextComponentProp, TextInputProps } from "../types/item-properties";
|
|
3
3
|
interface CommonProps {
|
|
4
4
|
key?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LocalizedString, ItemComponent, ExpressionName, Expression, ItemGroupComponent, SurveySingleItem } from "survey-engine/
|
|
1
|
+
import { LocalizedString, ItemComponent, ExpressionName, Expression, ItemGroupComponent, SurveySingleItem } from "survey-engine/data_types";
|
|
2
2
|
import { StyledTextComponentProp } from "../types/item-properties";
|
|
3
3
|
export declare const generateLocStrings: (translations: Map<string, string>) => LocalizedString[];
|
|
4
4
|
export declare const generateTitleComponent: (content: Map<string, string> | Array<StyledTextComponentProp>, description?: Map<string, string> | undefined, className?: string | undefined) => ItemComponent;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Expression, ItemComponent } from "survey-engine/
|
|
1
|
+
import { Expression, ItemComponent } from "survey-engine/data_types";
|
|
2
2
|
import { ItemEditor } from "../survey-editor/item-editor";
|
|
3
3
|
import { StyledTextComponentProp } from "../types/item-properties";
|
|
4
4
|
export declare class SimpleQuestionEditor {
|
|
5
5
|
editor: ItemEditor;
|
|
6
6
|
key: string;
|
|
7
7
|
constructor(parentKey: string, key: string, version: number);
|
|
8
|
-
getItem(): import("survey-engine/
|
|
8
|
+
getItem(): import("survey-engine/data_types").SurveyItem;
|
|
9
9
|
setTitle(title: Map<string, string> | Array<StyledTextComponentProp>, description?: Map<string, string>, className?: string): void;
|
|
10
10
|
setCondition(exp: Expression): void;
|
|
11
11
|
addDisplayComponent(comp: ItemComponent, atPosition?: number): 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-
|
|
6
|
+
var surveys_surveyEditor_itemEditor = require('../../item-editor-c6933791.js');
|
|
7
7
|
var surveys_utils_simpleGenerators = require('./simple-generators.js');
|
|
8
8
|
require('../survey-editor/component-editor.js');
|
|
9
9
|
require('./randomKeyGenerator.js');
|
package/types/expression.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Expression, ExpressionArg } from "survey-engine/
|
|
1
|
+
import { Expression, ExpressionArg } from "survey-engine/data_types";
|
|
2
2
|
export declare const isExpression: (value: Expression | any) => value is Expression;
|
|
3
3
|
export declare type ExpressionArgDType = 'exp' | 'num' | 'str';
|
|
4
4
|
export declare const expressionArgParser: (arg: ExpressionArg) => any;
|
package/types/study.d.ts
CHANGED
package/types/studyRules.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-editor-7f825952.js","sources":["../node_modules/survey-engine/lib/data_types/expression.js","../node_modules/survey-engine/lib/data_types/survey-item.js","../node_modules/survey-engine/lib/data_types/survey-item-component.js","../node_modules/survey-engine/lib/data_types/response.js","../node_modules/survey-engine/lib/data_types/index.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isExpression = (value) => {\n return typeof (value) === 'object' && value.name !== undefined && value.name.length > 0;\n};\nexports.expressionArgParser = (arg) => {\n switch (arg.dtype) {\n case 'num':\n return arg.num;\n case 'str':\n return arg.str;\n case 'exp':\n return arg.exp;\n default:\n return arg.str;\n }\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isSurveyGroupItem = (item) => {\n const items = item.items;\n return items !== undefined && items.length > 0;\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isItemGroupComponent = (item) => {\n const items = item.items;\n return items !== undefined && items.length > 0;\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isSurveyGroupItemResponse = (item) => {\n const items = item.items;\n return items !== undefined && items.length > 0;\n};\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(require(\"./expression\"));\n__export(require(\"./survey-item\"));\n__export(require(\"./survey-item-component\"));\n__export(require(\"./response\"));\n"],"names":["require$$0","require$$1","require$$2","require$$3"],"mappings":";;;;;;;;;;AACA,MAAM,CAAC,cAAc,CAAC,UAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;uBAC1C,GAAG,CAAC,KAAK,KAAK;AAClC,IAAI,OAAO,QAAQ,KAAK,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;AAC5F,EAAE;8BACyB,GAAG,CAAC,GAAG,KAAK;AACvC,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;;;;ACfA,MAAM,CAAC,cAAc,CAAC,UAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;4BACrC,GAAG,CAAC,IAAI,KAAK;AACtC,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;AAC7B,IAAI,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AACnD;;;;ACJA,MAAM,CAAC,cAAc,CAAC,mBAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,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