Skip to content

Commit 35ed283

Browse files
authored
Fix responsive component import errors (#629)
1 parent 5a373d9 commit 35ed283

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

pynecone/components/forms/upload.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""A file upload component."""
22

3-
from typing import Dict
3+
from typing import Dict, List, Optional
44

55
from pynecone.components.component import EVENT_ARG, Component
66
from pynecone.components.forms.input import Input
@@ -18,6 +18,33 @@ class Upload(Component):
1818

1919
tag = "ReactDropzone"
2020

21+
# The list of accepted file types.
22+
accept: Var[Optional[List[str]]]
23+
24+
# Whether the dropzone is disabled.
25+
disabled: Var[bool]
26+
27+
# The maximum number of files that can be uploaded.
28+
max_files: Var[int]
29+
30+
# The maximum file size (bytes) that can be uploaded.
31+
max_size: Var[int]
32+
33+
# The minimum file size (bytes) that can be uploaded.
34+
min_size: Var[int]
35+
36+
# Whether to allow multiple files to be uploaded.
37+
multiple: Var[bool] = True # type: ignore
38+
39+
# Whether to disable click to upload.
40+
no_click: Var[bool]
41+
42+
# Whether to disable drag and drop.
43+
no_drag: Var[bool]
44+
45+
# Whether to disable using the space/enter keys to upload.
46+
no_keyboard: Var[bool]
47+
2148
@classmethod
2249
def create(cls, *children, **props) -> Component:
2350
"""Create an upload component.

pynecone/components/layout/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,13 @@
2020
from .stack import Hstack, Stack, Vstack
2121
from .wrap import Wrap, WrapItem
2222

23-
__all__ = [f for f in dir() if f[0].isupper()] # type: ignore
23+
helpers = [
24+
"cond",
25+
"desktop_only",
26+
"mobile_and_tablet",
27+
"mobile_only",
28+
"tablet_and_desktop",
29+
"tablet_only",
30+
]
31+
32+
__all__ = [f for f in dir() if f[0].isupper()] + helpers # type: ignore

0 commit comments

Comments
 (0)