react-survey-builder 1.0.16 → 1.0.18

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.
Files changed (38) hide show
  1. package/README.md +18 -16
  2. package/dist/186.index.js +1 -0
  3. package/dist/app.css +1 -1
  4. package/dist/app.css.map +1 -1
  5. package/dist/index.js +1 -1
  6. package/lib/dynamic-option-list.js +1 -1
  7. package/lib/fieldset/FieldSet.js +15 -17
  8. package/lib/form copy.js +622 -0
  9. package/lib/form-fields.js +201 -208
  10. package/lib/form.js +765 -534
  11. package/lib/index.js +3 -3
  12. package/lib/language-provider/locales/en-us.json +1 -0
  13. package/lib/multi-column/MultiColumnRow.js +25 -25
  14. package/lib/multi-column/dustbin.js +16 -16
  15. package/lib/multi-column/grip.js +6 -6
  16. package/lib/preview.js +41 -40
  17. package/lib/sortable-element.js +6 -6
  18. package/lib/sortable-form-elements.js +2 -0
  19. package/lib/stores/store.js +22 -22
  20. package/lib/survey-elements/component-drag-handle.js +6 -6
  21. package/lib/survey-elements/component-drag-layer.js +3 -3
  22. package/lib/survey-elements/component-drag-preview.js +1 -1
  23. package/lib/survey-elements/component-error-message.js +1 -0
  24. package/lib/survey-elements/component-header.js +5 -5
  25. package/lib/survey-elements/component-label.js +12 -6
  26. package/lib/survey-elements/custom-element.js +23 -12
  27. package/lib/survey-elements/header-bar.js +5 -5
  28. package/lib/survey-elements/index.js +817 -740
  29. package/lib/survey-elements/myxss.js +68 -1
  30. package/lib/survey-elements-edit.js +211 -53
  31. package/lib/toolbar-draggable-item.js +4 -4
  32. package/lib/toolbar.js +49 -18
  33. package/lib/utils/ipUtils.js +53 -0
  34. package/package.json +2 -3
  35. package/types/index.d.ts +5 -1
  36. package/dist/967.index.js +0 -1
  37. package/lib/survey-elements/date-picker.js +0 -272
  38. package/lib/utils/custom-date-picker.js +0 -93
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
@@ -19,19 +20,23 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
19
20
  var _isomorphicFetch = _interopRequireDefault(require("isomorphic-fetch"));
20
21
  var _fileSaver = require("file-saver");
21
22
  var _react = _interopRequireDefault(require("react"));
22
- var _reactSelect = _interopRequireDefault(require("react-select"));
23
23
  var _reactSignatureCanvas = _interopRequireDefault(require("react-signature-canvas"));
24
24
  var _reactBootstrapRangeSlider = _interopRequireDefault(require("react-bootstrap-range-slider"));
25
25
  var _starRating = _interopRequireDefault(require("./star-rating"));
26
26
  var _componentHeader = _interopRequireDefault(require("./component-header"));
27
27
  var _componentLabel = _interopRequireDefault(require("./component-label"));
28
- var _myxss = _interopRequireDefault(require("./myxss"));
28
+ var _myxss = _interopRequireWildcard(require("./myxss"));
29
29
  var _fa = require("react-icons/fa");
30
30
  var _reactBootstrap = require("react-bootstrap");
31
31
  var _reactImask = require("react-imask");
32
32
  var _reactBootstrapTypeahead = require("react-bootstrap-typeahead");
33
+ var _componentErrorMessage = _interopRequireDefault(require("./component-error-message"));
34
+ var _ipUtils = require("../utils/ipUtils");
35
+ var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
33
36
  var _excluded = ["onChange"],
34
37
  _excluded2 = ["onChange", "formatMask"]; // eslint-disable-next-line max-classes-per-file
38
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
39
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
35
40
  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; }
36
41
  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) { (0, _defineProperty2["default"])(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; }
37
42
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
@@ -139,16 +144,15 @@ var Header = /*#__PURE__*/function (_React$Component) {
139
144
  (0, _createClass2["default"])(Header, [{
140
145
  key: "render",
141
146
  value: function render() {
142
- // const headerClasses = `dynamic-input ${this.props.data.element}-input`;
143
147
  var classNames = 'static';
144
- if (this.props.data.bold) {
148
+ if (this.props.item.bold) {
145
149
  classNames += ' bold';
146
150
  }
147
- if (this.props.data.italic) {
151
+ if (this.props.item.italic) {
148
152
  classNames += ' italic';
149
153
  }
150
154
  var baseClasses = 'SortableItem rfb-item';
151
- if (this.props.data.pageBreakBefore) {
155
+ if (this.props.item.pageBreakBefore) {
152
156
  baseClasses += ' alwaysbreak';
153
157
  }
154
158
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -157,32 +161,60 @@ var Header = /*#__PURE__*/function (_React$Component) {
157
161
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement("h3", {
158
162
  className: classNames,
159
163
  dangerouslySetInnerHTML: {
160
- __html: _myxss["default"].process(this.props.data.content)
164
+ __html: _myxss["default"].process(this.props.item.content)
161
165
  }
162
166
  }));
163
167
  }
164
168
  }]);
165
169
  return Header;
166
170
  }(_react["default"].Component);
167
- var Paragraph = /*#__PURE__*/function (_React$Component2) {
168
- (0, _inherits2["default"])(Paragraph, _React$Component2);
169
- var _super2 = _createSuper(Paragraph);
171
+ var ContentBody = /*#__PURE__*/function (_React$Component2) {
172
+ (0, _inherits2["default"])(ContentBody, _React$Component2);
173
+ var _super2 = _createSuper(ContentBody);
174
+ function ContentBody() {
175
+ (0, _classCallCheck2["default"])(this, ContentBody);
176
+ return _super2.apply(this, arguments);
177
+ }
178
+ (0, _createClass2["default"])(ContentBody, [{
179
+ key: "render",
180
+ value: function render() {
181
+ var classNames = 'static';
182
+ var baseClasses = 'SortableItem rfb-item';
183
+ if (this.props.item.pageBreakBefore) {
184
+ baseClasses += ' alwaysbreak';
185
+ }
186
+ return /*#__PURE__*/_react["default"].createElement("div", {
187
+ style: _objectSpread({}, this.props.style),
188
+ className: baseClasses
189
+ }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement("div", {
190
+ className: classNames,
191
+ dangerouslySetInnerHTML: {
192
+ __html: _myxss.myContentXSS.process(this.props.item.content)
193
+ }
194
+ }));
195
+ }
196
+ }]);
197
+ return ContentBody;
198
+ }(_react["default"].Component);
199
+ var Paragraph = /*#__PURE__*/function (_React$Component3) {
200
+ (0, _inherits2["default"])(Paragraph, _React$Component3);
201
+ var _super3 = _createSuper(Paragraph);
170
202
  function Paragraph() {
171
203
  (0, _classCallCheck2["default"])(this, Paragraph);
172
- return _super2.apply(this, arguments);
204
+ return _super3.apply(this, arguments);
173
205
  }
174
206
  (0, _createClass2["default"])(Paragraph, [{
175
207
  key: "render",
176
208
  value: function render() {
177
209
  var classNames = 'static';
178
- if (this.props.data.bold) {
210
+ if (this.props.item.bold) {
179
211
  classNames += ' bold';
180
212
  }
181
- if (this.props.data.italic) {
213
+ if (this.props.item.italic) {
182
214
  classNames += ' italic';
183
215
  }
184
216
  var baseClasses = 'SortableItem rfb-item';
185
- if (this.props.data.pageBreakBefore) {
217
+ if (this.props.item.pageBreakBefore) {
186
218
  baseClasses += ' alwaysbreak';
187
219
  }
188
220
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -191,32 +223,32 @@ var Paragraph = /*#__PURE__*/function (_React$Component2) {
191
223
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement("p", {
192
224
  className: classNames,
193
225
  dangerouslySetInnerHTML: {
194
- __html: _myxss["default"].process(this.props.data.content)
226
+ __html: _myxss["default"].process(this.props.item.content)
195
227
  }
196
228
  }));
197
229
  }
198
230
  }]);
199
231
  return Paragraph;
200
232
  }(_react["default"].Component);
201
- var Label = /*#__PURE__*/function (_React$Component3) {
202
- (0, _inherits2["default"])(Label, _React$Component3);
203
- var _super3 = _createSuper(Label);
233
+ var Label = /*#__PURE__*/function (_React$Component4) {
234
+ (0, _inherits2["default"])(Label, _React$Component4);
235
+ var _super4 = _createSuper(Label);
204
236
  function Label() {
205
237
  (0, _classCallCheck2["default"])(this, Label);
206
- return _super3.apply(this, arguments);
238
+ return _super4.apply(this, arguments);
207
239
  }
208
240
  (0, _createClass2["default"])(Label, [{
209
241
  key: "render",
210
242
  value: function render() {
211
243
  var classNames = 'static';
212
- if (this.props.data.bold) {
244
+ if (this.props.item.bold) {
213
245
  classNames += ' bold';
214
246
  }
215
- if (this.props.data.italic) {
247
+ if (this.props.item.italic) {
216
248
  classNames += ' italic';
217
249
  }
218
250
  var baseClasses = 'SortableItem rfb-item';
219
- if (this.props.data.pageBreakBefore) {
251
+ if (this.props.item.pageBreakBefore) {
220
252
  baseClasses += ' alwaysbreak';
221
253
  }
222
254
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -225,25 +257,25 @@ var Label = /*#__PURE__*/function (_React$Component3) {
225
257
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement("label", {
226
258
  className: "".concat(classNames, " form-label"),
227
259
  dangerouslySetInnerHTML: {
228
- __html: _myxss["default"].process(this.props.data.content)
260
+ __html: _myxss["default"].process(this.props.item.content)
229
261
  }
230
262
  }));
231
263
  }
232
264
  }]);
233
265
  return Label;
234
266
  }(_react["default"].Component);
235
- var LineBreak = /*#__PURE__*/function (_React$Component4) {
236
- (0, _inherits2["default"])(LineBreak, _React$Component4);
237
- var _super4 = _createSuper(LineBreak);
267
+ var LineBreak = /*#__PURE__*/function (_React$Component5) {
268
+ (0, _inherits2["default"])(LineBreak, _React$Component5);
269
+ var _super5 = _createSuper(LineBreak);
238
270
  function LineBreak() {
239
271
  (0, _classCallCheck2["default"])(this, LineBreak);
240
- return _super4.apply(this, arguments);
272
+ return _super5.apply(this, arguments);
241
273
  }
242
274
  (0, _createClass2["default"])(LineBreak, [{
243
275
  key: "render",
244
276
  value: function render() {
245
277
  var baseClasses = 'SortableItem rfb-item';
246
- if (this.props.data.pageBreakBefore) {
278
+ if (this.props.item.pageBreakBefore) {
247
279
  baseClasses += ' alwaysbreak';
248
280
  }
249
281
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -254,413 +286,426 @@ var LineBreak = /*#__PURE__*/function (_React$Component4) {
254
286
  }]);
255
287
  return LineBreak;
256
288
  }(_react["default"].Component);
257
- var TextInput = /*#__PURE__*/function (_React$Component5) {
258
- (0, _inherits2["default"])(TextInput, _React$Component5);
259
- var _super5 = _createSuper(TextInput);
289
+ var TextInput = /*#__PURE__*/function (_React$Component6) {
290
+ (0, _inherits2["default"])(TextInput, _React$Component6);
291
+ var _super6 = _createSuper(TextInput);
260
292
  function TextInput(props) {
261
293
  var _this;
262
294
  (0, _classCallCheck2["default"])(this, TextInput);
263
- _this = _super5.call(this, props);
295
+ _this = _super6.call(this, props);
264
296
  _this.inputField = /*#__PURE__*/_react["default"].createRef();
265
297
  return _this;
266
298
  }
267
299
  (0, _createClass2["default"])(TextInput, [{
268
300
  key: "render",
269
301
  value: function render() {
270
- var _this$props$data$plac,
271
- _this2 = this;
302
+ var _this2 = this;
272
303
  var props = {};
273
- props.type = 'text';
274
- props.name = this.props.data.fieldName;
275
- props.placeholder = (_this$props$data$plac = this.props.data.placeholder) !== null && _this$props$data$plac !== void 0 ? _this$props$data$plac : _myxss["default"].process(this.props.data.label);
276
- if (this.props.mutable) {
277
- props.defaultValue = this.props.defaultValue;
278
- props.ref = this.inputField;
279
- }
280
- if (this.props.onChange) {
281
- props.onChange = function (e) {
282
- _this2.props.onChange(e.target.value);
283
- };
284
- }
285
- if (this.props.value) {
286
- props.value = this.props.value;
287
- }
288
- if (this.props.isInvalid) {
289
- props.isInvalid = this.props.isInvalid;
290
- }
291
- if (this.props.onBlur) {
292
- props.onBlur = this.props.onBlur;
293
- }
294
- if (this.props.readOnly) {
304
+ props.name = this.props.name;
305
+ props.placeholder = this.props.item.placeholder;
306
+ props.onChange = function (event) {
307
+ _this2.props.onChange(event.target.value);
308
+ };
309
+ props.value = this.props.value;
310
+ props.isInvalid = this.props.isInvalid;
311
+ props.onBlur = this.props.onBlur;
312
+ props.autoComplete = "new-password";
313
+ if (this.props.item.disabled) {
295
314
  props.disabled = 'disabled';
296
315
  }
316
+ if (this.props.item.mutable) {
317
+ props.ref = this.inputField;
318
+ }
297
319
  var labelLocation = 'ABOVE';
298
- if (this.props.data.labelLocation) {
299
- labelLocation = this.props.data.labelLocation;
320
+ if (this.props.item.labelLocation) {
321
+ labelLocation = this.props.item.labelLocation;
300
322
  }
301
323
  var baseClasses = 'SortableItem rfb-item';
302
- if (this.props.data.pageBreakBefore) {
324
+ if (this.props.item.pageBreakBefore) {
303
325
  baseClasses += ' alwaysbreak';
304
326
  }
327
+ if (this.props.item.print === true) {
328
+ return /*#__PURE__*/_react["default"].createElement("div", {
329
+ style: _objectSpread({}, this.props.style),
330
+ className: baseClasses
331
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
332
+ className: "form-group mb-3"
333
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
334
+ htmlFor: props.name
335
+ })), /*#__PURE__*/_react["default"].createElement("div", null, props.value)));
336
+ }
305
337
  return /*#__PURE__*/_react["default"].createElement("div", {
306
338
  style: _objectSpread({}, this.props.style),
307
339
  className: baseClasses
308
340
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
309
341
  className: "form-group mb-3"
310
342
  }, labelLocation === "FLOATING" ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Floating, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
311
- id: props.name
343
+ id: props.name,
344
+ type: "text"
312
345
  }, props)), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
313
346
  htmlFor: props.name
314
347
  }))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
315
348
  htmlFor: props.name
316
349
  })), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
317
- id: props.name
318
- }, props))), this.props.data.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
350
+ id: props.name,
351
+ type: "text"
352
+ }, props))), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
319
353
  muted: true
320
- }, this.props.data.help) : null));
354
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
355
+ name: props.name
356
+ })));
321
357
  }
