added stuff

This commit is contained in:
vali 2024-04-09 23:11:33 +02:00
commit 236b8c2a6b
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,53 @@
import { App, Widget, Utils } from "../imports.js";
const { Box, Revealer, Window } = Widget;
export default ({
onOpen = () => {},
onClose = () => {},
name,
child,
transition = "slide_up",
transitionDuration = 250,
...props
}) => {
const window = Window({
name,
visible: false,
...props,
child: Box({
css: `
min-height: 2px;
min-width: 2px;
`,
child: Revealer({
transition,
transitionDuration,
child: child || Box(),
setup: (self) => {
self.hook(App, (rev, currentName, isOpen) => {
if (currentName === name) {
rev.revealChild = isOpen;
if (isOpen) {
onOpen(window);
} else {
Utils.timeout(transitionDuration, () => {
onClose(window);
});
}
}
});
},
}),
}),
});
window.getChild = () => window.child.children[0].child;
window.setChild = (newChild) => {
window.child.children[0].child = newChild;
window.child.children[0].show_all();
};
return window;
};