Update new functions

This commit is contained in:
2026-04-06 03:19:15 +02:00
parent f9095332eb
commit 294547fc56
139 changed files with 2249 additions and 2109 deletions

View File

@@ -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),
]);
};