react-survey-builder 1.0.28 → 1.0.30
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.
@@ -29,6 +29,7 @@ var getError = exports.getError = function getError(errors, name) {
|
|
29
29
|
var ComponentErrorMessage = function ComponentErrorMessage(_ref) {
|
30
30
|
var name = _ref.name;
|
31
31
|
var methods = (0, _reactHookForm.useFormContext)();
|
32
|
+
console.log(methods);
|
32
33
|
if (!methods) return null;
|
33
34
|
if (getError(methods.formState.errors, name) !== undefined) {
|
34
35
|
return /*#__PURE__*/_react["default"].createElement(_errorMessage.ErrorMessage, {
|
@@ -34,6 +34,7 @@ var _componentErrorMessage = _interopRequireDefault(require("./component-error-m
|
|
34
34
|
var _ipUtils = require("../utils/ipUtils");
|
35
35
|
var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
|
36
36
|
var _ri = require("react-icons/ri");
|
37
|
+
var _UUID = _interopRequireDefault(require("../UUID"));
|
37
38
|
var _excluded = ["onChange"],
|
38
39
|
_excluded2 = ["onChange", "formatMask"]; // eslint-disable-next-line max-classes-per-file
|
39
40
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
@@ -1165,12 +1166,12 @@ var Checkboxes = /*#__PURE__*/function (_React$Component15) {
|
|
1165
1166
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({}, this.props, {
|
1166
1167
|
htmlFor: this.props.name
|
1167
1168
|
})), this.props.item.options.map(function (option) {
|
1168
|
-
var
|
1169
|
+
var _this20$props$checkbo;
|
1169
1170
|
var props = {};
|
1170
1171
|
props.name = "option_".concat(option.key);
|
1171
1172
|
props.value = option.value;
|
1172
1173
|
props.checked = self.props.value ? self.props.value.indexOf(option.value) > -1 : false;
|
1173
|
-
props.inline =
|
1174
|
+
//props.inline = self.props.item.inline ?? false;
|
1174
1175
|
if (self.props.item.disabled) {
|
1175
1176
|
props.disabled = 'disabled';
|
1176
1177
|
}
|
@@ -1222,7 +1223,6 @@ var Checkbox = /*#__PURE__*/function (_React$Component16) {
|
|
1222
1223
|
key: "render",
|
1223
1224
|
value: function render() {
|
1224
1225
|
var _this22 = this,
|
1225
|
-
_this$props$item$inli,
|
1226
1226
|
_this$props$checkboxB;
|
1227
1227
|
var baseClasses = 'SortableItem rfb-item';
|
1228
1228
|
if (this.props.item.pageBreakBefore) {
|
@@ -1232,19 +1232,22 @@ var Checkbox = /*#__PURE__*/function (_React$Component16) {
|
|
1232
1232
|
// eslint-disable-next-line no-undef
|
1233
1233
|
props.name = this.props.name;
|
1234
1234
|
props.onChange = function (event) {
|
1235
|
-
_this22.props.onChange
|
1235
|
+
if (_this22.props.onChange) {
|
1236
|
+
_this22.props.onChange(event.target.checked);
|
1237
|
+
}
|
1236
1238
|
};
|
1237
|
-
props.isInvalid = this.props.isInvalid;
|
1239
|
+
//props.isInvalid = this.props.isInvalid;
|
1238
1240
|
props.onBlur = this.props.onBlur;
|
1239
1241
|
props.autoComplete = "new-password";
|
1240
1242
|
if (this.props.item.disabled) {
|
1241
1243
|
props.disabled = 'disabled';
|
1242
1244
|
}
|
1243
1245
|
if (this.props.item.mutable) {
|
1244
|
-
props.
|
1246
|
+
props.inputRef = this.inputField;
|
1245
1247
|
}
|
1246
1248
|
props.checked = this.props.value;
|
1247
|
-
props.inline =
|
1249
|
+
//props.inline = this.props.item.inline ?? false;
|
1250
|
+
|
1248
1251
|
if (this.props.item.print === true) {
|
1249
1252
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
1250
1253
|
style: _objectSpread({}, this.props.style),
|
@@ -1271,7 +1274,7 @@ var Checkbox = /*#__PURE__*/function (_React$Component16) {
|
|
1271
1274
|
variant: (_this$props$checkboxB = this.props.checkboxButtonClassName) !== null && _this$props$checkboxB !== void 0 ? _this$props$checkboxB : "outline-light",
|
1272
1275
|
className: "btn-survey-builder-checkbox",
|
1273
1276
|
value: props.name,
|
1274
|
-
id: props.name
|
1277
|
+
id: props.name + '-' + _UUID["default"].uuid()
|
1275
1278
|
}, props), /*#__PURE__*/_react["default"].createElement("div", {
|
1276
1279
|
className: "d-flex align-items-center justify-content-between text-black text-survey-builder-checkbox"
|
1277
1280
|
}, props.checked !== true && /*#__PURE__*/_react["default"].createElement(_ri.RiCheckboxBlankLine, {
|
@@ -1334,7 +1337,7 @@ var RadioButtons = /*#__PURE__*/function (_React$Component17) {
|
|
1334
1337
|
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement(_reactBootstrap.Form.Group, {
|
1335
1338
|
className: "form-group mb-3"
|
1336
1339
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.item.options.map(function (option) {
|
1337
|
-
var
|
1340
|
+
var _this24$props$checkbo;
|
1338
1341
|
var props = {};
|
1339
1342
|
props.name = self.props.name;
|
1340
1343
|
props.value = option.value;
|
@@ -1345,7 +1348,8 @@ var RadioButtons = /*#__PURE__*/function (_React$Component17) {
|
|
1345
1348
|
if (self.props.item.disabled) {
|
1346
1349
|
props.disabled = 'disabled';
|
1347
1350
|
}
|
1348
|
-
props.inline =
|
1351
|
+
//props.inline = self.props.item.inline ?? false;
|
1352
|
+
|
1349
1353
|
return /*#__PURE__*/_react["default"].createElement(_reactBootstrap.ToggleButton, (0, _extends2["default"])({
|
1350
1354
|
label: option.text,
|
1351
1355
|
type: "radio",
|