@goldenpine/react-form-builder2 0.20.3-build.30 → 0.20.3-build.32

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.
@@ -1,22 +1,25 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports["default"] = void 0;
8
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
13
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
14
14
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
15
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
16
16
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
18
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
19
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
20
  var _isomorphicFetch = _interopRequireDefault(require("isomorphic-fetch"));
18
21
  var _fileSaver = require("file-saver");
19
- var _react = _interopRequireDefault(require("react"));
22
+ var _react = _interopRequireWildcard(require("react"));
20
23
  var _reactSelect = _interopRequireDefault(require("react-select"));
21
24
  var _reactSignatureCanvas = _interopRequireDefault(require("react-signature-canvas"));
22
25
  var _reactBootstrapSlider = _interopRequireDefault(require("@goldenpine/react-bootstrap-slider"));
@@ -25,10 +28,86 @@ var _datePicker = _interopRequireDefault(require("./date-picker"));
25
28
  var _componentHeader = _interopRequireDefault(require("./component-header"));
26
29
  var _componentLabel = _interopRequireDefault(require("./component-label"));
27
30
  var _myxss = _interopRequireDefault(require("./myxss"));
31
+ var _excluded = ["placeholder"],
32
+ _excluded2 = ["placeholder"];
33
+ /* eslint-disable quote-props */
34
+ // eslint-disable-next-line max-classes-per-file
35
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
28
36
  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; }
29
37
  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; }
30
38
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
31
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable quote-props */ // eslint-disable-next-line max-classes-per-file
39
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
40
+ // This component is used for text inputs (text, email, tel, number) and textarea
41
+ // to provide a floating placeholder that moves above the input
42
+ // when the user focuses on the input or when there is a value in the input.
43
+ // It accepts the following props:
44
+ // - Tag: the HTML tag to use for the input (default is 'input', can be 'textarea' for multiline input)
45
+ var FloatingPlaceholderInput = function FloatingPlaceholderInput(_ref) {
46
+ var _ref$Tag = _ref.Tag,
47
+ Tag = _ref$Tag === void 0 ? 'input' : _ref$Tag,
48
+ _ref$inputProps = _ref.inputProps,
49
+ inputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
50
+ _ref$placeholder = _ref.placeholder,
51
+ placeholder = _ref$placeholder === void 0 ? '' : _ref$placeholder,
52
+ _ref$defaultValue = _ref.defaultValue,
53
+ defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
54
+ _ref$mutable = _ref.mutable,
55
+ mutable = _ref$mutable === void 0 ? false : _ref$mutable;
56
+ var _useState = (0, _react.useState)(!!(defaultValue && String(defaultValue).length > 0)),
57
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
58
+ hasValue = _useState2[0],
59
+ setHasValue = _useState2[1];
60
+ var _useState3 = (0, _react.useState)(false),
61
+ _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
62
+ focused = _useState4[0],
63
+ setFocused = _useState4[1];
64
+ var ref = (0, _react.useRef)(null);
65
+ (0, _react.useEffect)(function () {
66
+ setHasValue(!!(defaultValue && String(defaultValue).length > 0));
67
+ }, [defaultValue]);
68
+ var handleChange = function handleChange(e) {
69
+ var val = e.target.value;
70
+ setHasValue(val !== '' && val !== undefined && val !== null);
71
+ if (typeof inputProps.onChange === 'function') {
72
+ inputProps.onChange(e);
73
+ }
74
+ };
75
+ var handleFocus = function handleFocus(e) {
76
+ setFocused(true);
77
+ if (typeof inputProps.onFocus === 'function') {
78
+ inputProps.onFocus(e);
79
+ }
80
+ };
81
+ var handleBlur = function handleBlur(e) {
82
+ setFocused(false);
83
+ // If no value, ensure placeholder returns to original position
84
+ if (!ref.current || !ref.current.value) {
85
+ setHasValue(false);
86
+ }
87
+ if (typeof inputProps.onBlur === 'function') {
88
+ inputProps.onBlur(e);
89
+ }
90
+ };
91
+
92
+ // remove placeholder attribute from actual input to avoid duplicate text
93
+ var _ph = inputProps.placeholder,
94
+ restProps = (0, _objectWithoutProperties2["default"])(inputProps, _excluded);
95
+ var shrunken = hasValue || focused;
96
+ return /*#__PURE__*/_react["default"].createElement("div", {
97
+ className: "floating-input-wrapper".concat(placeholder ? ' has-placeholder' : ''),
98
+ onClick: function onClick() {
99
+ if (ref.current) ref.current.focus();
100
+ }
101
+ }, /*#__PURE__*/_react["default"].createElement(Tag, (0, _extends2["default"])({}, restProps, {
102
+ ref: ref,
103
+ onChange: handleChange,
104
+ onFocus: handleFocus,
105
+ onBlur: handleBlur,
106
+ defaultValue: mutable ? defaultValue : undefined
107
+ })), placeholder && /*#__PURE__*/_react["default"].createElement("span", {
108
+ className: "fb-placeholder ".concat(shrunken ? 'shrunken' : '')
109
+ }, placeholder));
110
+ };
32
111
  var FormElements = {};
