case-editor-tools 1.0.0-beta.9 → 1.0.2
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 +3 -0
- package/constants/key-definitions.js +7 -1
- package/constants/key-definitions.js.map +1 -1
- package/exporter/index.d.ts +2 -0
- package/exporter/index.js +128 -0
- package/exporter/index.js.map +1 -0
- package/expression-utils/expressionGen.d.ts +1 -1
- package/expression-utils/studyEngineExpressions.d.ts +94 -13
- package/expression-utils/studyEngineExpressions.js +215 -19
- package/expression-utils/studyEngineExpressions.js.map +1 -1
- package/{item-editor-cb5ebc1a.js → item-editor-59f51ecc.js} +67 -46
- package/item-editor-59f51ecc.js.map +1 -0
- package/logger/index.d.ts +1 -0
- package/logger/index.js +10 -0
- package/logger/index.js.map +1 -0
- package/package.json +5 -5
- package/surveys/index.d.ts +1 -0
- package/surveys/index.js +9 -1
- package/surveys/index.js.map +1 -1
- package/surveys/responseTypeGenerators/likertGroupComponents.d.ts +27 -0
- package/surveys/responseTypeGenerators/likertGroupComponents.js +350 -0
- package/surveys/responseTypeGenerators/likertGroupComponents.js.map +1 -0
- package/surveys/responseTypeGenerators/matrixGroupComponent.d.ts +49 -0
- package/surveys/responseTypeGenerators/matrixGroupComponent.js +100 -0
- package/surveys/responseTypeGenerators/matrixGroupComponent.js.map +1 -0
- package/surveys/responseTypeGenerators/optionGroupComponents.d.ts +7 -0
- package/surveys/responseTypeGenerators/optionGroupComponents.js +129 -0
- package/surveys/responseTypeGenerators/optionGroupComponents.js.map +1 -0
- 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 +2 -1
- package/surveys/survey-editor/item-editor.js +2 -1
- package/surveys/survey-editor/item-editor.js.map +1 -1
- package/surveys/survey-editor/survey-editor.d.ts +6 -1
- package/surveys/survey-editor/survey-editor.js +13 -6
- package/surveys/survey-editor/survey-editor.js.map +1 -1
- package/surveys/survey-engine-expressions.d.ts +12 -2
- package/surveys/survey-engine-expressions.js +43 -2
- package/surveys/survey-engine-expressions.js.map +1 -1
- package/surveys/survey-items.d.ts +33 -227
- package/surveys/survey-items.js +215 -780
- package/surveys/survey-items.js.map +1 -1
- package/surveys/types/group.d.ts +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 +206 -2
- package/surveys/types/item-properties.js +7 -0
- package/surveys/types/item-properties.js.map +1 -1
- package/surveys/types/item.d.ts +1 -1
- package/surveys/types/survey-definition.d.ts +7 -3
- package/surveys/types/survey-definition.js +11 -2
- package/surveys/types/survey-definition.js.map +1 -1
- package/surveys/utils/componentGenerators.d.ts +2 -13
- package/surveys/utils/componentGenerators.js +1 -34
- package/surveys/utils/componentGenerators.js.map +1 -1
- package/surveys/utils/optionDefGenerators.d.ts +84 -0
- package/surveys/utils/optionDefGenerators.js +211 -0
- package/surveys/utils/optionDefGenerators.js.map +1 -0
- package/surveys/utils/simple-generators.d.ts +4 -3
- 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 +5 -5
- package/surveys/utils/simple-question-editor.js +5 -2
- package/surveys/utils/simple-question-editor.js.map +1 -1
- package/types/expression.d.ts +1 -1
- package/types/messageConfig.d.ts +49 -0
- package/types/messageConfig.js +23 -0
- package/types/messageConfig.js.map +1 -0
- package/types/study.d.ts +3 -1
- package/types/studyRules.d.ts +3 -2
- package/types/studyRules.js +5 -1
- package/types/studyRules.js.map +1 -1
- package/item-editor-cb5ebc1a.js.map +0 -1
|
@@ -1,36 +1,13 @@
|
|
|
1
|
-
import { ItemGroupComponent, Expression,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
interface GenericQuestionProps {
|
|
5
|
-
parentKey: string;
|
|
6
|
-
itemKey: string;
|
|
7
|
-
version?: number;
|
|
8
|
-
questionText: Map<string, string> | Array<StyledTextComponentProp>;
|
|
9
|
-
questionSubText?: Map<string, string>;
|
|
10
|
-
titleClassName?: string;
|
|
11
|
-
helpGroupContent?: Array<{
|
|
12
|
-
content: Map<string, string>;
|
|
13
|
-
style?: Array<{
|
|
14
|
-
key: string;
|
|
15
|
-
value: string;
|
|
16
|
-
}>;
|
|
17
|
-
}>;
|
|
18
|
-
condition?: Expression;
|
|
19
|
-
topDisplayCompoments?: Array<ItemComponent>;
|
|
20
|
-
bottomDisplayCompoments?: Array<ItemComponent>;
|
|
21
|
-
isRequired?: boolean;
|
|
22
|
-
footnoteText?: Map<string, string>;
|
|
23
|
-
customValidations?: Array<Validation>;
|
|
24
|
-
}
|
|
25
|
-
interface NumericInputQuestionProps extends GenericQuestionProps {
|
|
26
|
-
content: Map<string, string>;
|
|
27
|
-
contentBehindInput?: boolean;
|
|
28
|
-
componentProperties?: ComponentProperties;
|
|
29
|
-
inputMaxWidth?: string;
|
|
30
|
-
}
|
|
1
|
+
import { ItemGroupComponent, Expression, ItemComponent, SurveyItem, ExpressionArg, ResponseComponent } from "survey-engine/data_types";
|
|
2
|
+
import { ClozeQuestionProps, ConsentQuestionProps, DateInputQuestionProps, GenericQuestionProps, MultiLineTextInput, NumericInputQuestionProps, OptionDef, ResponsiveBipolarLikertArrayQuestionProps, ResponsiveSingleChoiceArrayQuestionProps, TextInputQuestionProps, TimeInputQuestionProps } from "./types/item-properties";
|
|
3
|
+
import { LikertGroupRow } from "./responseTypeGenerators/likertGroupComponents";
|
|
31
4
|
interface OptionQuestionProps extends GenericQuestionProps {
|
|
32
5
|
responseOptions: Array<OptionDef>;
|
|
33
6
|
}
|
|
7
|
+
interface DropDownQuestionProps extends GenericQuestionProps {
|
|
8
|
+
responseOptions: Array<OptionDef>;
|
|
9
|
+
placeholder?: Map<string, string>;
|
|
10
|
+
}
|
|
34
11
|
interface LikertGroupQuestionProps extends GenericQuestionProps {
|
|
35
12
|
rows: Array<LikertGroupRow>;
|
|
36
13
|
scaleOptions: Array<{
|
|
@@ -40,98 +17,6 @@ interface LikertGroupQuestionProps extends GenericQuestionProps {
|
|
|
40
17
|
}>;
|
|
41
18
|
stackOnSmallScreen?: boolean;
|
|
42
19
|
}
|
|
43
|
-
declare type ResponsiveSingleChoiceArrayVariant = 'horizontal' | 'vertical' | 'table';
|
|
44
|
-
declare type ResponsiveBipolarLikertArrayVariant = 'withLabelRow' | 'vertical' | 'table';
|
|
45
|
-
interface ResponsiveSingleChoiceArrayProps {
|
|
46
|
-
scaleOptions: Array<{
|
|
47
|
-
key: string;
|
|
48
|
-
className?: string;
|
|
49
|
-
content: Map<string, string> | StyledTextComponentProp[];
|
|
50
|
-
}>;
|
|
51
|
-
rows: Array<{
|
|
52
|
-
key: string;
|
|
53
|
-
content: Map<string, string> | StyledTextComponentProp[];
|
|
54
|
-
horizontalModeProps?: {
|
|
55
|
-
labelPlacement?: 'none' | 'top' | 'bottom';
|
|
56
|
-
className?: string;
|
|
57
|
-
};
|
|
58
|
-
verticalModeProps?: {
|
|
59
|
-
className?: string;
|
|
60
|
-
};
|
|
61
|
-
tableModeProps?: {
|
|
62
|
-
className?: string;
|
|
63
|
-
};
|
|
64
|
-
}>;
|
|
65
|
-
defaultMode: ResponsiveSingleChoiceArrayVariant;
|
|
66
|
-
responsiveModes?: {
|
|
67
|
-
sm?: ResponsiveSingleChoiceArrayVariant;
|
|
68
|
-
md?: ResponsiveSingleChoiceArrayVariant;
|
|
69
|
-
lg?: ResponsiveSingleChoiceArrayVariant;
|
|
70
|
-
xl?: ResponsiveSingleChoiceArrayVariant;
|
|
71
|
-
xxl?: ResponsiveSingleChoiceArrayVariant;
|
|
72
|
-
};
|
|
73
|
-
rgClassName?: string;
|
|
74
|
-
tableModeProps?: {
|
|
75
|
-
className?: string;
|
|
76
|
-
layout?: "fixed";
|
|
77
|
-
firstColWidth?: string;
|
|
78
|
-
optionHeaderClassName?: string;
|
|
79
|
-
hideRowBorder?: boolean;
|
|
80
|
-
};
|
|
81
|
-
horizontalModeProps?: {
|
|
82
|
-
hideRowBorder?: boolean;
|
|
83
|
-
};
|
|
84
|
-
verticalModeProps?: {
|
|
85
|
-
hideRowBorder?: boolean;
|
|
86
|
-
useReverseOptionOrder?: boolean;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
interface ResponsiveBipolarLikertArrayProps {
|
|
90
|
-
scaleOptions: Array<{
|
|
91
|
-
key: string;
|
|
92
|
-
}>;
|
|
93
|
-
rows: Array<{
|
|
94
|
-
key: string;
|
|
95
|
-
startLabel: Map<string, string> | StyledTextComponentProp[];
|
|
96
|
-
endLabel: Map<string, string> | StyledTextComponentProp[];
|
|
97
|
-
withLabelRowModeProps?: {
|
|
98
|
-
className?: string;
|
|
99
|
-
};
|
|
100
|
-
verticalModeProps?: {
|
|
101
|
-
className?: string;
|
|
102
|
-
};
|
|
103
|
-
tableModeProps?: {
|
|
104
|
-
className?: string;
|
|
105
|
-
};
|
|
106
|
-
}>;
|
|
107
|
-
defaultMode: ResponsiveBipolarLikertArrayVariant;
|
|
108
|
-
responsiveModes?: {
|
|
109
|
-
sm?: ResponsiveBipolarLikertArrayVariant;
|
|
110
|
-
md?: ResponsiveBipolarLikertArrayVariant;
|
|
111
|
-
lg?: ResponsiveBipolarLikertArrayVariant;
|
|
112
|
-
xl?: ResponsiveBipolarLikertArrayVariant;
|
|
113
|
-
xxl?: ResponsiveBipolarLikertArrayVariant;
|
|
114
|
-
};
|
|
115
|
-
rgClassName?: string;
|
|
116
|
-
tableModeProps?: {
|
|
117
|
-
className?: string;
|
|
118
|
-
layout?: "fixed";
|
|
119
|
-
labelColWidth?: string;
|
|
120
|
-
hideRowBorder?: boolean;
|
|
121
|
-
};
|
|
122
|
-
withLabelRowModeProps?: {
|
|
123
|
-
hideRowBorder?: boolean;
|
|
124
|
-
maxLabelWidth?: string;
|
|
125
|
-
useBottomLabel?: boolean;
|
|
126
|
-
};
|
|
127
|
-
verticalModeProps?: {
|
|
128
|
-
hideRowBorder?: boolean;
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
interface ResponsiveSingleChoiceArrayQuestionProps extends GenericQuestionProps, ResponsiveSingleChoiceArrayProps {
|
|
132
|
-
}
|
|
133
|
-
interface ResponsiveBipolarLikertArrayQuestionProps extends GenericQuestionProps, ResponsiveBipolarLikertArrayProps {
|
|
134
|
-
}
|
|
135
20
|
interface NumericSliderProps extends GenericQuestionProps {
|
|
136
21
|
sliderLabel: Map<string, string>;
|
|
137
22
|
noResponseLabel: Map<string, string>;
|
|
@@ -139,22 +24,12 @@ interface NumericSliderProps extends GenericQuestionProps {
|
|
|
139
24
|
max?: number | ExpressionArg;
|
|
140
25
|
stepSize?: number | ExpressionArg;
|
|
141
26
|
}
|
|
142
|
-
interface
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
placeholderText?: Map<string, string>;
|
|
146
|
-
minRelativeDate?: {
|
|
147
|
-
reference?: number | Expression;
|
|
148
|
-
delta: Duration;
|
|
149
|
-
};
|
|
150
|
-
maxRelativeDate?: {
|
|
151
|
-
reference?: number | Expression;
|
|
152
|
-
delta: Duration;
|
|
153
|
-
};
|
|
27
|
+
interface CustomResponseItem extends ResponseComponent {
|
|
28
|
+
mapToRole?: 'singleChoiceGroup' | 'multipleChoiceGroup' | 'input';
|
|
29
|
+
items?: ItemComponent[];
|
|
154
30
|
}
|
|
155
|
-
interface
|
|
156
|
-
|
|
157
|
-
placeholderText?: Map<string, string>;
|
|
31
|
+
interface CustomQuestionProps extends GenericQuestionProps {
|
|
32
|
+
responseItemDefs: CustomResponseItem[];
|
|
158
33
|
}
|
|
159
34
|
interface DisplayProps {
|
|
160
35
|
parentKey: string;
|
|
@@ -162,71 +37,6 @@ interface DisplayProps {
|
|
|
162
37
|
content: Array<ItemComponent>;
|
|
163
38
|
condition?: Expression;
|
|
164
39
|
}
|
|
165
|
-
export declare const SurveyItems: {
|
|
166
|
-
singleChoice: (props: OptionQuestionProps) => SurveyItem;
|
|
167
|
-
responsiveSingleChoiceArray: (props: ResponsiveSingleChoiceArrayQuestionProps) => SurveyItem;
|
|
168
|
-
responsiveBipolarLikertArray: (props: ResponsiveBipolarLikertArrayQuestionProps) => SurveyItem;
|
|
169
|
-
multipleChoice: (props: OptionQuestionProps) => SurveyItem;
|
|
170
|
-
simpleLikertGroup: (props: LikertGroupQuestionProps) => SurveyItem;
|
|
171
|
-
dateInput: (props: DatePickerInput) => SurveyItem;
|
|
172
|
-
multilineTextInput: (props: MultiLineTextInput) => SurveyItem;
|
|
173
|
-
dropDown: (props: OptionQuestionProps) => SurveyItem;
|
|
174
|
-
numericSlider: (props: NumericSliderProps) => SurveyItem;
|
|
175
|
-
numericInput: (props: NumericInputQuestionProps) => SurveyItem;
|
|
176
|
-
display: (props: DisplayProps) => SurveyItem;
|
|
177
|
-
surveyEnd: (parentKey: string, content: Map<string, string>, condition?: Expression | undefined) => SurveyItem;
|
|
178
|
-
};
|
|
179
|
-
export declare const initSingleChoiceGroup: (key: string, optionItems: OptionDef[], order?: Expression | undefined) => ItemGroupComponent;
|
|
180
|
-
export declare const initMultipleChoiceGroup: (key: string, optionItems: OptionDef[], order?: Expression | undefined) => ItemGroupComponent;
|
|
181
|
-
export declare const initDropdownGroup: (key: string, optionItems: OptionDef[], order?: Expression | undefined, groupDisabled?: Expression | undefined, groupContent?: Map<string, string> | undefined, groupDescription?: Map<string, string> | undefined) => ItemGroupComponent;
|
|
182
|
-
export declare const initSliderCategoricalGroup: (key: string, optionItems: OptionDef[], order?: Expression | undefined, groupDisabled?: Expression | undefined) => ItemGroupComponent;
|
|
183
|
-
interface HeaderRow {
|
|
184
|
-
role: 'headerRow';
|
|
185
|
-
key: string;
|
|
186
|
-
displayCondition?: Expression;
|
|
187
|
-
disabled?: Expression;
|
|
188
|
-
cells: Array<{
|
|
189
|
-
role: 'text';
|
|
190
|
-
key: string;
|
|
191
|
-
content?: Map<string, string>;
|
|
192
|
-
description?: Map<string, string>;
|
|
193
|
-
}>;
|
|
194
|
-
}
|
|
195
|
-
interface RadioRow {
|
|
196
|
-
role: 'radioRow';
|
|
197
|
-
key: string;
|
|
198
|
-
displayCondition?: Expression;
|
|
199
|
-
disabled?: Expression;
|
|
200
|
-
cells: Array<{
|
|
201
|
-
role: 'label' | 'option';
|
|
202
|
-
key: string;
|
|
203
|
-
content?: Map<string, string>;
|
|
204
|
-
description?: Map<string, string>;
|
|
205
|
-
}>;
|
|
206
|
-
}
|
|
207
|
-
export interface ResponseRowCell {
|
|
208
|
-
role: 'label' | 'check' | 'input' | 'numberInput' | 'dropDownGroup';
|
|
209
|
-
key: string;
|
|
210
|
-
content?: Map<string, string>;
|
|
211
|
-
description?: Map<string, string>;
|
|
212
|
-
properties?: ComponentProperties;
|
|
213
|
-
items?: Array<{
|
|
214
|
-
role: 'option';
|
|
215
|
-
key: string;
|
|
216
|
-
content?: Map<string, string>;
|
|
217
|
-
disabled?: Expression;
|
|
218
|
-
displayCondition?: Expression;
|
|
219
|
-
}>;
|
|
220
|
-
}
|
|
221
|
-
interface ResponseRow {
|
|
222
|
-
role: 'responseRow';
|
|
223
|
-
key: string;
|
|
224
|
-
displayCondition?: Expression;
|
|
225
|
-
disabled?: Expression;
|
|
226
|
-
cells: Array<ResponseRowCell>;
|
|
227
|
-
}
|
|
228
|
-
declare type MatrixRow = HeaderRow | RadioRow | ResponseRow;
|
|
229
|
-
export declare const initMatrixQuestion: (key: string, rows: Array<MatrixRow>, order?: Expression | undefined) => ItemGroupComponent;
|
|
230
40
|
interface EQ5DHealthSliderProps {
|
|
231
41
|
role: 'eq5d-health-indicator';
|
|
232
42
|
key: string;
|
|
@@ -238,29 +48,25 @@ interface EQ5DHealthSliderProps {
|
|
|
238
48
|
minHealthText: Map<string, string>;
|
|
239
49
|
}
|
|
240
50
|
export declare const initEQ5DHealthIndicatorQuestion: (props: EQ5DHealthSliderProps) => ItemGroupComponent;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
content: Map<string, string
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
className?: string | undefined;
|
|
263
|
-
content?: Map<string, string> | undefined;
|
|
264
|
-
disabled?: Expression | undefined;
|
|
265
|
-
}[], stackOnSmallScreen?: boolean | undefined, displayCondition?: Expression | undefined) => ItemGroupComponent;
|
|
51
|
+
export declare const SurveyItems: {
|
|
52
|
+
consent: (props: ConsentQuestionProps) => SurveyItem;
|
|
53
|
+
singleChoice: (props: OptionQuestionProps) => SurveyItem;
|
|
54
|
+
responsiveSingleChoiceArray: (props: ResponsiveSingleChoiceArrayQuestionProps) => SurveyItem;
|
|
55
|
+
responsiveBipolarLikertArray: (props: ResponsiveBipolarLikertArrayQuestionProps) => SurveyItem;
|
|
56
|
+
multipleChoice: (props: OptionQuestionProps) => SurveyItem;
|
|
57
|
+
dateInput: (props: DateInputQuestionProps) => SurveyItem;
|
|
58
|
+
timeInput: (props: TimeInputQuestionProps) => SurveyItem;
|
|
59
|
+
textInput: (props: TextInputQuestionProps) => SurveyItem;
|
|
60
|
+
clozeQuestion: (props: ClozeQuestionProps) => SurveyItem;
|
|
61
|
+
numericInput: (props: NumericInputQuestionProps) => SurveyItem;
|
|
62
|
+
multilineTextInput: (props: MultiLineTextInput) => SurveyItem;
|
|
63
|
+
dropDown: (props: DropDownQuestionProps) => SurveyItem;
|
|
64
|
+
numericSlider: (props: NumericSliderProps) => SurveyItem;
|
|
65
|
+
display: (props: DisplayProps) => SurveyItem;
|
|
66
|
+
surveyEnd: (parentKey: string, content: Map<string, string>, condition?: Expression | undefined) => SurveyItem;
|
|
67
|
+
customQuestion: (props: CustomQuestionProps) => SurveyItem;
|
|
68
|
+
old: {
|
|
69
|
+
simpleLikertGroup: (props: LikertGroupQuestionProps) => SurveyItem;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
266
72
|
export {};
|