Rebuild all components
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s

This commit is contained in:
2026-04-21 18:00:17 +02:00
parent d900659d88
commit 16afea2768
67 changed files with 1820 additions and 2132 deletions

View File

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