File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed
Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 11"""A file upload component."""
22
3- from typing import Dict
3+ from typing import Dict , List , Optional
44
55from pynecone .components .component import EVENT_ARG , Component
66from 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.
Original file line number Diff line number Diff line change 2020from .stack import Hstack , Stack , Vstack
2121from .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
You can’t perform that action at this time.
0 commit comments