322
358
  }]);
323
359
  return TextInput;
324
360
  }(_react["default"].Component);
325
- var EmailInput = /*#__PURE__*/function (_React$Component6) {
326
- (0, _inherits2["default"])(EmailInput, _React$Component6);
327
- var _super6 = _createSuper(EmailInput);
361
+ var EmailInput = /*#__PURE__*/function (_React$Component7) {
362
+ (0, _inherits2["default"])(EmailInput, _React$Component7);
363
+ var _super7 = _createSuper(EmailInput);
328
364
  function EmailInput(props) {
329
365
  var _this3;
330
366
  (0, _classCallCheck2["default"])(this, EmailInput);
331
- _this3 = _super6.call(this, props);
367
+ _this3 = _super7.call(this, props);
332
368
  _this3.inputField = /*#__PURE__*/_react["default"].createRef();
333
369
  return _this3;
334
370
  }
335
371
  (0, _createClass2["default"])(EmailInput, [{
336
372
  key: "render",
337
373
  value: function render() {
338
- var _this$props$data$plac2,
339
- _this4 = this;
374
+ var _this4 = this;
340
375
  var props = {};
341
- props.type = 'text';
342
- props.name = this.props.data.fieldName;
343
- props.placeholder = (_this$props$data$plac2 = this.props.data.placeholder) !== null && _this$props$data$plac2 !== void 0 ? _this$props$data$plac2 : _myxss["default"].process(this.props.data.label);
344
- if (this.props.mutable) {
345
- props.defaultValue = this.props.defaultValue;
346
- props.ref = this.inputField;
347
- }
348
- if (this.props.onChange) {
349
- props.onChange = function (e) {
350
- _this4.props.onChange(e.target.value);
351
- };
352
- }
353
- if (this.props.value) {
354
- props.value = this.props.value;
355
- }
356
- if (this.props.isInvalid) {
357
- props.isInvalid = this.props.isInvalid;
358
- }
359
- if (this.props.onBlur) {
360
- props.onBlur = this.props.onBlur;
361
- }
362
- if (this.props.readOnly) {
376
+ props.name = this.props.name;
377
+ props.placeholder = this.props.item.placeholder;
378
+ props.onChange = function (event) {
379
+ _this4.props.onChange(event.target.value);
380
+ };
381
+ props.value = this.props.value;
382
+ props.isInvalid = this.props.isInvalid;
383
+ props.onBlur = this.props.onBlur;
384
+ props.autoComplete = "new-password";
385
+ if (this.props.item.disabled) {
363
386
  props.disabled = 'disabled';
364
387
  }
388
+ if (this.props.item.mutable) {
389
+ props.ref = this.inputField;
390
+ }
365
391
  var labelLocation = 'ABOVE';
366
- if (this.props.data.labelLocation) {
367
- labelLocation = this.props.data.labelLocation;
392
+ if (this.props.item.labelLocation) {
393
+ labelLocation = this.props.item.labelLocation;
368
394
  }
369
395
  var baseClasses = 'SortableItem rfb-item';
370
- if (this.props.data.pageBreakBefore) {
396
+ if (this.props.item.pageBreakBefore) {
371
397
  baseClasses += ' alwaysbreak';
372
398
  }
399
+ if (this.props.item.print === true) {
400
+ return /*#__PURE__*/_react["default"].createElement("div", {
401
+ style: _objectSpread({}, this.props.style),
402
+ className: baseClasses
403
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
404
+ className: "form-group mb-3"
405
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
406
+ htmlFor: props.name
407
+ })), /*#__PURE__*/_react["default"].createElement("div", null, this.props.value)));
408
+ }
373
409
  return /*#__PURE__*/_react["default"].createElement("div", {
374
410
  style: _objectSpread({}, this.props.style),
375
411
  className: baseClasses
376
412
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
377
413
  className: "form-group mb-3"
378
414
  }, labelLocation === "FLOATING" ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Floating, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
379
- id: props.name
415
+ id: props.name,
416
+ type: "text"
380
417
  }, props)), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
381
418
  htmlFor: props.name
382
419
  }))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
383
420
  htmlFor: props.name
384
421
  })), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
385
- id: props.name
386
- }, props))), this.props.data.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
422
+ id: props.name,
423
+ type: "text"
424
+ }, props))), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
387
425
  muted: true
388
- }, this.props.data.help) : null));
426
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
427
+ name: props.name
428
+ })));
389
429
  }
390
430
  }]);
391
431
  return EmailInput;
392
432
  }(_react["default"].Component);
393
- var PhoneNumber = /*#__PURE__*/function (_React$Component7) {
394
- (0, _inherits2["default"])(PhoneNumber, _React$Component7);
395
- var _super7 = _createSuper(PhoneNumber);
433
+ var PhoneNumber = /*#__PURE__*/function (_React$Component8) {
434
+ (0, _inherits2["default"])(PhoneNumber, _React$Component8);
435
+ var _super8 = _createSuper(PhoneNumber);
396
436
  function PhoneNumber(props) {
397
437
  var _this5;
398
438
  (0, _classCallCheck2["default"])(this, PhoneNumber);
399
- _this5 = _super7.call(this, props);
439
+ _this5 = _super8.call(this, props);
400
440
  _this5.inputField = /*#__PURE__*/_react["default"].createRef();
401
441
  return _this5;
402
442
  }
403
443
  (0, _createClass2["default"])(PhoneNumber, [{
404
444
  key: "render",
405
445
  value: function render() {
406
- var _this$props$data$plac3,
407
- _this6 = this;
446
+ var _this6 = this;
408
447
  var props = {};
409
- props.type = 'text';
410
- props.name = this.props.data.fieldName;
411
- props.placeholder = (_this$props$data$plac3 = this.props.data.placeholder) !== null && _this$props$data$plac3 !== void 0 ? _this$props$data$plac3 : _myxss["default"].process(this.props.data.label);
412
- if (this.props.mutable) {
413
- props.defaultValue = this.props.defaultValue;
414
- props.ref = this.inputField;
415
- }
416
- if (this.props.onChange) {
417
- props.onChange = function (e) {
418
- _this6.props.onChange(e);
419
- };
420
- }
421
- if (this.props.value) {
422
- props.value = this.props.value;
423
- }
424
- if (this.props.isInvalid) {
425
- props.isInvalid = this.props.isInvalid;
426
- }
427
- if (this.props.onBlur) {
428
- props.onBlur = this.props.onBlur;
429
- }
430
- if (this.props.readOnly) {
448
+ props.name = this.props.name;
449
+ props.placeholder = this.props.item.placeholder;
450
+ props.onChange = function (val) {
451
+ _this6.props.onChange(val);
452
+ };
453
+ props.value = this.props.value;
454
+ props.isInvalid = this.props.isInvalid;
455
+ props.onBlur = this.props.onBlur;
456
+ props.autoComplete = "new-password";
457
+ if (this.props.item.disabled) {
431
458
  props.disabled = 'disabled';
432
459
  }
433
- props.autoComplete = "new-password";
460
+ if (this.props.item.mutable) {
461
+ props.ref = this.inputField;
462
+ }
434
463
  var labelLocation = 'ABOVE';
435
- if (this.props.data.labelLocation) {
436
- labelLocation = this.props.data.labelLocation;
464
+ if (this.props.item.labelLocation) {
465
+ labelLocation = this.props.item.labelLocation;
437
466
  }
438
467
  var baseClasses = 'SortableItem rfb-item';
439
- if (this.props.data.pageBreakBefore) {
468
+ if (this.props.item.pageBreakBefore) {
440
469
  baseClasses += ' alwaysbreak';
441
470
  }
471
+ if (this.props.item.print === true) {
472
+ return /*#__PURE__*/_react["default"].createElement("div", {
473
+ style: _objectSpread({}, this.props.style),
474
+ className: baseClasses
475
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
476
+ className: "form-group mb-3"
477
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
478
+ htmlFor: props.name
479
+ })), /*#__PURE__*/_react["default"].createElement("div", null, this.props.value)));
480
+ }
442
481
  return /*#__PURE__*/_react["default"].createElement("div", {
443
482
  style: _objectSpread({}, this.props.style),
444
483
  className: baseClasses
445
484
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
446
485
  className: "form-group mb-3"
447
486
  }, labelLocation === "FLOATING" ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Floating, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
448
- id: props.name
487
+ id: props.name,
488
+ type: "text"
449
489
  }, props, {
450
490
  as: CustomPhoneInput
451
491
  })), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
452
- name: props.name,
453
492
  htmlFor: props.name
454
493
  }))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
455
- name: props.name,
456
494
  htmlFor: props.name
457
495
  })), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
458
- id: props.name
496
+ id: props.name,
497
+ type: "text"
459
498
  }, props, {
460
499
  as: CustomPhoneInput
461
- }))), this.props.data.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
500
+ }))), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
462
501
  muted: true
463
- }, this.props.data.help) : null));
502
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
503
+ name: props.name
504
+ })));
464
505
  }
465
506
  }]);
466
507
  return PhoneNumber;
467
508
  }(_react["default"].Component);
468
- var DatePicker = /*#__PURE__*/function (_React$Component8) {
469
- (0, _inherits2["default"])(DatePicker, _React$Component8);
470
- var _super8 = _createSuper(DatePicker);
509
+ var DatePicker = /*#__PURE__*/function (_React$Component9) {
510
+ (0, _inherits2["default"])(DatePicker, _React$Component9);
511
+ var _super9 = _createSuper(DatePicker);
471
512
  function DatePicker(props) {
472
513
  var _this7;
473
514
  (0, _classCallCheck2["default"])(this, DatePicker);
474
- _this7 = _super8.call(this, props);
515
+ _this7 = _super9.call(this, props);
475
516
  _this7.inputField = /*#__PURE__*/_react["default"].createRef();
476
517
  return _this7;
477
518
  }
478
519
  (0, _createClass2["default"])(DatePicker, [{
479
520
  key: "render",
480
521
  value: function render() {
481
- var _this$props$data$plac4,
482
- _this8 = this;
522
+ var _this8 = this;
483
523
  var props = {};
484
- props.type = 'text';
485
- props.name = this.props.data.fieldName;
486
- props.placeholder = (_this$props$data$plac4 = this.props.data.placeholder) !== null && _this$props$data$plac4 !== void 0 ? _this$props$data$plac4 : _myxss["default"].process(this.props.data.label);
487
- if (this.props.mutable) {
488
- props.defaultValue = this.props.defaultValue;
489
- props.ref = this.inputField;
490
- }
491
- props.formatMask = this.props.data.formatMask || 'MM/DD/YYYY';
492
- if (this.props.onChange) {
493
- props.onChange = function (e) {
494
- _this8.props.onChange(e);
495
- };
496
- }
497
- if (this.props.value) {
498
- props.value = this.props.value;
499
- }
500
- if (this.props.isInvalid) {
501
- props.isInvalid = this.props.isInvalid;
502
- }
503
- if (this.props.onBlur) {
504
- props.onBlur = this.props.onBlur;
505
- }
506
- if (this.props.readOnly) {
524
+ props.name = this.props.name;
525
+ props.placeholder = this.props.item.placeholder;
526
+ props.onChange = function (val) {
527
+ _this8.props.onChange(val);
528
+ };
529
+ props.value = this.props.value;
530
+ props.isInvalid = this.props.isInvalid;
531
+ props.onBlur = this.props.onBlur;
532
+ props.autoComplete = "new-password";
533
+ if (this.props.item.disabled) {
507
534
  props.disabled = 'disabled';
508
535
  }
509
- props.autoComplete = "new-password";
536
+ if (this.props.item.mutable) {
537
+ props.ref = this.inputField;
538
+ }
539
+ props.formatMask = this.props.item.formatMask || 'MM/DD/YYYY';
510
540
  var labelLocation = 'ABOVE';
511
- if (this.props.data.labelLocation) {
512
- labelLocation = this.props.data.labelLocation;
541
+ if (this.props.item.labelLocation) {
542
+ labelLocation = this.props.item.labelLocation;
513
543
  }
514
544
  var baseClasses = 'SortableItem rfb-item';
515
- if (this.props.data.pageBreakBefore) {
545
+ if (this.props.item.pageBreakBefore) {
516
546
  baseClasses += ' alwaysbreak';
517
547
  }
548
+ if (this.props.item.print === true) {
549
+ return /*#__PURE__*/_react["default"].createElement("div", {
550
+ style: _objectSpread({}, this.props.style),
551
+ className: baseClasses
552
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
553
+ className: "form-group mb-3"
554
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
555
+ htmlFor: props.name
556
+ })), /*#__PURE__*/_react["default"].createElement("div", null, this.props.value)));
557
+ }
518
558
  return /*#__PURE__*/_react["default"].createElement("div", {
519
559
  style: _objectSpread({}, this.props.style),
520
560
  className: baseClasses
521
561
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
522
562
  className: "form-group mb-3"
523
563
  }, labelLocation === "FLOATING" ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Floating, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
524
- id: props.name
564
+ id: props.name,
565
+ type: "text"
525
566
  }, props, {
526
567
  as: CustomDateInput
527
568
  })), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
528
- name: props.name,
529
569
  htmlFor: props.name
530
570
  }))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
531
- name: props.name,
532
571
  htmlFor: props.name
533
572
  })), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