33
112
 
34
113
  // Helper function to format placeholder with asterisk if the field is required and label is hidden.
@@ -197,19 +276,122 @@ var TextInput = /*#__PURE__*/function (_React$Component5) {
197
276
  className: ["form-label",
198
277
  // In app, it's leveraged to identify element labels. Additionally removed !important of its specificity in scss to make it work with labelHidden.
199
278
  this.props.className, labelHidden ? "d-none" : ""].filter(Boolean).join(" ")
200
- })), /*#__PURE__*/_react["default"].createElement("input", props)));
279
+ })), /*#__PURE__*/_react["default"].createElement(FloatingPlaceholderInput, {
280
+ inputProps: props,
281
+ placeholder: props.placeholder,
282
+ defaultValue: props.defaultValue,
283
+ mutable: this.props.mutable
284
+ })));
201
285
  }
202
286
  }]);
203
287
  }(_react["default"].Component);
204
- var EmailInput = /*#__PURE__*/function (_React$Component6) {
205
- function EmailInput(props) {
288
+ var SensitiveInput = /*#__PURE__*/function (_React$Component6) {
289
+ function SensitiveInput(props) {
206
290
  var _this2;
207
- (0, _classCallCheck2["default"])(this, EmailInput);
208
- _this2 = _callSuper(this, EmailInput, [props]);
291
+ (0, _classCallCheck2["default"])(this, SensitiveInput);
292
+ _this2 = _callSuper(this, SensitiveInput, [props]);
293
+ (0, _defineProperty2["default"])(_this2, "handleChange", function (e) {
294
+ var val = e.target.value;
295
+ _this2.setState({
296
+ value: val
297
+ });
298
+ });
299
+ (0, _defineProperty2["default"])(_this2, "handleFocus", function () {
300
+ _this2.setState({
301
+ focused: true
302
+ });
303
+ });
304
+ (0, _defineProperty2["default"])(_this2, "handleBlur", function () {
305
+ _this2.setState({
306
+ focused: false
307
+ });
308
+ });
309
+ (0, _defineProperty2["default"])(_this2, "toggleShow", function (e) {
310
+ if (e) e.stopPropagation();
311
+ var next = !_this2.state.show;
312
+ _this2.setState({
313
+ show: next
314
+ }, function () {
315
+ if (_this2.inputField && _this2.inputField.current) {
316
+ try {
317
+ _this2.inputField.current.type = next ? 'text' : 'password';
318
+ } catch (err) {
319
+ // ignore if cannot change type
320
+ }
321
+ }
322
+ });
323
+ });
209
324
  _this2.inputField = /*#__PURE__*/_react["default"].createRef();
325
+ _this2.state = {
326
+ value: props.defaultValue !== undefined ? props.defaultValue : '',
327
+ focused: false,
328
+ show: false
329
+ };
210
330
  return _this2;
211
331
  }
212
- (0, _inherits2["default"])(EmailInput, _React$Component6);
332
+ (0, _inherits2["default"])(SensitiveInput, _React$Component6);
333
+ return (0, _createClass2["default"])(SensitiveInput, [{
334
+ key: "render",
335
+ value: function render() {
336
+ var _this3 = this;
337
+ var props = {};
338
+ props.type = 'password';
339
+ props.className = 'form-control';
340
+ props.name = this.props.data.field_name;
341
+ var labelHidden = this.props.data.labelHidden || false;
342
+ var hasRequiredLabel = this.props.data.hasOwnProperty('required') && this.props.data.required === true && !this.props.read_only;
343
+ props.placeholder = formatPlaceholder(this.props.data.placeholder, hasRequiredLabel, labelHidden);
344
+ if (this.props.mutable) {
345
+ props.defaultValue = this.props.defaultValue;
346
+ }
347
+ var baseClasses = 'SortableItem rfb-item';
348
+ if (this.props.data.pageBreakBefore) {
349
+ baseClasses += ' alwaysbreak';
350
+ }
351
+ if (this.props.read_only) {
352
+ props.disabled = 'disabled';
353
+ }
354
+
355
+ // remove placeholder attribute from actual input to avoid duplicate text
356
+ var _ph = props.placeholder,
357
+ restProps = (0, _objectWithoutProperties2["default"])(props, _excluded2);
358
+ var shrunken = this.state.value && String(this.state.value).length > 0 || this.state.focused;
359
+ return /*#__PURE__*/_react["default"].createElement("div", {
360
+ style: _objectSpread({}, this.props.style),
361
+ className: baseClasses
362
+ }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement("div", {
363
+ className: "mb-3"
364
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
365
+ className: ["form-label", this.props.className, labelHidden ? "d-none" : ""].filter(Boolean).join(" ")
366
+ })), /*#__PURE__*/_react["default"].createElement("div", {
367
+ className: "floating-input-wrapper".concat(props.placeholder ? ' has-placeholder' : '', " sensitive-wrapper"),
368
+ onClick: function onClick() {
369
+ if (_this3.inputField.current) _this3.inputField.current.focus();
370
+ }
371
+ }, /*#__PURE__*/_react["default"].createElement("input", (0, _extends2["default"])({}, restProps, {
372
+ ref: this.inputField,
373
+ onChange: this.handleChange,
374
+ onFocus: this.handleFocus,
375
+ onBlur: this.handleBlur
376
+ })), props.placeholder && /*#__PURE__*/_react["default"].createElement("span", {
377
+ className: "fb-placeholder ".concat(shrunken ? 'shrunken' : '')
378
+ }, props.placeholder), /*#__PURE__*/_react["default"].createElement("i", {
379
+ className: "fas ".concat(this.state.show ? 'fa-eye-slash' : 'fa-eye', " toggle-password"),
380
+ onClick: this.toggleShow
381
+ // title={this.state.show ? 'Hide' : 'Show'}
382
+ }))));
383
+ }
384
+ }]);
385
+ }(_react["default"].Component);
386
+ var EmailInput = /*#__PURE__*/function (_React$Component7) {
387
+ function EmailInput(props) {
388
+ var _this4;
389
+ (0, _classCallCheck2["default"])(this, EmailInput);
390
+ _this4 = _callSuper(this, EmailInput, [props]);
391
+ _this4.inputField = /*#__PURE__*/_react["default"].createRef();
392
+ return _this4;
393
+ }
394
+ (0, _inherits2["default"])(EmailInput, _React$Component7);
213
395
  return (0, _createClass2["default"])(EmailInput, [{
214
396
  key: "render",
215
397
  value: function render() {
@@ -238,19 +420,24 @@ var EmailInput = /*#__PURE__*/function (_React$Component6) {
238
420
  className: "mb-3"
239
421
  }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
240
422
  className: ["form-label", this.props.className, labelHidden ? "d-none" : ""].filter(Boolean).join(" ")
241
- })), /*#__PURE__*/_react["default"].createElement("input", props)));
423
+ })), /*#__PURE__*/_react["default"].createElement(FloatingPlaceholderInput, {
424
+ inputProps: props,
425
+ placeholder: props.placeholder,
426
+ defaultValue: props.defaultValue,
427
+ mutable: this.props.mutable
428
+ })));
242
429
  }
