react-survey-builder 1.0.33 → 1.0.35
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/index.js +1 -1
- package/lib/survey-elements/index.js +18 -14
- package/package.json +1 -1
@@ -35,7 +35,6 @@ var _ipUtils = require("../utils/ipUtils");
|
|
35
35
|
var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
|
36
36
|
var _ri = require("react-icons/ri");
|
37
37
|
var _UUID = _interopRequireDefault(require("../UUID"));
|
38
|
-
var _md = require("react-icons/md");
|
39
38
|
var _io = require("react-icons/io5");
|
40
39
|
var _excluded = ["onChange"],
|
41
40
|
_excluded2 = ["onChange", "formatMask"]; // eslint-disable-next-line max-classes-per-file
|
@@ -77,11 +76,12 @@ var CustomDateInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2,
|
|
77
76
|
_ref2$formatMask = _ref2.formatMask,
|
78
77
|
formatMask = _ref2$formatMask === void 0 ? 'MM/DD/YYYY' : _ref2$formatMask,
|
79
78
|
otherProps = (0, _objectWithoutProperties2["default"])(_ref2, _excluded2);
|
79
|
+
console.log('otherProps', otherProps);
|
80
80
|
return /*#__PURE__*/_react["default"].createElement(_reactImask.IMaskInput, (0, _extends2["default"])({}, otherProps, {
|
81
81
|
mask: Date,
|
82
82
|
lazy: false,
|
83
83
|
overwrite: true,
|
84
|
-
pattern: formatMask,
|
84
|
+
pattern: formatMask !== null && formatMask !== void 0 ? formatMask : 'MM/DD/YYYY',
|
85
85
|
format: function format(date) {
|
86
86
|
var day = date.getDate();
|
87
87
|
var month = date.getMonth() + 1;
|
@@ -525,7 +525,10 @@ var DatePicker = /*#__PURE__*/function (_React$Component9) {
|
|
525
525
|
(0, _createClass2["default"])(DatePicker, [{
|
526
526
|
key: "render",
|
527
527
|
value: function render() {
|
528
|
-
var _this8 = this
|
528
|
+
var _this8 = this,
|
529
|
+
_this$props$value,
|
530
|
+
_this$props$isInvalid,
|
531
|
+
_this$props$onBlur;
|
529
532
|
var props = {};
|
530
533
|
props.name = this.props.name;
|
531
534
|
props.placeholder = this.props.item.placeholder || this.props.item.formatMask || 'MM/DD/YYYY';
|
@@ -534,9 +537,9 @@ var DatePicker = /*#__PURE__*/function (_React$Component9) {
|
|
534
537
|
_this8.props.onChange(val);
|
535
538
|
}
|
536
539
|
};
|
537
|
-
props.value = this.props.value;
|
538
|
-
props.isInvalid = this.props.isInvalid;
|
539
|
-
props.onBlur = this.props.onBlur;
|
540
|
+
props.value = (_this$props$value = this.props.value) !== null && _this$props$value !== void 0 ? _this$props$value : '';
|
541
|
+
props.isInvalid = (_this$props$isInvalid = this.props.isInvalid) !== null && _this$props$isInvalid !== void 0 ? _this$props$isInvalid : false;
|
542
|
+
props.onBlur = (_this$props$onBlur = this.props.onBlur) !== null && _this$props$onBlur !== void 0 ? _this$props$onBlur : null;
|
540
543
|
props.autoComplete = "new-password";
|
541
544
|
if (this.props.item.disabled) {
|
542
545
|
props.disabled = 'disabled';
|
@@ -548,6 +551,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component9) {
|
|
548
551
|
var labelLocation = 'ABOVE';
|
549
552
|
if (this.props.item.labelLocation) {
|
550
553
|
labelLocation = this.props.item.labelLocation;
|
554
|
+
props.label = props.placeholder;
|
551
555
|
}
|
552
556
|
var baseClasses = 'SortableItem rfb-item';
|
553
557
|
if (this.props.item.pageBreakBefore) {
|
@@ -920,13 +924,13 @@ var Signature = /*#__PURE__*/function (_React$Component13) {
|
|
920
924
|
value: function render() {
|
921
925
|
var _this$state$value,
|
922
926
|
_this$state$value2,
|
923
|
-
_this$props$value6,
|
924
927
|
_this$props$value7,
|
925
928
|
_this$props$value8,
|
926
929
|
_this$props$value9,
|
930
|
+
_this$props$value10,
|
927
931
|
_this16 = this,
|
928
932
|
_this$props$value$nam,
|
929
|
-
_this$props$
|
933
|
+
_this$props$value11;
|
930
934
|
var canClear = !!this.state.value;
|
931
935
|
var props = {};
|
932
936
|
props.name = this.props.name;
|
@@ -938,8 +942,8 @@ var Signature = /*#__PURE__*/function (_React$Component13) {
|
|
938
942
|
var padProps = {};
|
939
943
|
// umd requires canvasProps={{ width: 400, height: 150 }}
|
940
944
|
if (this.props.item.mutable) {
|
941
|
-
var _this$props$
|
942
|
-
padProps.defaultValue = (_this$props$
|
945
|
+
var _this$props$value2;
|
946
|
+
padProps.defaultValue = (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2.signature;
|
943
947
|
padProps.ref = this.canvas;
|
944
948
|
canClear = !this.props.item.readOnly;
|
945
949
|
}
|
@@ -954,7 +958,7 @@ var Signature = /*#__PURE__*/function (_React$Component13) {
|
|
954
958
|
}
|
955
959
|
padProps.canvasProps = {};
|
956
960
|
if (this.props.item.print === true && !!sourceDataURL) {
|
957
|
-
var _this$props$
|
961
|
+
var _this$props$value3, _this$props$value4, _this$props$value5, _this$props$value6;
|
958
962
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
959
963
|
style: _objectSpread({}, this.props.style),
|
960
964
|
className: baseClasses
|
@@ -968,7 +972,7 @@ var Signature = /*#__PURE__*/function (_React$Component13) {
|
|
968
972
|
style: {
|
969
973
|
borderStyle: 'dashed'
|
970
974
|
}
|
971
|
-
}), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("strong", null, "Electronic Signature"), " at ", (_this$props$
|
975
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("strong", null, "Electronic Signature"), " at ", (_this$props$value3 = this.props.value) !== null && _this$props$value3 !== void 0 && _this$props$value3.date ? (0, _momentTimezone["default"])((_this$props$value4 = this.props.value) === null || _this$props$value4 === void 0 ? void 0 : _this$props$value4.date).format('dddd MMMM D, YYYY hh:mm A') : (0, _momentTimezone["default"])().format('dddd MMMM D, YYYY hh:mm A'), " by ", (_this$props$value5 = this.props.value) === null || _this$props$value5 === void 0 ? void 0 : _this$props$value5.name, " via IP Address ", (_this$props$value6 = this.props.value) === null || _this$props$value6 === void 0 ? void 0 : _this$props$value6.ipAddress), /*#__PURE__*/_react["default"].createElement("hr", null))));
|
972
976
|
}
|
973
977
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
974
978
|
style: _objectSpread({}, this.props.style),
|
@@ -983,7 +987,7 @@ var Signature = /*#__PURE__*/function (_React$Component13) {
|
|
983
987
|
style: {
|
984
988
|
borderStyle: 'dashed'
|
985
989
|
}
|
986
|
-
}), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("strong", null, "Electronic Signature"), " at ", (_this$props$
|
990
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("strong", null, "Electronic Signature"), " at ", (_this$props$value7 = this.props.value) !== null && _this$props$value7 !== void 0 && _this$props$value7.date ? (0, _momentTimezone["default"])((_this$props$value8 = this.props.value) === null || _this$props$value8 === void 0 ? void 0 : _this$props$value8.date).format('dddd MMMM D, YYYY hh:mm A') : (0, _momentTimezone["default"])().format('dddd MMMM D, YYYY hh:mm A'), " by ", (_this$props$value9 = this.props.value) === null || _this$props$value9 === void 0 ? void 0 : _this$props$value9.name, " via IP Address ", (_this$props$value10 = this.props.value) === null || _this$props$value10 === void 0 ? void 0 : _this$props$value10.ipAddress), /*#__PURE__*/_react["default"].createElement("hr", null)) : null : /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
987
991
|
className: "m-signature-pad"
|
988
992
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
989
993
|
className: "m-signature-pad--body"
|
@@ -1002,7 +1006,7 @@ var Signature = /*#__PURE__*/function (_React$Component13) {
|
|
1002
1006
|
}, /*#__PURE__*/_react["default"].createElement(_fa.FaTimes, null), " clear"))), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Label, null, "Please print your full legal name and today's date."), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Container, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Row, null, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Col, {
|
1003
1007
|
sm: 6
|
1004
1008
|
}, /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Control, {
|
1005
|
-
value: (_this$props$value$nam = (_this$props$
|
1009
|
+
value: (_this$props$value$nam = (_this$props$value11 = this.props.value) === null || _this$props$value11 === void 0 ? void 0 : _this$props$value11.name) !== null && _this$props$value$nam !== void 0 ? _this$props$value$nam : '',
|
1006
1010
|
type: "text",
|
1007
1011
|
required: true,
|
1008
1012
|
placeholder: "Full Legal Name",
|