534
- id: props.name
573
+ id: props.name,
574
+ type: "text"
535
575
  }, props, {
536
576
  as: CustomDateInput
537
- }))), this.props.data.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
577
+ }))), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
538
578
  muted: true
539
- }, this.props.data.help) : null));
579
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
580
+ name: props.name
581
+ })));
540
582
  }
541
583
  }]);
542
584
  return DatePicker;
543
585
  }(_react["default"].Component);
544
- var NumberInput = /*#__PURE__*/function (_React$Component9) {
545
- (0, _inherits2["default"])(NumberInput, _React$Component9);
546
- var _super9 = _createSuper(NumberInput);
586
+ var NumberInput = /*#__PURE__*/function (_React$Component10) {
587
+ (0, _inherits2["default"])(NumberInput, _React$Component10);
588
+ var _super10 = _createSuper(NumberInput);
547
589
  function NumberInput(props) {
548
590
  var _this9;
549
591
  (0, _classCallCheck2["default"])(this, NumberInput);
550
- _this9 = _super9.call(this, props);
592
+ _this9 = _super10.call(this, props);
551
593
  _this9.inputField = /*#__PURE__*/_react["default"].createRef();
552
594
  return _this9;
553
595
  }
554
596
  (0, _createClass2["default"])(NumberInput, [{
555
597
  key: "render",
556
598
  value: function render() {
557
- var _this$props$data$plac5,
558
- _this10 = this;
599
+ var _this10 = this;
559
600
  var props = {};
560
- props.type = 'number';
561
- props.name = this.props.data.fieldName;
562
- props.placeholder = (_this$props$data$plac5 = this.props.data.placeholder) !== null && _this$props$data$plac5 !== void 0 ? _this$props$data$plac5 : _myxss["default"].process(this.props.data.label);
563
- if (this.props.mutable) {
564
- props.defaultValue = this.props.defaultValue;
565
- props.ref = this.inputField;
566
- }
567
- if (this.props.onChange) {
568
- props.onChange = function (e) {
569
- _this10.props.onChange(e.target.value);
570
- };
571
- }
572
- if (this.props.value) {
573
- props.value = this.props.value;
574
- }
575
- if (this.props.isInvalid) {
576
- props.isInvalid = this.props.isInvalid;
577
- }
578
- if (this.props.onBlur) {
579
- props.onBlur = this.props.onBlur;
580
- }
581
- if (this.props.readOnly) {
601
+ props.name = this.props.name;
602
+ props.placeholder = this.props.item.placeholder;
603
+ props.onChange = function (event) {
604
+ _this10.props.onChange(event.target.value);
605
+ };
606
+ props.value = this.props.value;
607
+ props.isInvalid = this.props.isInvalid;
608
+ props.onBlur = this.props.onBlur;
609
+ props.autoComplete = "new-password";
610
+ if (this.props.item.disabled) {
582
611
  props.disabled = 'disabled';
583
612
  }
584
- props.min = this.props.data.minValue;
585
- props.max = this.props.data.maxValue;
586
- props.step = this.props.data.step;
613
+ if (this.props.item.mutable) {
614
+ props.ref = this.inputField;
615
+ }
616
+ props.min = this.props.item.minValue;
617
+ props.max = this.props.item.maxValue;
618
+ props.step = this.props.item.step;
587
619
  var labelLocation = 'ABOVE';
588
- if (this.props.data.labelLocation) {
589
- labelLocation = this.props.data.labelLocation;
620
+ if (this.props.item.labelLocation) {
621
+ labelLocation = this.props.item.labelLocation;
590
622
  }
591
623
  var baseClasses = 'SortableItem rfb-item';
592
- if (this.props.data.pageBreakBefore) {
624
+ if (this.props.item.pageBreakBefore) {
593
625
  baseClasses += ' alwaysbreak';
594
626
  }
627
+ if (this.props.item.print === true) {
628
+ return /*#__PURE__*/_react["default"].createElement("div", {
629
+ style: _objectSpread({}, this.props.style),
630
+ className: baseClasses
631
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
632
+ className: "form-group mb-3"
633
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
634
+ htmlFor: props.name
635
+ })), /*#__PURE__*/_react["default"].createElement("div", null, this.props.value)));
636
+ }
595
637
  return /*#__PURE__*/_react["default"].createElement("div", {
596
638
  style: _objectSpread({}, this.props.style),
597
639
  className: baseClasses
598
640
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
599
641
  className: "form-group mb-3"
600
642
  }, labelLocation === "FLOATING" ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Floating, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
601
- id: props.name
643
+ id: props.name,
644
+ type: "number"
602
645
  }, props)), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
603
- name: props.name,
604
646
  htmlFor: props.name
605
647
  }))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
606
- name: props.name,
607
648
  htmlFor: props.name
608
649
  })), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
609
- id: props.name
610
- }, props))), this.props.data.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
650
+ id: props.name,
651
+ type: "number"
652
+ }, props))), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
611
653
  muted: true
612
- }, this.props.data.help) : null));
654
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
655
+ name: props.name
656
+ })));
613
657
  }
614
658
  }]);
615
659
  return NumberInput;
616
660
  }(_react["default"].Component);
617
- var TextArea = /*#__PURE__*/function (_React$Component10) {
618
- (0, _inherits2["default"])(TextArea, _React$Component10);
619
- var _super10 = _createSuper(TextArea);
661
+ var TextArea = /*#__PURE__*/function (_React$Component11) {
662
+ (0, _inherits2["default"])(TextArea, _React$Component11);
663
+ var _super11 = _createSuper(TextArea);
620
664
  function TextArea(props) {
621
665
  var _this11;
622
666
  (0, _classCallCheck2["default"])(this, TextArea);
623
- _this11 = _super10.call(this, props);
667
+ _this11 = _super11.call(this, props);
624
668
  _this11.inputField = /*#__PURE__*/_react["default"].createRef();
625
669
  return _this11;
626
670
  }
627
671
  (0, _createClass2["default"])(TextArea, [{
628
672
  key: "render",
629
673
  value: function render() {
630
- var _this$props$data$plac6,
631
- _this12 = this;
674
+ var _this12 = this;
632
675
  var props = {};
633
- props.name = this.props.data.fieldName;
634
- props.placeholder = (_this$props$data$plac6 = this.props.data.placeholder) !== null && _this$props$data$plac6 !== void 0 ? _this$props$data$plac6 : _myxss["default"].process(this.props.data.label);
635
- if (this.props.mutable) {
636
- props.defaultValue = this.props.defaultValue;
637
- props.ref = this.inputField;
638
- }
639
- if (this.props.onChange) {
640
- props.onChange = function (e) {
641
- _this12.props.onChange(e.target.value);
642
- };
643
- }
644
- if (this.props.value) {
645
- props.value = this.props.value;
646
- }
647
- if (this.props.isInvalid) {
648
- props.isInvalid = this.props.isInvalid;
649
- }
650
- if (this.props.onBlur) {
651
- props.onBlur = this.props.onBlur;
652
- }
653
- if (this.props.readOnly) {
676
+ props.name = this.props.name;
677
+ props.placeholder = this.props.item.placeholder;
678
+ props.onChange = function (event) {
679
+ _this12.props.onChange(event.target.value);
680
+ };
681
+ props.value = this.props.value;
682
+ props.isInvalid = this.props.isInvalid;
683
+ props.onBlur = this.props.onBlur;
684
+ props.autoComplete = "new-password";
685
+ if (this.props.item.disabled) {
654
686
  props.disabled = 'disabled';
655
687
  }
688
+ if (this.props.item.mutable) {
689
+ props.ref = this.inputField;
690
+ }
656
691
  var labelLocation = 'ABOVE';
657
- if (this.props.data.labelLocation) {
658
- labelLocation = this.props.data.labelLocation;
692
+ if (this.props.item.labelLocation) {
693
+ labelLocation = this.props.item.labelLocation;
659
694
  }
660
695
  var baseClasses = 'SortableItem rfb-item';
661
- if (this.props.data.pageBreakBefore) {
696
+ if (this.props.item.pageBreakBefore) {
662
697
  baseClasses += ' alwaysbreak';
663
698
  }
699
+ if (this.props.item.print === true) {
700
+ return /*#__PURE__*/_react["default"].createElement("div", {
701
+ style: _objectSpread({}, this.props.style),
702
+ className: baseClasses
703
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
704
+ className: "form-group mb-3"
705
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
706
+ htmlFor: props.name
707
+ })), /*#__PURE__*/_react["default"].createElement("div", null, this.props.value)));
708
+ }
664
709
  return /*#__PURE__*/_react["default"].createElement("div", {
665
710
  style: _objectSpread({}, this.props.style),
666
711
  className: baseClasses
@@ -670,28 +715,28 @@ var TextArea = /*#__PURE__*/function (_React$Component10) {
670
715
  as: "textarea",
671
716
  id: props.name
672
717
  }, props)), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
673
- name: props.name,
674
718
  htmlFor: props.name
675
719
  }))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
676
- name: props.name,
677
720
  htmlFor: props.name
678
721
  })), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
679
722
  as: "textarea",
680
723
  id: props.name
681
- }, props))), this.props.data.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
724
+ }, props))), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
682
725
  muted: true
683
- }, this.props.data.help) : null));
726
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
727
+ name: props.name
728
+ })));
684
729
  }
685
730
  }]);
686
731
  return TextArea;
687
732
  }(_react["default"].Component);
688
- var Dropdown = /*#__PURE__*/function (_React$Component11) {
689
- (0, _inherits2["default"])(Dropdown, _React$Component11);
690
- var _super11 = _createSuper(Dropdown);
733
+ var Dropdown = /*#__PURE__*/function (_React$Component12) {
734
+ (0, _inherits2["default"])(Dropdown, _React$Component12);
735
+ var _super12 = _createSuper(Dropdown);
691
736
  function Dropdown(props) {
692
737
  var _this13;
693
738
  (0, _classCallCheck2["default"])(this, Dropdown);
694
- _this13 = _super11.call(this, props);
739
+ _this13 = _super12.call(this, props);
695
740
  _this13.inputField = /*#__PURE__*/_react["default"].createRef();
696
741
  return _this13;
697
742
  }
@@ -700,37 +745,42 @@ var Dropdown = /*#__PURE__*/function (_React$Component11) {
700
745
  value: function render() {
701
746
  var _this14 = this;
702
747
  var props = {};
703
- props.name = this.props.data.fieldName;
704
- props.placeholder = this.props.data.placeholder || 'Select One';
705
- if (this.props.mutable) {
706
- props.defaultValue = this.props.defaultValue;
707
- props.ref = this.inputField;
708
- }
709
- if (this.props.onChange) {
710
- props.onChange = function (e) {
711
- _this14.props.onChange(e.target.value);
712
- };
713
- }
714
- if (this.props.value) {
715
- props.value = this.props.value;
716
- }
717
- if (this.props.isInvalid) {
718
- props.isInvalid = this.props.isInvalid;
719
- }
720
- if (this.props.onBlur) {
721
- props.onBlur = this.props.onBlur;
722
- }
723
- if (this.props.readOnly) {
748
+ props.name = this.props.name;
749
+ props.placeholder = this.props.item.placeholder || 'Select One';
750
+ props.onChange = function (event) {
751
+ _this14.props.onChange(event.target.value);
752
+ };
753
+ props.value = this.props.value;
754
+ props.isInvalid = this.props.isInvalid;
755
+ props.onBlur = this.props.onBlur;
756
+ props.autoComplete = "new-password";
757
+ if (this.props.item.disabled) {
724
758
  props.disabled = 'disabled';
725
759
  }
760
+ if (this.props.item.mutable) {
761
+ props.ref = this.inputField;
762
+ }
726
763
  var labelLocation = 'ABOVE';
727
- if (this.props.data.labelLocation) {
728
- labelLocation = this.props.data.labelLocation;
764
+ if (this.props.item.labelLocation) {
765
+ labelLocation = this.props.item.labelLocation;
729
766
  }
730
767
  var baseClasses = 'SortableItem rfb-item';
731
- if (this.props.data.pageBreakBefore) {
768
+ if (this.props.item.pageBreakBefore) {
732
769
  baseClasses += ' alwaysbreak';
733
770
  }
771
+ if (this.props.item.print === true) {
772
+ var _this$props$item$opti;
773
+ return /*#__PURE__*/_react["default"].createElement("div", {
774
+ style: _objectSpread({}, this.props.style),
775
+ className: baseClasses
776
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
777
+ className: "form-group mb-3"
778
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
779
+ htmlFor: props.name
780
+ })), /*#__PURE__*/_react["default"].createElement("div", null, (_this$props$item$opti = this.props.item.options.filter(function (selectedOption) {
781
+ return selectedOption.value === _this14.props.value;
782
+ })) === null || _this$props$item$opti === void 0 ? void 0 : _this$props$item$opti.label)));
783
+ }
734
784
  return /*#__PURE__*/_react["default"].createElement("div", {
735
785
  style: _objectSpread({}, this.props.style),
736
786
  className: baseClasses
@@ -740,73 +790,112 @@ var Dropdown = /*#__PURE__*/function (_React$Component11) {
740
790
  id: props.name
741
791
  }, props), props.placeholder ? /*#__PURE__*/_react["default"].createElement("option", {
742
792
  value: ""
743
- }, props.placeholder) : null, this.props.data.options.map(function (option) {
793
+ }, props.placeholder) : null, this.props.item.options.map(function (option) {
744
794
  var thisKey = "preview_".concat(option.key);
745
795
  return /*#__PURE__*/_react["default"].createElement("option", {
746
796
  value: option.value,
747
797
  key: thisKey
748
798
  }, option.text);
749
799
  })), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
750
- name: props.name,
751
800
  htmlFor: props.name
752
801
  }))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
753
- name: props.name,
754
802
  htmlFor: props.name
755
803
  })), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Select, (0, _extends2["default"])({
756
804
  id: props.name
757
805
  }, props), props.placeholder ? /*#__PURE__*/_react["default"].createElement("option", {
758
806
  value: ""
759
- }, props.placeholder) : null, this.props.data.options.map(function (option) {
807
+ }, props.placeholder) : null, this.props.item.options.map(function (option) {
760
808
  var thisKey = "preview_".concat(option.key);
761
809
  return /*#__PURE__*/_react["default"].createElement("option", {
762
810
  value: option.value,
763
811
  key: thisKey
764
812
  }, option.text);
765
- }))), this.props.data.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
813
+ }))), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
766
814
  muted: true
