Update new functions
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// components/Swap.js
|
||||
import { $html } from "../sigpro.js";
|
||||
import { Tag } from "../sigpro.js";
|
||||
import { ui, val } from "../core/utils.js";
|
||||
|
||||
/**
|
||||
@@ -12,8 +12,8 @@ import { ui, val } from "../core/utils.js";
|
||||
export const Swap = (props) => {
|
||||
const { class: className, value, on, off, ...rest } = props;
|
||||
|
||||
return $html("label", { ...rest, class: ui('swap', className) }, [
|
||||
$html("input", {
|
||||
return Tag("label", { ...rest, class: ui('swap', className) }, [
|
||||
Tag("input", {
|
||||
type: "checkbox",
|
||||
checked: () => val(value), // ← FUNCIÓN: se reevalúa cuando la señal cambia
|
||||
onclick: (e) => {
|
||||
@@ -22,7 +22,7 @@ export const Swap = (props) => {
|
||||
}
|
||||
}
|
||||
}),
|
||||
$html("div", { class: "swap-on" }, on),
|
||||
$html("div", { class: "swap-off" }, off),
|
||||
Tag("div", { class: "swap-on" }, on),
|
||||
Tag("div", { class: "swap-off" }, off),
|
||||
]);
|
||||
};
|
||||
Reference in New Issue
Block a user