Преглед на файлове

Fix responsive component import errors (#629)

Nikhil Rao преди 2 години
родител
ревизия
35ed2839fd
променени са 2 файла, в които са добавени 38 реда и са изтрити 2 реда
  1. 28 1
      pynecone/components/forms/upload.py
  2. 10 1
      pynecone/components/layout/__init__.py

+ 28 - 1
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.

+ 10 - 1
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