|
@@ -1,11 +1,15 @@
|
|
|
import justpy as jp
|
|
|
-from typing import Callable, Union
|
|
|
+from typing import Callable, Literal, Union
|
|
|
from .element import Element
|
|
|
from ..utils import handle_exceptions, provide_arguments
|
|
|
|
|
|
class Input(Element):
|
|
|
|
|
|
- def __init__(self, placeholder: str = None, value: Union[str, float] = None, type: str = 'text', on_change: Callable = None):
|
|
|
+ def __init__(self,
|
|
|
+ placeholder: str = None,
|
|
|
+ value: Union[str, float] = None,
|
|
|
+ type: Literal['text', 'number'] = 'text',
|
|
|
+ on_change: Callable = None):
|
|
|
|
|
|
view = jp.QInput(placeholder=placeholder, type=type)
|
|
|
|