|
6 | 6 | from pathlib import Path |
7 | 7 | from typing import Any, ClassVar, Dict, List, Optional, Union, overload |
8 | 8 |
|
| 9 | +from reflex.components.base.fragment import Fragment |
9 | 10 | from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf |
10 | 11 | from reflex.constants import Dirs |
11 | 12 | from reflex.event import BASE_STATE, CallableEventSpec, EventSpec, EventType |
@@ -84,6 +85,56 @@ class UploadFilesProvider(Component): |
84 | 85 | """ |
85 | 86 | ... |
86 | 87 |
|
| 88 | +class GhostUpload(Fragment): |
| 89 | + @overload |
| 90 | + @classmethod |
| 91 | + def create( # type: ignore |
| 92 | + cls, |
| 93 | + *children, |
| 94 | + style: Optional[Style] = None, |
| 95 | + key: Optional[Any] = None, |
| 96 | + id: Optional[Any] = None, |
| 97 | + class_name: Optional[Any] = None, |
| 98 | + autofocus: Optional[bool] = None, |
| 99 | + custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, |
| 100 | + on_blur: Optional[EventType[[], BASE_STATE]] = None, |
| 101 | + on_click: Optional[EventType[[], BASE_STATE]] = None, |
| 102 | + on_context_menu: Optional[EventType[[], BASE_STATE]] = None, |
| 103 | + on_double_click: Optional[EventType[[], BASE_STATE]] = None, |
| 104 | + on_drop: Optional[ |
| 105 | + Union[EventType[[], BASE_STATE], EventType[[Any], BASE_STATE]] |
| 106 | + ] = None, |
| 107 | + on_focus: Optional[EventType[[], BASE_STATE]] = None, |
| 108 | + on_mount: Optional[EventType[[], BASE_STATE]] = None, |
| 109 | + on_mouse_down: Optional[EventType[[], BASE_STATE]] = None, |
| 110 | + on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None, |
| 111 | + on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None, |
| 112 | + on_mouse_move: Optional[EventType[[], BASE_STATE]] = None, |
| 113 | + on_mouse_out: Optional[EventType[[], BASE_STATE]] = None, |
| 114 | + on_mouse_over: Optional[EventType[[], BASE_STATE]] = None, |
| 115 | + on_mouse_up: Optional[EventType[[], BASE_STATE]] = None, |
| 116 | + on_scroll: Optional[EventType[[], BASE_STATE]] = None, |
| 117 | + on_unmount: Optional[EventType[[], BASE_STATE]] = None, |
| 118 | + **props, |
| 119 | + ) -> "GhostUpload": |
| 120 | + """Create the component. |
| 121 | +
|
| 122 | + Args: |
| 123 | + *children: The children of the component. |
| 124 | + on_drop: Fired when files are dropped. |
| 125 | + style: The style of the component. |
| 126 | + key: A unique key for the component. |
| 127 | + id: The id for the component. |
| 128 | + class_name: The class name for the component. |
| 129 | + autofocus: Whether the component should take the focus once the page is loaded |
| 130 | + custom_attrs: custom attribute |
| 131 | + **props: The props of the component. |
| 132 | +
|
| 133 | + Returns: |
| 134 | + The component. |
| 135 | + """ |
| 136 | + ... |
| 137 | + |
87 | 138 | class Upload(MemoizationLeaf): |
88 | 139 | is_used: ClassVar[bool] = False |
89 | 140 |
|
|
0 commit comments