767
- }, this.props.data.help) : null));
815
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
816
+ name: props.name
817
+ })));
768
818
  }
769
819
  }]);
770
820
  return Dropdown;
771
821
  }(_react["default"].Component);
772
- var Signature = /*#__PURE__*/function (_React$Component12) {
773
- (0, _inherits2["default"])(Signature, _React$Component12);
774
- var _super12 = _createSuper(Signature);
822
+ var Signature = /*#__PURE__*/function (_React$Component13) {
823
+ (0, _inherits2["default"])(Signature, _React$Component13);
824
+ var _super13 = _createSuper(Signature);
775
825
  function Signature(props) {
776
826
  var _this15;
777
827
  (0, _classCallCheck2["default"])(this, Signature);
778
- _this15 = _super12.call(this, props);
828
+ _this15 = _super13.call(this, props);
779
829
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this15), "clear", function () {
780
- if (_this15.state.defaultValue) {
830
+ var $canvas_sig = _this15.canvas.current;
831
+ if (_this15.props.value) {
832
+ var $input_sig = _this15.inputField.current;
833
+ var signature = _objectSpread(_objectSpread({}, _this15.props.value), {}, {
834
+ signature: ''
835
+ });
836
+ $input_sig.value = signature;
837
+ if (_this15.props.methods) {
838
+ _this15.props.methods.setValue(_this15.props.name, signature);
839
+ }
781
840
  _this15.setState({
782
- defaultValue: ''
841
+ value: signature
783
842
  });
784
- } else if (_this15.canvas.current) {
785
- _this15.canvas.current.clear();
843
+ } else if ($canvas_sig) {
844
+ $canvas_sig.clear();
786
845
  }
787
846
  });
788
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this15), "_getSignatureImg", function () {
789
- var $canvas_sig = _this15.canvas.current;
790
- if ($canvas_sig) {
791
- var base64 = $canvas_sig.toDataURL().replace('data:image/png;base64,', '');
792
- var isEmpty = $canvas_sig.isEmpty();
793
- var $input_sig = _this15.inputField.current;
794
- var name = _this15.props.data.fieldName;
795
- if (isEmpty) {
796
- $input_sig.value = '';
797
- if (_this15.props.methods) {
798
- _this15.props.methods.setValue(name, '');
799
- }
800
- } else {
801
- $input_sig.value = base64;
802
- if (_this15.props.methods) {
803
- _this15.props.methods.setValue(name, base64);
804
- }
847
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this15), "_getSignatureImg", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
848
+ var $canvas_sig, base64, isEmpty, $input_sig, value, ipAddress, date, signature;
849
+ return _regenerator["default"].wrap(function _callee$(_context) {
850
+ while (1) switch (_context.prev = _context.next) {
851
+ case 0:
852
+ $canvas_sig = _this15.canvas.current;
853
+ if (!$canvas_sig) {
854
+ _context.next = 14;
855
+ break;
856
+ }
857
+ base64 = $canvas_sig.getTrimmedCanvas().toDataURL("image/png");
858
+ isEmpty = $canvas_sig.isEmpty();
859
+ $input_sig = _this15.inputField.current;
860
+ value = isEmpty ? '' : base64;
861
+ _context.next = 8;
862
+ return (0, _ipUtils.getIPAddress)();
863
+ case 8:
864
+ ipAddress = _context.sent;
865
+ date = (0, _momentTimezone["default"])().toISOString();
866
+ signature = _objectSpread(_objectSpread({}, _this15.props.value), {}, {
867
+ signature: value,
868
+ ipAddress: ipAddress,
869
+ date: date
870
+ });
871
+ $input_sig.value = signature;
872
+ if (_this15.props.methods) {
873
+ _this15.props.methods.setValue(_this15.props.name, signature);
874
+ }
875
+ _this15.setState({
876
+ value: signature
877
+ });
878
+ case 14:
879
+ case "end":
880
+ return _context.stop();
805
881
  }
882
+ }, _callee);
883
+ })));
884
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this15), "onChangeName", function (event) {
885
+ var $input_sig = _this15.inputField.current;
886
+ var signature = _objectSpread(_objectSpread({}, _this15.props.value), {}, {
887
+ name: event.target.value
888
+ });
889
+ $input_sig.value = signature;
890
+ if (_this15.props.methods) {
891
+ _this15.props.methods.setValue(_this15.props.name, signature);
806
892
  }
893
+ _this15.setState({
894
+ value: signature
895
+ });
807
896
  });
808
897
  _this15.state = {
809
- defaultValue: props.defaultValue
898
+ value: props.value
810
899
  };
811
900
  _this15.inputField = /*#__PURE__*/_react["default"].createRef();
812
901
  _this15.canvas = /*#__PURE__*/_react["default"].createRef();
@@ -815,48 +904,72 @@ var Signature = /*#__PURE__*/function (_React$Component12) {
815
904
  (0, _createClass2["default"])(Signature, [{
816
905
  key: "render",
817
906
  value: function render() {
818
- var _this16 = this;
819
- var defaultValue = this.state.defaultValue;
820
- var canClear = !!defaultValue;
907
+ var _this$state$value,
908
+ _this$state$value2,
909
+ _this$props$value6,
910
+ _this$props$value7,
911
+ _this$props$value8,
912
+ _this$props$value9,
913
+ _this16 = this,
914
+ _this$props$value$nam,
915
+ _this$props$value10;
916
+ var canClear = !!this.state.value;
821
917
  var props = {};
822
- props.type = 'hidden';
823
- props.name = this.props.data.fieldName;
824
- if (this.props.onChange) {
825
- props.onChange = function (e) {
826
- _this16.props.onChange(e.target.value);
827
- };
828
- }
829
- if (this.props.value) {
830
- props.value = this.props.value;
831
- }
832
- if (this.props.mutable) {
833
- props.defaultValue = defaultValue;
918
+ props.name = this.props.name;
919
+ // props.onChange = (event) => { console.log('onChangeSignature', event.target.value); this.props.onChange(event.target.value); };
920
+ props.value = this.props.value;
921
+ if (this.props.item.mutable) {
834
922
  props.ref = this.inputField;
835
923
  }
836
924
  var padProps = {};
837
925
  // umd requires canvasProps={{ width: 400, height: 150 }}
838
- if (this.props.mutable) {
839
- padProps.defaultValue = defaultValue;
926
+ if (this.props.item.mutable) {
927
+ var _this$props$value;
928
+ padProps.defaultValue = (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.signature;
840
929
  padProps.ref = this.canvas;
841
- canClear = !this.props.readOnly;
930
+ canClear = !this.props.item.readOnly;
842
931
  }
843
932
  var baseClasses = 'SortableItem rfb-item';
844
- if (this.props.data.pageBreakBefore) {
933
+ if (this.props.item.pageBreakBefore) {
845
934
  baseClasses += ' alwaysbreak';
846
935
  }
847
936
  var sourceDataURL;
848
- if (defaultValue && defaultValue.length > 0) {
849
- sourceDataURL = "data:image/png;base64,".concat(defaultValue);
937
+ if ((_this$state$value = this.state.value) !== null && _this$state$value !== void 0 && _this$state$value.signature && ((_this$state$value2 = this.state.value) === null || _this$state$value2 === void 0 ? void 0 : _this$state$value2.signature.length) > 0) {
938
+ var _this$state$value3;
939
+ sourceDataURL = (_this$state$value3 = this.state.value) === null || _this$state$value3 === void 0 ? void 0 : _this$state$value3.signature;
850
940
  }
851
941
  padProps.canvasProps = {};
942
+ if (this.props.item.print === true && !!sourceDataURL) {
943
+ var _this$props$value2, _this$props$value3, _this$props$value4, _this$props$value5;
944
+ return /*#__PURE__*/_react["default"].createElement("div", {
945
+ style: _objectSpread({}, this.props.style),
946
+ className: baseClasses
947
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
948
+ className: "form-group mb-3"
949
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
950
+ htmlFor: this.props.name
951
+ })), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Image, {
952
+ src: sourceDataURL
953
+ }), /*#__PURE__*/_react["default"].createElement("hr", {
954
+ style: {
955
+ borderStyle: 'dashed'
956
+ }
957
+ }), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("strong", null, "Electronic Signature"), " at ", (_this$props$value2 = this.props.value) !== null && _this$props$value2 !== void 0 && _this$props$value2.date ? (0, _momentTimezone["default"])((_this$props$value3 = this.props.value) === null || _this$props$value3 === void 0 ? void 0 : _this$props$value3.date).format('dddd MMMM D, YYYY hh:mm A') : (0, _momentTimezone["default"])().format('dddd MMMM D, YYYY hh:mm A'), " by ", (_this$props$value4 = this.props.value) === null || _this$props$value4 === void 0 ? void 0 : _this$props$value4.name, " via IP Address ", (_this$props$value5 = this.props.value) === null || _this$props$value5 === void 0 ? void 0 : _this$props$value5.ipAddress), /*#__PURE__*/_react["default"].createElement("hr", null))));
958
+ }
852
959
  return /*#__PURE__*/_react["default"].createElement("div", {
853
960
  style: _objectSpread({}, this.props.style),
854
961
  className: baseClasses
855
962
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
856
963
  className: "form-group mb-3"
857
- }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.readOnly === true || !!sourceDataURL ? /*#__PURE__*/_react["default"].createElement("img", {
964
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
965
+ htmlFor: this.props.name
966
+ })), this.props.readOnly === true ? !!sourceDataURL ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Image, {
858
967
  src: sourceDataURL
859
- }) : /*#__PURE__*/_react["default"].createElement("div", {
968
+ }), /*#__PURE__*/_react["default"].createElement("hr", {
969
+ style: {
970
+ borderStyle: 'dashed'
971
+ }
972
+ }), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("strong", null, "Electronic Signature"), " at ", (_this$props$value6 = this.props.value) !== null && _this$props$value6 !== void 0 && _this$props$value6.date ? (0, _momentTimezone["default"])((_this$props$value7 = this.props.value) === null || _this$props$value7 === void 0 ? void 0 : _this$props$value7.date).format('dddd MMMM D, YYYY hh:mm A') : (0, _momentTimezone["default"])().format('dddd MMMM D, YYYY hh:mm A'), " by ", (_this$props$value8 = this.props.value) === null || _this$props$value8 === void 0 ? void 0 : _this$props$value8.name, " via IP Address ", (_this$props$value9 = this.props.value) === null || _this$props$value9 === void 0 ? void 0 : _this$props$value9.ipAddress), /*#__PURE__*/_react["default"].createElement("hr", null)) : null : /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
860
973
  className: "m-signature-pad"
861
974
  }, /*#__PURE__*/_react["default"].createElement("div", {
862
975
  className: "m-signature-pad--body"
@@ -872,168 +985,45 @@ var Signature = /*#__PURE__*/function (_React$Component12) {
872
985
  className: "clear-signature float-end",
873
986
  onClick: this.clear,
874
987
  title: "Clear Signature"
875
- }, /*#__PURE__*/_react["default"].createElement(_fa.FaTimes, null), " clear"))), this.props.methods ? /*#__PURE__*/_react["default"].createElement("input", (0, _extends2["default"])({}, this.props.methods.register(props.name), props)) : /*#__PURE__*/_react["default"].createElement("input", props)));
876
- }
877
- }]);
878
- return Signature;
879
- }(_react["default"].Component);
880
- var Tags2 = /*#__PURE__*/function (_React$Component13) {
881
- (0, _inherits2["default"])(Tags2, _React$Component13);
882
- var _super13 = _createSuper(Tags2);
883
- function Tags2(props) {
884
- var _this17;
885
- (0, _classCallCheck2["default"])(this, Tags2);
886
- _this17 = _super13.call(this, props);
887
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this17), "handleChange", function (e) {
888
- _this17.setState({
889
- value: e.map(function (i) {
890
- return i.value;
891
- }).join(',') || null
892
- });
893
- if (_this17.props.onChange) {
894
- _this17.props.onChange(e ? e.map(function (i) {
895
- return i.value;
896
- }).join(',') : null);
897
- }
898
- });
899
- _this17.inputField = /*#__PURE__*/_react["default"].createRef();
900
- var defaultValue = props.defaultValue,
901
- data = props.data;
902
- if (props.value) {
903
- _this17.state = {
904
- value: props.value
905
- };
906
- } else {
907
- _this17.state = {
908
- value: defaultValue
909
- };
910
- }
911
- return _this17;
912
- }
913
- (0, _createClass2["default"])(Tags2, [{
914
- key: "getDefaultValue",
915
- value: function getDefaultValue(defaultValue, options) {
916
- if (defaultValue) {
917
- if (typeof defaultValue === 'string') {
918
- var vals = defaultValue.split(',').map(function (x) {
919
- return x.trim();
920
- });
921
- return options.filter(function (x) {
922
- return vals.indexOf(x.value) > -1;
923
- });
924
- }
925
- return options.filter(function (x) {
926
- return defaultValue.indexOf(x.value) > -1;
927
- });
928
- }
929
- return [];
930
- }
931
- }, {
932
- key: "render",
933
- value: function render() {
934
- var options = this.props.data.options.map(function (option) {
935
- option.label = option.text;
936
- return option;
937
- });
938
- var props = {};
939
- props.isMulti = true;
940
- props.name = this.props.data.fieldName;
941
- props.onChange = this.handleChange;
942
-
943
- //if (this.props.isInvalid) { props.isInvalid = this.props.isInvalid; }
944
- //if (this.props.onBlur) { props.onBlur = this.props.onBlur; }
945
-
946
- props.options = options;
947
- if (!this.props.mutable) {
948
- props.value = options[0].text;
949
- } // to show a sample of what tags looks like
950
- if (this.props.mutable) {
951
- props.isDisabled = this.props.readOnly;
952
- props.value = this.getDefaultValue(this.state.value, options);
953
- props.ref = this.inputField;
954
- }
955
- var baseClasses = 'SortableItem rfb-item';
956
- if (this.props.data.pageBreakBefore) {
957
- baseClasses += ' alwaysbreak';
958
- }
959
- var labelLocation = 'ABOVE';
960
- if (this.props.data.labelLocation) {
961
- labelLocation = this.props.data.labelLocation;
962
- }
963
- return /*#__PURE__*/_react["default"].createElement("div", {
964
- style: _objectSpread({}, this.props.style),
965
- className: baseClasses
966
- }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
967
- className: "form-group mb-3"
968
- }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
969
- name: props.name,
970
- htmlFor: props.name
971
- })), /*#__PURE__*/_react["default"].createElement(_reactSelect["default"], (0, _extends2["default"])({
972
- id: props.name
973
- }, props)), this.props.data.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
988
+ }, /*#__PURE__*/_react["default"].createElement(_fa.FaTimes, null), " clear"))), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Label, null, "Please print your full legal name and today's date."), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Container, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Row, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Col, {
989
+ sm: 6
990
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, {
991
+ value: (_this$props$value$nam = (_this$props$value10 = this.props.value) === null || _this$props$value10 === void 0 ? void 0 : _this$props$value10.name) !== null && _this$props$value$nam !== void 0 ? _this$props$value$nam : '',
992
+ type: "text",
993
+ required: true,
994
+ placeholder: "Full Legal Name",
995
+ onChange: this.onChangeName
996
+ })), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Col, {
997
+ sm: 6
998
+ }, "Today's Date: ", (0, _momentTimezone["default"])().format('MM/DD/YYYY'))))), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
974
999
  muted: true
