react-survey-builder 1.0.18 → 1.0.20
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/dist/index.js +1 -1
- package/lib/index.js +8 -4
- package/lib/language-provider/locales/en-us.json +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +3 -0
package/lib/index.js
CHANGED
@@ -92,7 +92,7 @@ var ReactSurveyBuilder = exports.ReactSurveyBuilder = /*#__PURE__*/function (_Re
|
|
92
92
|
}, {
|
93
93
|
key: "render",
|
94
94
|
value: function render() {
|
95
|
-
var _this$props$
|
95
|
+
var _this$props$editSurve,
|
96
96
|
_this2 = this,
|
97
97
|
_this$props$saveSurve;
|
98
98
|
var toolbarProps = {
|
@@ -132,14 +132,18 @@ var ReactSurveyBuilder = exports.ReactSurveyBuilder = /*#__PURE__*/function (_Re
|
|
132
132
|
saveAlways: this.props.saveAlways
|
133
133
|
})), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Col, {
|
134
134
|
md: 3
|
135
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
135
|
+
}, (!!!this.props.saveAlways || this.props.editSurveyBlock || this.props.previewSurveyBlock || this.props.surveyName) && /*#__PURE__*/_react["default"].createElement("div", {
|
136
|
+
className: this.props.surveyToolbarClassName
|
137
|
+
}, (!!!this.props.saveAlways || this.props.editSurveyBlock || this.props.surveyName) && /*#__PURE__*/_react["default"].createElement("div", {
|
136
138
|
className: "border border-light border-3 p-3 d-grid gap-1 mb-3"
|
137
|
-
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("h4", null,
|
139
|
+
}, (_this$props$editSurve = this.props.editSurveyBlock) !== null && _this$props$editSurve !== void 0 ? _this$props$editSurve : this.props.surveyName ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("h4", null, this.props.surveyName)) : null, !!!this.props.saveAlways && /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
|
138
140
|
variant: "primary",
|
139
141
|
onClick: function onClick() {
|
140
142
|
_this2.saveFormData();
|
141
143
|
}
|
142
|
-
}, (_this$props$saveSurve = this.props.saveSurveyName) !== null && _this$props$saveSurve !== void 0 ? _this$props$saveSurve : 'Save Survey')), /*#__PURE__*/_react["default"].createElement(
|
144
|
+
}, (_this$props$saveSurve = this.props.saveSurveyName) !== null && _this$props$saveSurve !== void 0 ? _this$props$saveSurve : 'Save Survey')), this.props.previewSurveyBlock ? /*#__PURE__*/_react["default"].createElement("div", {
|
145
|
+
className: "border border-light border-3 p-3 d-grid gap-1 mb-3"
|
146
|
+
}, this.props.previewSurveyBlock) : null), /*#__PURE__*/_react["default"].createElement(_toolbar["default"], (0, _extends2["default"])({}, toolbarProps, {
|
143
147
|
customItems: this.props.customToolbarItems
|
144
148
|
}))))))));
|
145
149
|
}
|
@@ -50,7 +50,7 @@
|
|
50
50
|
"place-holder-tag-1": "Place holder option 1",
|
51
51
|
"place-holder-tag-2": "Place holder option 2",
|
52
52
|
"place-holder-tag-3": "Place holder option 3",
|
53
|
-
"toolbox": "Toolbox",
|
53
|
+
"toolbox": "Survey Blocks Toolbox",
|
54
54
|
"header-text": "Header Text",
|
55
55
|
"label": "Label",
|
56
56
|
"paragraph": "Paragraph",
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
@@ -128,6 +128,9 @@ export type ToolbarItem = {
|
|
128
128
|
export interface SurveyBuilderProps {
|
129
129
|
surveyName?: string;
|
130
130
|
saveSurveyName?: string;
|
131
|
+
editSurveyBlock?: React.ReactNode;
|
132
|
+
previewSurveyBlock?: React.ReactNode;
|
133
|
+
surveyToolbarClassName?: string;
|
131
134
|
toolbarItems?: ToolbarItem[];
|
132
135
|
files?: any[];
|
133
136
|
url?: string;
|