Radio correction
This commit is contained in:
13
dist/sigpro-ui.umd.js
vendored
13
dist/sigpro-ui.umd.js
vendored
@@ -1101,26 +1101,25 @@ var SigProUI = (function (exports, sigpro) {
|
||||
|
||||
/** RADIO */
|
||||
const Radio = (props) => {
|
||||
const { label, tooltip, value, name, ...rest } = props;
|
||||
const { label, tooltip, value, inputValue, name, ...rest } = props;
|
||||
|
||||
const radioEl = sigpro.$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 = sigpro.$html("label", { class: "label cursor-pointer justify-start gap-3" }, [
|
||||
return sigpro.$html("label", { class: "label cursor-pointer justify-start gap-3" }, [
|
||||
radioEl,
|
||||
label ? sigpro.$html("span", { class: "label-text" }, label) : null,
|
||||
]);
|
||||
|
||||
return tooltip ? sigpro.$html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout;
|
||||
};
|
||||
|
||||
var RadioModule = /*#__PURE__*/Object.freeze({
|
||||
|
||||
Reference in New Issue
Block a user