react-form-builder-more-flexibility 1.0.47 → 1.0.48
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/app.js +6 -6
- package/lib/form-elements/index.js +13 -20
- package/package.json +1 -1
|
@@ -599,6 +599,17 @@ var Checkbox = /*#__PURE__*/function (_React$Component14) {
|
|
|
599
599
|
var _this11;
|
|
600
600
|
(0, _classCallCheck2["default"])(this, Checkbox);
|
|
601
601
|
_this11 = _super14.call(this, props);
|
|
602
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this11), "clickDetected", function () {
|
|
603
|
+
if (_this11.props.onCheckboxClick) {
|
|
604
|
+
_this11.props.onCheckboxClick(_this11.props.data); // Pass the field name or data to the parent component
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this11), "handleLabelClick", function (event) {
|
|
608
|
+
event.preventDefault();
|
|
609
|
+
if (_this11.props.data && _this11.props.data.hasPopUp) {
|
|
610
|
+
_this11.clickDetected();
|
|
611
|
+
}
|
|
612
|
+
});
|
|
602
613
|
_this11.inputField = /*#__PURE__*/_react["default"].createRef();
|
|
603
614
|
return _this11;
|
|
604
615
|
}
|
|
@@ -620,31 +631,13 @@ var Checkbox = /*#__PURE__*/function (_React$Component14) {
|
|
|
620
631
|
if (this.props.read_only) {
|
|
621
632
|
props.disabled = 'disabled';
|
|
622
633
|
}
|
|
623
|
-
var hasPopUpBody;
|
|
624
|
-
if (this.props.data && this.props.data.hasPopUp) {
|
|
625
|
-
hasPopUpBody = true;
|
|
626
|
-
}
|
|
627
|
-
function clickDetected() {
|
|
628
|
-
console.log('CLICK DETECTED!!');
|
|
629
|
-
if (this.props.onCheckboxClick) {
|
|
630
|
-
this.props.onCheckboxClick(this.props.data); // Pass the field name or data to the parent component
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
function handleLabelClick(event) {
|
|
634
|
-
event.preventDefault();
|
|
635
|
-
if (hasPopUpBody) {
|
|
636
|
-
clickDetected();
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
634
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
640
635
|
style: _objectSpread({}, this.props.style),
|
|
641
636
|
className: baseClasses
|
|
642
637
|
}, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement("div", {
|
|
643
638
|
className: "form-group"
|
|
644
639
|
}, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], (0, _extends2["default"])({
|
|
645
|
-
passUpClick:
|
|
646
|
-
return clickDetected();
|
|
647
|
-
},
|
|
640
|
+
passUpClick: this.clickDetected,
|
|
648
641
|
className: "form-label"
|
|
649
642
|
}, this.props)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
650
643
|
className: "form-check form-check-inline"
|
|
@@ -653,7 +646,7 @@ var Checkbox = /*#__PURE__*/function (_React$Component14) {
|
|
|
653
646
|
id: this.props.data.field_name
|
|
654
647
|
}, props)), /*#__PURE__*/_react["default"].createElement("label", {
|
|
655
648
|
className: "form-check-label",
|
|
656
|
-
onClick: handleLabelClick,
|
|
649
|
+
onClick: this.handleLabelClick,
|
|
657
650
|
htmlFor: this.props.data.field_name,
|
|
658
651
|
dangerouslySetInnerHTML: {
|
|
659
652
|
__html: this.props.data.boxLabel
|