mirror of
https://github.com/anotherhadi/ilovetui.git
synced 2026-10-05 19:08:25 +02:00
+3
-1
@@ -18,6 +18,8 @@ function Modal(props) {
|
|||||||
const screenCap = () => Math.max(5, dimensions().height - 4);
|
const screenCap = () => Math.max(5, dimensions().height - 4);
|
||||||
const maxPanelHeight = () => Math.min(props.maxHeight ?? screenCap(), screenCap());
|
const maxPanelHeight = () => Math.min(props.maxHeight ?? screenCap(), screenCap());
|
||||||
const maxContentHeight = () => Math.max(1, maxPanelHeight() - 4);
|
const maxContentHeight = () => Math.max(1, maxPanelHeight() - 4);
|
||||||
|
const maxPanelWidth = () => Math.max(10, dimensions().width - 4);
|
||||||
|
const panelWidth = () => Math.min(props.width ?? 50, maxPanelWidth());
|
||||||
return _$createComponent(Portal, {
|
return _$createComponent(Portal, {
|
||||||
get children() {
|
get children() {
|
||||||
return _$createComponent(Show, {
|
return _$createComponent(Show, {
|
||||||
@@ -64,7 +66,7 @@ function Modal(props) {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
_$effect((_p$) => {
|
_$effect((_p$) => {
|
||||||
var _v$ = dimensions().width, _v$2 = dimensions().height, _v$3 = props.backdropColor ?? RGBA.fromInts(0, 0, 0, 150), _v$4 = theme.mouse ? props.onDismiss : undefined, _v$5 = props.width ?? 50, _v$6 = maxPanelHeight(), _v$7 = theme.borderStyle, _v$8 = props.accentColor ?? theme.primary, _v$9 = props.backgroundColor ?? theme.background, _v$0 = theme.mouse ? (event) => event.stopPropagation() : undefined;
|
var _v$ = dimensions().width, _v$2 = dimensions().height, _v$3 = props.backdropColor ?? RGBA.fromInts(0, 0, 0, 150), _v$4 = theme.mouse ? props.onDismiss : undefined, _v$5 = panelWidth(), _v$6 = maxPanelHeight(), _v$7 = theme.borderStyle, _v$8 = props.accentColor ?? theme.primary, _v$9 = props.backgroundColor ?? theme.background, _v$0 = theme.mouse ? (event) => event.stopPropagation() : undefined;
|
||||||
_v$ !== _p$.e && (_p$.e = _$setProp(_el$, "width", _v$, _p$.e));
|
_v$ !== _p$.e && (_p$.e = _$setProp(_el$, "width", _v$, _p$.e));
|
||||||
_v$2 !== _p$.t && (_p$.t = _$setProp(_el$, "height", _v$2, _p$.t));
|
_v$2 !== _p$.t && (_p$.t = _$setProp(_el$, "height", _v$2, _p$.t));
|
||||||
_v$3 !== _p$.a && (_p$.a = _$setProp(_el$, "backgroundColor", _v$3, _p$.a));
|
_v$3 !== _p$.a && (_p$.a = _$setProp(_el$, "backgroundColor", _v$3, _p$.a));
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// @bun
|
// @bun
|
||||||
import {
|
import {
|
||||||
Modal
|
Modal
|
||||||
} from "./chunk-8j8kdeb4.js";
|
} from "./chunk-7q3vke56.js";
|
||||||
import {
|
import {
|
||||||
helpOpen,
|
helpOpen,
|
||||||
toggleHelp
|
toggleHelp
|
||||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
// @bun
|
// @bun
|
||||||
import {
|
import {
|
||||||
HelpModal
|
HelpModal
|
||||||
} from "../chunk-ggv00s7t.js";
|
} from "../chunk-j3tzsq9q.js";
|
||||||
import"../chunk-8j8kdeb4.js";
|
import"../chunk-7q3vke56.js";
|
||||||
import"../chunk-9cbm4zqz.js";
|
import"../chunk-9cbm4zqz.js";
|
||||||
import"../chunk-hcq62p48.js";
|
import"../chunk-hcq62p48.js";
|
||||||
import"../chunk-cnhhssmz.js";
|
import"../chunk-cnhhssmz.js";
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// @bun
|
// @bun
|
||||||
import {
|
import {
|
||||||
Modal
|
Modal
|
||||||
} from "../chunk-8j8kdeb4.js";
|
} from "../chunk-7q3vke56.js";
|
||||||
import"../chunk-9cbm4zqz.js";
|
import"../chunk-9cbm4zqz.js";
|
||||||
import"../chunk-hcq62p48.js";
|
import"../chunk-hcq62p48.js";
|
||||||
import"../chunk-cnhhssmz.js";
|
import"../chunk-cnhhssmz.js";
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
// @bun
|
// @bun
|
||||||
import {
|
import {
|
||||||
HelpModal
|
HelpModal
|
||||||
} from "../chunk-ggv00s7t.js";
|
} from "../chunk-j3tzsq9q.js";
|
||||||
import"../chunk-8j8kdeb4.js";
|
import"../chunk-7q3vke56.js";
|
||||||
import {
|
import {
|
||||||
HelpBar
|
HelpBar
|
||||||
} from "../chunk-mj1hhxzy.js";
|
} from "../chunk-mj1hhxzy.js";
|
||||||
|
|||||||
Vendored
+1
-1
@@ -17,7 +17,7 @@ import {
|
|||||||
} from "../chunk-gc6m7gbw.js";
|
} from "../chunk-gc6m7gbw.js";
|
||||||
import {
|
import {
|
||||||
Modal
|
Modal
|
||||||
} from "../chunk-8j8kdeb4.js";
|
} from "../chunk-7q3vke56.js";
|
||||||
import {
|
import {
|
||||||
Badge
|
Badge
|
||||||
} from "../chunk-5my64v78.js";
|
} from "../chunk-5my64v78.js";
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ export function Modal(props: ModalProps) {
|
|||||||
const screenCap = () => Math.max(5, dimensions().height - 4);
|
const screenCap = () => Math.max(5, dimensions().height - 4);
|
||||||
const maxPanelHeight = () => Math.min(props.maxHeight ?? screenCap(), screenCap());
|
const maxPanelHeight = () => Math.min(props.maxHeight ?? screenCap(), screenCap());
|
||||||
const maxContentHeight = () => Math.max(1, maxPanelHeight() - 4);
|
const maxContentHeight = () => Math.max(1, maxPanelHeight() - 4);
|
||||||
|
const maxPanelWidth = () => Math.max(10, dimensions().width - 4);
|
||||||
|
const panelWidth = () => Math.min(props.width ?? 50, maxPanelWidth());
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Portal>
|
<Portal>
|
||||||
@@ -36,7 +38,7 @@ export function Modal(props: ModalProps) {
|
|||||||
onMouseDown={theme.mouse ? props.onDismiss : undefined}
|
onMouseDown={theme.mouse ? props.onDismiss : undefined}
|
||||||
>
|
>
|
||||||
<box
|
<box
|
||||||
width={props.width ?? 50}
|
width={panelWidth()}
|
||||||
maxHeight={maxPanelHeight()}
|
maxHeight={maxPanelHeight()}
|
||||||
border
|
border
|
||||||
borderStyle={theme.borderStyle}
|
borderStyle={theme.borderStyle}
|
||||||
|
|||||||
Reference in New Issue
Block a user