react-survey-builder 1.0.7 → 1.0.8
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/README.md +15 -15
- package/dist/967.index.js +1 -1
- package/dist/app.css +1 -1
- package/dist/app.css.map +1 -1
- package/dist/index.js +1 -1
- package/lib/dynamic-option-list.js +52 -58
- package/lib/fieldset/FieldSet.js +7 -8
- package/lib/form.js +53 -51
- package/lib/index.js +6 -4
- package/lib/language-provider/IntlMessages.js +2 -2
- package/lib/language-provider/locales/en-us.json +8 -8
- package/lib/language-provider/locales/it-it.json +2 -2
- package/lib/language-provider/locales/vi-vn.json +1 -1
- package/lib/multi-column/MultiColumnRow.js +13 -14
- package/lib/multi-column/dustbin.js +2 -2
- package/lib/preview.js +9 -7
- package/lib/survey-elements/component-label.js +9 -5
- package/lib/survey-elements/custom-element.js +4 -5
- package/lib/survey-elements/date-picker.js +9 -15
- package/lib/survey-elements/header-bar.js +11 -8
- package/lib/survey-elements/index.js +228 -155
- package/lib/survey-elements-edit.js +134 -234
- package/lib/survey-validator.js +9 -9
- package/lib/toolbar-group-item.js +4 -2
- package/lib/toolbar.js +117 -82
- package/package.json +7 -3
- package/types/index.d.ts +23 -21
package/types/index.d.ts
CHANGED
@@ -46,7 +46,7 @@ export type StaticElement = {
|
|
46
46
|
};
|
47
47
|
export type SurveyBuilderInput = {
|
48
48
|
canHaveAnswer?: true;
|
49
|
-
|
49
|
+
fieldName: string;
|
50
50
|
label: string;
|
51
51
|
};
|
52
52
|
export type Option = {
|
@@ -59,7 +59,7 @@ export type SelectableElement = {
|
|
59
59
|
options: Option[];
|
60
60
|
} & SurveyBuilderInput;
|
61
61
|
export type ImageElement = {
|
62
|
-
|
62
|
+
fieldName: string;
|
63
63
|
src: string;
|
64
64
|
};
|
65
65
|
export type DateElement = {
|
@@ -72,15 +72,16 @@ export type DateElement = {
|
|
72
72
|
timeFormat: string;
|
73
73
|
} & SurveyBuilderInput;
|
74
74
|
export type RangeElement = {
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
75
|
+
maxLabel: string;
|
76
|
+
maxValue: number;
|
77
|
+
minLabel: string;
|
78
|
+
minValue: number;
|
79
|
+
step: number;
|
79
80
|
} & SurveyBuilderInput;
|
80
81
|
export type FileElement = {
|
81
82
|
_href: string;
|
82
|
-
|
83
|
-
|
83
|
+
filePath: string;
|
84
|
+
fieldName: string;
|
84
85
|
} & StaticElement;
|
85
86
|
export type WebsiteElement = {
|
86
87
|
href: string;
|
@@ -104,7 +105,7 @@ export type TaskData = BaseElement &
|
|
104
105
|
export type SurveyBuilderLayout = {
|
105
106
|
isContainer: true;
|
106
107
|
childItems: TaskData[];
|
107
|
-
|
108
|
+
fieldName: string;
|
108
109
|
};
|
109
110
|
export type SurveyBuilderPostData = {
|
110
111
|
task_data: TaskData[];
|
@@ -123,7 +124,7 @@ export interface SurveyBuilderProps {
|
|
123
124
|
files?: any[];
|
124
125
|
url?: string;
|
125
126
|
showCorrectColumn?: boolean;
|
126
|
-
|
127
|
+
showDescription?: boolean;
|
127
128
|
onLoad?: () => Promise<SurveyBuilderPostData>;
|
128
129
|
onPost?: (data: SurveyBuilderPostData) => void;
|
129
130
|
saveUrl?: string;
|
@@ -137,28 +138,29 @@ export class ReactSurveyBuilder extends React.Component<SurveyBuilderProps> {}
|
|
137
138
|
export interface SurveyGeneratorOnSubmitParams {
|
138
139
|
id: number;
|
139
140
|
name: string;
|
140
|
-
|
141
|
+
customName: string;
|
141
142
|
help: string;
|
142
143
|
value: string | string[];
|
144
|
+
label: string;
|
143
145
|
}
|
144
146
|
|
145
147
|
export interface SurveyGeneratorProps {
|
146
|
-
|
147
|
-
|
148
|
-
|
148
|
+
formAction: string;
|
149
|
+
formMethod: string;
|
150
|
+
actionName?: string;
|
149
151
|
onBlur?: (info: SurveyGeneratorOnSubmitParams[]) => void;
|
150
152
|
onSubmit?: (info: SurveyGeneratorOnSubmitParams[]) => void;
|
151
153
|
onChange?: (info: SurveyGeneratorOnSubmitParams[]) => void;
|
152
154
|
data: any[];
|
153
|
-
|
154
|
-
|
155
|
+
backAction?: string;
|
156
|
+
backName?: string;
|
155
157
|
task_id?: number;
|
156
|
-
|
158
|
+
answerData?: any[];
|
157
159
|
authenticity_token?: string;
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
160
|
+
hideActions?: boolean;
|
161
|
+
skipValidations?: boolean;
|
162
|
+
displayShort?: boolean;
|
163
|
+
readOnly?: boolean;
|
162
164
|
// eslint-disable-next-line no-undef
|
163
165
|
variables?: Record<any, any>;
|
164
166
|
submitButton?: JSX.Element;
|