case-editor-tools 1.3.0-beta.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/exporter/index.d.ts +1 -1
- package/expression-utils/expressionGen.d.ts +1 -1
- package/expression-utils/studyEngineExpressions.d.ts +23 -23
- package/item-editor-b2c1632b.js.map +1 -1
- package/package.json +2 -2
- package/surveys/responseTypeGenerators/likertGroupComponents.d.ts +5 -5
- package/surveys/responseTypeGenerators/matrixGroupComponent.d.ts +1 -1
- package/surveys/responseTypeGenerators/optionGroupComponents.d.ts +4 -4
- package/surveys/survey-engine-expressions.d.ts +4 -4
- package/surveys/survey-items.d.ts +1 -1
- package/surveys/utils/optionDefGenerators.d.ts +2 -2
- package/surveys/utils/simple-generators.d.ts +2 -2
package/exporter/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Study } from "../types/study";
|
|
2
|
-
export declare const generateFilesForStudy: (study: Study, pretty?: boolean
|
|
2
|
+
export declare const generateFilesForStudy: (study: Study, pretty?: boolean) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Expression, ExpressionName } from "survey-engine/data_types";
|
|
2
|
-
export declare const generateExpression: (name: ExpressionName, returnType?:
|
|
2
|
+
export declare const generateExpression: (name: ExpressionName, returnType?: 'string' | 'float', ...args: any[]) => Expression;
|
|
@@ -11,7 +11,7 @@ export declare const NativeStudyEngineExpressions: {
|
|
|
11
11
|
hasResponseKey: (itemKey: string, responseKey: string) => Expression;
|
|
12
12
|
hasResponseKeyWithValue: (itemKey: string, responseKey: string, value: string) => Expression;
|
|
13
13
|
countResponseItems: (itemKey: string, responseKey: string) => Expression;
|
|
14
|
-
checkConditionForOldResponses: (condition: Expression, checkType?: number |
|
|
14
|
+
checkConditionForOldResponses: (condition: Expression, checkType?: number | 'all' | 'any', surveyKey?: string, querySince?: number | Expression, queryUntil?: number | Expression) => Expression;
|
|
15
15
|
participantState: {
|
|
16
16
|
getStudyEntryTime: () => Expression;
|
|
17
17
|
hasSurveyKeyAssigned: (surveyKey: string) => Expression;
|
|
@@ -21,7 +21,7 @@ export declare const NativeStudyEngineExpressions: {
|
|
|
21
21
|
hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
|
|
22
22
|
hasParticipantFlagKey: (key: string) => Expression;
|
|
23
23
|
getParticipantFlagValue: (key: string) => Expression;
|
|
24
|
-
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string
|
|
24
|
+
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string) => Expression;
|
|
25
25
|
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
26
26
|
getMessageNextTime: (messageType: string) => Expression;
|
|
27
27
|
incomingParticipantState: {
|
|
@@ -33,7 +33,7 @@ export declare const NativeStudyEngineExpressions: {
|
|
|
33
33
|
hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
|
|
34
34
|
hasParticipantFlagKey: (key: string) => Expression;
|
|
35
35
|
getParticipantFlagValue: (key: string) => Expression;
|
|
36
|
-
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string
|
|
36
|
+
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string) => Expression;
|
|
37
37
|
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
38
38
|
getMessageNextTime: (messageType: string) => Expression;
|
|
39
39
|
};
|
|
@@ -46,11 +46,11 @@ export declare const NativeStudyEngineExpressions: {
|
|
|
46
46
|
or: (...args: Expression[]) => Expression;
|
|
47
47
|
and: (...args: Expression[]) => Expression;
|
|
48
48
|
not: (arg: Expression) => Expression;
|
|
49
|
-
timestampWithOffset: (delta: Duration, reference?: number | Expression
|
|
50
|
-
externalEventEval: (serviceName: string, expectFloat?: boolean
|
|
49
|
+
timestampWithOffset: (delta: Duration, reference?: number | Expression) => Expression;
|
|
50
|
+
externalEventEval: (serviceName: string, expectFloat?: boolean) => Expression;
|
|
51
51
|
};
|
|
52
52
|
export declare const StudyEngineActions: {
|
|
53
|
-
if: (condition: Expression, actionIfTrue: Expression, actionIfFalse?: Expression
|
|
53
|
+
if: (condition: Expression, actionIfTrue: Expression, actionIfFalse?: Expression) => Expression;
|
|
54
54
|
do: (...args: Expression[]) => Expression;
|
|
55
55
|
ifThen: (condition: Expression, ...args: Expression[]) => Expression;
|
|
56
56
|
participantActions: {
|
|
@@ -59,18 +59,18 @@ export declare const StudyEngineActions: {
|
|
|
59
59
|
updateFlag: (key: string, newValue: string | number | Expression) => Expression;
|
|
60
60
|
removeFlag: (key: string) => Expression;
|
|
61
61
|
assignedSurveys: {
|
|
62
|
-
add: (surveyKey: string, category: 'immediate' | 'prio' | 'normal' | 'optional', activeFrom?: number | Expression
|
|
62
|
+
add: (surveyKey: string, category: 'immediate' | 'prio' | 'normal' | 'optional', activeFrom?: number | Expression, activeUntil?: number | Expression) => Expression;
|
|
63
63
|
removeAll: () => Expression;
|
|
64
64
|
remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
|
|
65
65
|
};
|
|
66
66
|
reports: {
|
|
67
67
|
init: (reportKey: string) => Expression;
|
|
68
68
|
cancel: (reportKey: string) => Expression;
|
|
69
|
-
updateData: (reportKey: string, attributeKey: string, value: number | string | Expression, dtype?:
|
|
69
|
+
updateData: (reportKey: string, attributeKey: string, value: number | string | Expression, dtype?: 'date' | 'float' | 'int' | 'string' | 'rawMessage' | 'keyList') => Expression;
|
|
70
70
|
removeData: (reportKey: string, attributeKey: string) => Expression;
|
|
71
71
|
setReportIcon: (reportKey: string, icon: string) => Expression;
|
|
72
|
-
setReportMessage: (reportKey: string, content: string, asTranslationKey?: boolean
|
|
73
|
-
setReportSummary: (reportKey: string, content: string, asTranslationKey?: boolean
|
|
72
|
+
setReportMessage: (reportKey: string, content: string, asTranslationKey?: boolean) => Expression;
|
|
73
|
+
setReportSummary: (reportKey: string, content: string, asTranslationKey?: boolean) => Expression;
|
|
74
74
|
};
|
|
75
75
|
messages: {
|
|
76
76
|
add: (messageType: string, scheduledFor: number | Expression) => Expression;
|
|
@@ -102,12 +102,12 @@ export declare const StudyEngine: {
|
|
|
102
102
|
};
|
|
103
103
|
survey: {
|
|
104
104
|
isActive: (surveyKey: string) => Expression;
|
|
105
|
-
validFromOlderThan: (surveyKey: string, delta: Duration, reference?: number | Expression
|
|
106
|
-
validUntilSoonerThan: (surveyKey: string, delta: Duration, reference?: number | Expression
|
|
105
|
+
validFromOlderThan: (surveyKey: string, delta: Duration, reference?: number | Expression) => Expression;
|
|
106
|
+
validUntilSoonerThan: (surveyKey: string, delta: Duration, reference?: number | Expression) => Expression;
|
|
107
107
|
};
|
|
108
108
|
prefillRules: {
|
|
109
109
|
PREFILL_SLOT_WITH_VALUE: (itemKey: string, slotKey: string, value: string | number) => Expression;
|
|
110
|
-
GET_LAST_SURVEY_ITEM: (surveyKey: string, itemKey: string, submittedLaterThan?: Duration
|
|
110
|
+
GET_LAST_SURVEY_ITEM: (surveyKey: string, itemKey: string, submittedLaterThan?: Duration) => Expression;
|
|
111
111
|
};
|
|
112
112
|
contextRules: {
|
|
113
113
|
previousResponses: {
|
|
@@ -116,7 +116,7 @@ export declare const StudyEngine: {
|
|
|
116
116
|
RESPONSES_SINCE_BY_KEY: (sinceTimestamp: number, surveyKey: string) => Expression;
|
|
117
117
|
};
|
|
118
118
|
};
|
|
119
|
-
if: (condition: Expression, actionIfTrue: Expression, actionIfFalse?: Expression
|
|
119
|
+
if: (condition: Expression, actionIfTrue: Expression, actionIfFalse?: Expression) => Expression;
|
|
120
120
|
do: (...args: Expression[]) => Expression;
|
|
121
121
|
ifThen: (condition: Expression, ...args: Expression[]) => Expression;
|
|
122
122
|
participantActions: {
|
|
@@ -125,18 +125,18 @@ export declare const StudyEngine: {
|
|
|
125
125
|
updateFlag: (key: string, newValue: string | number | Expression) => Expression;
|
|
126
126
|
removeFlag: (key: string) => Expression;
|
|
127
127
|
assignedSurveys: {
|
|
128
|
-
add: (surveyKey: string, category: 'immediate' | 'prio' | 'normal' | 'optional', activeFrom?: number | Expression
|
|
128
|
+
add: (surveyKey: string, category: 'immediate' | 'prio' | 'normal' | 'optional', activeFrom?: number | Expression, activeUntil?: number | Expression) => Expression;
|
|
129
129
|
removeAll: () => Expression;
|
|
130
130
|
remove: (surveyKey: string, selector: 'first' | 'last' | 'all') => Expression;
|
|
131
131
|
};
|
|
132
132
|
reports: {
|
|
133
133
|
init: (reportKey: string) => Expression;
|
|
134
134
|
cancel: (reportKey: string) => Expression;
|
|
135
|
-
updateData: (reportKey: string, attributeKey: string, value: number | string | Expression, dtype?:
|
|
135
|
+
updateData: (reportKey: string, attributeKey: string, value: number | string | Expression, dtype?: 'date' | 'float' | 'int' | 'string' | 'rawMessage' | 'keyList') => Expression;
|
|
136
136
|
removeData: (reportKey: string, attributeKey: string) => Expression;
|
|
137
137
|
setReportIcon: (reportKey: string, icon: string) => Expression;
|
|
138
|
-
setReportMessage: (reportKey: string, content: string, asTranslationKey?: boolean
|
|
139
|
-
setReportSummary: (reportKey: string, content: string, asTranslationKey?: boolean
|
|
138
|
+
setReportMessage: (reportKey: string, content: string, asTranslationKey?: boolean) => Expression;
|
|
139
|
+
setReportSummary: (reportKey: string, content: string, asTranslationKey?: boolean) => Expression;
|
|
140
140
|
};
|
|
141
141
|
messages: {
|
|
142
142
|
add: (messageType: string, scheduledFor: number | Expression) => Expression;
|
|
@@ -162,7 +162,7 @@ export declare const StudyEngine: {
|
|
|
162
162
|
hasResponseKey: (itemKey: string, responseKey: string) => Expression;
|
|
163
163
|
hasResponseKeyWithValue: (itemKey: string, responseKey: string, value: string) => Expression;
|
|
164
164
|
countResponseItems: (itemKey: string, responseKey: string) => Expression;
|
|
165
|
-
checkConditionForOldResponses: (condition: Expression, checkType?: number |
|
|
165
|
+
checkConditionForOldResponses: (condition: Expression, checkType?: number | 'all' | 'any', surveyKey?: string, querySince?: number | Expression, queryUntil?: number | Expression) => Expression;
|
|
166
166
|
participantState: {
|
|
167
167
|
getStudyEntryTime: () => Expression;
|
|
168
168
|
hasSurveyKeyAssigned: (surveyKey: string) => Expression;
|
|
@@ -172,7 +172,7 @@ export declare const StudyEngine: {
|
|
|
172
172
|
hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
|
|
173
173
|
hasParticipantFlagKey: (key: string) => Expression;
|
|
174
174
|
getParticipantFlagValue: (key: string) => Expression;
|
|
175
|
-
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string
|
|
175
|
+
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string) => Expression;
|
|
176
176
|
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
177
177
|
getMessageNextTime: (messageType: string) => Expression;
|
|
178
178
|
incomingParticipantState: {
|
|
@@ -184,7 +184,7 @@ export declare const StudyEngine: {
|
|
|
184
184
|
hasParticipantFlagKeyAndValue: (key: string, value: string) => Expression;
|
|
185
185
|
hasParticipantFlagKey: (key: string) => Expression;
|
|
186
186
|
getParticipantFlagValue: (key: string) => Expression;
|
|
187
|
-
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string
|
|
187
|
+
lastSubmissionDateOlderThan: (reference: number | Expression, surveyKey?: string) => Expression;
|
|
188
188
|
hasMessageTypeAssigned: (messageType: string) => Expression;
|
|
189
189
|
getMessageNextTime: (messageType: string) => Expression;
|
|
190
190
|
};
|
|
@@ -197,6 +197,6 @@ export declare const StudyEngine: {
|
|
|
197
197
|
or: (...args: Expression[]) => Expression;
|
|
198
198
|
and: (...args: Expression[]) => Expression;
|
|
199
199
|
not: (arg: Expression) => Expression;
|
|
200
|
-
timestampWithOffset: (delta: Duration, reference?: number | Expression
|
|
201
|
-
externalEventEval: (serviceName: string, expectFloat?: boolean
|
|
200
|
+
timestampWithOffset: (delta: Duration, reference?: number | Expression) => Expression;
|
|
201
|
+
externalEventEval: (serviceName: string, expectFloat?: boolean) => Expression;
|
|
202
202
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-editor-b2c1632b.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;
|
|
1
|
+
{"version":3,"file":"item-editor-b2c1632b.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;AA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "case-editor-tools",
|
|
3
3
|
"description": "Javascript tools to simplify survey and study coding for CASE.",
|
|
4
|
-
"version": "1.3.0
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": "github:case-framework/case-editor-tools",
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"build": "rollup -c"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"survey-engine": "^1.2.0
|
|
23
|
+
"survey-engine": "^1.2.0"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -16,13 +16,13 @@ export declare const initLikertScaleGroup: (key: string, rows: Array<LikertGroup
|
|
|
16
16
|
key: string;
|
|
17
17
|
className?: string | undefined;
|
|
18
18
|
content: Map<string, string>;
|
|
19
|
-
}[], stackOnSmallScreen?: boolean
|
|
20
|
-
export declare const initResponsiveSingleChoiceArray: (rgKey: string, props: ResponsiveSingleChoiceArrayProps, displayCondition?: Expression
|
|
21
|
-
export declare const initResponsiveBipolarLikertArray: (rgKey: string, props: ResponsiveBipolarLikertArrayProps, displayCondition?: Expression
|
|
22
|
-
export declare const initResponsiveMatrixItem: (rgKey: string, props: ResponsiveMatrixProps, displayCondition?: Expression
|
|
19
|
+
}[], stackOnSmallScreen?: boolean, displayCondition?: Expression) => ItemGroupComponent;
|
|
20
|
+
export declare const initResponsiveSingleChoiceArray: (rgKey: string, props: ResponsiveSingleChoiceArrayProps, displayCondition?: Expression) => ItemGroupComponent;
|
|
21
|
+
export declare const initResponsiveBipolarLikertArray: (rgKey: string, props: ResponsiveBipolarLikertArrayProps, displayCondition?: Expression) => ItemGroupComponent;
|
|
22
|
+
export declare const initResponsiveMatrixItem: (rgKey: string, props: ResponsiveMatrixProps, displayCondition?: Expression) => ItemGroupComponent;
|
|
23
23
|
export declare const initLikertScaleItem: (key: string, options: {
|
|
24
24
|
key: string;
|
|
25
25
|
className?: string | undefined;
|
|
26
26
|
content?: Map<string, string> | undefined;
|
|
27
27
|
disabled?: Expression | undefined;
|
|
28
|
-
}[], stackOnSmallScreen?: boolean
|
|
28
|
+
}[], stackOnSmallScreen?: boolean, displayCondition?: Expression) => ItemGroupComponent;
|
|
@@ -45,5 +45,5 @@ interface ResponseRow {
|
|
|
45
45
|
cells: Array<ResponseRowCell>;
|
|
46
46
|
}
|
|
47
47
|
declare type MatrixRow = HeaderRow | RadioRow | ResponseRow;
|
|
48
|
-
export declare const initMatrixQuestion: (key: string, rows: Array<MatrixRow>, order?: Expression
|
|
48
|
+
export declare const initMatrixQuestion: (key: string, rows: Array<MatrixRow>, order?: Expression) => ItemGroupComponent;
|
|
49
49
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
export declare const initSingleChoiceGroup: (key: string, optionItems: OptionDef[], order?: Expression
|
|
5
|
-
export declare const initMultipleChoiceGroup: (key: string, optionItems: OptionDef[], order?: Expression
|
|
6
|
-
export declare const initDropdownGroup: (key: string, optionItems: OptionDef[], order?: Expression
|
|
7
|
-
export declare const initSliderCategoricalGroup: (key: string, optionItems: OptionDef[], order?: Expression
|
|
4
|
+
export declare const initSingleChoiceGroup: (key: string, optionItems: OptionDef[], order?: Expression) => ItemGroupComponent;
|
|
5
|
+
export declare const initMultipleChoiceGroup: (key: string, optionItems: OptionDef[], order?: Expression) => ItemGroupComponent;
|
|
6
|
+
export declare const initDropdownGroup: (key: string, optionItems: OptionDef[], order?: Expression, groupDisabled?: Expression, groupContent?: Map<string, string>, groupDescription?: Map<string, string>) => ItemGroupComponent;
|
|
7
|
+
export declare const initSliderCategoricalGroup: (key: string, optionItems: OptionDef[], order?: Expression, groupDisabled?: Expression) => ItemGroupComponent;
|
|
@@ -30,7 +30,7 @@ export declare const NativeSurveyEngineExpressions: {
|
|
|
30
30
|
responseHasKeysAll: (itemKey: string, responseKey: string, ...optionKeys: string[]) => Expression;
|
|
31
31
|
responseHasOnlyKeysOtherThan: (itemKey: string, responseKey: string, ...optionKeys: string[]) => Expression;
|
|
32
32
|
getSurveyItemValidation: (itemKey: string, validationKey: string) => Expression;
|
|
33
|
-
dateResponseDiffFromNow: (itemKey: string, responseKey: string, unit: 'years' | 'months' | 'days' | 'hours' | 'minutes' | 'seconds', ignoreSign?: boolean
|
|
33
|
+
dateResponseDiffFromNow: (itemKey: string, responseKey: string, unit: 'years' | 'months' | 'days' | 'hours' | 'minutes' | 'seconds', ignoreSign?: boolean) => Expression;
|
|
34
34
|
countResponseItems: (itemKey: string, responseKey: string) => Expression;
|
|
35
35
|
compare: {
|
|
36
36
|
eq: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
@@ -45,7 +45,7 @@ export declare const NativeSurveyEngineExpressions: {
|
|
|
45
45
|
not: (arg: Expression) => Expression;
|
|
46
46
|
};
|
|
47
47
|
getSecondsSince: (referenceTime: Expression) => Expression;
|
|
48
|
-
timestampWithOffset: (delta: Duration, reference?: number | Expression
|
|
48
|
+
timestampWithOffset: (delta: Duration, reference?: number | Expression) => Expression;
|
|
49
49
|
};
|
|
50
50
|
export declare const SurveyEngine: {
|
|
51
51
|
singleChoice: {
|
|
@@ -111,7 +111,7 @@ export declare const SurveyEngine: {
|
|
|
111
111
|
responseHasKeysAll: (itemKey: string, responseKey: string, ...optionKeys: string[]) => Expression;
|
|
112
112
|
responseHasOnlyKeysOtherThan: (itemKey: string, responseKey: string, ...optionKeys: string[]) => Expression;
|
|
113
113
|
getSurveyItemValidation: (itemKey: string, validationKey: string) => Expression;
|
|
114
|
-
dateResponseDiffFromNow: (itemKey: string, responseKey: string, unit: 'years' | 'months' | 'days' | 'hours' | 'minutes' | 'seconds', ignoreSign?: boolean
|
|
114
|
+
dateResponseDiffFromNow: (itemKey: string, responseKey: string, unit: 'years' | 'months' | 'days' | 'hours' | 'minutes' | 'seconds', ignoreSign?: boolean) => Expression;
|
|
115
115
|
countResponseItems: (itemKey: string, responseKey: string) => Expression;
|
|
116
116
|
compare: {
|
|
117
117
|
eq: (val1: Expression | string | number, val2: Expression | string | number) => Expression;
|
|
@@ -126,5 +126,5 @@ export declare const SurveyEngine: {
|
|
|
126
126
|
not: (arg: Expression) => Expression;
|
|
127
127
|
};
|
|
128
128
|
getSecondsSince: (referenceTime: Expression) => Expression;
|
|
129
|
-
timestampWithOffset: (delta: Duration, reference?: number | Expression
|
|
129
|
+
timestampWithOffset: (delta: Duration, reference?: number | Expression) => Expression;
|
|
130
130
|
};
|
|
@@ -67,7 +67,7 @@ export declare const SurveyItems: {
|
|
|
67
67
|
dropDown: (props: DropDownQuestionProps) => SurveyItem;
|
|
68
68
|
numericSlider: (props: NumericSliderProps) => SurveyItem;
|
|
69
69
|
display: (props: DisplayProps) => SurveyItem;
|
|
70
|
-
surveyEnd: (parentKey: string, content: Map<string, string>, condition?: Expression
|
|
70
|
+
surveyEnd: (parentKey: string, content: Map<string, string>, condition?: Expression) => SurveyItem;
|
|
71
71
|
customQuestion: (props: CustomQuestionProps) => SurveyItem;
|
|
72
72
|
old: {
|
|
73
73
|
simpleLikertGroup: (props: LikertGroupQuestionProps) => SurveyItem;
|
|
@@ -14,7 +14,7 @@ interface OptionTextProps extends CommonProps {
|
|
|
14
14
|
className?: string;
|
|
15
15
|
}
|
|
16
16
|
export declare const SingleChoiceOptionTypes: {
|
|
17
|
-
option: (key: string, content: Map<string, string> | StyledTextComponentProp[], extraProps?: OptionProps
|
|
17
|
+
option: (key: string, content: Map<string, string> | StyledTextComponentProp[], extraProps?: OptionProps) => OptionDef;
|
|
18
18
|
textInput: (props: TextInputProps & {
|
|
19
19
|
key: string;
|
|
20
20
|
displayCondition?: Expression;
|
|
@@ -36,7 +36,7 @@ export declare const SingleChoiceOptionTypes: {
|
|
|
36
36
|
}) => OptionDef;
|
|
37
37
|
};
|
|
38
38
|
export declare const MultipleChoiceOptionTypes: {
|
|
39
|
-
option: (key: string, content: Map<string, string> | StyledTextComponentProp[], extraProps?: OptionProps
|
|
39
|
+
option: (key: string, content: Map<string, string> | StyledTextComponentProp[], extraProps?: OptionProps) => OptionDef;
|
|
40
40
|
subtitle: (props: OptionTextProps) => OptionDef;
|
|
41
41
|
textInput: (props: TextInputProps & {
|
|
42
42
|
key: string;
|
|
@@ -2,7 +2,7 @@ import { LocalizedString, ItemComponent, ExpressionName, Expression, ItemGroupCo
|
|
|
2
2
|
import { DateDisplayComponentProp, StyledTextComponentProp } from "../types/item-properties";
|
|
3
3
|
export declare const generateLocStrings: (translations: Map<string, string>) => LocalizedString[];
|
|
4
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
|
|
5
|
+
export declare const generateTitleComponent: (content: Map<string, string> | Array<StyledTextComponentProp | DateDisplayComponentProp>, description?: Map<string, string>, className?: string) => ItemComponent;
|
|
6
6
|
export declare const generateHelpGroupComponent: (items: Array<{
|
|
7
7
|
content: Map<string, string>;
|
|
8
8
|
style?: Array<{
|
|
@@ -11,4 +11,4 @@ export declare const generateHelpGroupComponent: (items: Array<{
|
|
|
11
11
|
}>;
|
|
12
12
|
}>) => ItemGroupComponent;
|
|
13
13
|
export declare const expWithArgs: (name: ExpressionName, ...args: any[]) => Expression;
|
|
14
|
-
export declare const generatePageBreak: (parentKey: string, key?: string
|
|
14
|
+
export declare const generatePageBreak: (parentKey: string, key?: string) => SurveySingleItem;
|