243
430
  }]);
244
431
  }(_react["default"].Component);
245
- var PhoneNumber = /*#__PURE__*/function (_React$Component7) {
432
+ var PhoneNumber = /*#__PURE__*/function (_React$Component8) {
246
433
  function PhoneNumber(props) {
247
- var _this3;
434
+ var _this5;
248
435
  (0, _classCallCheck2["default"])(this, PhoneNumber);
249
- _this3 = _callSuper(this, PhoneNumber, [props]);
250
- _this3.inputField = /*#__PURE__*/_react["default"].createRef();
251
- return _this3;
436
+ _this5 = _callSuper(this, PhoneNumber, [props]);
437
+ _this5.inputField = /*#__PURE__*/_react["default"].createRef();
438
+ return _this5;
252
439
  }
253
- (0, _inherits2["default"])(PhoneNumber, _React$Component7);
440
+ (0, _inherits2["default"])(PhoneNumber, _React$Component8);
254
441
  return (0, _createClass2["default"])(PhoneNumber, [{
255
442
  key: "render",
256
443
  value: function render() {
@@ -285,19 +472,24 @@ var PhoneNumber = /*#__PURE__*/function (_React$Component7) {
285
472
  className: "mb-3"
286
473
  }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
287
474
  className: ["form-label", this.props.className, labelHidden ? "d-none" : ""].filter(Boolean).join(" ")
288
- })), /*#__PURE__*/_react["default"].createElement("input", props)));
475
+ })), /*#__PURE__*/_react["default"].createElement(FloatingPlaceholderInput, {
476
+ inputProps: props,
477
+ placeholder: props.placeholder,
478
+ defaultValue: props.defaultValue,
479
+ mutable: this.props.mutable
480
+ })));
289
481
  }
290
482
  }]);
291
483
  }(_react["default"].Component);
292
- var NumberInput = /*#__PURE__*/function (_React$Component8) {
484
+ var NumberInput = /*#__PURE__*/function (_React$Component9) {
293
485
  function NumberInput(props) {
294
- var _this4;
486
+ var _this6;
295
487
  (0, _classCallCheck2["default"])(this, NumberInput);
296
- _this4 = _callSuper(this, NumberInput, [props]);
297
- _this4.inputField = /*#__PURE__*/_react["default"].createRef();
298
- return _this4;
488
+ _this6 = _callSuper(this, NumberInput, [props]);
489
+ _this6.inputField = /*#__PURE__*/_react["default"].createRef();
490
+ return _this6;
299
491
  }
300
- (0, _inherits2["default"])(NumberInput, _React$Component8);
492
+ (0, _inherits2["default"])(NumberInput, _React$Component9);
301
493
  return (0, _createClass2["default"])(NumberInput, [{
302
494
  key: "render",
303
495
  value: function render() {
@@ -326,19 +518,24 @@ var NumberInput = /*#__PURE__*/function (_React$Component8) {
326
518
  className: "mb-3"
327
519
  }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
328
520
  className: ["form-label", this.props.className, labelHidden ? "d-none" : ""].filter(Boolean).join(" ")
329
- })), /*#__PURE__*/_react["default"].createElement("input", props)));
521
+ })), /*#__PURE__*/_react["default"].createElement(FloatingPlaceholderInput, {
522
+ inputProps: props,
523
+ placeholder: props.placeholder,
524
+ defaultValue: props.defaultValue,
525
+ mutable: this.props.mutable
526
+ })));
330
527
  }
