pesona-ui 1.0.13 → 1.0.15
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.esm.js
CHANGED
|
@@ -8494,18 +8494,17 @@ const Radio = React.forwardRef(({ name, label, options, error, ...rest }, ref) =
|
|
|
8494
8494
|
error && React.createElement("small", { className: "form-message" }, error)));
|
|
8495
8495
|
});
|
|
8496
8496
|
|
|
8497
|
-
const RadioButtonGroup =
|
|
8498
|
-
// Convert
|
|
8499
|
-
const
|
|
8500
|
-
return (React.createElement(
|
|
8501
|
-
label && (React.createElement("label",
|
|
8497
|
+
const RadioButtonGroup = forwardRef(({ label, required, options, error, defaultValue, ...rest }, ref) => {
|
|
8498
|
+
// Convert boolean value to string
|
|
8499
|
+
const stringDefaultValue = typeof defaultValue === 'boolean' ? (defaultValue ? 'true' : 'false') : defaultValue;
|
|
8500
|
+
return (React.createElement("div", null,
|
|
8501
|
+
label && (React.createElement("label", null,
|
|
8502
8502
|
label,
|
|
8503
|
-
" ",
|
|
8504
8503
|
required && React.createElement("span", { className: "text-danger" }, "*"))),
|
|
8505
|
-
React.createElement("div", { className: "btn-group", "data-toggle": "buttons" }, options.map((option) => (React.createElement("label", { key: option.value
|
|
8506
|
-
React.createElement("input", { type: "radio",
|
|
8504
|
+
React.createElement("div", { className: "btn-group", "data-toggle": "buttons" }, options.map((option) => (React.createElement("label", { key: `${option.value}`, className: `btn auto btn-default btn-md ${option.value === stringDefaultValue ? 'active' : ''}` },
|
|
8505
|
+
React.createElement("input", { type: "radio", ref: ref, value: option.value, defaultChecked: option.value === stringDefaultValue, ...rest }),
|
|
8507
8506
|
React.createElement("span", null, option.label))))),
|
|
8508
|
-
error
|
|
8507
|
+
error && React.createElement("small", { className: "form-message" }, error)));
|
|
8509
8508
|
});
|
|
8510
8509
|
RadioButtonGroup.displayName = 'RadioButtonGroup';
|
|
8511
8510
|
|