2023-10-02 12:06:35 -04:00
|
|
|
import { App, Widget } from '../../imports.js';
|
2023-10-08 00:43:35 -04:00
|
|
|
const { Revealer, Box, Window } = Widget;
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
export default ({
|
|
|
|
name,
|
2023-10-20 23:11:21 -04:00
|
|
|
child,
|
|
|
|
transition = 'slide_down',
|
|
|
|
onOpen = () => {},
|
|
|
|
...props
|
|
|
|
}) => {
|
|
|
|
const window = Window({
|
|
|
|
name,
|
|
|
|
popup: true,
|
|
|
|
visible: false,
|
|
|
|
layer: 'overlay',
|
|
|
|
...props,
|
2023-09-22 01:34:36 -04:00
|
|
|
|
2023-10-20 23:11:21 -04:00
|
|
|
child: Box({
|
2023-10-21 14:39:37 -04:00
|
|
|
style: `min-height:1px;
|
|
|
|
min-width:1px;
|
|
|
|
padding: 1px;`,
|
2023-10-20 23:11:21 -04:00
|
|
|
child: Revealer({
|
|
|
|
transition,
|
|
|
|
transitionDuration: 500,
|
|
|
|
connections: [[App, (rev, currentName, visible) => {
|
|
|
|
if (currentName === name) {
|
|
|
|
rev.reveal_child = visible;
|
|
|
|
onOpen(child);
|
2023-10-08 00:43:35 -04:00
|
|
|
|
2023-10-20 23:11:21 -04:00
|
|
|
if (visible && name !== 'overview')
|
|
|
|
App.openWindow('closer');
|
|
|
|
}
|
|
|
|
}]],
|
|
|
|
child: child,
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
window.getChild = () => child;
|
|
|
|
return window;
|
|
|
|
};
|