Fix responsive component import errors (#629)
This commit is contained in:
parent
5a373d94e4
commit
35ed2839fd
@ -1,6 +1,6 @@
|
|||||||
"""A file upload component."""
|
"""A file upload component."""
|
||||||
|
|
||||||
from typing import Dict
|
from typing import Dict, List, Optional
|
||||||
|
|
||||||
from pynecone.components.component import EVENT_ARG, Component
|
from pynecone.components.component import EVENT_ARG, Component
|
||||||
from pynecone.components.forms.input import Input
|
from pynecone.components.forms.input import Input
|
||||||
@ -18,6 +18,33 @@ class Upload(Component):
|
|||||||
|
|
||||||
tag = "ReactDropzone"
|
tag = "ReactDropzone"
|
||||||
|
|
||||||
|
# The list of accepted file types.
|
||||||
|
accept: Var[Optional[List[str]]]
|
||||||
|
|
||||||
|
# Whether the dropzone is disabled.
|
||||||
|
disabled: Var[bool]
|
||||||
|
|
||||||
|
# The maximum number of files that can be uploaded.
|
||||||
|
max_files: Var[int]
|
||||||
|
|
||||||
|
# The maximum file size (bytes) that can be uploaded.
|
||||||
|
max_size: Var[int]
|
||||||
|
|
||||||
|
# The minimum file size (bytes) that can be uploaded.
|
||||||
|
min_size: Var[int]
|
||||||
|
|
||||||
|
# Whether to allow multiple files to be uploaded.
|
||||||
|
multiple: Var[bool] = True # type: ignore
|
||||||
|
|
||||||
|
# Whether to disable click to upload.
|
||||||
|
no_click: Var[bool]
|
||||||
|
|
||||||
|
# Whether to disable drag and drop.
|
||||||
|
no_drag: Var[bool]
|
||||||
|
|
||||||
|
# Whether to disable using the space/enter keys to upload.
|
||||||
|
no_keyboard: Var[bool]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(cls, *children, **props) -> Component:
|
def create(cls, *children, **props) -> Component:
|
||||||
"""Create an upload component.
|
"""Create an upload component.
|
||||||
|
@ -20,4 +20,13 @@ from .spacer import Spacer
|
|||||||
from .stack import Hstack, Stack, Vstack
|
from .stack import Hstack, Stack, Vstack
|
||||||
from .wrap import Wrap, WrapItem
|
from .wrap import Wrap, WrapItem
|
||||||
|
|
||||||
__all__ = [f for f in dir() if f[0].isupper()] # type: ignore
|
helpers = [
|
||||||
|
"cond",
|
||||||
|
"desktop_only",
|
||||||
|
"mobile_and_tablet",
|
||||||
|
"mobile_only",
|
||||||
|
"tablet_and_desktop",
|
||||||
|
"tablet_only",
|
||||||
|
]
|
||||||
|
|
||||||
|
__all__ = [f for f in dir() if f[0].isupper()] + helpers # type: ignore
|
||||||
|
Loading…
Reference in New Issue
Block a user