diff --git a/pynecone/components/forms/upload.py b/pynecone/components/forms/upload.py index 5717a5d2d..81e69f937 100644 --- a/pynecone/components/forms/upload.py +++ b/pynecone/components/forms/upload.py @@ -1,6 +1,6 @@ """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.forms.input import Input @@ -18,6 +18,33 @@ class Upload(Component): 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 def create(cls, *children, **props) -> Component: """Create an upload component. diff --git a/pynecone/components/layout/__init__.py b/pynecone/components/layout/__init__.py index e29550588..a8654c139 100644 --- a/pynecone/components/layout/__init__.py +++ b/pynecone/components/layout/__init__.py @@ -20,4 +20,13 @@ from .spacer import Spacer from .stack import Hstack, Stack, Vstack 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