react-survey-builder 1.0.7 → 1.0.9
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 +19 -15
- package/dist/967.index.js +1 -1
- package/dist/app.css +1 -1
- package/dist/app.css.map +1 -1
- package/dist/index.js +1 -1
- package/lib/dynamic-option-list.js +52 -58
- package/lib/fieldset/FieldSet.js +7 -8
- package/lib/form.js +54 -52
- package/lib/index.js +6 -4
- package/lib/language-provider/IntlMessages.js +2 -2
- package/lib/language-provider/index.js +1 -15
- package/lib/language-provider/locales/en-us.json +9 -8
- package/lib/multi-column/MultiColumnRow.js +13 -14
- package/lib/multi-column/dustbin.js +2 -2
- package/lib/preview.js +9 -7
- package/lib/survey-elements/component-label.js +9 -5
- package/lib/survey-elements/custom-element.js +4 -5
- package/lib/survey-elements/date-picker.js +9 -15
- package/lib/survey-elements/header-bar.js +11 -8
- package/lib/survey-elements/index.js +293 -153
- package/lib/survey-elements-edit.js +175 -262
- package/lib/survey-validator.js +9 -9
- package/lib/toolbar-group-item.js +4 -2
- package/lib/toolbar.js +125 -82
- package/package.json +7 -3
- package/types/index.d.ts +29 -21
- package/lib/language-provider/entries/it-it.js +0 -16
- package/lib/language-provider/entries/vi-vn.js +0 -16
- package/lib/language-provider/locales/it-it.json +0 -92
- package/lib/language-provider/locales/vi-vn.json +0 -82
@@ -8,13 +8,14 @@ exports["default"] = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
10
10
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
11
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
12
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
13
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
14
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
15
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
16
15
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
17
16
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
17
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
18
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
18
19
|
var _isomorphicFetch = _interopRequireDefault(require("isomorphic-fetch"));
|
19
20
|
var _fileSaver = require("file-saver");
|
20
21
|
var _react = _interopRequireDefault(require("react"));
|
@@ -28,10 +29,39 @@ var _componentLabel = _interopRequireDefault(require("./component-label"));
|
|
28
29
|
var _myxss = _interopRequireDefault(require("./myxss"));
|
29
30
|
var _fa = require("react-icons/fa");
|
30
31
|
var _reactBootstrap = require("react-bootstrap");
|
32
|
+
var _reactImask = require("react-imask");
|
33
|
+
var _excluded = ["onChange"]; // eslint-disable-next-line max-classes-per-file
|
31
34
|
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; }
|
32
35
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
33
36
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
34
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
37
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
38
|
+
var CustomPhoneInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
39
|
+
var onChange = _ref.onChange,
|
40
|
+
otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
41
|
+
return /*#__PURE__*/_react["default"].createElement(_reactImask.IMaskInput, (0, _extends2["default"])({}, otherProps, {
|
42
|
+
mask: '{+1} (#00) 000-0000',
|
43
|
+
lazy: false,
|
44
|
+
overwrite: true,
|
45
|
+
definitions: {
|
46
|
+
'#': /[1-9]/
|
47
|
+
},
|
48
|
+
unmask: true // true|false|'typed'
|
49
|
+
,
|
50
|
+
inputRef: ref
|
51
|
+
// inputRef={inputRef} // access to nested input
|
52
|
+
// DO NOT USE onChange TO HANDLE CHANGES!
|
53
|
+
// USE onAccept INSTEAD
|
54
|
+
,
|
55
|
+
onAccept:
|
56
|
+
// depending on prop above first argument is
|
57
|
+
// `value` if `unmask=false`,
|
58
|
+
// `unmaskedValue` if `unmask=true`,
|
59
|
+
// `typedValue` if `unmask='typed'`
|
60
|
+
function onAccept(value, mask) {
|
61
|
+
onChange(value);
|
62
|
+
}
|
63
|
+
}));
|
64
|
+
});
|
35
65
|
var SurveyElements = {};
|
36
66
|
var Header = /*#__PURE__*/function (_React$Component) {
|
37
67
|
(0, _inherits2["default"])(Header, _React$Component);
|
@@ -171,32 +201,39 @@ var TextInput = /*#__PURE__*/function (_React$Component5) {
|
|
171
201
|
(0, _createClass2["default"])(TextInput, [{
|
172
202
|
key: "render",
|
173
203
|
value: function render() {
|
204
|
+
var _this$props$data$plac;
|
174
205
|
var props = {};
|
175
206
|
props.type = 'text';
|
176
|
-
props.className = 'form-control';
|
177
|
-
props.name = this.props.data.
|
178
|
-
props.placeholder = this.props.data.placeholder;
|
207
|
+
//props.className = 'form-control';
|
208
|
+
props.name = this.props.data.fieldName;
|
179
209
|
props.help = this.props.data.help;
|
210
|
+
props.placeholder = (_this$props$data$plac = this.props.data.placeholder) !== null && _this$props$data$plac !== void 0 ? _this$props$data$plac : _myxss["default"].process(this.props.data.label);
|
180
211
|
if (this.props.mutable) {
|
181
212
|
props.defaultValue = this.props.defaultValue;
|
182
213
|
props.ref = this.inputField;
|
183
214
|
}
|
215
|
+
var labelLocation = 'ABOVE';
|
216
|
+
if (this.props.data.labelLocation) {
|
217
|
+
labelLocation = this.props.data.labelLocation;
|
218
|
+
}
|
184
219
|
var baseClasses = 'SortableItem rfb-item';
|
185
220
|
if (this.props.data.pageBreakBefore) {
|
186
221
|
baseClasses += ' alwaysbreak';
|
187
222
|
}
|
188
|
-
if (this.props.
|
223
|
+
if (this.props.readOnly) {
|
189
224
|
props.disabled = 'disabled';
|
190
225
|
}
|
191
226
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
192
227
|
style: _objectSpread({}, this.props.style),
|
193
228
|
className: baseClasses
|
194
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
195
|
-
className: "form-group"
|
196
|
-
}, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Floating, {
|
197
|
-
|
198
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
199
|
-
|
229
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
230
|
+
className: "form-group mb-3"
|
231
|
+
}, labelLocation === "FLOATING" ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Floating, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
|
232
|
+
id: props.name
|
233
|
+
}, props)), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
234
|
+
htmlFor: props.name
|
235
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
236
|
+
htmlFor: props.name
|
200
237
|
})), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
|
201
238
|
id: props.name
|
202
239
|
}, props))), props.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
|
@@ -219,28 +256,44 @@ var EmailInput = /*#__PURE__*/function (_React$Component6) {
|
|
219
256
|
(0, _createClass2["default"])(EmailInput, [{
|
220
257
|
key: "render",
|
221
258
|
value: function render() {
|
259
|
+
var _this$props$data$plac2;
|
222
260
|
var props = {};
|
223
261
|
props.type = 'text';
|
224
|
-
props.className = 'form-control';
|
225
|
-
props.name = this.props.data.
|
226
|
-
props.
|
262
|
+
// props.className = 'form-control';
|
263
|
+
props.name = this.props.data.fieldName;
|
264
|
+
props.help = this.props.data.help;
|
265
|
+
props.placeholder = (_this$props$data$plac2 = this.props.data.placeholder) !== null && _this$props$data$plac2 !== void 0 ? _this$props$data$plac2 : _myxss["default"].process(this.props.data.label);
|
227
266
|
if (this.props.mutable) {
|
228
267
|
props.defaultValue = this.props.defaultValue;
|
229
268
|
props.ref = this.inputField;
|
230
269
|
}
|
270
|
+
var labelLocation = 'ABOVE';
|
271
|
+
if (this.props.data.labelLocation) {
|
272
|
+
labelLocation = this.props.data.labelLocation;
|
273
|
+
}
|
231
274
|
var baseClasses = 'SortableItem rfb-item';
|
232
275
|
if (this.props.data.pageBreakBefore) {
|
233
276
|
baseClasses += ' alwaysbreak';
|
234
277
|
}
|
235
|
-
if (this.props.
|
278
|
+
if (this.props.readOnly) {
|
236
279
|
props.disabled = 'disabled';
|
237
280
|
}
|
238
281
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
239
282
|
style: _objectSpread({}, this.props.style),
|
240
283
|
className: baseClasses
|
241
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
242
|
-
className: "form-group"
|
243
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
284
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
285
|
+
className: "form-group mb-3"
|
286
|
+
}, labelLocation === "FLOATING" ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Floating, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
|
287
|
+
id: props.name
|
288
|
+
}, props)), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
289
|
+
htmlFor: props.name
|
290
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
291
|
+
htmlFor: props.name
|
292
|
+
})), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
|
293
|
+
id: props.name
|
294
|
+
}, props))), props.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
|
295
|
+
muted: true
|
296
|
+
}, props.help) : null));
|
244
297
|
}
|
245
298
|
}]);
|
246
299
|
return EmailInput;
|
@@ -252,34 +305,68 @@ var PhoneNumber = /*#__PURE__*/function (_React$Component7) {
|
|
252
305
|
var _this3;
|
253
306
|
(0, _classCallCheck2["default"])(this, PhoneNumber);
|
254
307
|
_this3 = _super7.call(this, props);
|
308
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this3), "handleChange", function (e) {
|
309
|
+
_this3.setState({
|
310
|
+
value: e
|
311
|
+
});
|
312
|
+
});
|
255
313
|
_this3.inputField = /*#__PURE__*/_react["default"].createRef();
|
314
|
+
var defaultValue = props.defaultValue,
|
315
|
+
data = props.data;
|
316
|
+
_this3.state = {
|
317
|
+
value: defaultValue
|
318
|
+
};
|
256
319
|
return _this3;
|
257
320
|
}
|
258
321
|
(0, _createClass2["default"])(PhoneNumber, [{
|
259
322
|
key: "render",
|
260
323
|
value: function render() {
|
324
|
+
var _this$props$data$plac3;
|
261
325
|
var props = {};
|
262
326
|
props.type = 'tel';
|
263
327
|
props.className = 'form-control';
|
264
|
-
props.name = this.props.data.
|
265
|
-
props.
|
328
|
+
props.name = this.props.data.fieldName;
|
329
|
+
props.help = this.props.data.help;
|
330
|
+
props.placeholder = (_this$props$data$plac3 = this.props.data.placeholder) !== null && _this$props$data$plac3 !== void 0 ? _this$props$data$plac3 : _myxss["default"].process(this.props.data.label);
|
266
331
|
if (this.props.mutable) {
|
267
332
|
props.defaultValue = this.props.defaultValue;
|
268
333
|
props.ref = this.inputField;
|
269
334
|
}
|
335
|
+
var labelLocation = 'ABOVE';
|
336
|
+
if (this.props.data.labelLocation) {
|
337
|
+
labelLocation = this.props.data.labelLocation;
|
338
|
+
}
|
270
339
|
var baseClasses = 'SortableItem rfb-item';
|
271
340
|
if (this.props.data.pageBreakBefore) {
|
272
341
|
baseClasses += ' alwaysbreak';
|
273
342
|
}
|
274
|
-
if (this.props.
|
343
|
+
if (this.props.readOnly) {
|
275
344
|
props.disabled = 'disabled';
|
276
345
|
}
|
277
346
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
278
347
|
style: _objectSpread({}, this.props.style),
|
279
348
|
className: baseClasses
|
280
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
281
|
-
className: "form-group"
|
282
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
349
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
350
|
+
className: "form-group mb-3"
|
351
|
+
}, labelLocation === "FLOATING" ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Floating, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
|
352
|
+
id: props.name
|
353
|
+
}, props, {
|
354
|
+
onChange: this.handleChange,
|
355
|
+
as: CustomPhoneInput
|
356
|
+
})), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
357
|
+
name: props.name,
|
358
|
+
htmlFor: props.name
|
359
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
360
|
+
name: props.name,
|
361
|
+
htmlFor: props.name
|
362
|
+
})), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
|
363
|
+
id: props.name
|
364
|
+
}, props, {
|
365
|
+
onChange: this.handleChange,
|
366
|
+
as: CustomPhoneInput
|
367
|
+
}))), props.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
|
368
|
+
muted: true
|
369
|
+
}, props.help) : null));
|
283
370
|
}
|
284
371
|
}]);
|
285
372
|
return PhoneNumber;
|
@@ -297,19 +384,24 @@ var NumberInput = /*#__PURE__*/function (_React$Component8) {
|
|
297
384
|
(0, _createClass2["default"])(NumberInput, [{
|
298
385
|
key: "render",
|
299
386
|
value: function render() {
|
387
|
+
var _this$props$data$plac4;
|
300
388
|
var props = {};
|
301
389
|
props.type = 'number';
|
302
|
-
props.
|
303
|
-
props.
|
304
|
-
props.placeholder = this.props.data.placeholder;
|
390
|
+
props.name = this.props.data.fieldName;
|
391
|
+
props.help = this.props.data.help;
|
392
|
+
props.placeholder = (_this$props$data$plac4 = this.props.data.placeholder) !== null && _this$props$data$plac4 !== void 0 ? _this$props$data$plac4 : _myxss["default"].process(this.props.data.label);
|
305
393
|
if (this.props.mutable) {
|
306
394
|
props.defaultValue = this.props.defaultValue;
|
307
395
|
props.ref = this.inputField;
|
308
396
|
}
|
309
|
-
props.min = this.props.data.
|
310
|
-
props.max = this.props.data.
|
397
|
+
props.min = this.props.data.minValue;
|
398
|
+
props.max = this.props.data.maxValue;
|
311
399
|
props.step = this.props.data.step;
|
312
|
-
|
400
|
+
var labelLocation = 'ABOVE';
|
401
|
+
if (this.props.data.labelLocation) {
|
402
|
+
labelLocation = this.props.data.labelLocation;
|
403
|
+
}
|
404
|
+
if (this.props.readOnly) {
|
313
405
|
props.disabled = 'disabled';
|
314
406
|
}
|
315
407
|
var baseClasses = 'SortableItem rfb-item';
|
@@ -319,9 +411,21 @@ var NumberInput = /*#__PURE__*/function (_React$Component8) {
|
|
319
411
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
320
412
|
style: _objectSpread({}, this.props.style),
|
321
413
|
className: baseClasses
|
322
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
323
|
-
className: "form-group"
|
324
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
414
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
415
|
+
className: "form-group mb-3"
|
416
|
+
}, labelLocation === "FLOATING" ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Floating, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
|
417
|
+
id: props.name
|
418
|
+
}, props)), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
419
|
+
name: props.name,
|
420
|
+
htmlFor: props.name
|
421
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
422
|
+
name: props.name,
|
423
|
+
htmlFor: props.name
|
424
|
+
})), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
|
425
|
+
id: props.name
|
426
|
+
}, props))), props.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
|
427
|
+
muted: true
|
428
|
+
}, props.help) : null));
|
325
429
|
}
|
326
430
|
}]);
|
327
431
|
return NumberInput;
|
@@ -339,17 +443,22 @@ var TextArea = /*#__PURE__*/function (_React$Component9) {
|
|
339
443
|
(0, _createClass2["default"])(TextArea, [{
|
340
444
|
key: "render",
|
341
445
|
value: function render() {
|
446
|
+
var _this$props$data$plac5;
|
342
447
|
var props = {};
|
343
|
-
props.
|
344
|
-
props.
|
345
|
-
props.placeholder = this.props.data.placeholder;
|
346
|
-
if (this.props.
|
448
|
+
props.name = this.props.data.fieldName;
|
449
|
+
props.help = this.props.data.help;
|
450
|
+
props.placeholder = (_this$props$data$plac5 = this.props.data.placeholder) !== null && _this$props$data$plac5 !== void 0 ? _this$props$data$plac5 : _myxss["default"].process(this.props.data.label);
|
451
|
+
if (this.props.readOnly) {
|
347
452
|
props.disabled = 'disabled';
|
348
453
|
}
|
349
454
|
if (this.props.mutable) {
|
350
455
|
props.defaultValue = this.props.defaultValue;
|
351
456
|
props.ref = this.inputField;
|
352
457
|
}
|
458
|
+
var labelLocation = 'ABOVE';
|
459
|
+
if (this.props.data.labelLocation) {
|
460
|
+
labelLocation = this.props.data.labelLocation;
|
461
|
+
}
|
353
462
|
var baseClasses = 'SortableItem rfb-item';
|
354
463
|
if (this.props.data.pageBreakBefore) {
|
355
464
|
baseClasses += ' alwaysbreak';
|
@@ -357,9 +466,23 @@ var TextArea = /*#__PURE__*/function (_React$Component9) {
|
|
357
466
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
358
467
|
style: _objectSpread({}, this.props.style),
|
359
468
|
className: baseClasses
|
360
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
361
|
-
className: "form-group"
|
362
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
469
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
470
|
+
className: "form-group mb-3"
|
471
|
+
}, labelLocation === "FLOATING" ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Floating, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
|
472
|
+
as: "textarea",
|
473
|
+
id: props.name
|
474
|
+
}, props)), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
475
|
+
name: props.name,
|
476
|
+
htmlFor: props.name
|
477
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
478
|
+
name: props.name,
|
479
|
+
htmlFor: props.name
|
480
|
+
})), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, (0, _extends2["default"])({
|
481
|
+
as: "textarea",
|
482
|
+
id: props.name
|
483
|
+
}, props))), props.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
|
484
|
+
muted: true
|
485
|
+
}, props.help) : null));
|
363
486
|
}
|
364
487
|
}]);
|
365
488
|
return TextArea;
|
@@ -378,13 +501,19 @@ var Dropdown = /*#__PURE__*/function (_React$Component10) {
|
|
378
501
|
key: "render",
|
379
502
|
value: function render() {
|
380
503
|
var props = {};
|
381
|
-
props.className = 'form-select';
|
382
|
-
props.name = this.props.data.
|
504
|
+
//props.className = 'form-select';
|
505
|
+
props.name = this.props.data.fieldName;
|
506
|
+
props.placeholder = this.props.data.placeholder;
|
507
|
+
props.help = this.props.data.help;
|
383
508
|
if (this.props.mutable) {
|
384
509
|
props.defaultValue = this.props.defaultValue;
|
385
510
|
props.ref = this.inputField;
|
386
511
|
}
|
387
|
-
|
512
|
+
var labelLocation = 'ABOVE';
|
513
|
+
if (this.props.data.labelLocation) {
|
514
|
+
labelLocation = this.props.data.labelLocation;
|
515
|
+
}
|
516
|
+
if (this.props.readOnly) {
|
388
517
|
props.disabled = 'disabled';
|
389
518
|
}
|
390
519
|
var baseClasses = 'SortableItem rfb-item';
|
@@ -394,15 +523,37 @@ var Dropdown = /*#__PURE__*/function (_React$Component10) {
|
|
394
523
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
395
524
|
style: _objectSpread({}, this.props.style),
|
396
525
|
className: baseClasses
|
397
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
398
|
-
className: "form-group"
|
399
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
400
|
-
|
526
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
527
|
+
className: "form-group mb-3"
|
528
|
+
}, labelLocation === "FLOATING" ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Floating, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Select, (0, _extends2["default"])({
|
529
|
+
id: props.name
|
530
|
+
}, props), props.placeholder ? /*#__PURE__*/_react["default"].createElement("option", {
|
531
|
+
value: ""
|
532
|
+
}, props.placeholder) : null, this.props.data.options.map(function (option) {
|
533
|
+
var thisKey = "preview_".concat(option.key);
|
401
534
|
return /*#__PURE__*/_react["default"].createElement("option", {
|
402
535
|
value: option.value,
|
403
|
-
key:
|
536
|
+
key: thisKey
|
404
537
|
}, option.text);
|
405
|
-
})))
|
538
|
+
})), /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
539
|
+
name: props.name,
|
540
|
+
htmlFor: props.name
|
541
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
542
|
+
name: props.name,
|
543
|
+
htmlFor: props.name
|
544
|
+
})), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Select, (0, _extends2["default"])({
|
545
|
+
id: props.name
|
546
|
+
}, props), props.placeholder ? /*#__PURE__*/_react["default"].createElement("option", {
|
547
|
+
value: ""
|
548
|
+
}, props.placeholder) : null, this.props.data.options.map(function (option) {
|
549
|
+
var thisKey = "preview_".concat(option.key);
|
550
|
+
return /*#__PURE__*/_react["default"].createElement("option", {
|
551
|
+
value: option.value,
|
552
|
+
key: thisKey
|
553
|
+
}, option.text);
|
554
|
+
}))), props.help ? /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Text, {
|
555
|
+
muted: true
|
556
|
+
}, props.help) : null));
|
406
557
|
}
|
407
558
|
}]);
|
408
559
|
return Dropdown;
|
@@ -437,17 +588,17 @@ var Signature = /*#__PURE__*/function (_React$Component11) {
|
|
437
588
|
var canClear = !!defaultValue;
|
438
589
|
var props = {};
|
439
590
|
props.type = 'hidden';
|
440
|
-
props.name = this.props.data.
|
591
|
+
props.name = this.props.data.fieldName;
|
441
592
|
if (this.props.mutable) {
|
442
593
|
props.defaultValue = defaultValue;
|
443
594
|
props.ref = this.inputField;
|
444
595
|
}
|
445
|
-
var
|
596
|
+
var padProps = {};
|
446
597
|
// umd requires canvasProps={{ width: 400, height: 150 }}
|
447
598
|
if (this.props.mutable) {
|
448
|
-
|
449
|
-
|
450
|
-
canClear = !this.props.
|
599
|
+
padProps.defaultValue = defaultValue;
|
600
|
+
padProps.ref = this.canvas;
|
601
|
+
canClear = !this.props.readOnly;
|
451
602
|
}
|
452
603
|
var baseClasses = 'SortableItem rfb-item';
|
453
604
|
if (this.props.data.pageBreakBefore) {
|
@@ -460,11 +611,11 @@ var Signature = /*#__PURE__*/function (_React$Component11) {
|
|
460
611
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
461
612
|
style: _objectSpread({}, this.props.style),
|
462
613
|
className: baseClasses
|
463
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
464
|
-
className: "form-group"
|
465
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.
|
614
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
615
|
+
className: "form-group mb-3"
|
616
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.readOnly === true || !!sourceDataURL ? /*#__PURE__*/_react["default"].createElement("img", {
|
466
617
|
src: sourceDataURL
|
467
|
-
}) : /*#__PURE__*/_react["default"].createElement(_reactSignatureCanvas["default"],
|
618
|
+
}) : /*#__PURE__*/_react["default"].createElement(_reactSignatureCanvas["default"], padProps), canClear && /*#__PURE__*/_react["default"].createElement(_fa.FaTimes, {
|
468
619
|
className: "clear-signature",
|
469
620
|
onClick: this.clear,
|
470
621
|
title: "Clear Signature"
|
@@ -521,14 +672,14 @@ var Tags = /*#__PURE__*/function (_React$Component12) {
|
|
521
672
|
});
|
522
673
|
var props = {};
|
523
674
|
props.isMulti = true;
|
524
|
-
props.name = this.props.data.
|
675
|
+
props.name = this.props.data.fieldName;
|
525
676
|
props.onChange = this.handleChange;
|
526
677
|
props.options = options;
|
527
678
|
if (!this.props.mutable) {
|
528
679
|
props.value = options[0].text;
|
529
680
|
} // to show a sample of what tags looks like
|
530
681
|
if (this.props.mutable) {
|
531
|
-
props.isDisabled = this.props.
|
682
|
+
props.isDisabled = this.props.readOnly;
|
532
683
|
props.value = this.state.value;
|
533
684
|
props.ref = this.inputField;
|
534
685
|
}
|
@@ -539,8 +690,8 @@ var Tags = /*#__PURE__*/function (_React$Component12) {
|
|
539
690
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
540
691
|
style: _objectSpread({}, this.props.style),
|
541
692
|
className: baseClasses
|
542
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
543
|
-
className: "form-group"
|
693
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
694
|
+
className: "form-group mb-3"
|
544
695
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactSelect["default"], props)));
|
545
696
|
}
|
546
697
|
}]);
|
@@ -561,7 +712,7 @@ var Checkboxes = /*#__PURE__*/function (_React$Component13) {
|
|
561
712
|
value: function render() {
|
562
713
|
var _this10 = this;
|
563
714
|
var self = this;
|
564
|
-
var classNames = 'custom-control custom-checkbox';
|
715
|
+
var classNames = ''; // 'custom-control custom-checkbox';
|
565
716
|
if (this.props.data.inline) {
|
566
717
|
classNames += ' option-inline';
|
567
718
|
}
|
@@ -572,10 +723,10 @@ var Checkboxes = /*#__PURE__*/function (_React$Component13) {
|
|
572
723
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
573
724
|
style: _objectSpread({}, this.props.style),
|
574
725
|
className: baseClasses
|
575
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
576
|
-
className: "form-group"
|
726
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
727
|
+
className: "form-group mb-3"
|
577
728
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.data.options.map(function (option) {
|
578
|
-
var
|
729
|
+
var thisKey = "preview_".concat(option.key);
|
579
730
|
var props = {};
|
580
731
|
props.name = "option_".concat(option.key);
|
581
732
|
props.type = 'checkbox';
|
@@ -583,24 +734,21 @@ var Checkboxes = /*#__PURE__*/function (_React$Component13) {
|
|
583
734
|
if (self.props.mutable) {
|
584
735
|
props.defaultChecked = self.props.defaultValue !== undefined && self.props.defaultValue.indexOf(option.key) > -1;
|
585
736
|
}
|
586
|
-
if (_this10.props.
|
737
|
+
if (_this10.props.readOnly) {
|
587
738
|
props.disabled = 'disabled';
|
588
739
|
}
|
589
|
-
return /*#__PURE__*/_react["default"].createElement("
|
740
|
+
return /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Check, (0, _extends2["default"])({
|
741
|
+
label: option.text,
|
590
742
|
className: classNames,
|
591
|
-
|
592
|
-
|
593
|
-
id: "fid_".concat(
|
594
|
-
className: "custom-control-input",
|
743
|
+
type: "checkbox",
|
744
|
+
key: thisKey,
|
745
|
+
id: "fid_".concat(thisKey),
|
595
746
|
ref: function ref(c) {
|
596
747
|
if (c && self.props.mutable) {
|
597
748
|
self.options["child_ref_".concat(option.key)] = c;
|
598
749
|
}
|
599
750
|
}
|
600
|
-
}, props))
|
601
|
-
className: "custom-control-label",
|
602
|
-
htmlFor: "fid_".concat(this_key)
|
603
|
-
}, option.text));
|
751
|
+
}, props));
|
604
752
|
})));
|
605
753
|
}
|
606
754
|
}]);
|
@@ -619,7 +767,7 @@ var Checkbox = /*#__PURE__*/function (_React$Component14) {
|
|
619
767
|
(0, _createClass2["default"])(Checkbox, [{
|
620
768
|
key: "render",
|
621
769
|
value: function render() {
|
622
|
-
var classNames = 'custom-control custom-checkbox';
|
770
|
+
var classNames = ''; // 'custom-control custom-checkbox';
|
623
771
|
// if (this.props.data.inline) { classNames += ' option-inline'; }
|
624
772
|
|
625
773
|
var baseClasses = 'SortableItem rfb-item';
|
@@ -628,34 +776,31 @@ var Checkbox = /*#__PURE__*/function (_React$Component14) {
|
|
628
776
|
}
|
629
777
|
var props = {};
|
630
778
|
// eslint-disable-next-line no-undef
|
631
|
-
props.name = this.props.data.
|
779
|
+
props.name = this.props.data.fieldName;
|
632
780
|
props.type = 'checkbox';
|
633
781
|
props.defaultChecked = this.props.data.defaultChecked;
|
634
782
|
if (this.props.mutable) {
|
635
783
|
props.ref = this.inputField;
|
636
784
|
}
|
637
|
-
if (this.props.
|
785
|
+
if (this.props.readOnly) {
|
638
786
|
props.disabled = 'disabled';
|
639
787
|
}
|
640
788
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
641
789
|
style: _objectSpread({}, this.props.style),
|
642
790
|
className: baseClasses
|
643
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
644
|
-
className: "form-group"
|
791
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
792
|
+
className: "form-group mb-3"
|
645
793
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({
|
646
794
|
className: "form-label"
|
647
|
-
}, this.props)), /*#__PURE__*/_react["default"].createElement("
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
__html: this.props.data.boxLabel
|
657
|
-
}
|
658
|
-
}))));
|
795
|
+
}, this.props)), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Check, (0, _extends2["default"])({
|
796
|
+
label: /*#__PURE__*/_react["default"].createElement("span", {
|
797
|
+
dangerouslySetInnerHTML: {
|
798
|
+
__html: this.props.data.boxLabel
|
799
|
+
}
|
800
|
+
}),
|
801
|
+
type: "checkbox",
|
802
|
+
id: this.props.data.fieldName
|
803
|
+
}, props))));
|
659
804
|
}
|
660
805
|
}]);
|
661
806
|
return Checkbox;
|
@@ -675,7 +820,7 @@ var RadioButtons = /*#__PURE__*/function (_React$Component15) {
|
|
675
820
|
value: function render() {
|
676
821
|
var _this13 = this;
|
677
822
|
var self = this;
|
678
|
-
var classNames = 'custom-control custom-radio';
|
823
|
+
var classNames = ''; // 'custom-control custom-radio';
|
679
824
|
if (this.props.data.inline) {
|
680
825
|
classNames += ' option-inline';
|
681
826
|
}
|
@@ -686,35 +831,32 @@ var RadioButtons = /*#__PURE__*/function (_React$Component15) {
|
|
686
831
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
687
832
|
style: _objectSpread({}, this.props.style),
|
688
833
|
className: baseClasses
|
689
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
690
|
-
className: "form-group"
|
834
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
835
|
+
className: "form-group mb-3"
|
691
836
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.data.options.map(function (option) {
|
692
|
-
var
|
837
|
+
var thisKey = "preview_".concat(option.key);
|
693
838
|
var props = {};
|
694
|
-
props.name = self.props.data.
|
839
|
+
props.name = self.props.data.fieldName;
|
695
840
|
props.type = 'radio';
|
696
841
|
props.value = option.value;
|
697
842
|
if (self.props.mutable) {
|
698
843
|
props.defaultChecked = self.props.defaultValue !== undefined && (self.props.defaultValue.indexOf(option.key) > -1 || self.props.defaultValue.indexOf(option.value) > -1);
|
699
844
|
}
|
700
|
-
if (_this13.props.
|
845
|
+
if (_this13.props.readOnly) {
|
701
846
|
props.disabled = 'disabled';
|
702
847
|
}
|
703
|
-
return /*#__PURE__*/_react["default"].createElement("
|
848
|
+
return /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Check, (0, _extends2["default"])({
|
849
|
+
label: option.text,
|
704
850
|
className: classNames,
|
705
|
-
|
706
|
-
|
707
|
-
id: "fid_".concat(
|
708
|
-
className: "custom-control-input",
|
851
|
+
type: "radio",
|
852
|
+
key: thisKey,
|
853
|
+
id: "fid_".concat(thisKey),
|
709
854
|
ref: function ref(c) {
|
710
855
|
if (c && self.props.mutable) {
|
711
856
|
self.options["child_ref_".concat(option.key)] = c;
|
712
857
|
}
|
713
858
|
}
|
714
|
-
}, props))
|
715
|
-
className: "custom-control-label",
|
716
|
-
htmlFor: "fid_".concat(this_key)
|
717
|
-
}, option.text));
|
859
|
+
}, props));
|
718
860
|
})));
|
719
861
|
}
|
720
862
|
}]);
|
@@ -765,12 +907,12 @@ var Rating = /*#__PURE__*/function (_React$Component17) {
|
|
765
907
|
key: "render",
|
766
908
|
value: function render() {
|
767
909
|
var props = {};
|
768
|
-
props.name = this.props.data.
|
910
|
+
props.name = this.props.data.fieldName;
|
769
911
|
props.ratingAmount = 5;
|
770
912
|
if (this.props.mutable) {
|
771
913
|
props.rating = this.props.defaultValue !== undefined ? parseFloat(this.props.defaultValue, 10) : 0;
|
772
914
|
props.editing = true;
|
773
|
-
props.disabled = this.props.
|
915
|
+
props.disabled = this.props.readOnly;
|
774
916
|
props.ref = this.inputField;
|
775
917
|
}
|
776
918
|
var baseClasses = 'SortableItem rfb-item';
|
@@ -780,8 +922,8 @@ var Rating = /*#__PURE__*/function (_React$Component17) {
|
|
780
922
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
781
923
|
style: _objectSpread({}, this.props.style),
|
782
924
|
className: baseClasses
|
783
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
784
|
-
className: "form-group"
|
925
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
926
|
+
className: "form-group mb-3"
|
785
927
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement(_starRating["default"], props)));
|
786
928
|
}
|
787
929
|
}]);
|
@@ -804,11 +946,9 @@ var HyperLink = /*#__PURE__*/function (_React$Component18) {
|
|
804
946
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
805
947
|
style: _objectSpread({}, this.props.style),
|
806
948
|
className: baseClasses
|
807
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
808
|
-
className: "form-group"
|
809
|
-
}, /*#__PURE__*/_react["default"].createElement("
|
810
|
-
className: 'form-label'
|
811
|
-
}, /*#__PURE__*/_react["default"].createElement("a", {
|
949
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
950
|
+
className: "form-group mb-3"
|
951
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Label, null, /*#__PURE__*/_react["default"].createElement("a", {
|
812
952
|
target: "_blank",
|
813
953
|
href: this.props.data.href,
|
814
954
|
dangerouslySetInnerHTML: {
|
@@ -836,10 +976,10 @@ var Download = /*#__PURE__*/function (_React$Component19) {
|
|
836
976
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
837
977
|
style: _objectSpread({}, this.props.style),
|
838
978
|
className: baseClasses
|
839
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
840
|
-
className: "form-group"
|
979
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
980
|
+
className: "form-group mb-3"
|
841
981
|
}, /*#__PURE__*/_react["default"].createElement("a", {
|
842
|
-
href: "".concat(this.props.
|
982
|
+
href: "".concat(this.props.downloadPath, "?id=").concat(this.props.data.filePath)
|
843
983
|
}, this.props.data.content)));
|
844
984
|
}
|
845
985
|
}]);
|
@@ -876,9 +1016,9 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
876
1016
|
}
|
877
1017
|
(0, _createClass2["default"])(Camera, [{
|
878
1018
|
key: "getImageSizeProps",
|
879
|
-
value: function getImageSizeProps(
|
880
|
-
var width =
|
881
|
-
height =
|
1019
|
+
value: function getImageSizeProps(_ref2) {
|
1020
|
+
var width = _ref2.width,
|
1021
|
+
height = _ref2.height;
|
882
1022
|
var imgProps = {
|
883
1023
|
width: '100%'
|
884
1024
|
};
|
@@ -899,7 +1039,7 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
899
1039
|
objectPosition: this.props.data.center ? 'center' : 'left'
|
900
1040
|
};
|
901
1041
|
var baseClasses = 'SortableItem rfb-item';
|
902
|
-
var name = this.props.data.
|
1042
|
+
var name = this.props.data.fieldName;
|
903
1043
|
var fileInputStyle = this.state.img ? {
|
904
1044
|
display: 'none'
|
905
1045
|
} : null;
|
@@ -907,7 +1047,7 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
907
1047
|
baseClasses += ' alwaysbreak';
|
908
1048
|
}
|
909
1049
|
var sourceDataURL;
|
910
|
-
if (this.props.
|
1050
|
+
if (this.props.readOnly === true && this.props.defaultValue && this.props.defaultValue.length > 0) {
|
911
1051
|
if (this.props.defaultValue.indexOf(name > -1)) {
|
912
1052
|
sourceDataURL = this.props.defaultValue;
|
913
1053
|
} else {
|
@@ -917,9 +1057,9 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
917
1057
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
918
1058
|
style: _objectSpread({}, this.props.style),
|
919
1059
|
className: baseClasses
|
920
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
921
|
-
className: "form-group"
|
922
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.
|
1060
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
1061
|
+
className: "form-group mb-3"
|
1062
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.readOnly === true && this.props.defaultValue && this.props.defaultValue.length > 0 ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", (0, _extends2["default"])({
|
923
1063
|
style: imageStyle,
|
924
1064
|
src: sourceDataURL
|
925
1065
|
}, this.getImageSizeProps(this.props.data)))) : /*#__PURE__*/_react["default"].createElement("div", {
|
@@ -935,8 +1075,8 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
935
1075
|
onChange: this.displayImage
|
936
1076
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
937
1077
|
className: "image-upload-control"
|
938
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
939
|
-
|
1078
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
|
1079
|
+
variant: "light"
|
940
1080
|
}, /*#__PURE__*/_react["default"].createElement(_fa.FaCamera, null), " Upload Photo"), /*#__PURE__*/_react["default"].createElement("p", null, "Select an image from your computer or device."))), this.state.img && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
|
941
1081
|
onLoad: function onLoad() {
|
942
1082
|
return URL.revokeObjectURL(_this16.state.previewImg);
|
@@ -944,8 +1084,8 @@ var Camera = /*#__PURE__*/function (_React$Component20) {
|
|
944
1084
|
src: this.state.previewImg,
|
945
1085
|
height: "100",
|
946
1086
|
className: "image-upload-preview"
|
947
|
-
}), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(
|
948
|
-
className: "btn
|
1087
|
+
}), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
|
1088
|
+
className: "btn-image-clear",
|
949
1089
|
onClick: this.clearImage
|
950
1090
|
}, /*#__PURE__*/_react["default"].createElement(_fa.FaTimes, null), " Clear Photo")))));
|
951
1091
|
}
|
@@ -976,7 +1116,7 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
976
1116
|
});
|
977
1117
|
});
|
978
1118
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this17), "saveFile", /*#__PURE__*/function () {
|
979
|
-
var
|
1119
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(e) {
|
980
1120
|
var sourceUrl, response, dispositionHeader, resBlob, blob, fileName, _fileName;
|
981
1121
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
982
1122
|
while (1) switch (_context.prev = _context.next) {
|
@@ -1017,7 +1157,7 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
1017
1157
|
}, _callee);
|
1018
1158
|
}));
|
1019
1159
|
return function (_x) {
|
1020
|
-
return
|
1160
|
+
return _ref3.apply(this, arguments);
|
1021
1161
|
};
|
1022
1162
|
}());
|
1023
1163
|
_this17.state = {
|
@@ -1029,7 +1169,7 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
1029
1169
|
key: "render",
|
1030
1170
|
value: function render() {
|
1031
1171
|
var baseClasses = 'SortableItem rfb-item';
|
1032
|
-
var name = this.props.data.
|
1172
|
+
var name = this.props.data.fieldName;
|
1033
1173
|
var fileInputStyle = this.state.fileUpload ? {
|
1034
1174
|
display: 'none'
|
1035
1175
|
} : null;
|
@@ -1039,10 +1179,10 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
1039
1179
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
1040
1180
|
style: _objectSpread({}, this.props.style),
|
1041
1181
|
className: baseClasses
|
1042
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
1043
|
-
className: "form-group"
|
1044
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.
|
1045
|
-
|
1182
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
1183
|
+
className: "form-group mb-3"
|
1184
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.readOnly === true && this.props.defaultValue && this.props.defaultValue.length > 0 ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
|
1185
|
+
variant: "default",
|
1046
1186
|
onClick: this.saveFile
|
1047
1187
|
}, /*#__PURE__*/_react["default"].createElement(_fa.FaDownload, null), " Download File")) : /*#__PURE__*/_react["default"].createElement("div", {
|
1048
1188
|
className: "image-upload-container"
|
@@ -1056,8 +1196,8 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
1056
1196
|
onChange: this.displayFileUpload
|
1057
1197
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
1058
1198
|
className: "image-upload-control"
|
1059
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
1060
|
-
|
1199
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
|
1200
|
+
variant: "light"
|
1061
1201
|
}, /*#__PURE__*/_react["default"].createElement(_fa.FaFile, null), " Upload File"), /*#__PURE__*/_react["default"].createElement("p", null, "Select a file from your computer or device."))), this.state.fileUpload && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
1062
1202
|
className: "file-upload-preview"
|
1063
1203
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
@@ -1070,8 +1210,8 @@ var FileUpload = /*#__PURE__*/function (_React$Component21) {
|
|
1070
1210
|
display: 'inline-block',
|
1071
1211
|
marginLeft: '5px'
|
1072
1212
|
}
|
1073
|
-
}, this.state.fileUpload.size.length > 6 ? "Size: ".concat(Math.ceil(this.state.fileUpload.size / (1024 * 1024)), " mb") : "Size: ".concat(Math.ceil(this.state.fileUpload.size / 1024), " kb"))), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(
|
1074
|
-
className: "btn
|
1213
|
+
}, this.state.fileUpload.size.length > 6 ? "Size: ".concat(Math.ceil(this.state.fileUpload.size / (1024 * 1024)), " mb") : "Size: ".concat(Math.ceil(this.state.fileUpload.size / 1024), " kb"))), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Button, {
|
1214
|
+
className: "btn-file-upload-clear",
|
1075
1215
|
onClick: this.clearFileUpload
|
1076
1216
|
}, /*#__PURE__*/_react["default"].createElement(_fa.FaTimes, null), " Clear File")))));
|
1077
1217
|
}
|
@@ -1093,7 +1233,7 @@ var Range = /*#__PURE__*/function (_React$Component22) {
|
|
1093
1233
|
});
|
1094
1234
|
_this18.inputField = /*#__PURE__*/_react["default"].createRef();
|
1095
1235
|
_this18.state = {
|
1096
|
-
value: props.defaultValue !== undefined ? parseInt(props.defaultValue, 10) : parseInt(props.data.
|
1236
|
+
value: props.defaultValue !== undefined ? parseInt(props.defaultValue, 10) : parseInt(props.data.defaultValue, 10)
|
1097
1237
|
};
|
1098
1238
|
return _this18;
|
1099
1239
|
}
|
@@ -1101,11 +1241,11 @@ var Range = /*#__PURE__*/function (_React$Component22) {
|
|
1101
1241
|
key: "render",
|
1102
1242
|
value: function render() {
|
1103
1243
|
var props = {};
|
1104
|
-
var name = this.props.data.
|
1244
|
+
var name = this.props.data.fieldName;
|
1105
1245
|
props.type = 'range';
|
1106
1246
|
props.list = "tickmarks_".concat(name);
|
1107
|
-
props.min = this.props.data.
|
1108
|
-
props.max = this.props.data.
|
1247
|
+
props.min = this.props.data.minValue;
|
1248
|
+
props.max = this.props.data.maxValue;
|
1109
1249
|
props.step = this.props.data.step;
|
1110
1250
|
props.value = this.state.value;
|
1111
1251
|
props.onChange = this.changeValue;
|
@@ -1140,7 +1280,7 @@ var Range = /*#__PURE__*/function (_React$Component22) {
|
|
1140
1280
|
}
|
1141
1281
|
return /*#__PURE__*/_react["default"].createElement("label", option_props, d);
|
1142
1282
|
});
|
1143
|
-
if (this.props.
|
1283
|
+
if (this.props.readOnly) {
|
1144
1284
|
props.disabled = 'disabled';
|
1145
1285
|
}
|
1146
1286
|
var baseClasses = 'SortableItem rfb-item';
|
@@ -1150,17 +1290,17 @@ var Range = /*#__PURE__*/function (_React$Component22) {
|
|
1150
1290
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
1151
1291
|
style: _objectSpread({}, this.props.style),
|
1152
1292
|
className: baseClasses
|
1153
|
-
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(
|
1154
|
-
className: "form-group"
|
1293
|
+
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
1294
|
+
className: "form-group mb-3"
|
1155
1295
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), /*#__PURE__*/_react["default"].createElement("div", {
|
1156
1296
|
className: "range"
|
1157
1297
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
1158
1298
|
className: "clearfix"
|
1159
1299
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
1160
1300
|
className: "float-start"
|
1161
|
-
}, this.props.data.
|
1301
|
+
}, this.props.data.minLabel), /*#__PURE__*/_react["default"].createElement("span", {
|
1162
1302
|
className: "float-end"
|
1163
|
-
}, this.props.data.
|
1303
|
+
}, this.props.data.maxLabel)), /*#__PURE__*/_react["default"].createElement(_reactBootstrapRangeSlider["default"], props)), /*#__PURE__*/_react["default"].createElement("div", {
|
1164
1304
|
className: "visible_marks"
|
1165
1305
|
}, visible_marks), /*#__PURE__*/_react["default"].createElement("input", {
|
1166
1306
|
name: name,
|