dibk-design 3.3.1 → 3.3.3
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,11 +15,14 @@ var CheckBoxList = function CheckBoxList(props) {
|
|
|
15
15
|
var renderChildElements = function renderChildElements(childElements) {
|
|
16
16
|
var childElementsthroughFragments = (0, _helpers.cloneThroughFragments)(childElements);
|
|
17
17
|
return childElementsthroughFragments.map(function (childElement, index) {
|
|
18
|
-
var
|
|
18
|
+
var _childElement$type;
|
|
19
|
+
var isCheckBoxListItem = (childElement === null || childElement === void 0 || (_childElement$type = childElement.type) === null || _childElement$type === void 0 ? void 0 : _childElement$type.name) === "CheckBoxListItem";
|
|
20
|
+
var childElementProps = isCheckBoxListItem ? {
|
|
19
21
|
requiredGroup: props.required,
|
|
20
22
|
compact: props.compact,
|
|
21
23
|
key: "checkboxListItem-".concat(index)
|
|
22
|
-
}
|
|
24
|
+
} : null;
|
|
25
|
+
var childElementCopy = _react.default.cloneElement(childElement, childElementProps);
|
|
23
26
|
return childElementCopy;
|
|
24
27
|
});
|
|
25
28
|
};
|
|
@@ -15,11 +15,14 @@ var RadioButtonList = function RadioButtonList(props) {
|
|
|
15
15
|
var renderChildElements = function renderChildElements(childElements) {
|
|
16
16
|
var childElementsthroughFragments = (0, _helpers.cloneThroughFragments)(childElements);
|
|
17
17
|
return childElementsthroughFragments.map(function (childElement, index) {
|
|
18
|
-
var
|
|
18
|
+
var _childElement$type;
|
|
19
|
+
var isRadioButtonListItem = (childElement === null || childElement === void 0 || (_childElement$type = childElement.type) === null || _childElement$type === void 0 ? void 0 : _childElement$type.name) === "RadioButtonListItem";
|
|
20
|
+
var childElementProps = isRadioButtonListItem ? {
|
|
19
21
|
requiredGroup: props.required,
|
|
20
22
|
compact: props.compact,
|
|
21
23
|
key: "radioButtonListItem-".concat(index)
|
|
22
|
-
}
|
|
24
|
+
} : null;
|
|
25
|
+
var childElementCopy = _react.default.cloneElement(childElement, childElementProps);
|
|
23
26
|
return childElementCopy;
|
|
24
27
|
});
|
|
25
28
|
};
|
|
@@ -137,9 +137,8 @@ var Select = function Select(props) {
|
|
|
137
137
|
};
|
|
138
138
|
var renderPlaceholderOption = function renderPlaceholderOption(placeholder, placeholderValue) {
|
|
139
139
|
return placeholder ? _react.default.createElement("option", {
|
|
140
|
-
value: placeholderValue,
|
|
141
|
-
disabled: true
|
|
142
|
-
selected: true
|
|
140
|
+
value: placeholderValue || "",
|
|
141
|
+
disabled: true
|
|
143
142
|
}, placeholder) : "";
|
|
144
143
|
};
|
|
145
144
|
var getErrorElementId = function getErrorElementId() {
|
|
@@ -164,7 +163,7 @@ var Select = function Select(props) {
|
|
|
164
163
|
multiple: props.multiple,
|
|
165
164
|
required: props.required,
|
|
166
165
|
disabled: props.disabled
|
|
167
|
-
}, _defineProperty(_selectElementProps, defaultValue ? "defaultValue" : "value", defaultValue || props.value), _defineProperty(_selectElementProps, "onChange", props.onChange), _defineProperty(_selectElementProps, "id", props.id), _defineProperty(_selectElementProps, "role", props.role), _defineProperty(_selectElementProps, "key", "".concat(props.id, "-").concat((0, _generators.generateRandomString)(6))), _defineProperty(_selectElementProps, "className", className), _defineProperty(_selectElementProps, "aria-describedby", props.hasErrors && !!((_props$errorMessage = props.errorMessage) !== null && _props$errorMessage !== void 0 && _props$errorMessage.length) ? getErrorElementId() : !!((_props$ariaDescribed = props["aria-describedby"]) !== null && _props$ariaDescribed !== void 0 && _props$ariaDescribed.length) ? props["aria-describedby"] : null), _defineProperty(_selectElementProps, "aria-invalid", props.hasErrors ? "true" : null), _defineProperty(_selectElementProps, "style", styleRules), _selectElementProps);
|
|
166
|
+
}, _defineProperty(_selectElementProps, defaultValue ? "defaultValue" : "value", defaultValue || props.value || ""), _defineProperty(_selectElementProps, "onChange", props.onChange), _defineProperty(_selectElementProps, "id", props.id), _defineProperty(_selectElementProps, "role", props.role), _defineProperty(_selectElementProps, "key", "".concat(props.id, "-").concat((0, _generators.generateRandomString)(6))), _defineProperty(_selectElementProps, "className", className), _defineProperty(_selectElementProps, "aria-describedby", props.hasErrors && !!((_props$errorMessage = props.errorMessage) !== null && _props$errorMessage !== void 0 && _props$errorMessage.length) ? getErrorElementId() : !!((_props$ariaDescribed = props["aria-describedby"]) !== null && _props$ariaDescribed !== void 0 && _props$ariaDescribed.length) ? props["aria-describedby"] : null), _defineProperty(_selectElementProps, "aria-invalid", props.hasErrors ? "true" : null), _defineProperty(_selectElementProps, "style", styleRules), _selectElementProps);
|
|
168
167
|
return _react.default.createElement("div", {
|
|
169
168
|
className: _SelectModule.default.select
|
|
170
169
|
}, _react.default.createElement(_Label.default, {
|