975
- }, this.props.data.help) : null));
1000
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
1001
+ name: this.props.name
1002
+ }), this.props.methods ? /*#__PURE__*/_react["default"].createElement("input", (0, _extends2["default"])({}, this.props.methods.register(this.props.name), props, {
1003
+ type: "hidden"
1004
+ })) : /*#__PURE__*/_react["default"].createElement("input", (0, _extends2["default"])({}, props, {
1005
+ type: "hidden"
1006
+ }))));
976
1007
  }
977
1008
  }]);
978
- return Tags2;
1009
+ return Signature;
979
1010
  }(_react["default"].Component);
980
1011
  var Tags = /*#__PURE__*/function (_React$Component14) {
981
1012
  (0, _inherits2["default"])(Tags, _React$Component14);
982
1013
  var _super14 = _createSuper(Tags);
983
1014
  function Tags(props) {
984
- var _this18;
1015
+ var _this17;
985
1016
  (0, _classCallCheck2["default"])(this, Tags);
986
- _this18 = _super14.call(this, props);
987
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this18), "handleChange", function (selected) {
988
- if (selected !== undefined && selected !== null && selected.length > 0) {
989
- _this18.setState({
990
- value: selected.map(function (i) {
991
- return i.id;
992
- }).join(',')
993
- });
994
- if (_this18.props.onChange) {
995
- _this18.props.onChange(selected.map(function (i) {
996
- return i.id;
997
- }).join(','));
998
- }
999
- } else {
1000
- _this18.setState({
1001
- value: []
1002
- });
1003
- if (_this18.props.onChange) {
1004
- _this18.props.onChange([]);
1005
- }
1006
- }
1007
- });
1008
- _this18.inputField = /*#__PURE__*/_react["default"].createRef();
1009
- var defaultValue = props.defaultValue,
1010
- data = props.data;
1011
- if (props.value) {
1012
- _this18.state = {
1013
- value: props.value
1014
- };
1015
- } else {
1016
- _this18.state = {
1017
- value: defaultValue
1018
- };
1019
- }
1020
- return _this18;
1017
+ _this17 = _super14.call(this, props);
1018
+ _this17.inputField = /*#__PURE__*/_react["default"].createRef();
1019
+ return _this17;
1021
1020
  }
1022
1021
  (0, _createClass2["default"])(Tags, [{
1023
1022
  key: "getDefaultValue",
1024
- value: function getDefaultValue(defaultValue, options) {
1025
- console.log(defaultValue);
1026
- if (defaultValue) {
1027
- if (typeof defaultValue === 'string') {
1028
- var vals = defaultValue.split(',').map(function (x) {
1029
- return x.trim();
1030
- });
1031
- return options.filter(function (x) {
1032
- return vals.indexOf(x.value) > -1;
1033
- });
1034
- }
1035
- return options.filter(function (x) {
1036
- return defaultValue.indexOf(x.value) > -1;
1023
+ value: function getDefaultValue(val, options) {
1024
+ if (val) {
1025
+ return options.filter(function (option) {
1026
+ return val.indexOf(option.value) > -1;
1037
1027
  });
1038
1028
  }
1039
1029
  return [];
@@ -1041,36 +1031,55 @@ var Tags = /*#__PURE__*/function (_React$Component14) {
1041
1031
  }, {
1042
1032
  key: "render",
1043
1033
  value: function render() {
1044
- var options = this.props.data.options.map(function (option) {
1045
- option.label = option.text;
1046
- option.id = option.value;
1047
- return option;
1034
+ var _this18 = this;
1035
+ var options = this.props.item.options.map(function (option) {
1036
+ return {
1037
+ value: option.value,
1038
+ label: option.text,
1039
+ key: option.value
1040
+ };
1048
1041
  });
1049
1042
  var props = {};
1050
- props.multiple = true;
1051
- props.name = this.props.data.fieldName;
1052
- props.onChange = this.handleChange;
1053
- props.placeholder = this.props.data.placeholder || 'Select...';
1054
- props.required = this.props.data.required;
1055
- if (this.props.isInvalid) {
1056
- props.isInvalid = this.props.isInvalid;
1057
- }
1058
- if (this.props.onBlur) {
1059
- props.onBlur = this.props.onBlur;
1043
+ props.name = this.props.name;
1044
+ props.placeholder = this.props.item.placeholder || 'Select...';
1045
+ props.onChange = function (val) {
1046
+ _this18.props.onChange(val !== undefined && val !== null && val.length > 0 ? val.map(function (i) {
1047
+ return i.value;
1048
+ }) : []);
1049
+ };
1050
+ props.isInvalid = this.props.isInvalid;
1051
+ props.onBlur = this.props.onBlur;
1052
+ props.autoComplete = "new-password";
1053
+ if (this.props.item.disabled) {
1054
+ props.disabled = 'disabled';
1060
1055
  }
1061
- props.options = options;
1062
- if (this.props.mutable) {
1063
- props.disabled = this.props.readOnly;
1064
- props.selected = this.getDefaultValue(this.state.value, options);
1056
+ if (this.props.item.mutable) {
1065
1057
  props.ref = this.inputField;
1066
1058
  }
1059
+ props.multiple = true;
1060
+ props.selected = this.getDefaultValue(this.props.value, options);
1061
+ props.options = options;
1062
+ // props.required = this.props.item.required;
1063
+
1067
1064
  var baseClasses = 'SortableItem rfb-item';
1068
- if (this.props.data.pageBreakBefore) {
1065
+ if (this.props.item.pageBreakBefore) {
1069
1066
  baseClasses += ' alwaysbreak';
1070
1067
  }
1071
1068
  var labelLocation = 'ABOVE';
1072
- if (this.props.data.labelLocation) {
1073
- labelLocation = this.props.data.labelLocation;
1069
+ if (this.props.item.labelLocation) {
1070
+ labelLocation = this.props.item.labelLocation;
1071
+ }
1072
+ if (this.props.item.print === true) {
1073
+ return /*#__PURE__*/_react["default"].createElement("div", {
1074
+ style: _objectSpread({}, this.props.style),
1075
+ className: baseClasses
1076
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1077
+ className: "form-group mb-3"
1078
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
1079
+ htmlFor: props.name
1080
+ })), /*#__PURE__*/_react["default"].createElement("div", null, props.selected.map(function (selectedOption) {
1081
+ return selectedOption.label;
1082
+ }).join(', '))));
1074
1083
  }
1075
1084
  return /*#__PURE__*/_react["default"].createElement("div", {
1076
1085
  style: _objectSpread({}, this.props.style),
@@ -1083,19 +1092,19 @@ var Tags = /*#__PURE__*/function (_React$Component14) {
1083
1092
  },
1084
1093
  id: props.name
1085
1094
  }, props)), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
1086
- name: props.name,
1087
1095
  htmlFor: props.name
1088
1096
  }))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
1089
- name: props.name,
1090
1097
  htmlFor: props.name
1091
1098
  })), /*#__PURE__*/_react["default"].createElement(_reactBootstrapTypeahead.Typeahead, (0, _extends2["default"])({
1092
1099
  labelKey: function labelKey(option) {
1093
1100
  return option.label;
1094
1101
  },
1095
1102
  id: props.name
1096
- }, props))), this.props.data.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
1103
+ }, props))), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
1097
1104
  muted: true
1098
- }, this.props.data.help) : null));
1105
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
1106
+ name: props.name
1107
+ })));
1099
1108
  }
1100
1109
  }]);
1101
1110
  return Tags;
