react-survey-builder 1.0.71 → 1.0.73
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 +2 -0
- package/dist/app.css +1 -1
- package/dist/app.css.map +1 -1
- package/dist/bundle.js +628 -35
- package/dist/src_survey-elements-edit_jsx.bundle.js +2 -2
- package/lib/dynamic-option-list.js +140 -155
- package/lib/fieldset/FieldSet.js +118 -0
- package/lib/fieldset/index.js +2 -132
- package/lib/form-fields.js +45 -16
- package/lib/form-steps.js +793 -0
- package/lib/form.js +47 -17
- package/lib/index.js +130 -124
- package/lib/multi-column/MultiColumnRow.js +69 -81
- package/lib/multi-column/dustbin.js +52 -18
- package/lib/preview.js +378 -349
- package/lib/sortable-element.js +9 -0
- package/lib/sortable-form-elements.js +28 -2
- package/lib/step/Step.js +147 -0
- package/lib/step/index.js +2 -0
- package/lib/survey-elements/component-drag-layer.js +13 -8
- package/lib/survey-elements/component-error-message.js +1 -1
- package/lib/survey-elements/component-header.js +12 -11
- package/lib/survey-elements/custom-element.js +51 -62
- package/lib/survey-elements/header-bar.js +36 -55
- package/lib/survey-elements/index.js +372 -370
- package/lib/survey-elements/star-rating.js +232 -282
- package/lib/survey-elements-edit.js +659 -564
- package/lib/survey-place-holder.js +9 -33
- package/lib/survey-validator.js +45 -75
- package/lib/toolbar-draggable-item.js +10 -34
- package/lib/toolbar-group-item.js +1 -1
- package/lib/toolbar.js +578 -558
- package/lib/utils/objectUtils.js +139 -0
- package/package.json +6 -5
- package/types/index.d.ts +5 -0
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["onChange", "onBlur", "value", "name"];
|
|
3
|
-
function
|
|
4
|
-
function
|
|
5
|
-
function
|
|
2
|
+
var _excluded = ["containerProps", "onChange", "onBlur", "value", "name"];
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
10
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
11
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
function
|
|
9
|
-
function
|
|
10
|
-
function
|
|
11
|
-
function
|
|
12
|
-
function
|
|
13
|
-
function
|
|
14
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
15
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
16
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
18
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
19
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
20
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
|
18
21
|
import React from 'react';
|
|
19
22
|
import TextAreaAutosize from 'react-textarea-autosize';
|
|
20
|
-
import { ContentState, EditorState, convertFromHTML as
|
|
23
|
+
import { ContentState, EditorState, convertFromHTML as draftJsConvertFromHTML, convertToRaw } from 'draft-js';
|
|
21
24
|
import draftToHtml from 'draftjs-to-html';
|
|
22
25
|
import DynamicOptionList from './dynamic-option-list';
|
|
23
26
|
import { get } from './stores/requests';
|
|
24
27
|
import { FaTimes } from 'react-icons/fa';
|
|
25
|
-
import { Button, Col, Form, Row } from 'react-bootstrap
|
|
28
|
+
import { Button, Col, Form, Row } from 'react-bootstrap';
|
|
26
29
|
import Editor from 'react-simple-wysiwyg';
|
|
27
30
|
import ID from './UUID';
|
|
31
|
+
import { isListNotEmpty, isObjectNotEmpty } from './utils/objectUtils';
|
|
28
32
|
var CustomWysiwygInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
29
|
-
var
|
|
33
|
+
var containerProps = _ref.containerProps,
|
|
34
|
+
onChange = _ref.onChange,
|
|
30
35
|
onBlur = _ref.onBlur,
|
|
31
36
|
value = _ref.value,
|
|
32
37
|
name = _ref.name,
|
|
@@ -36,569 +41,659 @@ var CustomWysiwygInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
36
41
|
value: value,
|
|
37
42
|
name: name,
|
|
38
43
|
onChange: onChange,
|
|
39
|
-
containerProps:
|
|
40
|
-
style: {
|
|
41
|
-
height: '500px',
|
|
42
|
-
width: '100%',
|
|
43
|
-
resize: 'both'
|
|
44
|
-
}
|
|
45
|
-
}
|
|
44
|
+
containerProps: containerProps
|
|
46
45
|
}));
|
|
47
46
|
});
|
|
48
|
-
var SurveyElementsEdit =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
var SurveyElementsEdit = function SurveyElementsEdit(_ref2) {
|
|
48
|
+
var _element$options;
|
|
49
|
+
var element = _ref2.element,
|
|
50
|
+
setElement = _ref2.setElement,
|
|
51
|
+
_ref2$files = _ref2.files,
|
|
52
|
+
files = _ref2$files === void 0 ? [] : _ref2$files,
|
|
53
|
+
_ref2$showCorrectColu = _ref2.showCorrectColumn,
|
|
54
|
+
showCorrectColumn = _ref2$showCorrectColu === void 0 ? false : _ref2$showCorrectColu,
|
|
55
|
+
_ref2$showDescription = _ref2.showDescription,
|
|
56
|
+
showDescription = _ref2$showDescription === void 0 ? false : _ref2$showDescription,
|
|
57
|
+
manualEditModeOff = _ref2.manualEditModeOff,
|
|
58
|
+
updateElement = _ref2.updateElement;
|
|
59
|
+
var _React$useState = React.useState(false),
|
|
60
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
61
|
+
dirty = _React$useState2[0],
|
|
62
|
+
setDirty = _React$useState2[1];
|
|
63
|
+
var toggleRequired = function toggleRequired() {
|
|
64
|
+
// const thisElement = isObjectNotEmpty(element) ? { ...element } : {};
|
|
65
|
+
};
|
|
66
|
+
var editElementProp = function editElementProp(elementProperty, targetProperty, e) {
|
|
67
|
+
// elemProperty could be content or label
|
|
68
|
+
// targProperty could be value or checked
|
|
69
|
+
var thisElement = isObjectNotEmpty(element) ? _objectSpread({}, element) : {};
|
|
70
|
+
thisElement[elementProperty] = e.target[targetProperty];
|
|
71
|
+
setElement(thisElement);
|
|
72
|
+
setDirty(true);
|
|
73
|
+
if (targetProperty === 'checked') {
|
|
74
|
+
onUpdateElement();
|
|
65
75
|
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
};
|
|
77
|
+
var onEditorStateChange = function onEditorStateChange(index, property, editorContent) {
|
|
78
|
+
var html = draftToHtml(convertToRaw(editorContent.getCurrentContent())).replace(/ /g, ' ').replace(/(?:\r\n|\r|\n)/g, '');
|
|
79
|
+
var thisElement = isObjectNotEmpty(element) ? _objectSpread({}, element) : {};
|
|
80
|
+
thisElement[property] = html;
|
|
81
|
+
setElement(thisElement);
|
|
82
|
+
setDirty(true);
|
|
83
|
+
};
|
|
84
|
+
var onUpdateElement = function onUpdateElement() {
|
|
85
|
+
var thisElement = isObjectNotEmpty(element) ? _objectSpread({}, element) : {};
|
|
86
|
+
// to prevent ajax calls with no change
|
|
87
|
+
if (dirty) {
|
|
88
|
+
updateElement(thisElement);
|
|
89
|
+
setDirty(false);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
var convertFromHTML = function convertFromHTML(content) {
|
|
93
|
+
var newContent = draftJsConvertFromHTML(content);
|
|
94
|
+
if (!newContent.contentBlocks || !newContent.contentBlocks.length) {
|
|
95
|
+
// to prevent crash when no contents in editor
|
|
96
|
+
return EditorState.createEmpty();
|
|
97
|
+
}
|
|
98
|
+
var contentState = ContentState.createFromBlockArray(newContent);
|
|
99
|
+
return EditorState.createWithContent(contentState);
|
|
100
|
+
};
|
|
101
|
+
var addOptions = function addOptions() {
|
|
102
|
+
var optionsApiUrl = document.getElementById('optionsApiUrl').value;
|
|
103
|
+
if (optionsApiUrl) {
|
|
104
|
+
get(optionsApiUrl).then(function (data) {
|
|
105
|
+
var options = [];
|
|
106
|
+
data.forEach(function (dataOption) {
|
|
107
|
+
// eslint-disable-next-line no-param-reassign
|
|
108
|
+
dataOption.key = ID.uuid();
|
|
109
|
+
options.push(dataOption);
|
|
110
|
+
});
|
|
111
|
+
var thisElement = isObjectNotEmpty(element) ? _objectSpread({}, element) : {};
|
|
112
|
+
thisElement.options = options;
|
|
113
|
+
setElement(thisElement);
|
|
114
|
+
setDirty(true);
|
|
81
115
|
});
|
|
82
116
|
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
// const html = draftToHtml(convertToRaw(editorContent.getCurrentContent())).replace(/<p>/g, '').replace(/<\/p>/g, '').replace(/ /g, ' ').replace(/(?:\r\n|\r|\n)/g, '');
|
|
88
|
-
var html = draftToHtml(convertToRaw(editorContent.getCurrentContent())).replace(/ /g, ' ').replace(/(?:\r\n|\r|\n)/g, '');
|
|
89
|
-
var thisElement = this.state.element;
|
|
90
|
-
thisElement[property] = html;
|
|
91
|
-
this.setState({
|
|
92
|
-
element: thisElement,
|
|
117
|
+
};
|
|
118
|
+
React.useEffect(function () {
|
|
119
|
+
if (dirty) {
|
|
120
|
+
var thisElement = isObjectNotEmpty(element) ? _objectSpread(_objectSpread({}, element), {}, {
|
|
93
121
|
dirty: true
|
|
94
|
-
})
|
|
122
|
+
}) : {
|
|
123
|
+
dirty: true
|
|
124
|
+
};
|
|
125
|
+
updateElement(thisElement);
|
|
95
126
|
}
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
127
|
+
}, [dirty, element]);
|
|
128
|
+
var thisRequiredChecked = element.hasOwnProperty('required') ? element.required : false;
|
|
129
|
+
var thisDefaultChecked = element.hasOwnProperty('defaultChecked') ? element.defaultChecked : false;
|
|
130
|
+
var thisReadOnly = element.hasOwnProperty('readOnly') ? element.readOnly : false;
|
|
131
|
+
var thisDefaultToday = element.hasOwnProperty('defaultToday') ? element.defaultToday : false;
|
|
132
|
+
var thisCheckedInline = element.hasOwnProperty('inline') ? element.inline : false;
|
|
133
|
+
var thisCheckedBold = element.hasOwnProperty('bold') ? element.bold : false;
|
|
134
|
+
var thisCheckedItalic = element.hasOwnProperty('italic') ? element.italic : false;
|
|
135
|
+
var thisCheckedCenter = element.hasOwnProperty('center') ? element.center : false;
|
|
136
|
+
var thisCheckedPageBreak = element.hasOwnProperty('pageBreakBefore') ? element.pageBreakBefore : false;
|
|
137
|
+
var thisCheckedAlternateForm = element.hasOwnProperty('alternateForm') ? element.alternateForm : false;
|
|
138
|
+
var thisCheckedHideLabel = element.hasOwnProperty('hideLabel') ? element.hideLabel : false;
|
|
139
|
+
var thisCheckedConditional = element.hasOwnProperty('conditional') ? element.conditional : false;
|
|
140
|
+
var canHaveAnswer = ['NumberInput', 'EmailInput', 'TextInput', 'PhoneNumber', 'TextArea', 'DatePicker', 'Dropdown', 'Tags', 'Checkboxes', 'Checkbox', 'RadioButtons', 'Rating', 'Range'].indexOf(element.element) !== -1;
|
|
141
|
+
var canHaveOptionValue = ['Dropdown', 'Tags', 'Checkboxes', 'RadioButtons'].indexOf(element.element) !== -1;
|
|
142
|
+
var canHaveOptionCorrect = canHaveAnswer && canHaveOptionValue;
|
|
143
|
+
var thisFiles = isListNotEmpty(files) ? _toConsumableArray(files) : [];
|
|
144
|
+
if (thisFiles.length < 1 || thisFiles.length > 0 && thisFiles[0].id !== '') {
|
|
145
|
+
thisFiles.unshift({
|
|
146
|
+
id: '',
|
|
147
|
+
file_name: ''
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
151
|
+
className: "clearfix"
|
|
152
|
+
}, /*#__PURE__*/React.createElement("h4", {
|
|
153
|
+
className: "float-start"
|
|
154
|
+
}, element.text), /*#__PURE__*/React.createElement(FaTimes, {
|
|
155
|
+
className: "float-end dismiss-edit",
|
|
156
|
+
onClick: manualEditModeOff
|
|
157
|
+
})), element.hasOwnProperty('content') && (element.element === 'Header' || element.element === 'Label' || element.element === 'Paragraph' || element.element === 'ContentBody') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
158
|
+
className: "form-group mb-5"
|
|
159
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
160
|
+
className: "fw-bold"
|
|
161
|
+
}, "Text to display:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
162
|
+
type: "text",
|
|
163
|
+
id: "content",
|
|
164
|
+
name: "content",
|
|
165
|
+
as: CustomWysiwygInput,
|
|
166
|
+
value: element.content,
|
|
167
|
+
defaultValue: element.content,
|
|
168
|
+
onBlur: onUpdateElement,
|
|
169
|
+
onChange: function onChange(e) {
|
|
170
|
+
editElementProp('content', 'value', e);
|
|
171
|
+
},
|
|
172
|
+
containerProps: {
|
|
173
|
+
style: {
|
|
174
|
+
height: '200px',
|
|
175
|
+
width: '100%',
|
|
176
|
+
resize: 'vertical'
|
|
106
177
|
}
|
|
107
178
|
}
|
|
108
|
-
}, {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
179
|
+
})), element.hasOwnProperty('filePath') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
180
|
+
className: "form-group mb-5"
|
|
181
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
182
|
+
className: "fw-bold",
|
|
183
|
+
htmlFor: "fileSelect"
|
|
184
|
+
}, "Choose file:"), /*#__PURE__*/React.createElement(Form.Select, {
|
|
185
|
+
id: "fileSelect",
|
|
186
|
+
defaultValue: element.filePath,
|
|
187
|
+
onBlur: onUpdateElement,
|
|
188
|
+
onChange: function onChange(e) {
|
|
189
|
+
editElementProp('filePath', 'value', e);
|
|
190
|
+
}
|
|
191
|
+
}, thisFiles.map(function (file) {
|
|
192
|
+
var thisKey = "file_".concat(file.id);
|
|
193
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
194
|
+
value: file.id,
|
|
195
|
+
key: thisKey
|
|
196
|
+
}, file.file_name);
|
|
197
|
+
}))), element.hasOwnProperty('href') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
198
|
+
className: "form-group mb-5"
|
|
199
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
200
|
+
className: "fw-bold",
|
|
201
|
+
htmlFor: "href"
|
|
202
|
+
}, "Link to:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
203
|
+
id: "href",
|
|
204
|
+
type: "text",
|
|
205
|
+
defaultValue: element.href,
|
|
206
|
+
onBlur: onUpdateElement,
|
|
207
|
+
onChange: function onChange(e) {
|
|
208
|
+
editElementProp('href', 'value', e);
|
|
209
|
+
}
|
|
210
|
+
})), element.hasOwnProperty('label') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
211
|
+
className: "form-group mb-5"
|
|
212
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
213
|
+
className: "fw-bold"
|
|
214
|
+
}, "Display Label:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
215
|
+
type: "text",
|
|
216
|
+
id: "label",
|
|
217
|
+
name: "label",
|
|
218
|
+
as: CustomWysiwygInput,
|
|
219
|
+
value: element.label,
|
|
220
|
+
defaultValue: element.label,
|
|
221
|
+
onBlur: onUpdateElement,
|
|
222
|
+
onChange: function onChange(e) {
|
|
223
|
+
editElementProp('label', 'value', e);
|
|
224
|
+
},
|
|
225
|
+
containerProps: {
|
|
226
|
+
style: {
|
|
227
|
+
height: '200px',
|
|
228
|
+
width: '100%',
|
|
229
|
+
resize: 'vertical'
|
|
115
230
|
}
|
|
116
|
-
var contentState = ContentState.createFromBlockArray(newContent);
|
|
117
|
-
return EditorState.createWithContent(contentState);
|
|
118
231
|
}
|
|
119
|
-
}, {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
232
|
+
})), (element.hasOwnProperty('required') || element.hasOwnProperty('readOnly') || element.hasOwnProperty('defaultToday') || ['Checkboxes', 'Checkbox'].indexOf(element.element) !== -1 || (element.element === 'RadioButtons' || element.element === 'Checkboxes') && element.hasOwnProperty('inline')) && /*#__PURE__*/React.createElement(Form.Group, {
|
|
233
|
+
className: "form-group mb-5"
|
|
234
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
235
|
+
className: "fw-bold"
|
|
236
|
+
}, "Field Properties:"), element.hasOwnProperty('required') && /*#__PURE__*/React.createElement(Form.Check, {
|
|
237
|
+
id: "is-required",
|
|
238
|
+
label: "Required",
|
|
239
|
+
type: "checkbox",
|
|
240
|
+
checked: thisRequiredChecked,
|
|
241
|
+
value: true,
|
|
242
|
+
onChange: function onChange(e) {
|
|
243
|
+
editElementProp('required', 'checked', e);
|
|
244
|
+
}
|
|
245
|
+
}), element.hasOwnProperty('readOnly') && /*#__PURE__*/React.createElement(Form.Check, {
|
|
246
|
+
id: "is-read-only",
|
|
247
|
+
label: "Read Only",
|
|
248
|
+
type: "checkbox",
|
|
249
|
+
checked: thisReadOnly,
|
|
250
|
+
value: true,
|
|
251
|
+
onChange: function onChange(e) {
|
|
252
|
+
editElementProp('readOnly', 'checked', e);
|
|
253
|
+
}
|
|
254
|
+
}), element.hasOwnProperty('defaultToday') && /*#__PURE__*/React.createElement(Form.Check, {
|
|
255
|
+
id: "is-default-to-today",
|
|
256
|
+
label: "Default to Today",
|
|
257
|
+
type: "checkbox",
|
|
258
|
+
checked: thisDefaultToday,
|
|
259
|
+
value: true,
|
|
260
|
+
onChange: function onChange(e) {
|
|
261
|
+
editElementProp('defaultToday', 'checked', e);
|
|
262
|
+
}
|
|
263
|
+
}), ['Checkboxes', 'Checkbox'].indexOf(element.element) !== -1 && /*#__PURE__*/React.createElement(Form.Check, {
|
|
264
|
+
id: "default-checked",
|
|
265
|
+
label: "Default Checked",
|
|
266
|
+
type: "checkbox",
|
|
267
|
+
checked: thisDefaultChecked,
|
|
268
|
+
value: true,
|
|
269
|
+
onChange: function onChange(e) {
|
|
270
|
+
editElementProp('defaultChecked', 'checked', e);
|
|
271
|
+
}
|
|
272
|
+
}), (element.element === 'RadioButtons' || element.element === 'Checkboxes') && element.hasOwnProperty('inline') && /*#__PURE__*/React.createElement(Form.Check, {
|
|
273
|
+
id: "display-horizontal",
|
|
274
|
+
label: "Display Horizontal",
|
|
275
|
+
type: "checkbox",
|
|
276
|
+
checked: thisCheckedInline,
|
|
277
|
+
value: true,
|
|
278
|
+
onChange: function onChange(e) {
|
|
279
|
+
editElementProp('inline', 'checked', e);
|
|
280
|
+
}
|
|
281
|
+
})), element.element === 'Checkbox' && /*#__PURE__*/React.createElement(Form.Group, {
|
|
282
|
+
className: "form-group mb-5"
|
|
283
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
284
|
+
className: "fw-bold"
|
|
285
|
+
}, "Checkbox Label Text:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
286
|
+
type: "text",
|
|
287
|
+
id: "boxLabel",
|
|
288
|
+
name: "boxLabel",
|
|
289
|
+
as: CustomWysiwygInput,
|
|
290
|
+
value: element.boxLabel,
|
|
291
|
+
defaultValue: element.boxLabel,
|
|
292
|
+
onBlur: onUpdateElement,
|
|
293
|
+
onChange: function onChange(e) {
|
|
294
|
+
editElementProp('boxLabel', 'value', e);
|
|
295
|
+
},
|
|
296
|
+
containerProps: {
|
|
297
|
+
style: {
|
|
298
|
+
height: '200px',
|
|
299
|
+
width: '100%',
|
|
300
|
+
resize: 'vertical'
|
|
139
301
|
}
|
|
140
302
|
}
|
|
303
|
+
})), element.hasOwnProperty('src') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
304
|
+
className: "form-group mb-5"
|
|
305
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
306
|
+
className: "fw-bold",
|
|
307
|
+
htmlFor: "srcInput"
|
|
308
|
+
}, "Link to:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
309
|
+
id: "srcInput",
|
|
310
|
+
type: "text",
|
|
311
|
+
defaultValue: element.src,
|
|
312
|
+
onBlur: onUpdateElement,
|
|
313
|
+
onChange: function onChange(e) {
|
|
314
|
+
editElementProp('src', 'value', e);
|
|
315
|
+
}
|
|
316
|
+
})), (element.element === 'Image' || element.element === 'Camera') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
317
|
+
className: "form-group mb-5"
|
|
318
|
+
}, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
|
|
319
|
+
sm: 3
|
|
320
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
321
|
+
className: "fw-bold",
|
|
322
|
+
htmlFor: "do-center"
|
|
323
|
+
}, "Alignment:"), /*#__PURE__*/React.createElement(Form.Check, {
|
|
324
|
+
id: "do-center",
|
|
325
|
+
label: "Center",
|
|
326
|
+
type: "checkbox",
|
|
327
|
+
checked: thisCheckedCenter,
|
|
328
|
+
value: true,
|
|
329
|
+
onChange: function onChange(e) {
|
|
330
|
+
editElementProp('center', 'checked', e);
|
|
331
|
+
}
|
|
332
|
+
})), /*#__PURE__*/React.createElement(Col, {
|
|
333
|
+
sm: 3
|
|
334
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
335
|
+
className: "fw-bold",
|
|
336
|
+
htmlFor: "elementWidth"
|
|
337
|
+
}, "Width:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
338
|
+
id: "elementWidth",
|
|
339
|
+
type: "number",
|
|
340
|
+
defaultValue: element.width,
|
|
341
|
+
onBlur: onUpdateElement,
|
|
342
|
+
onChange: function onChange(e) {
|
|
343
|
+
editElementProp('width', 'value', e);
|
|
344
|
+
}
|
|
345
|
+
})), /*#__PURE__*/React.createElement(Col, {
|
|
346
|
+
sm: 3
|
|
347
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
348
|
+
className: "fw-bold",
|
|
349
|
+
htmlFor: "elementHeight"
|
|
350
|
+
}, "Height:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
351
|
+
id: "elementHeight",
|
|
352
|
+
type: "number",
|
|
353
|
+
defaultValue: element.height,
|
|
354
|
+
onBlur: onUpdateElement,
|
|
355
|
+
onChange: function onChange(e) {
|
|
356
|
+
editElementProp('height', 'value', e);
|
|
357
|
+
}
|
|
358
|
+
})))), element.element === 'FileUpload' && /*#__PURE__*/React.createElement(Form.Group, {
|
|
359
|
+
className: "form-group mb-5"
|
|
360
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
361
|
+
className: "fw-bold",
|
|
362
|
+
htmlFor: "fileType"
|
|
363
|
+
}, "Choose file type:"), /*#__PURE__*/React.createElement(Form.Select, {
|
|
364
|
+
id: "fileType",
|
|
365
|
+
onBlur: onUpdateElement,
|
|
366
|
+
onChange: function onChange(e) {
|
|
367
|
+
editElementProp('fileType', 'value', e);
|
|
368
|
+
}
|
|
369
|
+
}, [{
|
|
370
|
+
type: 'image, application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, video/mp4,video/x-m4v,video/*',
|
|
371
|
+
typeName: 'All File Type'
|
|
141
372
|
}, {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
onBlur: this.updateElement.bind(this),
|
|
466
|
-
onChange: this.editElementProp.bind(this, 'defaultValue', 'value')
|
|
467
|
-
}))), this.props.element.hasOwnProperty('static') && this.props.element["static"] && this.props.element.hasOwnProperty('bold') && this.props.element.hasOwnProperty('italic') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
468
|
-
className: "form-group mb-5"
|
|
469
|
-
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
470
|
-
className: "fw-bold"
|
|
471
|
-
}, "Text Style:"), /*#__PURE__*/React.createElement(Form.Check, {
|
|
472
|
-
id: "do-bold",
|
|
473
|
-
inline: true,
|
|
474
|
-
label: "Bold",
|
|
475
|
-
type: "checkbox",
|
|
476
|
-
checked: thisCheckedBold,
|
|
477
|
-
value: true,
|
|
478
|
-
onChange: this.editElementProp.bind(this, 'bold', 'checked')
|
|
479
|
-
}), /*#__PURE__*/React.createElement(Form.Check, {
|
|
480
|
-
id: "do-italic",
|
|
481
|
-
inline: true,
|
|
482
|
-
label: "Italic",
|
|
483
|
-
type: "checkbox",
|
|
484
|
-
checked: thisCheckedItalic,
|
|
485
|
-
value: true,
|
|
486
|
-
onChange: this.editElementProp.bind(this, 'italic', 'checked')
|
|
487
|
-
})), this.props.element.hasOwnProperty('placeholder') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
488
|
-
className: "form-group mb-5"
|
|
489
|
-
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
490
|
-
className: "fw-bold",
|
|
491
|
-
htmlFor: "placeholder"
|
|
492
|
-
}, "Placeholder:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
493
|
-
type: "text",
|
|
494
|
-
id: "placeholder",
|
|
495
|
-
defaultValue: this.props.element.placeholder,
|
|
496
|
-
onBlur: this.updateElement.bind(this),
|
|
497
|
-
onChange: this.editElementProp.bind(this, 'placeholder', 'value')
|
|
498
|
-
})), this.props.element.hasOwnProperty('customName') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
499
|
-
className: "form-group mb-5"
|
|
500
|
-
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
501
|
-
className: "fw-bold",
|
|
502
|
-
htmlFor: "customName"
|
|
503
|
-
}, "A Name To Give This Input That Will Show Up In Data Retrieval:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
504
|
-
type: "text",
|
|
505
|
-
id: "customName",
|
|
506
|
-
defaultValue: this.props.element.customName,
|
|
507
|
-
onBlur: this.updateElement.bind(this),
|
|
508
|
-
onChange: this.editElementProp.bind(this, 'customName', 'value')
|
|
509
|
-
})), this.props.element.hasOwnProperty('labelLocation') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
510
|
-
className: "form-group mb-5"
|
|
511
|
-
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
512
|
-
className: "fw-bold",
|
|
513
|
-
htmlFor: "labelLocation"
|
|
514
|
-
}, "Choose Label Location:"), /*#__PURE__*/React.createElement(Form.Select, {
|
|
515
|
-
id: "labelLocation",
|
|
516
|
-
defaultValue: this.props.element.labelLocation,
|
|
517
|
-
onBlur: this.updateElement.bind(this),
|
|
518
|
-
onChange: this.editElementProp.bind(this, 'labelLocation', 'value')
|
|
519
|
-
}, /*#__PURE__*/React.createElement("option", {
|
|
520
|
-
value: "ABOVE"
|
|
521
|
-
}, "Above Form Field"), /*#__PURE__*/React.createElement("option", {
|
|
522
|
-
value: "FLOATING"
|
|
523
|
-
}, "Floating Inside Form Field"))), this.props.element.hasOwnProperty('hideLabel') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
524
|
-
className: "form-group mb-5"
|
|
525
|
-
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
526
|
-
className: "fw-bold"
|
|
527
|
-
}, "Hide Label:"), /*#__PURE__*/React.createElement(Form.Check, {
|
|
528
|
-
id: "hide-label",
|
|
529
|
-
label: "Hide Label",
|
|
530
|
-
type: "checkbox",
|
|
531
|
-
checked: thisCheckedHideLabel,
|
|
532
|
-
value: true,
|
|
533
|
-
onChange: this.editElementProp.bind(this, 'hideLabel', 'checked')
|
|
534
|
-
})), this.props.element.hasOwnProperty('help') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
535
|
-
className: "form-group mb-5"
|
|
536
|
-
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
537
|
-
className: "fw-bold",
|
|
538
|
-
htmlFor: "help"
|
|
539
|
-
}, "Help instructions/details that will show up beneath the input field:"), /*#__PURE__*/React.createElement(TextAreaAutosize, {
|
|
540
|
-
type: "text",
|
|
541
|
-
className: "form-control",
|
|
542
|
-
id: "help",
|
|
543
|
-
defaultValue: this.props.element.help,
|
|
544
|
-
onBlur: this.updateElement.bind(this),
|
|
545
|
-
onChange: this.editElementProp.bind(this, 'help', 'value')
|
|
546
|
-
})), (this.props.showDescription && !this.props.element["static"] || this.props.element.hasOwnProperty('description')) && /*#__PURE__*/React.createElement(Form.Group, {
|
|
547
|
-
className: "form-group mb-5"
|
|
548
|
-
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
549
|
-
className: "fw-bold",
|
|
550
|
-
htmlFor: "description"
|
|
551
|
-
}, "Description:"), /*#__PURE__*/React.createElement(TextAreaAutosize, {
|
|
552
|
-
type: "text",
|
|
553
|
-
className: "form-control",
|
|
554
|
-
id: "description",
|
|
555
|
-
defaultValue: this.props.element.description,
|
|
556
|
-
onBlur: this.updateElement.bind(this),
|
|
557
|
-
onChange: this.editElementProp.bind(this, 'description', 'value')
|
|
558
|
-
})), this.props.showCorrectColumn && canHaveAnswer && !this.props.element.hasOwnProperty('options') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
559
|
-
className: "form-group mb-5"
|
|
560
|
-
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
561
|
-
className: "fw-bold",
|
|
562
|
-
htmlFor: "correct"
|
|
563
|
-
}, "Correct Answer:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
564
|
-
id: "correct",
|
|
565
|
-
type: "text",
|
|
566
|
-
defaultValue: this.props.element.correct,
|
|
567
|
-
onBlur: this.updateElement.bind(this),
|
|
568
|
-
onChange: this.editElementProp.bind(this, 'correct', 'value')
|
|
569
|
-
})), this.props.element.canPopulateFromApi && this.props.element.hasOwnProperty('options') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
570
|
-
className: "form-group mb-5"
|
|
571
|
-
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
572
|
-
className: "fw-bold",
|
|
573
|
-
htmlFor: "optionsApiUrl"
|
|
574
|
-
}, "Populate Options from API:"), /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
|
|
575
|
-
sm: 6
|
|
576
|
-
}, /*#__PURE__*/React.createElement(Form.Control, {
|
|
577
|
-
style: {
|
|
578
|
-
width: '100%'
|
|
579
|
-
},
|
|
580
|
-
type: "text",
|
|
581
|
-
id: "optionsApiUrl",
|
|
582
|
-
placeholder: "http://localhost:8080/api/optionsdata"
|
|
583
|
-
})), /*#__PURE__*/React.createElement(Col, {
|
|
584
|
-
sm: 6
|
|
585
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
586
|
-
variant: "success",
|
|
587
|
-
onClick: this.addOptions.bind(this)
|
|
588
|
-
}, "Populate")))), this.props.element.hasOwnProperty('options') && /*#__PURE__*/React.createElement(DynamicOptionList, {
|
|
589
|
-
showCorrectColumn: this.props.showCorrectColumn,
|
|
590
|
-
canHaveOptionCorrect: canHaveOptionCorrect,
|
|
591
|
-
canHaveOptionValue: canHaveOptionValue,
|
|
592
|
-
item: this.props.preview.state.item,
|
|
593
|
-
updateElement: this.props.updateElement,
|
|
594
|
-
preview: this.props.preview,
|
|
595
|
-
element: this.props.element,
|
|
596
|
-
key: this.props.element.options.length
|
|
597
|
-
}));
|
|
598
|
-
}
|
|
599
|
-
}]);
|
|
600
|
-
}(React.Component);
|
|
601
|
-
export { SurveyElementsEdit as default };
|
|
373
|
+
type: 'image',
|
|
374
|
+
typeName: 'Image'
|
|
375
|
+
}, {
|
|
376
|
+
type: 'application/pdf',
|
|
377
|
+
typeName: 'PDF'
|
|
378
|
+
}, {
|
|
379
|
+
type: 'application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
380
|
+
typeName: 'Word'
|
|
381
|
+
}, {
|
|
382
|
+
type: 'application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
383
|
+
typeName: 'Excel'
|
|
384
|
+
}, {
|
|
385
|
+
type: 'application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
386
|
+
typeName: 'Powerpoint'
|
|
387
|
+
}, {
|
|
388
|
+
type: 'video/mp4,video/x-m4v,video/*',
|
|
389
|
+
typeName: 'Videos'
|
|
390
|
+
}].map(function (file, index) {
|
|
391
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
392
|
+
value: file.type,
|
|
393
|
+
key: index
|
|
394
|
+
}, file.typeName);
|
|
395
|
+
}))), element.hasOwnProperty('pageBreakBefore') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
396
|
+
className: "form-group mb-5"
|
|
397
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
398
|
+
className: "fw-bold"
|
|
399
|
+
}, "Print options:"), /*#__PURE__*/React.createElement(Form.Check, {
|
|
400
|
+
id: "page-break-before-element",
|
|
401
|
+
label: "Page Break Before Element",
|
|
402
|
+
type: "checkbox",
|
|
403
|
+
checked: thisCheckedPageBreak,
|
|
404
|
+
value: true,
|
|
405
|
+
onChange: function onChange(e) {
|
|
406
|
+
editElementProp('pageBreakBefore', 'checked', e);
|
|
407
|
+
}
|
|
408
|
+
})), element.hasOwnProperty('alternateForm') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
409
|
+
className: "form-group mb-5"
|
|
410
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
411
|
+
className: "fw-bold"
|
|
412
|
+
}, "Alternate/Signature Page:"), /*#__PURE__*/React.createElement(Form.Check, {
|
|
413
|
+
id: "display-on-alternate",
|
|
414
|
+
label: "Display on alternate/signature Page",
|
|
415
|
+
type: "checkbox",
|
|
416
|
+
checked: thisCheckedAlternateForm,
|
|
417
|
+
value: true,
|
|
418
|
+
onChange: function onChange(e) {
|
|
419
|
+
editElementProp('alternateForm', 'checked', e);
|
|
420
|
+
}
|
|
421
|
+
})), element.hasOwnProperty('step') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
422
|
+
className: "form-group mb-5"
|
|
423
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
424
|
+
className: "form-group-range"
|
|
425
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
426
|
+
className: "fw-bold",
|
|
427
|
+
htmlFor: "rangeStep"
|
|
428
|
+
}, "Step:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
429
|
+
id: "rangeStep",
|
|
430
|
+
type: "number",
|
|
431
|
+
defaultValue: element.step,
|
|
432
|
+
onBlur: onUpdateElement,
|
|
433
|
+
onChange: function onChange(e) {
|
|
434
|
+
editElementProp('step', 'value', e);
|
|
435
|
+
}
|
|
436
|
+
}))), element.hasOwnProperty('minValue') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
437
|
+
className: "form-group mb-5"
|
|
438
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
439
|
+
className: "form-group-range"
|
|
440
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
441
|
+
className: "fw-bold",
|
|
442
|
+
htmlFor: "rangeMin"
|
|
443
|
+
}, "Min:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
444
|
+
id: "rangeMin",
|
|
445
|
+
type: "number",
|
|
446
|
+
defaultValue: element.minValue,
|
|
447
|
+
onBlur: onUpdateElement,
|
|
448
|
+
onChange: function onChange(e) {
|
|
449
|
+
editElementProp('minValue', 'value', e);
|
|
450
|
+
}
|
|
451
|
+
}))), element.hasOwnProperty('minLabel') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
452
|
+
className: "form-group mb-5"
|
|
453
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
454
|
+
className: "form-group-range"
|
|
455
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
456
|
+
className: "fw-bold",
|
|
457
|
+
htmlFor: "rangeMin"
|
|
458
|
+
}, "Minimum Value Label:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
459
|
+
type: "text",
|
|
460
|
+
defaultValue: element.minLabel,
|
|
461
|
+
onBlur: onUpdateElement,
|
|
462
|
+
onChange: function onChange(e) {
|
|
463
|
+
editElementProp('minLabel', 'value', e);
|
|
464
|
+
}
|
|
465
|
+
}))), element.hasOwnProperty('maxValue') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
466
|
+
className: "form-group mb-5"
|
|
467
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
468
|
+
className: "form-group-range"
|
|
469
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
470
|
+
className: "fw-bold",
|
|
471
|
+
htmlFor: "rangeMax"
|
|
472
|
+
}, "Max:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
473
|
+
id: "rangeMax",
|
|
474
|
+
type: "number",
|
|
475
|
+
defaultValue: element.maxValue,
|
|
476
|
+
onBlur: onUpdateElement,
|
|
477
|
+
onChange: function onChange(e) {
|
|
478
|
+
editElementProp('maxValue', 'value', e);
|
|
479
|
+
}
|
|
480
|
+
}))), element.hasOwnProperty('maxLabel') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
481
|
+
className: "form-group mb-5"
|
|
482
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
483
|
+
className: "form-group-range"
|
|
484
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
485
|
+
className: "fw-bold",
|
|
486
|
+
htmlFor: "rangeMax"
|
|
487
|
+
}, "Maximum Value Label:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
488
|
+
type: "text",
|
|
489
|
+
defaultValue: element.maxLabel,
|
|
490
|
+
onBlur: onUpdateElement,
|
|
491
|
+
onChange: function onChange(e) {
|
|
492
|
+
editElementProp('maxLabel', 'value', e);
|
|
493
|
+
}
|
|
494
|
+
}))), element.hasOwnProperty('defaultValue') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
495
|
+
className: "form-group mb-5"
|
|
496
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
497
|
+
className: "form-group-range"
|
|
498
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
499
|
+
className: "fw-bold",
|
|
500
|
+
htmlFor: "defaultSelected"
|
|
501
|
+
}, "Default Selected:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
502
|
+
id: "defaultSelected",
|
|
503
|
+
type: "number",
|
|
504
|
+
defaultValue: element.defaultValue,
|
|
505
|
+
onBlur: onUpdateElement,
|
|
506
|
+
onChange: function onChange(e) {
|
|
507
|
+
editElementProp('defaultValue', 'value', e);
|
|
508
|
+
}
|
|
509
|
+
}))), element.hasOwnProperty('static') && element["static"] && element.hasOwnProperty('bold') && element.hasOwnProperty('italic') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
510
|
+
className: "form-group mb-5"
|
|
511
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
512
|
+
className: "fw-bold"
|
|
513
|
+
}, "Text Style:"), /*#__PURE__*/React.createElement(Form.Check, {
|
|
514
|
+
id: "do-bold",
|
|
515
|
+
inline: true,
|
|
516
|
+
label: "Bold",
|
|
517
|
+
type: "checkbox",
|
|
518
|
+
checked: thisCheckedBold,
|
|
519
|
+
value: true,
|
|
520
|
+
onChange: function onChange(e) {
|
|
521
|
+
editElementProp('bold', 'checked', e);
|
|
522
|
+
}
|
|
523
|
+
}), /*#__PURE__*/React.createElement(Form.Check, {
|
|
524
|
+
id: "do-italic",
|
|
525
|
+
inline: true,
|
|
526
|
+
label: "Italic",
|
|
527
|
+
type: "checkbox",
|
|
528
|
+
checked: thisCheckedItalic,
|
|
529
|
+
value: true,
|
|
530
|
+
onChange: function onChange(e) {
|
|
531
|
+
editElementProp('italic', 'checked', e);
|
|
532
|
+
}
|
|
533
|
+
})), element.hasOwnProperty('placeholder') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
534
|
+
className: "form-group mb-5"
|
|
535
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
536
|
+
className: "fw-bold",
|
|
537
|
+
htmlFor: "placeholder"
|
|
538
|
+
}, "Placeholder:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
539
|
+
type: "text",
|
|
540
|
+
id: "placeholder",
|
|
541
|
+
defaultValue: element.placeholder,
|
|
542
|
+
onBlur: onUpdateElement,
|
|
543
|
+
onChange: function onChange(e) {
|
|
544
|
+
editElementProp('placeholder', 'value', e);
|
|
545
|
+
}
|
|
546
|
+
})), element.hasOwnProperty('customName') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
547
|
+
className: "form-group mb-5"
|
|
548
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
549
|
+
className: "fw-bold",
|
|
550
|
+
htmlFor: "customName"
|
|
551
|
+
}, "A Name To Give This Input That Will Show Up In Data Retrieval:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
552
|
+
type: "text",
|
|
553
|
+
id: "customName",
|
|
554
|
+
defaultValue: element.customName,
|
|
555
|
+
onBlur: onUpdateElement,
|
|
556
|
+
onChange: function onChange(e) {
|
|
557
|
+
editElementProp('customName', 'value', e);
|
|
558
|
+
}
|
|
559
|
+
})), element.hasOwnProperty('labelLocation') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
560
|
+
className: "form-group mb-5"
|
|
561
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
562
|
+
className: "fw-bold",
|
|
563
|
+
htmlFor: "labelLocation"
|
|
564
|
+
}, "Choose Label Location:"), /*#__PURE__*/React.createElement(Form.Select, {
|
|
565
|
+
id: "labelLocation",
|
|
566
|
+
defaultValue: element.labelLocation,
|
|
567
|
+
onBlur: onUpdateElement,
|
|
568
|
+
onChange: function onChange(e) {
|
|
569
|
+
editElementProp('labelLocation', 'value', e);
|
|
570
|
+
}
|
|
571
|
+
}, /*#__PURE__*/React.createElement("option", {
|
|
572
|
+
value: "ABOVE"
|
|
573
|
+
}, "Above Form Field"), /*#__PURE__*/React.createElement("option", {
|
|
574
|
+
value: "FLOATING"
|
|
575
|
+
}, "Floating Inside Form Field"))), element.hasOwnProperty('hideLabel') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
576
|
+
className: "form-group mb-5"
|
|
577
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
578
|
+
className: "fw-bold"
|
|
579
|
+
}, "Hide Label:"), /*#__PURE__*/React.createElement(Form.Check, {
|
|
580
|
+
id: "hide-label",
|
|
581
|
+
label: "Hide Label",
|
|
582
|
+
type: "checkbox",
|
|
583
|
+
checked: thisCheckedHideLabel,
|
|
584
|
+
value: true,
|
|
585
|
+
onChange: function onChange(e) {
|
|
586
|
+
editElementProp('hideLabel', 'checked', e);
|
|
587
|
+
}
|
|
588
|
+
})), element.hasOwnProperty('conditional') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
589
|
+
className: "form-group mb-5"
|
|
590
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
591
|
+
className: "fw-bold"
|
|
592
|
+
}, "Step is Conditional and Display is Dependent on Answers to another Survey Block:"), /*#__PURE__*/React.createElement(Form.Check, {
|
|
593
|
+
id: "conditional",
|
|
594
|
+
label: "Conditional",
|
|
595
|
+
type: "checkbox",
|
|
596
|
+
checked: thisCheckedConditional,
|
|
597
|
+
value: true,
|
|
598
|
+
onChange: function onChange(e) {
|
|
599
|
+
editElementProp('conditional', 'checked', e);
|
|
600
|
+
}
|
|
601
|
+
})), element.hasOwnProperty('conditionalFieldName') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
602
|
+
className: "form-group mb-5"
|
|
603
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
604
|
+
className: "fw-bold",
|
|
605
|
+
htmlFor: "conditionalFieldName"
|
|
606
|
+
}, "Field Name for the Dependent Survey Block:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
607
|
+
type: "text",
|
|
608
|
+
id: "conditionalFieldName",
|
|
609
|
+
defaultValue: element.conditionalFieldName,
|
|
610
|
+
onBlur: onUpdateElement,
|
|
611
|
+
onChange: function onChange(e) {
|
|
612
|
+
editElementProp('conditionalFieldName', 'value', e);
|
|
613
|
+
}
|
|
614
|
+
})), element.hasOwnProperty('conditionalFieldValue') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
615
|
+
className: "form-group mb-5"
|
|
616
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
617
|
+
className: "fw-bold",
|
|
618
|
+
htmlFor: "conditionalFieldValue"
|
|
619
|
+
}, "Value(s) for Survey Block to Display the Conditional Step:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
620
|
+
type: "text",
|
|
621
|
+
id: "conditionalFieldValue",
|
|
622
|
+
defaultValue: element.conditionalFieldValue,
|
|
623
|
+
onBlur: onUpdateElement,
|
|
624
|
+
onChange: function onChange(e) {
|
|
625
|
+
editElementProp('conditionalFieldValue', 'value', e);
|
|
626
|
+
}
|
|
627
|
+
})), element.hasOwnProperty('help') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
628
|
+
className: "form-group mb-5"
|
|
629
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
630
|
+
className: "fw-bold",
|
|
631
|
+
htmlFor: "help"
|
|
632
|
+
}, "Help instructions/details that will show up beneath the input field:"), /*#__PURE__*/React.createElement(TextAreaAutosize, {
|
|
633
|
+
type: "text",
|
|
634
|
+
className: "form-control",
|
|
635
|
+
id: "help",
|
|
636
|
+
defaultValue: element.help,
|
|
637
|
+
onBlur: onUpdateElement,
|
|
638
|
+
onChange: function onChange(e) {
|
|
639
|
+
editElementProp('help', 'value', e);
|
|
640
|
+
}
|
|
641
|
+
})), (showDescription && !element["static"] || element.hasOwnProperty('description')) && /*#__PURE__*/React.createElement(Form.Group, {
|
|
642
|
+
className: "form-group mb-5"
|
|
643
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
644
|
+
className: "fw-bold",
|
|
645
|
+
htmlFor: "description"
|
|
646
|
+
}, "Description:"), /*#__PURE__*/React.createElement(TextAreaAutosize, {
|
|
647
|
+
type: "text",
|
|
648
|
+
className: "form-control",
|
|
649
|
+
id: "description",
|
|
650
|
+
defaultValue: element.description,
|
|
651
|
+
onBlur: onUpdateElement,
|
|
652
|
+
onChange: function onChange(e) {
|
|
653
|
+
editElementProp('description', 'value', e);
|
|
654
|
+
}
|
|
655
|
+
})), showCorrectColumn && canHaveAnswer && !element.hasOwnProperty('options') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
656
|
+
className: "form-group mb-5"
|
|
657
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
658
|
+
className: "fw-bold",
|
|
659
|
+
htmlFor: "correct"
|
|
660
|
+
}, "Correct Answer:"), /*#__PURE__*/React.createElement(Form.Control, {
|
|
661
|
+
id: "correct",
|
|
662
|
+
type: "text",
|
|
663
|
+
defaultValue: element.correct,
|
|
664
|
+
onBlur: onUpdateElement,
|
|
665
|
+
onChange: function onChange(e) {
|
|
666
|
+
editElementProp('correct', 'value', e);
|
|
667
|
+
}
|
|
668
|
+
})), element.canPopulateFromApi && element.hasOwnProperty('options') && /*#__PURE__*/React.createElement(Form.Group, {
|
|
669
|
+
className: "form-group mb-5"
|
|
670
|
+
}, /*#__PURE__*/React.createElement(Form.Label, {
|
|
671
|
+
className: "fw-bold",
|
|
672
|
+
htmlFor: "optionsApiUrl"
|
|
673
|
+
}, "Populate Options from API:"), /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Col, {
|
|
674
|
+
sm: 6
|
|
675
|
+
}, /*#__PURE__*/React.createElement(Form.Control, {
|
|
676
|
+
style: {
|
|
677
|
+
width: '100%'
|
|
678
|
+
},
|
|
679
|
+
type: "text",
|
|
680
|
+
id: "optionsApiUrl",
|
|
681
|
+
placeholder: "http://localhost:8080/api/optionsdata"
|
|
682
|
+
})), /*#__PURE__*/React.createElement(Col, {
|
|
683
|
+
sm: 6
|
|
684
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
685
|
+
variant: "success",
|
|
686
|
+
onClick: addOptions
|
|
687
|
+
}, "Populate")))), element.hasOwnProperty('options') && /*#__PURE__*/React.createElement(DynamicOptionList, {
|
|
688
|
+
showCorrectColumn: showCorrectColumn,
|
|
689
|
+
canHaveOptionCorrect: canHaveOptionCorrect,
|
|
690
|
+
canHaveOptionValue: canHaveOptionValue,
|
|
691
|
+
updateElement: updateElement,
|
|
692
|
+
element: element,
|
|
693
|
+
key: element === null || element === void 0 || (_element$options = element.options) === null || _element$options === void 0 ? void 0 : _element$options.length
|
|
694
|
+
}));
|
|
695
|
+
};
|
|
602
696
|
SurveyElementsEdit.defaultProps = {
|
|
603
697
|
className: 'edit-element-fields'
|
|
604
|
-
};
|
|
698
|
+
};
|
|
699
|
+
export default SurveyElementsEdit;
|