mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Change reactable type
This commit is contained in:
@@ -414,10 +414,6 @@ class App(Generic[ReturnType], DOMNode):
|
|||||||
"""ReturnType | None: The return type of the app."""
|
"""ReturnType | None: The return type of the app."""
|
||||||
return self._return_value
|
return self._return_value
|
||||||
|
|
||||||
def _post_mount(self):
|
|
||||||
"""Called after the object has been mounted."""
|
|
||||||
Reactive._initialize_object(self)
|
|
||||||
|
|
||||||
def animate(
|
def animate(
|
||||||
self,
|
self,
|
||||||
attribute: str,
|
attribute: str,
|
||||||
|
|||||||
@@ -210,6 +210,10 @@ class DOMNode(MessagePump):
|
|||||||
styles = self._component_styles[name]
|
styles = self._component_styles[name]
|
||||||
return styles
|
return styles
|
||||||
|
|
||||||
|
def _post_mount(self):
|
||||||
|
"""Called after the object has been mounted."""
|
||||||
|
Reactive._initialize_object(self)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _node_bases(self) -> Iterator[Type[DOMNode]]:
|
def _node_bases(self) -> Iterator[Type[DOMNode]]:
|
||||||
"""Iterator[Type[DOMNode]]: The DOMNode bases classes (including self.__class__)"""
|
"""Iterator[Type[DOMNode]]: The DOMNode bases classes (including self.__class__)"""
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ from typing import (
|
|||||||
Generic,
|
Generic,
|
||||||
Type,
|
Type,
|
||||||
TypeVar,
|
TypeVar,
|
||||||
Union,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
import rich.repr
|
import rich.repr
|
||||||
@@ -21,10 +20,9 @@ from ._callback import count_parameters
|
|||||||
from ._types import MessageTarget
|
from ._types import MessageTarget
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .app import App
|
from .dom import DOMNode
|
||||||
from .widget import Widget
|
|
||||||
|
|
||||||
Reactable = Union[Widget, App]
|
Reactable = DOMNode
|
||||||
|
|
||||||
ReactiveType = TypeVar("ReactiveType")
|
ReactiveType = TypeVar("ReactiveType")
|
||||||
|
|
||||||
|
|||||||
@@ -360,10 +360,6 @@ class Widget(DOMNode):
|
|||||||
def offset(self, offset: Offset) -> None:
|
def offset(self, offset: Offset) -> None:
|
||||||
self.styles.offset = ScalarOffset.from_offset(offset)
|
self.styles.offset = ScalarOffset.from_offset(offset)
|
||||||
|
|
||||||
def _post_mount(self):
|
|
||||||
"""Called after the object has been mounted."""
|
|
||||||
Reactive._initialize_object(self)
|
|
||||||
|
|
||||||
ExpectType = TypeVar("ExpectType", bound="Widget")
|
ExpectType = TypeVar("ExpectType", bound="Widget")
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
|
|||||||
Reference in New Issue
Block a user