@@ -1108,18 +1117,18 @@ var Checkboxes = /*#__PURE__*/function (_React$Component15) {
1108
1117
  (0, _classCallCheck2["default"])(this, Checkboxes);
1109
1118
  _this19 = _super15.call(this, props);
1110
1119
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this19), "onCheckboxChange", function (checkboxValue, event) {
1120
+ var checkedValues = _this19.props.value;
1111
1121
  if (_this19.props.onChange) {
1112
1122
  if (event.target.checked) {
1113
- _this19.props.onChange(_this19.checkedValues.concat(checkboxValue));
1123
+ _this19.props.onChange(checkedValues.concat(checkboxValue));
1114
1124
  } else {
1115
- _this19.props.onChange(_this19.checkedValues.filter(function (v) {
1125
+ _this19.props.onChange(checkedValues.filter(function (v) {
1116
1126
  return v !== checkboxValue;
1117
1127
  }));
1118
1128
  }
1119
1129
  }
1120
1130
  });
1121
1131
  _this19.options = {};
1122
- _this19.checkedValues = [];
1123
1132
  return _this19;
1124
1133
  }
1125
1134
  (0, _createClass2["default"])(Checkboxes, [{
@@ -1128,41 +1137,47 @@ var Checkboxes = /*#__PURE__*/function (_React$Component15) {
1128
1137
  var _this20 = this;
1129
1138
  var self = this;
1130
1139
  var baseClasses = 'SortableItem rfb-item';
1131
- if (this.props.data.pageBreakBefore) {
1140
+ if (this.props.item.pageBreakBefore) {
1132
1141
  baseClasses += ' alwaysbreak';
1133
1142
  }
1134
- if (this.props.value) {
1135
- this.checkedValues = this.props.value;
1143
+ if (this.props.item.print === true) {
1144
+ return /*#__PURE__*/_react["default"].createElement("div", {
1145
+ style: _objectSpread({}, this.props.style),
1146
+ className: baseClasses
1147
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1148
+ className: "form-group mb-3"
1149
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
1150
+ htmlFor: props.name
1151
+ })), /*#__PURE__*/_react["default"].createElement("div", null, this.props.item.options.filter(function (option) {
1152
+ return _this20.props.value.includes(option.value);
1153
+ }).map(function (option) {
1154
+ return option.label;
1155
+ }).join(', '))));
1136
1156
  }
1137
1157
  return /*#__PURE__*/_react["default"].createElement("div", {
1138
1158
  style: _objectSpread({}, this.props.style),
1139
1159
  className: baseClasses
1140
1160
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1141
1161
  className: "form-group mb-3"
1142
- }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.data.options.map(function (option) {
1143
- var thisKey = "preview_".concat(option.key);
1162
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
1163
+ htmlFor: this.props.name
1164
+ })), this.props.item.options.map(function (option) {
1165
+ var _self$props$item$inli;
1144
1166
  var props = {};
1145
1167
  props.name = "option_".concat(option.key);
1146
- if (self.props.data.inline) {
1147
- props.inline = true;
1148
- }
1149
1168
  props.value = option.value;
1150
- if (self.props.mutable) {
1151
- props.defaultChecked = self.props.defaultValue !== undefined && self.props.defaultValue.indexOf(option.key) > -1;
1152
- }
1153
- if (self.props.readOnly) {
1169
+ props.checked = self.props.value ? self.props.value.indexOf(option.value) > -1 : false;
1170
+ props.inline = (_self$props$item$inli = self.props.item.inline) !== null && _self$props$item$inli !== void 0 ? _self$props$item$inli : false;
1171
+ if (self.props.item.disabled) {
1154
1172
  props.disabled = 'disabled';
1155
1173
  }
1156
- if (self.props.value) {
1157
- props.checked = _this20.props.value.indexOf(option.value) > -1;
1158
- }
1159
1174
  return /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Check, (0, _extends2["default"])({
1160
1175
  label: option.text,
1161
1176
  type: "checkbox",
1162
- key: thisKey,
1163
- id: "fid_".concat(thisKey),
1177
+ key: "preview_".concat(option.key),
1178
+ id: "fid_preview_".concat(option.key),
1164
1179
  ref: function ref(c) {
1165
- if (c && self.props.mutable) {
1180
+ if (c && self.props.item.mutable) {
1166
1181
  self.options["child_ref_".concat(option.key)] = c;
1167
1182
  }
1168
1183
  },
@@ -1170,6 +1185,10 @@ var Checkboxes = /*#__PURE__*/function (_React$Component15) {
1170
1185
  self.onCheckboxChange(option.value, e);
1171
1186
  }
1172
1187
  }, props));
1188
+ }), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
1189
+ muted: true
1190
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
1191
+ name: this.props.name
1173
1192
  })));
1174
1193
  }
1175
1194
  }]);
@@ -1188,38 +1207,42 @@ var Checkbox = /*#__PURE__*/function (_React$Component16) {
1188
1207
  (0, _createClass2["default"])(Checkbox, [{
1189
1208
  key: "render",
1190
1209
  value: function render() {
1191
- var _this22 = this;
1210
+ var _this22 = this,
1211
+ _this$props$item$inli;
1192
1212
  var baseClasses = 'SortableItem rfb-item';
1193
- if (this.props.data.pageBreakBefore) {
1213
+ if (this.props.item.pageBreakBefore) {
1194
1214
  baseClasses += ' alwaysbreak';
1195
1215
  }
1196
1216
  var props = {};
1197
1217
  // eslint-disable-next-line no-undef
1198
- props.name = this.props.data.fieldName;
1199
- props.type = 'checkbox';
1200
- props.defaultChecked = this.props.data.defaultChecked;
1201
- if (this.props.mutable) {
1202
- props.ref = this.inputField;
1203
- }
1204
- if (this.props.onChange) {
1205
- props.onChange = function (e) {
1206
- _this22.props.onChange(e.target.checked);
1207
- };
1208
- }
1209
- if (this.props.value) {
1210
- props.checked = this.props.value;
1211
- }
1212
- if (this.props.isInvalid) {
1213
- props.isInvalid = this.props.isInvalid;
1214
- }
1215
- if (this.props.onBlur) {
1216
- props.onBlur = this.props.onBlur;
1217
- }
1218
- if (this.props.readOnly) {
1218
+ props.name = this.props.name;
1219
+ props.onChange = function (event) {
1220
+ _this22.props.onChange(event.target.checked);
1221
+ };
1222
+ props.isInvalid = this.props.isInvalid;
1223
+ props.onBlur = this.props.onBlur;
1224
+ props.autoComplete = "new-password";
1225
+ if (this.props.item.disabled) {
1219
1226
  props.disabled = 'disabled';
1220
1227
  }
1221
- if (this.props.data.inline) {
1222
- props.inline = true;
1228
+ if (this.props.item.mutable) {
1229
+ props.ref = this.inputField;
1230
+ }
1231
+ props.checked = this.props.value;
1232
+ props.inline = (_this$props$item$inli = this.props.item.inline) !== null && _this$props$item$inli !== void 0 ? _this$props$item$inli : false;
1233
+ if (this.props.item.print === true) {
1234
+ return /*#__PURE__*/_react["default"].createElement("div", {
1235
+ style: _objectSpread({}, this.props.style),
1236
+ className: baseClasses
1237
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1238
+ className: "form-group mb-3"
1239
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
1240
+ htmlFor: props.name
1241
+ })), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
1242
+ dangerouslySetInnerHTML: {
1243
+ __html: this.props.item.boxLabel
1244
+ }
1245
+ }), ": ", this.props.value === true ? 'Yes' : 'No')));
1223
1246
  }
1224
1247
  return /*#__PURE__*/_react["default"].createElement("div", {
1225
1248
  style: _objectSpread({}, this.props.style),
@@ -1231,12 +1254,16 @@ var Checkbox = /*#__PURE__*/function (_React$Component16) {
1231
1254
  }, this.props)), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Check, (0, _extends2["default"])({
1232
1255
  label: /*#__PURE__*/_react["default"].createElement("span", {
1233
1256
  dangerouslySetInnerHTML: {
1234
- __html: this.props.data.boxLabel
1257
+ __html: this.props.item.boxLabel
1235
1258
  }
1236
1259
  }),
1237
1260
  type: "checkbox",
1238
- id: this.props.data.fieldName
1239
- }, props))));
1261
+ id: props.name
1262
+ }, props)), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
1263
+ muted: true
1264
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
1265
+ name: props.name
1266
+ })));
1240
1267
  }
1241
1268
  }]);
1242
1269
  return Checkbox;
@@ -1254,49 +1281,59 @@ var RadioButtons = /*#__PURE__*/function (_React$Component17) {
1254
1281
  (0, _createClass2["default"])(RadioButtons, [{
1255
1282
  key: "render",
1256
1283
  value: function render() {
1284
+ var _this24 = this;
1257
1285
  var self = this;
1258
1286
  var baseClasses = 'SortableItem rfb-item';
1259
- if (this.props.data.pageBreakBefore) {
1287
+ if (this.props.item.pageBreakBefore) {
1260
1288
  baseClasses += ' alwaysbreak';
1261
1289
  }
1290
+ if (this.props.item.print === true) {
1291
+ return /*#__PURE__*/_react["default"].createElement("div", {
1292
+ style: _objectSpread({}, this.props.style),
1293
+ className: baseClasses
1294
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1295
+ className: "form-group mb-3"
1296
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
1297
+ htmlFor: props.name
1298
+ })), /*#__PURE__*/_react["default"].createElement("div", null, this.props.item.options.filter(function (option) {
1299
+ return _this24.props.value === option.value;
1300
+ }).map(function (option) {
1301
+ return option.label;
1302
+ }).join(', '))));
1303
+ }
1262
1304
  return /*#__PURE__*/_react["default"].createElement("div", {
1263
1305
  style: _objectSpread({}, this.props.style),
1264
1306
  className: baseClasses
1265
1307
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1266
1308
  className: "form-group mb-3"
1267
- }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.data.options.map(function (option) {
1268
- var thisKey = "preview_".concat(option.key);
1309
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.item.options.map(function (option) {
1310
+ var _self$props$item$inli2;
1269
1311
  var props = {};
1270
- props.name = self.props.data.fieldName;
1312
+ props.name = self.props.name;
1271
1313
  props.value = option.value;
1272
- if (self.props.mutable) {
1273
- props.defaultChecked = self.props.defaultValue !== undefined && self.props.defaultValue.indexOf(option.value) > -1;
1274
- }
1275
- if (self.props.onChange) {
1276
- props.onChange = function (e) {
1277
- self.props.onChange(e.target.value);
1278
- };
1279
- }
1280
- if (self.props.value) {
1281
- props.checked = self.props.value === option.value;
1282
- }
1283
- if (self.props.readOnly) {
1314
+ props.checked = self.props.value === option.value;
1315
+ props.onChange = function (event) {
1316
+ self.props.onChange(event.target.value);
1317
+ };
1318
+ if (self.props.item.disabled) {
1284
1319
  props.disabled = 'disabled';
1285
1320
  }
1286
- if (self.props.data.inline) {
1287
- props.inline = true;
1288
- }
1321
+ props.inline = (_self$props$item$inli2 = self.props.item.inline) !== null && _self$props$item$inli2 !== void 0 ? _self$props$item$inli2 : false;
1289
1322
  return /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Check, (0, _extends2["default"])({
1290
1323
  label: option.text,
1291
1324
  type: "radio",
1292
- key: thisKey,
1293
- id: "fid_".concat(thisKey),
1325
+ key: "preview_".concat(option.key),
1326
+ id: "fid_preview_".concat(option.key),
1294
1327
  ref: function ref(c) {
1295
- if (c && self.props.mutable) {
1328
+ if (c && self.props.item.mutable) {
1296
1329
  self.options["child_ref_".concat(option.key)] = c;
1297
1330
  }
1298
1331
  }
1299
1332
  }, props));
1333
+ }), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
1334
+ muted: true
1335
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
1336
+ name: this.props.name
1300
1337
  })));
1301
1338
  }
1302
1339
  }]);
@@ -1312,21 +1349,21 @@ var Image = /*#__PURE__*/function (_React$Component18) {
1312
1349
  (0, _createClass2["default"])(Image, [{
1313
1350
  key: "render",
1314
1351
  value: function render() {
1315
- var style = this.props.data.center ? {
1352
+ var style = this.props.item.center ? {
1316
1353
  textAlign: 'center'
1317
1354
  } : null;
1318
1355
  var baseClasses = 'SortableItem rfb-item';
1319
- if (this.props.data.pageBreakBefore) {
1356
+ if (this.props.item.pageBreakBefore) {
1320
1357
  baseClasses += ' alwaysbreak';
1321
1358
  }
1322
1359
  return /*#__PURE__*/_react["default"].createElement("div", {
1323
1360
  style: _objectSpread(_objectSpread({}, this.props.style), style),
1324
1361
  className: baseClasses
1325
- }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), this.props.data.src && /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Image, {
1326
- src: this.props.data.src,
1327
- width: this.props.data.width,
1328
- height: this.props.data.height
1329
- }), !this.props.data.src && /*#__PURE__*/_react["default"].createElement("div", {
1362
+ }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), this.props.item.src && /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Image, {
1363
+ src: this.props.item.src,
1364
+ width: this.props.item.width,
1365
+ height: this.props.item.height
1366
+ }), !this.props.item.src && /*#__PURE__*/_react["default"].createElement("div", {
1330
1367
  className: "no-image"
1331
1368
  }, "No Image"));
1332
1369
  }
@@ -1337,47 +1374,58 @@ var Rating = /*#__PURE__*/function (_React$Component19) {
1337
1374
  (0, _inherits2["default"])(Rating, _React$Component19);
1338
1375
  var _super19 = _createSuper(Rating);
1339
1376
  function Rating(props) {
1340
- var _this24;
1377
+ var _this25;
1341
1378
  (0, _classCallCheck2["default"])(this, Rating);
1342
- _this24 = _super19.call(this, props);
1343
- _this24.inputField = /*#__PURE__*/_react["default"].createRef();
1344
- return _this24;
1379
+ _this25 = _super19.call(this, props);
1380
+ _this25.inputField = /*#__PURE__*/_react["default"].createRef();
1381
+ return _this25;
1345
1382
  }
1346
1383
  (0, _createClass2["default"])(Rating, [{
1347
1384
  key: "render",
1348
1385
  value: function render() {
1349
- var _this25 = this;
1386
+ var _this26 = this;
1350
1387
  var props = {};
1351
- props.name = this.props.data.fieldName;
1388
+ props.name = this.props.name;
1352
1389
  props.ratingAmount = 5;
1353
- if (this.props.mutable) {
1354
- props.rating = this.props.defaultValue !== undefined ? parseFloat(this.props.defaultValue, 10) : 0;
1390
+ props.rating = this.props.value !== undefined && this.props.value !== null && this.props.value !== '' ? parseFloat(this.props.value, 10) : 0;
1391
+ props.disabled = this.props.item.readOnly;
1392
+ if (this.props.item.disabled) {
1393
+ props.disabled = true;
1394
+ }
1395
+ props.onRatingClick = function (event, _ref4) {
1396
+ var rating = _ref4.rating;
1397
+ _this26.props.onChange(rating);
1398
+ };
1399
+ if (this.props.item.mutable) {
1355
1400
  props.editing = true;
1356
- props.disabled = this.props.readOnly;
1357
1401
  props.ref = this.inputField;
1358
1402
  }
1359
- if (this.props.onChange) {
1360
- props.onRatingClick = function (e, _ref3) {
1361
- var rating = _ref3.rating;
1362
- _this25.props.onChange(rating);
1363
- };
1364
- }
1365
- if (this.props.value) {
1366
- props.rating = this.props.value;
1367
- }
1368
- if (this.props.readOnly) {
1369
- props.disabled = true;
1370
- }
1371
1403
  var baseClasses = 'SortableItem rfb-item';
1372
- if (this.props.data.pageBreakBefore) {
1404
+ if (this.props.item.pageBreakBefore) {
1373
1405
  baseClasses += ' alwaysbreak';
1374
1406
  }
1407
+ if (this.props.item.print === true) {
1408
+ return /*#__PURE__*/_react["default"].createElement("div", {
1409
+ style: _objectSpread({}, this.props.style),
1410
+ className: baseClasses
1411
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1412
+ className: "form-group mb-3"
1413
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
1414
+ htmlFor: props.name
1415
+ })), /*#__PURE__*/_react["default"].createElement("div", null, this.props.value)));
1416
+ }
1375
1417
  return /*#__PURE__*/_react["default"].createElement("div", {
1376
1418
  style: _objectSpread({}, this.props.style),
1377
1419
  className: baseClasses
1378
1420
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1379
1421
  className: "form-group mb-3"
1380
- }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement(_starRating["default"], props)));
1422
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
1423
+ htmlFor: props.name
1424
+ })), /*#__PURE__*/_react["default"].createElement(_starRating["default"], props), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
1425
+ muted: true
1426
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
1427
+ name: props.name
1428
+ })));
1381
1429
  }