331
528
  }]);
332
529
  }(_react["default"].Component);
333
- var TextArea = /*#__PURE__*/function (_React$Component9) {
530
+ var TextArea = /*#__PURE__*/function (_React$Component0) {
334
531
  function TextArea(props) {
335
- var _this5;
532
+ var _this7;
336
533
  (0, _classCallCheck2["default"])(this, TextArea);
337
- _this5 = _callSuper(this, TextArea, [props]);
338
- _this5.inputField = /*#__PURE__*/_react["default"].createRef();
339
- return _this5;
534
+ _this7 = _callSuper(this, TextArea, [props]);
535
+ _this7.inputField = /*#__PURE__*/_react["default"].createRef();
536
+ return _this7;
340
537
  }
341
- (0, _inherits2["default"])(TextArea, _React$Component9);
538
+ (0, _inherits2["default"])(TextArea, _React$Component0);
342
539
  return (0, _createClass2["default"])(TextArea, [{
343
540
  key: "render",
344
541
  value: function render() {
@@ -366,19 +563,25 @@ var TextArea = /*#__PURE__*/function (_React$Component9) {
366
563
  className: "mb-3"
367
564
  }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
368
565
  className: ["form-label", this.props.className, labelHidden ? "d-none" : ""].filter(Boolean).join(" ")
369
- })), /*#__PURE__*/_react["default"].createElement("textarea", props)));
566
+ })), /*#__PURE__*/_react["default"].createElement(FloatingPlaceholderInput, {
567
+ Tag: "textarea",
568
+ inputProps: props,
569
+ placeholder: props.placeholder,
570
+ defaultValue: props.defaultValue,
571
+ mutable: this.props.mutable
572
+ })));
370
573
  }
371
574
  }]);
372
575
  }(_react["default"].Component);
