@goldenpine/react-form-builder2 0.20.3-build.31 → 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.
- package/dist/845.app.js +1 -1
- package/dist/app.css +1 -1
- package/dist/app.css.map +1 -1
- package/dist/app.js +1 -1
- package/lib/form-elements/floating-placeholder.js +89 -0
- package/lib/form-elements/index.js +217 -117
- package/lib/form-elements-edit.js +1 -1
- package/lib/language-provider/locales/en-us.json +1 -0
- package/lib/language-provider/locales/fa-ir.json +1 -0
- package/lib/language-provider/locales/it-it.json +1 -0
- package/lib/language-provider/locales/vi-vn.json +1 -0
- package/lib/sortable-form-elements.js +2 -0
- package/lib/toolbar.js +11 -0
- package/package.json +1 -1
- package/types/index.d.ts +3 -0
|
@@ -28,7 +28,8 @@ var _datePicker = _interopRequireDefault(require("./date-picker"));
|
|
|
28
28
|
var _componentHeader = _interopRequireDefault(require("./component-header"));
|
|
29
29
|
var _componentLabel = _interopRequireDefault(require("./component-label"));
|
|
30
30
|
var _myxss = _interopRequireDefault(require("./myxss"));
|
|
31
|
-
var _excluded = ["placeholder"]
|
|
31
|
+
var _excluded = ["placeholder"],
|
|
32
|
+
_excluded2 = ["placeholder"];
|
|
32
33
|
/* eslint-disable quote-props */
|
|
33
34
|
// eslint-disable-next-line max-classes-per-file
|
|
34
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); }
|
|
@@ -284,15 +285,113 @@ var TextInput = /*#__PURE__*/function (_React$Component5) {
|
|
|
284
285
|
}
|
|
285
286
|
}]);
|
|
286
287
|
}(_react["default"].Component);
|
|
287
|
-
var
|
|
288
|
-
function
|
|
288
|
+
var SensitiveInput = /*#__PURE__*/function (_React$Component6) {
|
|
289
|
+
function SensitiveInput(props) {
|
|
289
290
|
var _this2;
|
|
290
|
-
(0, _classCallCheck2["default"])(this,
|
|
291
|
-
_this2 = _callSuper(this,
|
|
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
|
+
});
|
|
292
324
|
_this2.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
325
|
+
_this2.state = {
|
|
326
|
+
value: props.defaultValue !== undefined ? props.defaultValue : '',
|
|
327
|
+
focused: false,
|
|
328
|
+
show: false
|
|
329
|
+
};
|
|
293
330
|
return _this2;
|
|
294
331
|
}
|
|
295
|
-
(0, _inherits2["default"])(
|
|
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);
|
|
296
395
|
return (0, _createClass2["default"])(EmailInput, [{
|
|
297
396
|
key: "render",
|
|
298
397
|
value: function render() {
|
|
@@ -330,15 +429,15 @@ var EmailInput = /*#__PURE__*/function (_React$Component6) {
|
|
|
330
429
|
}
|
|
331
430
|
}]);
|
|
332
431
|
}(_react["default"].Component);
|
|
333
|
-
var PhoneNumber = /*#__PURE__*/function (_React$
|
|
432
|
+
var PhoneNumber = /*#__PURE__*/function (_React$Component8) {
|
|
334
433
|
function PhoneNumber(props) {
|
|
335
|
-
var
|
|
434
|
+
var _this5;
|
|
336
435
|
(0, _classCallCheck2["default"])(this, PhoneNumber);
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
return
|
|
436
|
+
_this5 = _callSuper(this, PhoneNumber, [props]);
|
|
437
|
+
_this5.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
438
|
+
return _this5;
|
|
340
439
|
}
|
|
341
|
-
(0, _inherits2["default"])(PhoneNumber, _React$
|
|
440
|
+
(0, _inherits2["default"])(PhoneNumber, _React$Component8);
|
|
342
441
|
return (0, _createClass2["default"])(PhoneNumber, [{
|
|
343
442
|
key: "render",
|
|
344
443
|
value: function render() {
|
|
@@ -382,15 +481,15 @@ var PhoneNumber = /*#__PURE__*/function (_React$Component7) {
|
|
|
382
481
|
}
|
|
383
482
|
}]);
|
|
384
483
|
}(_react["default"].Component);
|
|
385
|
-
var NumberInput = /*#__PURE__*/function (_React$
|
|
484
|
+
var NumberInput = /*#__PURE__*/function (_React$Component9) {
|
|
386
485
|
function NumberInput(props) {
|
|
387
|
-
var
|
|
486
|
+
var _this6;
|
|
388
487
|
(0, _classCallCheck2["default"])(this, NumberInput);
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
return
|
|
488
|
+
_this6 = _callSuper(this, NumberInput, [props]);
|
|
489
|
+
_this6.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
490
|
+
return _this6;
|
|
392
491
|
}
|
|
393
|
-
(0, _inherits2["default"])(NumberInput, _React$
|
|
492
|
+
(0, _inherits2["default"])(NumberInput, _React$Component9);
|
|
394
493
|
return (0, _createClass2["default"])(NumberInput, [{
|
|
395
494
|
key: "render",
|
|
396
495
|
value: function render() {
|
|
@@ -428,15 +527,15 @@ var NumberInput = /*#__PURE__*/function (_React$Component8) {
|
|
|
428
527
|
}
|
|
429
528
|
}]);
|
|
430
529
|
}(_react["default"].Component);
|
|
431
|
-
var TextArea = /*#__PURE__*/function (_React$
|
|
530
|
+
var TextArea = /*#__PURE__*/function (_React$Component0) {
|
|
432
531
|
function TextArea(props) {
|
|
433
|
-
var
|
|
532
|
+
var _this7;
|
|
434
533
|
(0, _classCallCheck2["default"])(this, TextArea);
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
return
|
|
534
|
+
_this7 = _callSuper(this, TextArea, [props]);
|
|
535
|
+
_this7.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
536
|
+
return _this7;
|
|
438
537
|
}
|
|
439
|
-
(0, _inherits2["default"])(TextArea, _React$
|
|
538
|
+
(0, _inherits2["default"])(TextArea, _React$Component0);
|
|
440
539
|
return (0, _createClass2["default"])(TextArea, [{
|
|
441
540
|
key: "render",
|
|
442
541
|
value: function render() {
|
|
@@ -474,15 +573,15 @@ var TextArea = /*#__PURE__*/function (_React$Component9) {
|
|
|
474
573
|
}
|
|
475
574
|
}]);
|
|
476
575
|
}(_react["default"].Component);
|
|
477
|
-
var Dropdown = /*#__PURE__*/function (_React$
|
|
576
|
+
var Dropdown = /*#__PURE__*/function (_React$Component1) {
|
|
478
577
|
function Dropdown(props) {
|
|
479
|
-
var
|
|
578
|
+
var _this8;
|
|
480
579
|
(0, _classCallCheck2["default"])(this, Dropdown);
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
return
|
|
580
|
+
_this8 = _callSuper(this, Dropdown, [props]);
|
|
581
|
+
_this8.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
582
|
+
return _this8;
|
|
484
583
|
}
|
|
485
|
-
(0, _inherits2["default"])(Dropdown, _React$
|
|
584
|
+
(0, _inherits2["default"])(Dropdown, _React$Component1);
|
|
486
585
|
return (0, _createClass2["default"])(Dropdown, [{
|
|
487
586
|
key: "render",
|
|
488
587
|
value: function render() {
|
|
@@ -518,28 +617,28 @@ var Dropdown = /*#__PURE__*/function (_React$Component0) {
|
|
|
518
617
|
}
|
|
519
618
|
}]);
|
|
520
619
|
}(_react["default"].Component);
|
|
521
|
-
var Signature = /*#__PURE__*/function (_React$
|
|
620
|
+
var Signature = /*#__PURE__*/function (_React$Component10) {
|
|
522
621
|
function Signature(props) {
|
|
523
|
-
var
|
|
622
|
+
var _this9;
|
|
524
623
|
(0, _classCallCheck2["default"])(this, Signature);
|
|
525
|
-
|
|
526
|
-
(0, _defineProperty2["default"])(
|
|
527
|
-
if (
|
|
528
|
-
|
|
624
|
+
_this9 = _callSuper(this, Signature, [props]);
|
|
625
|
+
(0, _defineProperty2["default"])(_this9, "clear", function () {
|
|
626
|
+
if (_this9.state.defaultValue) {
|
|
627
|
+
_this9.setState({
|
|
529
628
|
defaultValue: ''
|
|
530
629
|
});
|
|
531
|
-
} else if (
|
|
532
|
-
|
|
630
|
+
} else if (_this9.canvas.current) {
|
|
631
|
+
_this9.canvas.current.clear();
|
|
533
632
|
}
|
|
534
633
|
});
|
|
535
|
-
|
|
634
|
+
_this9.state = {
|
|
536
635
|
defaultValue: props.defaultValue
|
|
537
636
|
};
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
return
|
|
637
|
+
_this9.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
638
|
+
_this9.canvas = /*#__PURE__*/_react["default"].createRef();
|
|
639
|
+
return _this9;
|
|
541
640
|
}
|
|
542
|
-
(0, _inherits2["default"])(Signature, _React$
|
|
641
|
+
(0, _inherits2["default"])(Signature, _React$Component10);
|
|
543
642
|
return (0, _createClass2["default"])(Signature, [{
|
|
544
643
|
key: "render",
|
|
545
644
|
value: function render() {
|
|
@@ -586,26 +685,26 @@ var Signature = /*#__PURE__*/function (_React$Component1) {
|
|
|
586
685
|
}
|
|
587
686
|
}]);
|
|
588
687
|
}(_react["default"].Component);
|
|
589
|
-
var Tags = /*#__PURE__*/function (_React$
|
|
688
|
+
var Tags = /*#__PURE__*/function (_React$Component11) {
|
|
590
689
|
function Tags(props) {
|
|
591
|
-
var
|
|
690
|
+
var _this0;
|
|
592
691
|
(0, _classCallCheck2["default"])(this, Tags);
|
|
593
|
-
|
|
692
|
+
_this0 = _callSuper(this, Tags, [props]);
|
|
594
693
|
// state = { value: this.props.defaultValue !== undefined ? this.props.defaultValue.split(',') : [] };
|
|
595
|
-
(0, _defineProperty2["default"])(
|
|
596
|
-
|
|
694
|
+
(0, _defineProperty2["default"])(_this0, "handleChange", function (e) {
|
|
695
|
+
_this0.setState({
|
|
597
696
|
value: e || []
|
|
598
697
|
});
|
|
599
698
|
});
|
|
600
|
-
|
|
699
|
+
_this0.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
601
700
|
var defaultValue = props.defaultValue,
|
|
602
701
|
data = props.data;
|
|
603
|
-
|
|
604
|
-
value:
|
|
702
|
+
_this0.state = {
|
|
703
|
+
value: _this0.getDefaultValue(defaultValue, data.options)
|
|
605
704
|
};
|
|
606
|
-
return
|
|
705
|
+
return _this0;
|
|
607
706
|
}
|
|
608
|
-
(0, _inherits2["default"])(Tags, _React$
|
|
707
|
+
(0, _inherits2["default"])(Tags, _React$Component11);
|
|
609
708
|
return (0, _createClass2["default"])(Tags, [{
|
|
610
709
|
key: "getDefaultValue",
|
|
611
710
|
value: function getDefaultValue(defaultValue, options) {
|
|
@@ -660,19 +759,19 @@ var Tags = /*#__PURE__*/function (_React$Component10) {
|
|
|
660
759
|
}
|
|
661
760
|
}]);
|
|
662
761
|
}(_react["default"].Component);
|
|
663
|
-
var Checkboxes = /*#__PURE__*/function (_React$
|
|
762
|
+
var Checkboxes = /*#__PURE__*/function (_React$Component12) {
|
|
664
763
|
function Checkboxes(props) {
|
|
665
|
-
var
|
|
764
|
+
var _this1;
|
|
666
765
|
(0, _classCallCheck2["default"])(this, Checkboxes);
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
return
|
|
766
|
+
_this1 = _callSuper(this, Checkboxes, [props]);
|
|
767
|
+
_this1.options = {};
|
|
768
|
+
return _this1;
|
|
670
769
|
}
|
|
671
|
-
(0, _inherits2["default"])(Checkboxes, _React$
|
|
770
|
+
(0, _inherits2["default"])(Checkboxes, _React$Component12);
|
|
672
771
|
return (0, _createClass2["default"])(Checkboxes, [{
|
|
673
772
|
key: "render",
|
|
674
773
|
value: function render() {
|
|
675
|
-
var
|
|
774
|
+
var _this10 = this;
|
|
676
775
|
var self = this;
|
|
677
776
|
var labelHidden = this.props.data.labelHidden || false;
|
|
678
777
|
var classNames = 'form-check';
|
|
@@ -699,7 +798,7 @@ var Checkboxes = /*#__PURE__*/function (_React$Component11) {
|
|
|
699
798
|
if (self.props.mutable) {
|
|
700
799
|
props.defaultChecked = self.props.defaultValue !== undefined && (self.props.defaultValue.indexOf(option.key) > -1 || self.props.defaultValue.indexOf(option.value) > -1);
|
|
701
800
|
}
|
|
702
|
-
if (
|
|
801
|
+
if (_this10.props.read_only) {
|
|
703
802
|
props.disabled = 'disabled';
|
|
704
803
|
}
|
|
705
804
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -713,7 +812,7 @@ var Checkboxes = /*#__PURE__*/function (_React$Component11) {
|
|
|
713
812
|
self.options["child_ref_".concat(option.key)] = c;
|
|
714
813
|
}
|
|
715
814
|
},
|
|
716
|
-
"data-required-checks":
|
|
815
|
+
"data-required-checks": _this10.props.data.checkbox_required_checks ? _this10.props.data.checkbox_required_checks : '1'
|
|
717
816
|
}, props)), /*#__PURE__*/_react["default"].createElement("label", {
|
|
718
817
|
className: "form-check-label",
|
|
719
818
|
htmlFor: "fid_".concat(this_key)
|
|
@@ -722,19 +821,19 @@ var Checkboxes = /*#__PURE__*/function (_React$Component11) {
|
|
|
722
821
|
}
|
|
723
822
|
}]);
|
|
724
823
|
}(_react["default"].Component);
|
|
725
|
-
var RadioButtons = /*#__PURE__*/function (_React$
|
|
824
|
+
var RadioButtons = /*#__PURE__*/function (_React$Component13) {
|
|
726
825
|
function RadioButtons(props) {
|
|
727
|
-
var
|
|
826
|
+
var _this11;
|
|
728
827
|
(0, _classCallCheck2["default"])(this, RadioButtons);
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
return
|
|
828
|
+
_this11 = _callSuper(this, RadioButtons, [props]);
|
|
829
|
+
_this11.options = {};
|
|
830
|
+
return _this11;
|
|
732
831
|
}
|
|
733
|
-
(0, _inherits2["default"])(RadioButtons, _React$
|
|
832
|
+
(0, _inherits2["default"])(RadioButtons, _React$Component13);
|
|
734
833
|
return (0, _createClass2["default"])(RadioButtons, [{
|
|
735
834
|
key: "render",
|
|
736
835
|
value: function render() {
|
|
737
|
-
var
|
|
836
|
+
var _this12 = this;
|
|
738
837
|
var self = this;
|
|
739
838
|
var labelHidden = this.props.data.labelHidden || false;
|
|
740
839
|
var classNames = 'form-check';
|
|
@@ -761,7 +860,7 @@ var RadioButtons = /*#__PURE__*/function (_React$Component12) {
|
|
|
761
860
|
if (self.props.mutable) {
|
|
762
861
|
props.defaultChecked = self.props.defaultValue !== undefined && (self.props.defaultValue.indexOf(option.key) > -1 || self.props.defaultValue.indexOf(option.value) > -1);
|
|
763
862
|
}
|
|
764
|
-
if (
|
|
863
|
+
if (_this12.props.read_only) {
|
|
765
864
|
props.disabled = 'disabled';
|
|
766
865
|
}
|
|
767
866
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -783,12 +882,12 @@ var RadioButtons = /*#__PURE__*/function (_React$Component12) {
|
|
|
783
882
|
}
|
|
784
883
|
}]);
|
|
785
884
|
}(_react["default"].Component);
|
|
786
|
-
var Image = /*#__PURE__*/function (_React$
|
|
885
|
+
var Image = /*#__PURE__*/function (_React$Component14) {
|
|
787
886
|
function Image() {
|
|
788
887
|
(0, _classCallCheck2["default"])(this, Image);
|
|
789
888
|
return _callSuper(this, Image, arguments);
|
|
790
889
|
}
|
|
791
|
-
(0, _inherits2["default"])(Image, _React$
|
|
890
|
+
(0, _inherits2["default"])(Image, _React$Component14);
|
|
792
891
|
return (0, _createClass2["default"])(Image, [{
|
|
793
892
|
key: "render",
|
|
794
893
|
value: function render() {
|
|
@@ -815,15 +914,15 @@ var Image = /*#__PURE__*/function (_React$Component13) {
|
|
|
815
914
|
}
|
|
816
915
|
}]);
|
|
817
916
|
}(_react["default"].Component);
|
|
818
|
-
var Rating = /*#__PURE__*/function (_React$
|
|
917
|
+
var Rating = /*#__PURE__*/function (_React$Component15) {
|
|
819
918
|
function Rating(props) {
|
|
820
|
-
var
|
|
919
|
+
var _this13;
|
|
821
920
|
(0, _classCallCheck2["default"])(this, Rating);
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
return
|
|
921
|
+
_this13 = _callSuper(this, Rating, [props]);
|
|
922
|
+
_this13.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
923
|
+
return _this13;
|
|
825
924
|
}
|
|
826
|
-
(0, _inherits2["default"])(Rating, _React$
|
|
925
|
+
(0, _inherits2["default"])(Rating, _React$Component15);
|
|
827
926
|
return (0, _createClass2["default"])(Rating, [{
|
|
828
927
|
key: "render",
|
|
829
928
|
value: function render() {
|
|
@@ -852,12 +951,12 @@ var Rating = /*#__PURE__*/function (_React$Component14) {
|
|
|
852
951
|
}
|
|
853
952
|
}]);
|
|
854
953
|
}(_react["default"].Component);
|
|
855
|
-
var HyperLink = /*#__PURE__*/function (_React$
|
|
954
|
+
var HyperLink = /*#__PURE__*/function (_React$Component16) {
|
|
856
955
|
function HyperLink() {
|
|
857
956
|
(0, _classCallCheck2["default"])(this, HyperLink);
|
|
858
957
|
return _callSuper(this, HyperLink, arguments);
|
|
859
958
|
}
|
|
860
|
-
(0, _inherits2["default"])(HyperLink, _React$
|
|
959
|
+
(0, _inherits2["default"])(HyperLink, _React$Component16);
|
|
861
960
|
return (0, _createClass2["default"])(HyperLink, [{
|
|
862
961
|
key: "render",
|
|
863
962
|
value: function render() {
|
|
@@ -882,12 +981,12 @@ var HyperLink = /*#__PURE__*/function (_React$Component15) {
|
|
|
882
981
|
}
|
|
883
982
|
}]);
|
|
884
983
|
}(_react["default"].Component);
|
|
885
|
-
var Download = /*#__PURE__*/function (_React$
|
|
984
|
+
var Download = /*#__PURE__*/function (_React$Component17) {
|
|
886
985
|
function Download() {
|
|
887
986
|
(0, _classCallCheck2["default"])(this, Download);
|
|
888
987
|
return _callSuper(this, Download, arguments);
|
|
889
988
|
}
|
|
890
|
-
(0, _inherits2["default"])(Download, _React$
|
|
989
|
+
(0, _inherits2["default"])(Download, _React$Component17);
|
|
891
990
|
return (0, _createClass2["default"])(Download, [{
|
|
892
991
|
key: "render",
|
|
893
992
|
value: function render() {
|
|
@@ -906,13 +1005,13 @@ var Download = /*#__PURE__*/function (_React$Component16) {
|
|
|
906
1005
|
}
|
|
907
1006
|
}]);
|
|
908
1007
|
}(_react["default"].Component);
|
|
909
|
-
var Camera = /*#__PURE__*/function (_React$
|
|
1008
|
+
var Camera = /*#__PURE__*/function (_React$Component18) {
|
|
910
1009
|
function Camera(props) {
|
|
911
|
-
var
|
|
1010
|
+
var _this14;
|
|
912
1011
|
(0, _classCallCheck2["default"])(this, Camera);
|
|
913
|
-
|
|
914
|
-
(0, _defineProperty2["default"])(
|
|
915
|
-
var self =
|
|
1012
|
+
_this14 = _callSuper(this, Camera, [props]);
|
|
1013
|
+
(0, _defineProperty2["default"])(_this14, "displayImage", function (e) {
|
|
1014
|
+
var self = _this14;
|
|
916
1015
|
var target = e.target;
|
|
917
1016
|
if (target.files && target.files.length) {
|
|
918
1017
|
self.setState({
|
|
@@ -921,19 +1020,19 @@ var Camera = /*#__PURE__*/function (_React$Component17) {
|
|
|
921
1020
|
});
|
|
922
1021
|
}
|
|
923
1022
|
});
|
|
924
|
-
(0, _defineProperty2["default"])(
|
|
925
|
-
|
|
1023
|
+
(0, _defineProperty2["default"])(_this14, "clearImage", function () {
|
|
1024
|
+
_this14.setState({
|
|
926
1025
|
img: null,
|
|
927
1026
|
previewImg: null
|
|
928
1027
|
});
|
|
929
1028
|
});
|
|
930
|
-
|
|
1029
|
+
_this14.state = {
|
|
931
1030
|
img: null,
|
|
932
1031
|
previewImg: null
|
|
933
1032
|
};
|
|
934
|
-
return
|
|
1033
|
+
return _this14;
|
|
935
1034
|
}
|
|
936
|
-
(0, _inherits2["default"])(Camera, _React$
|
|
1035
|
+
(0, _inherits2["default"])(Camera, _React$Component18);
|
|
937
1036
|
return (0, _createClass2["default"])(Camera, [{
|
|
938
1037
|
key: "getImageSizeProps",
|
|
939
1038
|
value: function getImageSizeProps(_ref2) {
|
|
@@ -961,7 +1060,7 @@ var Camera = /*#__PURE__*/function (_React$Component17) {
|
|
|
961
1060
|
}, {
|
|
962
1061
|
key: "render",
|
|
963
1062
|
value: function render() {
|
|
964
|
-
var
|
|
1063
|
+
var _this15 = this;
|
|
965
1064
|
var imageStyle = {
|
|
966
1065
|
// 2025/11/11
|
|
967
1066
|
// 'scale-down' looks to keep the original size of image on form-builder-generator.
|
|
@@ -1030,7 +1129,7 @@ var Camera = /*#__PURE__*/function (_React$Component17) {
|
|
|
1030
1129
|
className: "fas fa-camera"
|
|
1031
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", {
|
|
1032
1131
|
onLoad: function onLoad() {
|
|
1033
|
-
return URL.revokeObjectURL(
|
|
1132
|
+
return URL.revokeObjectURL(_this15.state.previewImg);
|
|
1034
1133
|
},
|
|
1035
1134
|
src: this.state.previewImg,
|
|
1036
1135
|
height: "100",
|
|
@@ -1077,7 +1176,7 @@ var Camera = /*#__PURE__*/function (_React$Component17) {
|
|
|
1077
1176
|
className: "btn-browse"
|
|
1078
1177
|
}, this.props.data.label_after_camera_icon))), this.state.img && /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
|
|
1079
1178
|
onLoad: function onLoad() {
|
|
1080
|
-
return URL.revokeObjectURL(
|
|
1179
|
+
return URL.revokeObjectURL(_this15.state.previewImg);
|
|
1081
1180
|
},
|
|
1082
1181
|
src: this.state.previewImg,
|
|
1083
1182
|
className: "image-upload-preview",
|
|
@@ -1093,13 +1192,13 @@ var Camera = /*#__PURE__*/function (_React$Component17) {
|
|
|
1093
1192
|
}
|
|
1094
1193
|
}]);
|
|
1095
1194
|
}(_react["default"].Component);
|
|
1096
|
-
var FileUpload = /*#__PURE__*/function (_React$
|
|
1195
|
+
var FileUpload = /*#__PURE__*/function (_React$Component19) {
|
|
1097
1196
|
function FileUpload(props) {
|
|
1098
|
-
var
|
|
1197
|
+
var _this16;
|
|
1099
1198
|
(0, _classCallCheck2["default"])(this, FileUpload);
|
|
1100
|
-
|
|
1101
|
-
(0, _defineProperty2["default"])(
|
|
1102
|
-
var self =
|
|
1199
|
+
_this16 = _callSuper(this, FileUpload, [props]);
|
|
1200
|
+
(0, _defineProperty2["default"])(_this16, "displayFileUpload", function (e) {
|
|
1201
|
+
var self = _this16;
|
|
1103
1202
|
var target = e.target;
|
|
1104
1203
|
var file;
|
|
1105
1204
|
if (target.files && target.files.length > 0) {
|
|
@@ -1109,19 +1208,19 @@ var FileUpload = /*#__PURE__*/function (_React$Component18) {
|
|
|
1109
1208
|
});
|
|
1110
1209
|
}
|
|
1111
1210
|
});
|
|
1112
|
-
(0, _defineProperty2["default"])(
|
|
1113
|
-
|
|
1211
|
+
(0, _defineProperty2["default"])(_this16, "clearFileUpload", function () {
|
|
1212
|
+
_this16.setState({
|
|
1114
1213
|
fileUpload: null
|
|
1115
1214
|
});
|
|
1116
1215
|
});
|
|
1117
|
-
(0, _defineProperty2["default"])(
|
|
1216
|
+
(0, _defineProperty2["default"])(_this16, "saveFile", /*#__PURE__*/function () {
|
|
1118
1217
|
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(e) {
|
|
1119
1218
|
var sourceUrl, response, dispositionHeader, resBlob, blob, fileName, _fileName;
|
|
1120
1219
|
return _regenerator["default"].wrap(function (_context) {
|
|
1121
1220
|
while (1) switch (_context.prev = _context.next) {
|
|
1122
1221
|
case 0:
|
|
1123
1222
|
e.preventDefault();
|
|
1124
|
-
sourceUrl =
|
|
1223
|
+
sourceUrl = _this16.props.defaultValue;
|
|
1125
1224
|
_context.next = 1;
|
|
1126
1225
|
return (0, _isomorphicFetch["default"])(sourceUrl, {
|
|
1127
1226
|
method: 'GET',
|
|
@@ -1140,7 +1239,7 @@ var FileUpload = /*#__PURE__*/function (_React$Component18) {
|
|
|
1140
1239
|
resBlob = _context.sent;
|
|
1141
1240
|
// eslint-disable-next-line no-undef
|
|
1142
1241
|
blob = new Blob([resBlob], {
|
|
1143
|
-
type:
|
|
1242
|
+
type: _this16.props.data.fileType || response.headers.get('Content-Type')
|
|
1144
1243
|
});
|
|
1145
1244
|
if (dispositionHeader && dispositionHeader.indexOf(';filename=') > -1) {
|
|
1146
1245
|
fileName = dispositionHeader.split(';filename=')[1];
|
|
@@ -1159,12 +1258,12 @@ var FileUpload = /*#__PURE__*/function (_React$Component18) {
|
|
|
1159
1258
|
return _ref3.apply(this, arguments);
|
|
1160
1259
|
};
|
|
1161
1260
|
}());
|
|
1162
|
-
|
|
1261
|
+
_this16.state = {
|
|
1163
1262
|
fileUpload: null
|
|
1164
1263
|
};
|
|
1165
|
-
return
|
|
1264
|
+
return _this16;
|
|
1166
1265
|
}
|
|
1167
|
-
(0, _inherits2["default"])(FileUpload, _React$
|
|
1266
|
+
(0, _inherits2["default"])(FileUpload, _React$Component19);
|
|
1168
1267
|
return (0, _createClass2["default"])(FileUpload, [{
|
|
1169
1268
|
key: "render",
|
|
1170
1269
|
value: function render() {
|
|
@@ -1290,24 +1389,24 @@ var FileUpload = /*#__PURE__*/function (_React$Component18) {
|
|
|
1290
1389
|
}
|
|
1291
1390
|
}]);
|
|
1292
1391
|
}(_react["default"].Component);
|
|
1293
|
-
var Range = /*#__PURE__*/function (_React$
|
|
1392
|
+
var Range = /*#__PURE__*/function (_React$Component20) {
|
|
1294
1393
|
function Range(props) {
|
|
1295
|
-
var
|
|
1394
|
+
var _this17;
|
|
1296
1395
|
(0, _classCallCheck2["default"])(this, Range);
|
|
1297
|
-
|
|
1298
|
-
(0, _defineProperty2["default"])(
|
|
1396
|
+
_this17 = _callSuper(this, Range, [props]);
|
|
1397
|
+
(0, _defineProperty2["default"])(_this17, "changeValue", function (e) {
|
|
1299
1398
|
var target = e.target;
|
|
1300
|
-
|
|
1399
|
+
_this17.setState({
|
|
1301
1400
|
value: target.value
|
|
1302
1401
|
});
|
|
1303
1402
|
});
|
|
1304
|
-
|
|
1305
|
-
|
|
1403
|
+
_this17.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
1404
|
+
_this17.state = {
|
|
1306
1405
|
value: props.defaultValue !== undefined ? parseInt(props.defaultValue, 10) : parseInt(props.data.default_value, 10)
|
|
1307
1406
|
};
|
|
1308
|
-
return
|
|
1407
|
+
return _this17;
|
|
1309
1408
|
}
|
|
1310
|
-
(0, _inherits2["default"])(Range, _React$
|
|
1409
|
+
(0, _inherits2["default"])(Range, _React$Component20);
|
|
1311
1410
|
return (0, _createClass2["default"])(Range, [{
|
|
1312
1411
|
key: "render",
|
|
1313
1412
|
value: function render() {
|
|
@@ -1394,6 +1493,7 @@ FormElements.Paragraph = Paragraph;
|
|
|
1394
1493
|
FormElements.Label = Label;
|
|
1395
1494
|
FormElements.LineBreak = LineBreak;
|
|
1396
1495
|
FormElements.TextInput = TextInput;
|
|
1496
|
+
FormElements.SensitiveInput = SensitiveInput;
|
|
1397
1497
|
FormElements.EmailInput = EmailInput;
|
|
1398
1498
|
FormElements.PhoneNumber = PhoneNumber;
|
|
1399
1499
|
FormElements.NumberInput = NumberInput;
|
|
@@ -173,7 +173,7 @@ var FormElementsEdit = exports["default"] = /*#__PURE__*/function (_React$Compon
|
|
|
173
173
|
canHaveOptionValue = _this$props$element.canHaveOptionValue;
|
|
174
174
|
var canHaveImageSize = this.state.element.element === 'Image' || this.state.element.element === 'Camera';
|
|
175
175
|
var canHaveUploadLayout = this.state.element.element === 'Camera' || this.state.element.element === 'FileUpload';
|
|
176
|
-
var canHavePlaceholder = this.props.element.element === 'TextInput' || this.props.element.element === 'TextArea' || this.props.element.element === 'EmailInput' || this.props.element.element === 'NumberInput' || this.props.element.element === 'PhoneNumber';
|
|
176
|
+
var canHavePlaceholder = this.props.element.element === 'TextInput' || this.props.element.element === 'TextArea' || this.props.element.element === 'EmailInput' || this.props.element.element === 'NumberInput' || this.props.element.element === 'PhoneNumber' || this.props.element.element === 'SensitiveInput';
|
|
177
177
|
var this_files = this.props.files.length ? this.props.files : [];
|
|
178
178
|
if (this_files.length < 1 || this_files.length > 0 && this_files[0].id !== '') {
|
|
179
179
|
this_files.unshift({
|