1382
1430
  }]);
1383
1431
  return Rating;
@@ -1393,7 +1441,7 @@ var HyperLink = /*#__PURE__*/function (_React$Component20) {
1393
1441
  key: "render",
1394
1442
  value: function render() {
1395
1443
  var baseClasses = 'SortableItem rfb-item';
1396
- if (this.props.data.pageBreakBefore) {
1444
+ if (this.props.item.pageBreakBefore) {
1397
1445
  baseClasses += ' alwaysbreak';
1398
1446
  }
1399
1447
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -1403,9 +1451,9 @@ var HyperLink = /*#__PURE__*/function (_React$Component20) {
1403
1451
  className: "form-group mb-3"
1404
1452
  }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Label, null, /*#__PURE__*/_react["default"].createElement("a", {
1405
1453
  target: "_blank",
1406
- href: this.props.data.href,
1454
+ href: this.props.item.href,
1407
1455
  dangerouslySetInnerHTML: {
1408
- __html: _myxss["default"].process(this.props.data.content)
1456
+ __html: _myxss["default"].process(this.props.item.content)
1409
1457
  }
1410
1458
  }))));
1411
1459
  }
@@ -1423,7 +1471,7 @@ var Download = /*#__PURE__*/function (_React$Component21) {
1423
1471
  key: "render",
1424
1472
  value: function render() {
1425
1473
  var baseClasses = 'SortableItem rfb-item';
1426
- if (this.props.data.pageBreakBefore) {
1474
+ if (this.props.item.pageBreakBefore) {
1427
1475
  baseClasses += ' alwaysbreak';
1428
1476
  }
1429
1477
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -1432,8 +1480,8 @@ var Download = /*#__PURE__*/function (_React$Component21) {
1432
1480
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1433
1481
  className: "form-group mb-3"
1434
1482
  }, /*#__PURE__*/_react["default"].createElement("a", {
1435
- href: "".concat(this.props.downloadPath, "?id=").concat(this.props.data.filePath)
1436
- }, this.props.data.content)));
1483
+ href: "".concat(this.props.downloadPath, "?id=").concat(this.props.item.filePath)
1484
+ }, this.props.item.content)));
1437
1485
  }
1438
1486
  }]);
1439
1487
  return Download;
@@ -1442,42 +1490,38 @@ var Camera = /*#__PURE__*/function (_React$Component22) {
1442
1490
  (0, _inherits2["default"])(Camera, _React$Component22);
1443
1491
  var _super22 = _createSuper(Camera);
1444
1492
  function Camera(props) {
1445
- var _this26;
1493
+ var _this27;
1446
1494
  (0, _classCallCheck2["default"])(this, Camera);
1447
- _this26 = _super22.call(this, props);
1448
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this26), "displayImage", function (e) {
1449
- var self = (0, _assertThisInitialized2["default"])(_this26);
1450
- var target = e.target;
1451
- if (target.files && target.files.length) {
1452
- self.setState({
1453
- img: target.files[0],
1454
- previewImg: URL.createObjectURL(target.files[0])
1495
+ _this27 = _super22.call(this, props);
1496
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this27), "handleChange", function (event) {
1497
+ if (event.target.files && event.target.files.length > 0) {
1498
+ _this27.setState({
1499
+ img: event.target.files[0]
1455
1500
  });
1456
- if (_this26.props.onChange) {
1457
- _this26.props.onChange(target.files[0]);
1501
+ if (_this27.props.onChange) {
1502
+ _this27.props.onChange(event.target.files[0]);
1458
1503
  }
1459
1504
  }
1460
1505
  });
1461
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this26), "clearImage", function (e) {
1462
- _this26.setState({
1463
- img: null,
1464
- previewImg: null
1506
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this27), "clearImage", function () {
1507
+ _this27.setState({
1508
+ img: null
1465
1509
  });
1466
- if (_this26.props.onChange) {
1467
- _this26.props.onChange(null);
1510
+ if (_this27.props.onChange) {
1511
+ _this27.props.onChange(null);
1468
1512
  }
1469
1513
  });
1470
- _this26.state = {
1471
- img: null,
1472
- previewImg: null
1514
+ _this27.inputField = /*#__PURE__*/_react["default"].createRef();
1515
+ _this27.state = {
1516
+ img: props.value
1473
1517
  };
1474
- return _this26;
1518
+ return _this27;
1475
1519
  }
1476
1520
  (0, _createClass2["default"])(Camera, [{
1477
1521
  key: "getImageSizeProps",
1478
- value: function getImageSizeProps(_ref4) {
1479
- var width = _ref4.width,
1480
- height = _ref4.height;
1522
+ value: function getImageSizeProps(_ref5) {
1523
+ var width = _ref5.width,
1524
+ height = _ref5.height;
1481
1525
  var imgProps = {
1482
1526
  width: '100%'
1483
1527
  };
@@ -1492,66 +1536,79 @@ var Camera = /*#__PURE__*/function (_React$Component22) {
1492
1536
  }, {
1493
1537
  key: "render",
1494
1538
  value: function render() {
1495
- var _this27 = this;
1496
1539
  var imageStyle = {
1497
1540
  objectFit: 'scale-down',
1498
- objectPosition: this.props.data.center ? 'center' : 'left'
1541
+ objectPosition: this.props.item.center ? 'center' : 'left'
1499
1542
  };
1500
- var baseClasses = 'SortableItem rfb-item';
1501
- var name = this.props.data.fieldName;
1502
1543
  var fileInputStyle = this.state.img ? {
1503
1544
  display: 'none'
1504
1545
  } : null;
1505
- if (this.props.data.pageBreakBefore) {
1546
+ var props = {};
1547
+ props.name = this.props.name;
1548
+ props.placeholder = this.props.item.placeholder || 'Select an image from your computer or device.';
1549
+ props.onChange = this.handleChange;
1550
+ props.onClick = function (event) {
1551
+ event.target.value = null;
1552
+ };
1553
+ props.isInvalid = this.props.isInvalid;
1554
+ props.onBlur = this.props.onBlur;
1555
+ if (this.props.item.disabled) {
1556
+ props.disabled = 'disabled';
1557
+ }
1558
+ if (this.props.item.mutable) {
1559
+ props.ref = this.inputField;
1560
+ }
1561
+ var baseClasses = 'SortableItem rfb-item';
1562
+ if (this.props.item.pageBreakBefore) {
1506
1563
  baseClasses += ' alwaysbreak';
1507
1564
  }
1508
1565
  var sourceDataURL;
1509
- if (this.props.readOnly === true && this.props.defaultValue && this.props.defaultValue.length > 0) {
1510
- if (this.props.defaultValue.indexOf(name > -1)) {
1511
- sourceDataURL = this.props.defaultValue;
1566
+ if (this.props.item.readOnly === true && this.props.value && this.props.value.length > 0) {
1567
+ console.log(this.props.value);
1568
+ if (this.props.value.indexOf(this.props.name > -1)) {
1569
+ sourceDataURL = this.props.value;
1512
1570
  } else {
1513
- sourceDataURL = "data:image/png;base64,".concat(this.props.defaultValue);
1571
+ sourceDataURL = "data:image/png;base64,".concat(this.props.value);
1514
1572
  }
1515
1573
  }
1516
- if (this.props.value) {
1517
- sourceDataURL = this.props.value;
1518
- }
1519
1574
  return /*#__PURE__*/_react["default"].createElement("div", {
1520
1575
  style: _objectSpread({}, this.props.style),
1521
1576
  className: baseClasses
1522
1577
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1523
1578
  className: "form-group mb-3"
1524
- }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.readOnly === true && this.props.defaultValue && this.props.defaultValue.length > 0 ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Image, (0, _extends2["default"])({
1579
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.item.readOnly === true && this.props.value && this.props.value.length > 0 ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Image, (0, _extends2["default"])({
1525
1580
  style: imageStyle,
1526
1581
  src: sourceDataURL
1527
- }, this.getImageSizeProps(this.props.data)))) : /*#__PURE__*/_react["default"].createElement("div", {
1582
+ }, this.getImageSizeProps(this.props.item)))) : /*#__PURE__*/_react["default"].createElement("div", {
1528
1583
  className: "image-upload-container"
1529
1584
  }, /*#__PURE__*/_react["default"].createElement("div", {
1530
1585
  style: fileInputStyle
1531
- }, /*#__PURE__*/_react["default"].createElement("input", {
1532
- name: name,
1586
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
1533
1587
  type: "file",
1534
1588
  accept: "image/*",
1535
1589
  capture: "camera",
1536
- className: "image-upload",
1537
- onChange: this.displayImage
1538
- }), /*#__PURE__*/_react["default"].createElement("div", {
1590
+ className: "image-upload"
1591
+ }, props)), /*#__PURE__*/_react["default"].createElement("div", {
1539
1592
  className: "image-upload-control"
1540
1593
  }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
1541
1594
  variant: "light"
1542
- }, /*#__PURE__*/_react["default"].createElement(_fa.FaCamera, null), " Upload Photo"), /*#__PURE__*/_react["default"].createElement("p", null, "Select an image from your computer or device."))), this.state.img && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Image, {
1543
- onLoad: function onLoad() {
1544
- return URL.revokeObjectURL(_this27.state.previewImg);
1545
- },
1546
- src: this.state.previewImg,
1595
+ }, /*#__PURE__*/_react["default"].createElement(_fa.FaCamera, null), " Upload Photo"), /*#__PURE__*/_react["default"].createElement("span", null, "Select an image from your computer or device."))), this.props.value && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
1596
+ className: "clearfix"
1597
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Image
1598
+ // onLoad={() => URL.revokeObjectURL(this.state.previewImg)}
1599
+ , {
1600
+ src: URL.createObjectURL(this.props.value),
1547
1601
  height: "100",
1548
1602
  className: "image-upload-preview"
1549
- }), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
1603
+ })), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
1550
1604
  variant: "default",
1551
1605
  size: "sm",
1552
- className: "btn-image-clear",
1553
1606
  onClick: this.clearImage
1554
- }, /*#__PURE__*/_react["default"].createElement(_fa.FaTimes, null), " Clear Photo")))));
1607
+ }, /*#__PURE__*/_react["default"].createElement(_fa.FaTimes, null), " Clear Photo"))), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
1608
+ muted: true
1609
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
1610
+ name: this.props.name
1611
+ })));
1555
1612
  }
1556
1613
  }]);
1557
1614
  return Camera;
@@ -1563,17 +1620,13 @@ var FileUpload = /*#__PURE__*/function (_React$Component23) {
1563
1620
  var _this28;
1564
1621
  (0, _classCallCheck2["default"])(this, FileUpload);
1565
1622
  _this28 = _super23.call(this, props);
1566
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this28), "displayFileUpload", function (e) {
1567
- var self = (0, _assertThisInitialized2["default"])(_this28);
1568
- var target = e.target;
1569
- var file;
1570
- if (target.files && target.files.length > 0) {
1571
- file = target.files[0];
1572
- self.setState({
1573
- fileUpload: file
1623
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this28), "handleChange", function (event) {
1624
+ if (event.target.files && event.target.files.length > 0) {
1625
+ _this28.setState({
1626
+ fileUpload: event.target.files[0]
1574
1627
  });
1575
1628
  if (_this28.props.onChange) {
1576
- _this28.props.onChange(file);
1629
+ _this28.props.onChange(event.target.files[0]);
1577
1630
  }
1578
1631
  }
1579
1632
  });
@@ -1586,14 +1639,14 @@ var FileUpload = /*#__PURE__*/function (_React$Component23) {
1586
1639
  }
1587
1640
  });
