changed to new functions
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s

This commit is contained in:
2026-04-22 12:06:34 +02:00
parent 5a5f593025
commit 59e6d972a8
125 changed files with 1934 additions and 2015 deletions

View File

@@ -1,10 +1,10 @@
// components/Modal.js
import { Tag, Watch } from "sigpro";
import { h, watch } from "sigpro";
export const Modal = (props) => {
let dialogRef = null;
Watch(() => {
watch(() => {
const isOpen = typeof props.open === "function" ? props.open() : props.open;
if (!dialogRef) return;
isOpen ? dialogRef.showModal() : dialogRef.close();
@@ -12,22 +12,22 @@ export const Modal = (props) => {
const close = () => typeof props.open === "function" && props.open(false);
return Tag("dialog", {
return h("dialog", {
...props,
ref: el => dialogRef = el,
class: `modal ${props.class ?? ''}`,
onclose: close,
oncancel: close
}, [
Tag("div", { class: "modal-box" }, [
props.title && Tag("h3", { class: "text-lg font-bold" }, props.title),
h("div", { class: "modal-box" }, [
props.title && h("h3", { class: "text-lg font-bold" }, props.title),
props.children,
Tag("div", { class: "modal-action" }, [
props.actions || Tag("button", { class: "btn", onclick: close }, "Cerrar")
h("div", { class: "modal-action" }, [
props.actions || h("button", { class: "btn", onclick: close }, "Cerrar")
])
]),
Tag("form", { method: "dialog", class: "modal-backdrop" }, [
Tag("button", {}, "close")
h("form", { method: "dialog", class: "modal-backdrop" }, [
h("button", {}, "close")
])
]);
};