373
- var Dropdown = /*#__PURE__*/function (_React$Component0) {
576
+ var Dropdown = /*#__PURE__*/function (_React$Component1) {
374
577
  function Dropdown(props) {
375
- var _this6;
578
+ var _this8;
376
579
  (0, _classCallCheck2["default"])(this, Dropdown);
377
- _this6 = _callSuper(this, Dropdown, [props]);
378
- _this6.inputField = /*#__PURE__*/_react["default"].createRef();
379
- return _this6;
580
+ _this8 = _callSuper(this, Dropdown, [props]);
581
+ _this8.inputField = /*#__PURE__*/_react["default"].createRef();
582
+ return _this8;
380
583
  }
381
- (0, _inherits2["default"])(Dropdown, _React$Component0);
584
+ (0, _inherits2["default"])(Dropdown, _React$Component1);
382
585
  return (0, _createClass2["default"])(Dropdown, [{
383
586
  key: "render",
384
587
  value: function render() {
@@ -414,28 +617,28 @@ var Dropdown = /*#__PURE__*/function (_React$Component0) {
414
617
  }
415
618
  }]);
416
619
  }(_react["default"].Component);
417
- var Signature = /*#__PURE__*/function (_React$Component1) {
620
+ var Signature = /*#__PURE__*/function (_React$Component10) {
418
621
  function Signature(props) {
419
- var _this7;
622
+ var _this9;
420
623
  (0, _classCallCheck2["default"])(this, Signature);
421
- _this7 = _callSuper(this, Signature, [props]);
422
- (0, _defineProperty2["default"])(_this7, "clear", function () {
423
- if (_this7.state.defaultValue) {
424
- _this7.setState({
624
+ _this9 = _callSuper(this, Signature, [props]);
625
+ (0, _defineProperty2["default"])(_this9, "clear", function () {
626
+ if (_this9.state.defaultValue) {
627
+ _this9.setState({
425
628
  defaultValue: ''
426
629
  });
427
- } else if (_this7.canvas.current) {
428
- _this7.canvas.current.clear();
630
+ } else if (_this9.canvas.current) {
631
+ _this9.canvas.current.clear();
429
632
  }
430
633
  });
431
- _this7.state = {
634
+ _this9.state = {
432
635
  defaultValue: props.defaultValue
433
636
  };
434
- _this7.inputField = /*#__PURE__*/_react["default"].createRef();
435
- _this7.canvas = /*#__PURE__*/_react["default"].createRef();
436
- return _this7;
637
+ _this9.inputField = /*#__PURE__*/_react["default"].createRef();
638
+ _this9.canvas = /*#__PURE__*/_react["default"].createRef();
639
+ return _this9;
437
640
  }
438
- (0, _inherits2["default"])(Signature, _React$Component1);
641
+ (0, _inherits2["default"])(Signature, _React$Component10);
439
642
  return (0, _createClass2["default"])(Signature, [{
440
643
  key: "render",
441
644
  value: function render() {
@@ -482,26 +685,26 @@ var Signature = /*#__PURE__*/function (_React$Component1) {
482
685
  }
483
686
  }]);
484
687
  }(_react["default"].Component);
485
- var Tags = /*#__PURE__*/function (_React$Component10) {
688
+ var Tags = /*#__PURE__*/function (_React$Component11) {
486
689
  function Tags(props) {
487
- var _this8;
690
+ var _this0;
488
691
  (0, _classCallCheck2["default"])(this, Tags);
489
- _this8 = _callSuper(this, Tags, [props]);
692
+ _this0 = _callSuper(this, Tags, [props]);
490
693
  // state = { value: this.props.defaultValue !== undefined ? this.props.defaultValue.split(',') : [] };
491
- (0, _defineProperty2["default"])(_this8, "handleChange", function (e) {
492
- _this8.setState({
694
+ (0, _defineProperty2["default"])(_this0, "handleChange", function (e) {
695
+ _this0.setState({
493
696
  value: e || []
494
697
  });
495
698
  });
496
- _this8.inputField = /*#__PURE__*/_react["default"].createRef();
699
+ _this0.inputField = /*#__PURE__*/_react["default"].createRef();
497
700
  var defaultValue = props.defaultValue,
498
701
  data = props.data;
499
- _this8.state = {
500
- value: _this8.getDefaultValue(defaultValue, data.options)
702
+ _this0.state = {
703
+ value: _this0.getDefaultValue(defaultValue, data.options)
501
704
  };
502
- return _this8;
705
+ return _this0;
503
706
  }
504
- (0, _inherits2["default"])(Tags, _React$Component10);
707
+ (0, _inherits2["default"])(Tags, _React$Component11);
505
708
  return (0, _createClass2["default"])(Tags, [{
506
709
  key: "getDefaultValue",
507
710
  value: function getDefaultValue(defaultValue, options) {
@@ -556,19 +759,19 @@ var Tags = /*#__PURE__*/function (_React$Component10) {
556
759
  }
557
760
  }]);
558
761
  }(_react["default"].Component);
559
- var Checkboxes = /*#__PURE__*/function (_React$Component11) {
762
+ var Checkboxes = /*#__PURE__*/function (_React$Component12) {
560
763
  function Checkboxes(props) {
561
- var _this9;
764
+ var _this1;
562
765
  (0, _classCallCheck2["default"])(this, Checkboxes);
563
- _this9 = _callSuper(this, Checkboxes, [props]);
564
- _this9.options = {};
565
- return _this9;
766
+ _this1 = _callSuper(this, Checkboxes, [props]);
767
+ _this1.options = {};
768
+ return _this1;
566
769
  }
567
- (0, _inherits2["default"])(Checkboxes, _React$Component11);
770
+ (0, _inherits2["default"])(Checkboxes, _React$Component12);
568
771
  return (0, _createClass2["default"])(Checkboxes, [{
569
772
  key: "render",
570
773
  value: function render() {
571
- var _this0 = this;
774
+ var _this10 = this;
572
775
  var self = this;
573
776
  var labelHidden = this.props.data.labelHidden || false;
574
777
  var classNames = 'form-check';
@@ -595,7 +798,7 @@ var Checkboxes = /*#__PURE__*/function (_React$Component11) {
595
798
  if (self.props.mutable) {
596
799
  props.defaultChecked = self.props.defaultValue !== undefined && (self.props.defaultValue.indexOf(option.key) > -1 || self.props.defaultValue.indexOf(option.value) > -1);
597
800
  }
598
- if (_this0.props.read_only) {
801
+ if (_this10.props.read_only) {
599
802
  props.disabled = 'disabled';
600
803
  }
601
804
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -609,7 +812,7 @@ var Checkboxes = /*#__PURE__*/function (_React$Component11) {
609
812
  self.options["child_ref_".concat(option.key)] = c;
610
813
  }
611
814
  },
612
- "data-required-checks": _this0.props.data.checkbox_required_checks ? _this0.props.data.checkbox_required_checks : '1'
815
+ "data-required-checks": _this10.props.data.checkbox_required_checks ? _this10.props.data.checkbox_required_checks : '1'
613
816
  }, props)), /*#__PURE__*/_react["default"].createElement("label", {
614
817
  className: "form-check-label",
615
818
  htmlFor: "fid_".concat(this_key)
@@ -618,19 +821,19 @@ var Checkboxes = /*#__PURE__*/function (_React$Component11) {
618
821
  }
619
822
  }]);
620
823
  }(_react["default"].Component);
621
- var RadioButtons = /*#__PURE__*/function (_React$Component12) {
824
+ var RadioButtons = /*#__PURE__*/function (_React$Component13) {
622
825
  function RadioButtons(props) {
623
- var _this1;
826
+ var _this11;
624
827
  (0, _classCallCheck2["default"])(this, RadioButtons);
625
- _this1 = _callSuper(this, RadioButtons, [props]);
626
- _this1.options = {};
627
- return _this1;
828
+ _this11 = _callSuper(this, RadioButtons, [props]);
829
+ _this11.options = {};
830
+ return _this11;
628
831
  }
629
- (0, _inherits2["default"])(RadioButtons, _React$Component12);
832
+ (0, _inherits2["default"])(RadioButtons, _React$Component13);
630
833
  return (0, _createClass2["default"])(RadioButtons, [{
631
834
  key: "render",
632
835
  value: function render() {
633
- var _this10 = this;
836
+ var _this12 = this;
634
837
  var self = this;
635
838
  var labelHidden = this.props.data.labelHidden || false;
636
839
  var classNames = 'form-check';
@@ -657,7 +860,7 @@ var RadioButtons = /*#__PURE__*/function (_React$Component12) {
657
860
  if (self.props.mutable) {
658
861
  props.defaultChecked = self.props.defaultValue !== undefined && (self.props.defaultValue.indexOf(option.key) > -1 || self.props.defaultValue.indexOf(option.value) > -1);
659
862
  }
660
- if (_this10.props.read_only) {
863
+ if (_this12.props.read_only) {
661
864
  props.disabled = 'disabled';
662
865
  }
663
866
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -679,12 +882,12 @@ var RadioButtons = /*#__PURE__*/function (_React$Component12) {
679
882
  }
680
883
  }]);
681
884
  }(_react["default"].Component);
682
- var Image = /*#__PURE__*/function (_React$Component13) {
885
+ var Image = /*#__PURE__*/function (_React$Component14) {
683
886
  function Image() {
684
887
  (0, _classCallCheck2["default"])(this, Image);
685
888
  return _callSuper(this, Image, arguments);
686
889
  }
687
- (0, _inherits2["default"])(Image, _React$Component13);
890
+ (0, _inherits2["default"])(Image, _React$Component14);
688
891
  return (0, _createClass2["default"])(Image, [{
689
892
  key: "render",
690
893
  value: function render() {
@@ -711,15 +914,15 @@ var Image = /*#__PURE__*/function (_React$Component13) {
711
914
  }
712
915
  }]);
713
916
  }(_react["default"].Component);
714
- var Rating = /*#__PURE__*/function (_React$Component14) {
917
+ var Rating = /*#__PURE__*/function (_React$Component15) {
715
918
  function Rating(props) {
716
- var _this11;
919
+ var _this13;
717
920
  (0, _classCallCheck2["default"])(this, Rating);
718
- _this11 = _callSuper(this, Rating, [props]);
719
- _this11.inputField = /*#__PURE__*/_react["default"].createRef();
720
- return _this11;
921
+ _this13 = _callSuper(this, Rating, [props]);
922
+ _this13.inputField = /*#__PURE__*/_react["default"].createRef();
923
+ return _this13;
721
924
  }
722
- (0, _inherits2["default"])(Rating, _React$Component14);
925
+ (0, _inherits2["default"])(Rating, _React$Component15);
723
926
  return (0, _createClass2["default"])(Rating, [{
724
927
  key: "render",
725
928
  value: function render() {
@@ -748,12 +951,12 @@ var Rating = /*#__PURE__*/function (_React$Component14) {
748
951
  }
749
952
  }]);
750
953
  }(_react["default"].Component);
751
- var HyperLink = /*#__PURE__*/function (_React$Component15) {
954
+ var HyperLink = /*#__PURE__*/function (_React$Component16) {
752
955
  function HyperLink() {
753
956
  (0, _classCallCheck2["default"])(this, HyperLink);
754
957
  return _callSuper(this, HyperLink, arguments);
755
958
  }
756
- (0, _inherits2["default"])(HyperLink, _React$Component15);
959
+ (0, _inherits2["default"])(HyperLink, _React$Component16);
757
960
  return (0, _createClass2["default"])(HyperLink, [{
758
961
  key: "render",
759
962
  value: function render() {
@@ -778,12 +981,12 @@ var HyperLink = /*#__PURE__*/function (_React$Component15) {
778
981
  }
779
982
  }]);
780
983
  }(_react["default"].Component);
781
- var Download = /*#__PURE__*/function (_React$Component16) {
984
+ var Download = /*#__PURE__*/function (_React$Component17) {
782
985
  function Download() {
783
986
  (0, _classCallCheck2["default"])(this, Download);
784
987
  return _callSuper(this, Download, arguments);
785
988
  }
786
- (0, _inherits2["default"])(Download, _React$Component16);
989
+ (0, _inherits2["default"])(Download, _React$Component17);
787
990
  return (0, _createClass2["default"])(Download, [{
788
991
  key: "render",
789
992
  value: function render() {
@@ -802,13 +1005,13 @@ var Download = /*#__PURE__*/function (_React$Component16) {
802
1005
  }
803
1006
  }]);
804
1007
  }(_react["default"].Component);
805
- var Camera = /*#__PURE__*/function (_React$Component17) {
1008
+ var Camera = /*#__PURE__*/function (_React$Component18) {
806
1009
  function Camera(props) {
807
- var _this12;
1010
+ var _this14;
808
1011
  (0, _classCallCheck2["default"])(this, Camera);
809
- _this12 = _callSuper(this, Camera, [props]);
810
- (0, _defineProperty2["default"])(_this12, "displayImage", function (e) {
811
- var self = _this12;
1012
+ _this14 = _callSuper(this, Camera, [props]);
1013
+ (0, _defineProperty2["default"])(_this14, "displayImage", function (e) {
1014
+ var self = _this14;
812
1015
  var target = e.target;
813
1016
  if (target.files && target.files.length) {
814
1017
  self.setState({
@@ -817,24 +1020,24 @@ var Camera = /*#__PURE__*/function (_React$Component17) {
817
1020
  });
818
1021
  }
819
1022
  });
820
- (0, _defineProperty2["default"])(_this12, "clearImage", function () {
821
- _this12.setState({
1023
+ (0, _defineProperty2["default"])(_this14, "clearImage", function () {
1024
+ _this14.setState({
822
1025
  img: null,
823
1026
  previewImg: null
824
1027
  });
825
1028
  });
826
- _this12.state = {
1029
+ _this14.state = {
827
1030
  img: null,
828
1031
  previewImg: null
829
1032
  };
830
- return _this12;
1033
+ return _this14;
831
1034
  }
832
- (0, _inherits2["default"])(Camera, _React$Component17);
1035
+ (0, _inherits2["default"])(Camera, _React$Component18);
833
1036
  return (0, _createClass2["default"])(Camera, [{
834
1037
  key: "getImageSizeProps",
835
- value: function getImageSizeProps(_ref) {
836
- var width = _ref.width,
837
- height = _ref.height;
1038
+ value: function getImageSizeProps(_ref2) {
1039
+ var width = _ref2.width,
1040
+ height = _ref2.height;
838
1041
  var imgProps = {
839
1042
  width: '100%'
840
1043
  };
@@ -857,7 +1060,7 @@ var Camera = /*#__PURE__*/function (_React$Component17) {
857
1060
  }, {
858
1061
  key: "render",
859
1062
  value: function render() {
860
- var _this13 = this;
1063
+ var _this15 = this;
861
1064
  var imageStyle = {
862
1065
  // 2025/11/11
863
1066
  // 'scale-down' looks to keep the original size of image on form-builder-generator.
@@ -926,7 +1129,7 @@ var Camera = /*#__PURE__*/function (_React$Component17) {
926
1129
  className: "fas fa-camera"
927
1130
  }), " ", this.props.data.label_after_camera_icon), /*#__PURE__*/_react["default"].createElement("div", null, this.props.data.message_under_camera_icon))), this.state.img && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
928
1131
  onLoad: function onLoad() {
929
- return URL.revokeObjectURL(_this13.state.previewImg);
1132
+ return URL.revokeObjectURL(_this15.state.previewImg);
930
1133
  },
931
1134
  src: this.state.previewImg,
932
1135
  height: "100",
@@ -973,7 +1176,7 @@ var Camera = /*#__PURE__*/function (_React$Component17) {
973
1176
  className: "btn-browse"
974
1177
  }, this.props.data.label_after_camera_icon))), this.state.img && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
975
1178
  onLoad: function onLoad() {
976
- return URL.revokeObjectURL(_this13.state.previewImg);
1179
+ return URL.revokeObjectURL(_this15.state.previewImg);
977
1180
  },
978
1181
  src: this.state.previewImg,
979
1182
  className: "image-upload-preview",
@@ -989,13 +1192,13 @@ var Camera = /*#__PURE__*/function (_React$Component17) {
989
1192
  }
990
1193
  }]);
991
1194
  }(_react["default"].Component);
992
- var FileUpload = /*#__PURE__*/function (_React$Component18) {
1195
+ var FileUpload = /*#__PURE__*/function (_React$Component19) {
993
1196
  function FileUpload(props) {
994
- var _this14;
1197
+ var _this16;
995
1198
  (0, _classCallCheck2["default"])(this, FileUpload);
996
- _this14 = _callSuper(this, FileUpload, [props]);
997
- (0, _defineProperty2["default"])(_this14, "displayFileUpload", function (e) {
998
- var self = _this14;
1199
+ _this16 = _callSuper(this, FileUpload, [props]);
1200
+ (0, _defineProperty2["default"])(_this16, "displayFileUpload", function (e) {
1201
+ var self = _this16;
999
1202
  var target = e.target;
1000
1203
  var file;
1001
1204
  if (target.files && target.files.length > 0) {
@@ -1005,19 +1208,19 @@ var FileUpload = /*#__PURE__*/function (_React$Component18) {
1005
1208
  });
1006
1209
  }
1007
1210
  });
1008
- (0, _defineProperty2["default"])(_this14, "clearFileUpload", function () {
1009
- _this14.setState({
1211
+ (0, _defineProperty2["default"])(_this16, "clearFileUpload", function () {
1212
+ _this16.setState({
1010
1213
  fileUpload: null
1011
1214
  });
1012
1215
  });
1013
- (0, _defineProperty2["default"])(_this14, "saveFile", /*#__PURE__*/function () {
1014
- var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(e) {
1216
+ (0, _defineProperty2["default"])(_this16, "saveFile", /*#__PURE__*/function () {
1217
+ var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(e) {
1015
1218
  var sourceUrl, response, dispositionHeader, resBlob, blob, fileName, _fileName;
1016
1219
  return _regenerator["default"].wrap(function (_context) {
1017
1220
  while (1) switch (_context.prev = _context.next) {
1018
1221
  case 0:
1019
1222
  e.preventDefault();
1020
- sourceUrl = _this14.props.defaultValue;
1223
+ sourceUrl = _this16.props.defaultValue;
1021
1224
  _context.next = 1;
1022
1225
  return (0, _isomorphicFetch["default"])(sourceUrl, {
1023
1226
  method: 'GET',
@@ -1036,7 +1239,7 @@ var FileUpload = /*#__PURE__*/function (_React$Component18) {
1036
1239
  resBlob = _context.sent;
1037
1240
  // eslint-disable-next-line no-undef
1038
1241
  blob = new Blob([resBlob], {
1039
- type: _this14.props.data.fileType || response.headers.get('Content-Type')
1242
+ type: _this16.props.data.fileType || response.headers.get('Content-Type')
1040
1243
  });
1041
1244
  if (dispositionHeader && dispositionHeader.indexOf(';filename=') > -1) {
1042
1245
  fileName = dispositionHeader.split(';filename=')[1];
@@ -1052,15 +1255,15 @@ var FileUpload = /*#__PURE__*/function (_React$Component18) {
1052
1255
  }, _callee);
1053
1256
  }));
1054
1257
  return function (_x) {
1055
- return _ref2.apply(this, arguments);
1258
+ return _ref3.apply(this, arguments);
1056
1259
  };
1057
1260
  }());
1058
- _this14.state = {
1261
+ _this16.state = {
1059
1262
  fileUpload: null
1060
1263
  };
1061
- return _this14;
1264
+ return _this16;
1062
1265
  }
1063
- (0, _inherits2["default"])(FileUpload, _React$Component18);
1266
+ (0, _inherits2["default"])(FileUpload, _React$Component19);
1064
1267
  return (0, _createClass2["default"])(FileUpload, [{
1065
1268
  key: "render",
1066
1269
  value: function render() {
@@ -1186,24 +1389,24 @@ var FileUpload = /*#__PURE__*/function (_React$Component18) {
1186
1389
  }
1187
1390
  }]);
1188
1391
  }(_react["default"].Component);
1189
- var Range = /*#__PURE__*/function (_React$Component19) {
1392
+ var Range = /*#__PURE__*/function (_React$Component20) {
1190
1393
  function Range(props) {
1191
- var _this15;
1394
+ var _this17;
1192
1395
  (0, _classCallCheck2["default"])(this, Range);
1193
- _this15 = _callSuper(this, Range, [props]);
1194
- (0, _defineProperty2["default"])(_this15, "changeValue", function (e) {
1396
+ _this17 = _callSuper(this, Range, [props]);
1397
+ (0, _defineProperty2["default"])(_this17, "changeValue", function (e) {
1195
1398
  var target = e.target;
1196
- _this15.setState({
1399
+ _this17.setState({
1197
1400
  value: target.value
1198
1401
  });
1199
1402
  });
1200
- _this15.inputField = /*#__PURE__*/_react["default"].createRef();
1201
- _this15.state = {
1403
+ _this17.inputField = /*#__PURE__*/_react["default"].createRef();
1404
+ _this17.state = {
1202
1405
  value: props.defaultValue !== undefined ? parseInt(props.defaultValue, 10) : parseInt(props.data.default_value, 10)
1203
1406
  };
1204
- return _this15;
1407
+ return _this17;
1205
1408
  }
1206
- (0, _inherits2["default"])(Range, _React$Component19);
1409
+ (0, _inherits2["default"])(Range, _React$Component20);
1207
1410
  return (0, _createClass2["default"])(Range, [{
1208
1411
  key: "render",
1209
1412
  value: function render() {
@@ -1290,6 +1493,7 @@ FormElements.Paragraph = Paragraph;
1290
1493
  FormElements.Label = Label;
1291
1494
  FormElements.LineBreak = LineBreak;
1292
1495
  FormElements.TextInput = TextInput;
1496
+ FormElements.SensitiveInput = SensitiveInput;
1293
1497
  FormElements.EmailInput = EmailInput;
1294
1498
  FormElements.PhoneNumber = PhoneNumber;
1295
1499
  FormElements.NumberInput = NumberInput;