1588
1641
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this28), "saveFile", /*#__PURE__*/function () {
1589
- var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(e) {
1642
+ var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(e) {
1590
1643
  var sourceUrl, response, dispositionHeader, resBlob, blob, fileName, _fileName;
1591
- return _regenerator["default"].wrap(function _callee$(_context) {
1592
- while (1) switch (_context.prev = _context.next) {
1644
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
1645
+ while (1) switch (_context2.prev = _context2.next) {
1593
1646
  case 0:
1594
1647
  e.preventDefault();
1595
- sourceUrl = _this28.props.defaultValue;
1596
- _context.next = 4;
1648
+ sourceUrl = _this28.props.value;
1649
+ _context2.next = 4;
1597
1650
  return (0, _isomorphicFetch["default"])(sourceUrl, {
1598
1651
  method: 'GET',
1599
1652
  headers: {
@@ -1603,15 +1656,15 @@ var FileUpload = /*#__PURE__*/function (_React$Component23) {
1603
1656
  responseType: 'blob'
1604
1657
  });
1605
1658
  case 4:
1606
- response = _context.sent;
1659
+ response = _context2.sent;
1607
1660
  dispositionHeader = response.headers.get('Content-Disposition');
1608
- _context.next = 8;
1661
+ _context2.next = 8;
1609
1662
  return response.blob();
1610
1663
  case 8:
1611
- resBlob = _context.sent;
1664
+ resBlob = _context2.sent;
1612
1665
  // eslint-disable-next-line no-undef
1613
1666
  blob = new Blob([resBlob], {
1614
- type: _this28.props.data.fileType || response.headers.get('Content-Type')
1667
+ type: _this28.props.item.fileType || response.headers.get('Content-Type')
1615
1668
  });
1616
1669
  if (dispositionHeader && dispositionHeader.indexOf(';filename=') > -1) {
1617
1670
  fileName = dispositionHeader.split(';filename=')[1];
@@ -1622,28 +1675,43 @@ var FileUpload = /*#__PURE__*/function (_React$Component23) {
1622
1675
  }
1623
1676
  case 11:
1624
1677
  case "end":
1625
- return _context.stop();
1678
+ return _context2.stop();
1626
1679
  }
1627
- }, _callee);
1680
+ }, _callee2);
1628
1681
  }));
1629
1682
  return function (_x) {
1630
- return _ref5.apply(this, arguments);
1683
+ return _ref6.apply(this, arguments);
1631
1684
  };
1632
1685
  }());
1686
+ _this28.inputField = /*#__PURE__*/_react["default"].createRef();
1633
1687
  _this28.state = {
1634
- fileUpload: null
1688
+ fileUpload: props.value
1635
1689
  };
1636
1690
  return _this28;
1637
1691
  }
1638
1692
  (0, _createClass2["default"])(FileUpload, [{
1639
1693
  key: "render",
1640
1694
  value: function render() {
1641
- var baseClasses = 'SortableItem rfb-item';
1642
- var name = this.props.data.fieldName;
1643
1695
  var fileInputStyle = this.state.fileUpload ? {
1644
1696
  display: 'none'
1645
1697
  } : null;
1646
- if (this.props.data.pageBreakBefore) {
1698
+ var props = {};
1699
+ props.name = this.props.name;
1700
+ props.placeholder = this.props.item.placeholder || 'Select a file from your computer or device.';
1701
+ props.onChange = this.handleChange;
1702
+ props.onClick = function (event) {
1703
+ event.target.value = null;
1704
+ };
1705
+ props.isInvalid = this.props.isInvalid;
1706
+ props.onBlur = this.props.onBlur;
1707
+ if (this.props.item.disabled) {
1708
+ props.disabled = 'disabled';
1709
+ }
1710
+ if (this.props.item.mutable) {
1711
+ props.ref = this.inputField;
1712
+ }
1713
+ var baseClasses = 'SortableItem rfb-item';
1714
+ if (this.props.item.pageBreakBefore) {
1647
1715
  baseClasses += ' alwaysbreak';
1648
1716
  }
1649
1717
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -1651,24 +1719,24 @@ var FileUpload = /*#__PURE__*/function (_React$Component23) {
1651
1719
  className: baseClasses
1652
1720
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1653
1721
  className: "form-group mb-3"
1654
- }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.readOnly === true && this.props.defaultValue && this.props.defaultValue.length > 0 ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
1722
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.item.readOnly === true && this.props.value && this.props.value.length > 0 ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
1655
1723
  variant: "default",
1656
1724
  onClick: this.saveFile
1657
1725
  }, /*#__PURE__*/_react["default"].createElement(_fa.FaDownload, null), " Download File")) : /*#__PURE__*/_react["default"].createElement("div", {
1658
1726
  className: "image-upload-container"
1659
1727
  }, /*#__PURE__*/_react["default"].createElement("div", {
1660
1728
  style: fileInputStyle
1661
- }, /*#__PURE__*/_react["default"].createElement("input", {
1662
- name: name,
1729
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
1663
1730
  type: "file",
1664
- accept: this.props.data.fileType || '*',
1665
- className: "image-upload",
1666
- onChange: this.displayFileUpload
1667
- }), /*#__PURE__*/_react["default"].createElement("div", {
1731
+ accept: this.props.item.fileType || '*',
1732
+ className: "image-upload"
1733
+ }, props)), /*#__PURE__*/_react["default"].createElement("div", {
1668
1734
  className: "image-upload-control"
1669
1735
  }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
1670
1736
  variant: "light"
1671
- }, /*#__PURE__*/_react["default"].createElement(_fa.FaFile, null), " Upload File"), /*#__PURE__*/_react["default"].createElement("p", null, "Select a file from your computer or device."))), this.state.fileUpload && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
1737
+ }, /*#__PURE__*/_react["default"].createElement(_fa.FaFile, null), " Upload File"), /*#__PURE__*/_react["default"].createElement("span", null, "Select a file from your computer or device."))), this.state.fileUpload && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
1738
+ className: "clearfix"
1739
+ }, /*#__PURE__*/_react["default"].createElement("div", {
1672
1740
  className: "file-upload-preview"
1673
1741
  }, /*#__PURE__*/_react["default"].createElement("div", {
1674
1742
  style: {
@@ -1680,12 +1748,16 @@ var FileUpload = /*#__PURE__*/function (_React$Component23) {
1680
1748
  display: 'inline-block',
1681
1749
  marginLeft: '5px'
1682
1750
  }
1683
- }, this.state.fileUpload.size.length > 6 ? "Size: ".concat(Math.ceil(this.state.fileUpload.size / (1024 * 1024)), " mb") : "Size: ".concat(Math.ceil(this.state.fileUpload.size / 1024), " kb"))), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
1751
+ }, this.state.fileUpload.size.length > 6 ? "Size: ".concat(Math.ceil(this.state.fileUpload.size / (1024 * 1024)), " mb") : "Size: ".concat(Math.ceil(this.state.fileUpload.size / 1024), " kb")))), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
1684
1752
  variant: "default",
1685
1753
  size: "sm",
1686
1754
  className: "btn-file-upload-clear",
1687
1755
  onClick: this.clearFileUpload
1688
- }, /*#__PURE__*/_react["default"].createElement(_fa.FaTimes, null), " Clear File")))));
1756
+ }, /*#__PURE__*/_react["default"].createElement(_fa.FaTimes, null), " Clear File"))), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
1757
+ muted: true
1758
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
1759
+ name: this.props.name
1760
+ })));
1689
1761
  }
1690
1762
  }]);
1691
1763
  return FileUpload;
@@ -1697,36 +1769,31 @@ var Range = /*#__PURE__*/function (_React$Component24) {
1697
1769
  var _this29;
1698
1770
  (0, _classCallCheck2["default"])(this, Range);
1699
1771
  _this29 = _super24.call(this, props);
1700
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this29), "changeValue", function (e) {
1701
- var target = e.target;
1702
- _this29.setState({
1703
- value: target.value
1704
- });
1705
- if (_this29.props.onChange) {
1706
- _this29.props.onChange(target.value);
1707
- }
1708
- });
1709
1772
  _this29.inputField = /*#__PURE__*/_react["default"].createRef();
1710
- _this29.state = {
1711
- value: props.defaultValue !== undefined ? parseInt(props.defaultValue, 10) : parseInt(props.data.defaultValue, 10)
1712
- };
1713
1773
  return _this29;
1714
1774
  }
1715
1775
  (0, _createClass2["default"])(Range, [{
1716
1776
  key: "render",
1717
1777
  value: function render() {
1778
+ var _this30 = this;
1718
1779
  var props = {};
1719
- var name = this.props.data.fieldName;
1720
- props.type = 'range';
1721
- props.list = "tickmarks_".concat(name);
1722
- props.min = this.props.data.minValue;
1723
- props.max = this.props.data.maxValue;
1724
- props.step = this.props.data.step;
1725
- props.value = this.state.value;
1726
- props.onChange = this.changeValue;
1727
- if (this.props.mutable) {
1780
+ var name = this.props.name;
1781
+ props.name = this.props.name;
1782
+ props.value = this.props.value;
1783
+ props.onChange = function (event) {
1784
+ _this30.props.onChange(event.target.value);
1785
+ };
1786
+ if (this.props.item.disabled) {
1787
+ props.disabled = true;
1788
+ }
1789
+ if (this.props.item.mutable) {
1728
1790
  props.ref = this.inputField;
1729
1791
  }
1792
+ props.type = 'range';
1793
+ props.list = "tickmarks_".concat(name);
1794
+ props.min = this.props.item.minValue;
1795
+ props.max = this.props.item.maxValue;
1796
+ props.step = this.props.item.step;
1730
1797
  var datalist = [];
1731
1798
  for (var i = parseInt(props.min, 10); i <= parseInt(props.max, 10); i += parseInt(props.step, 10)) {
1732
1799
  datalist.push(i);
@@ -1737,59 +1804,69 @@ var Range = /*#__PURE__*/function (_React$Component24) {
1737
1804
  key: "".concat(props.list, "_").concat(idx)
1738
1805
  }, d);
1739
1806
  });
1740
- var visible_marks = datalist.map(function (d, idx) {
1741
- var option_props = {};
1807
+ var visibleMarks = datalist.map(function (d, idx) {
1808
+ var optionProps = {};
1742
1809
  var w = oneBig;
1743
1810
  if (idx === 0 || idx === datalist.length - 1) {
1744
1811
  w = oneBig / 2;
1745
1812
  }
1746
- option_props.key = "".concat(props.list, "_label_").concat(idx);
1747
- option_props.style = {
1813
+ optionProps.key = "".concat(props.list, "_label_").concat(idx);
1814
+ optionProps.style = {
1748
1815
  width: "".concat(w, "%")
1749
1816
  };
1750
1817
  if (idx === datalist.length - 1) {
1751
- option_props.style = {
1818
+ optionProps.style = {
1752
1819
  width: "".concat(w, "%"),
1753
1820
  textAlign: 'right'
1754
1821
  };
1755
1822
  }
1756
- return /*#__PURE__*/_react["default"].createElement("label", option_props, d);
1823
+ return /*#__PURE__*/_react["default"].createElement("label", optionProps, d);
1757
1824
  });
1758
- if (this.props.readOnly) {
1759
- props.disabled = 'disabled';
1760
- }
1761
1825
  var baseClasses = 'SortableItem rfb-item';
1762
- if (this.props.data.pageBreakBefore) {
1826
+ if (this.props.item.pageBreakBefore) {
1763
1827
  baseClasses += ' alwaysbreak';
1764
1828
  }
1829
+ if (this.props.item.print === true) {
1830
+ return /*#__PURE__*/_react["default"].createElement("div", {
1831
+ style: _objectSpread({}, this.props.style),
1832
+ className: baseClasses
1833
+ }, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1834
+ className: "form-group mb-3"
1835
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
1836
+ htmlFor: name
1837
+ })), /*#__PURE__*/_react["default"].createElement("div", null, this.props.value)));
1838
+ }
1765
1839
  return /*#__PURE__*/_react["default"].createElement("div", {
1766
1840
  style: _objectSpread({}, this.props.style),
1767
1841
  className: baseClasses
1768
1842
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
1769
1843
  className: "form-group mb-3"
1770
- }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement("div", {
1844
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
1845
+ htmlFor: name
1846
+ })), /*#__PURE__*/_react["default"].createElement("div", {
1771
1847
  className: "range"
1772
1848
  }, /*#__PURE__*/_react["default"].createElement("div", {
1773
1849
  className: "clearfix"
1774
1850
  }, /*#__PURE__*/_react["default"].createElement("span", {
1775
1851
  className: "float-start"
1776
- }, this.props.data.minLabel), /*#__PURE__*/_react["default"].createElement("span", {
1852
+ }, this.props.item.minLabel), /*#__PURE__*/_react["default"].createElement("span", {
1777
1853
  className: "float-end"
1778
- }, this.props.data.maxLabel)), /*#__PURE__*/_react["default"].createElement(_reactBootstrapRangeSlider["default"], props)), /*#__PURE__*/_react["default"].createElement("div", {
1854
+ }, this.props.item.maxLabel)), /*#__PURE__*/_react["default"].createElement(_reactBootstrapRangeSlider["default"], props)), /*#__PURE__*/_react["default"].createElement("div", {
1779
1855
  className: "visible_marks"
1780
- }, visible_marks), /*#__PURE__*/_react["default"].createElement("input", {
1781
- name: name,
1782
- value: this.state.value,
1783
- type: "hidden"
1784
- }), /*#__PURE__*/_react["default"].createElement("datalist", {
1856
+ }, visibleMarks), /*#__PURE__*/_react["default"].createElement("datalist", {
1785
1857
  id: props.list
1786
- }, _datalist)));
1858
+ }, _datalist), this.props.item.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
1859
+ muted: true
1860
+ }, this.props.item.help) : null, /*#__PURE__*/_react["default"].createElement(_componentErrorMessage["default"], {
1861
+ name: name
1862
+ })));
1787
1863
  }
1788
1864
  }]);
1789
1865
  return Range;
1790
1866
  }(_react["default"].Component);
1791
1867
  SurveyElements.Header = Header;
1792
1868
  SurveyElements.Paragraph = Paragraph;
1869
+ SurveyElements.ContentBody = ContentBody;
1793
1870
  SurveyElements.Label = Label;
1794
1871
  SurveyElements.LineBreak = LineBreak;
1795
1872
  SurveyElements.TextInput = TextInput;