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