Radio correction

This commit is contained in:
2026-03-31 19:38:10 +02:00
parent 3de48fe222
commit dcfd7b67b6
6 changed files with 28 additions and 31 deletions

13
dist/sigpro-ui.esm.js vendored
View File

@@ -1100,26 +1100,25 @@ var NavbarModule = /*#__PURE__*/Object.freeze({
/** RADIO */
const Radio = (props) => {
const { label, tooltip, value, name, ...rest } = props;
const { label, tooltip, value, inputValue, name, ...rest } = props;
const radioEl = $html("input", {
...rest,
type: "radio",
name: name,
class: joinClass("radio", props.class),
checked: () => val(value) === props.value,
disabled: () => val(props.disabled),
onclick: () => typeof value === "function" && value(props.value),
checked: () => val(value) === inputValue,
onclick: () => {
if (typeof value === "function") value(inputValue);
},
});
if (!label && !tooltip) return radioEl;
const layout = $html("label", { class: "label cursor-pointer justify-start gap-3" }, [
return $html("label", { class: "label cursor-pointer justify-start gap-3" }, [
radioEl,
label ? $html("span", { class: "label-text" }, label) : null,
]);
return tooltip ? $html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout;
};
var RadioModule = /*#__PURE__*/Object.freeze({