dibk-design 3.7.1 → 3.7.2
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.
|
@@ -15,15 +15,18 @@ const CheckBoxList = props => {
|
|
|
15
15
|
const renderChildElements = childElements => {
|
|
16
16
|
const childElementsthroughFragments = (0, _helpers.cloneThroughFragments)(childElements);
|
|
17
17
|
return childElementsthroughFragments.map((childElement, index) => {
|
|
18
|
-
var _childElement$
|
|
19
|
-
const isCheckBoxListItem = (childElement === null || childElement === void 0 || (_childElement$
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
var _childElement$props;
|
|
19
|
+
const isCheckBoxListItem = (childElement === null || childElement === void 0 || (_childElement$props = childElement.props) === null || _childElement$props === void 0 ? void 0 : _childElement$props.type) === "CheckBoxListItem";
|
|
20
|
+
if (isCheckBoxListItem) {
|
|
21
|
+
const childElementCopy = _react.default.cloneElement(childElement, {
|
|
22
|
+
requiredGroup: props.required,
|
|
23
|
+
compact: props.compact,
|
|
24
|
+
key: "checkboxListItem-".concat(index)
|
|
25
|
+
});
|
|
26
|
+
return childElementCopy;
|
|
27
|
+
} else {
|
|
28
|
+
return childElement;
|
|
29
|
+
}
|
|
27
30
|
});
|
|
28
31
|
};
|
|
29
32
|
return _react.default.createElement("fieldset", {
|
|
@@ -15,15 +15,18 @@ const RadioButtonList = props => {
|
|
|
15
15
|
const renderChildElements = childElements => {
|
|
16
16
|
const childElementsthroughFragments = (0, _helpers.cloneThroughFragments)(childElements);
|
|
17
17
|
return childElementsthroughFragments.map((childElement, index) => {
|
|
18
|
-
var _childElement$
|
|
19
|
-
const isRadioButtonListItem = (childElement === null || childElement === void 0 || (_childElement$
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
var _childElement$props;
|
|
19
|
+
const isRadioButtonListItem = (childElement === null || childElement === void 0 || (_childElement$props = childElement.props) === null || _childElement$props === void 0 ? void 0 : _childElement$props.type) === "RadioButtonListItem";
|
|
20
|
+
if (isRadioButtonListItem) {
|
|
21
|
+
const childElementCopy = _react.default.cloneElement(childElement, {
|
|
22
|
+
requiredGroup: props.required,
|
|
23
|
+
compact: props.compact,
|
|
24
|
+
key: "radioButtonListItem-".concat(index)
|
|
25
|
+
});
|
|
26
|
+
return childElementCopy;
|
|
27
|
+
} else {
|
|
28
|
+
return childElement;
|
|
29
|
+
}
|
|
27
30
|
});
|
|
28
31
|
};
|
|
29
32
|
return _react.default.createElement("fieldset", {
|