dataeditor.pyi 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. """Stub file for reflex/components/datadisplay/dataeditor.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from enum import Enum
  6. from typing import Any, Dict, List, Literal, Optional, Union, overload
  7. from typing_extensions import TypedDict
  8. from reflex.base import Base
  9. from reflex.components.component import NoSSRComponent
  10. from reflex.event import BASE_STATE, EventType
  11. from reflex.style import Style
  12. from reflex.utils.imports import ImportDict
  13. from reflex.utils.serializers import serializer
  14. from reflex.vars.base import Var
  15. class GridColumnIcons(Enum):
  16. Array = "array"
  17. AudioUri = "audio_uri"
  18. Boolean = "boolean"
  19. HeaderCode = "code"
  20. Date = "date"
  21. Email = "email"
  22. Emoji = "emoji"
  23. GeoDistance = "geo_distance"
  24. IfThenElse = "if_then_else"
  25. Image = "image"
  26. JoinStrings = "join_strings"
  27. Lookup = "lookup"
  28. Markdown = "markdown"
  29. Math = "math"
  30. Number = "number"
  31. Phone = "phone"
  32. Reference = "reference"
  33. Rollup = "rollup"
  34. RowID = "row_id"
  35. SingleValue = "single_value"
  36. SplitString = "split_string"
  37. String = "string"
  38. TextTemplate = "text_template"
  39. Time = "time"
  40. Uri = "uri"
  41. VideoUri = "video_uri"
  42. class DataEditorTheme(Base):
  43. accent_color: Optional[str]
  44. accent_fg: Optional[str]
  45. accent_light: Optional[str]
  46. base_font_style: Optional[str]
  47. bg_bubble: Optional[str]
  48. bg_bubble_selected: Optional[str]
  49. bg_cell: Optional[str]
  50. bg_cell_medium: Optional[str]
  51. bg_header: Optional[str]
  52. bg_header_has_focus: Optional[str]
  53. bg_header_hovered: Optional[str]
  54. bg_icon_header: Optional[str]
  55. bg_search_result: Optional[str]
  56. border_color: Optional[str]
  57. cell_horizontal_padding: Optional[int]
  58. cell_vertical_padding: Optional[int]
  59. drilldown_border: Optional[str]
  60. editor_font_size: Optional[str]
  61. fg_icon_header: Optional[str]
  62. font_family: Optional[str]
  63. header_bottom_border_color: Optional[str]
  64. header_font_style: Optional[str]
  65. horizontal_border_color: Optional[str]
  66. line_height: Optional[int]
  67. link_color: Optional[str]
  68. text_bubble: Optional[str]
  69. text_dark: Optional[str]
  70. text_group_header: Optional[str]
  71. text_header: Optional[str]
  72. text_header_selected: Optional[str]
  73. text_light: Optional[str]
  74. text_medium: Optional[str]
  75. class Bounds(TypedDict):
  76. x: int
  77. y: int
  78. width: int
  79. height: int
  80. class CompatSelection(TypedDict):
  81. items: list
  82. class Rectangle(TypedDict):
  83. x: int
  84. y: int
  85. width: int
  86. height: int
  87. class GridSelectionCurrent(TypedDict):
  88. cell: tuple[int, int]
  89. range: Rectangle
  90. rangeStack: list[Rectangle]
  91. class GridSelection(TypedDict):
  92. current: Optional[GridSelectionCurrent]
  93. columns: CompatSelection
  94. rows: CompatSelection
  95. class GroupHeaderClickedEventArgs(TypedDict):
  96. kind: str
  97. group: str
  98. location: tuple[int, int]
  99. bounds: Bounds
  100. isEdge: bool
  101. shiftKey: bool
  102. ctrlKey: bool
  103. metaKey: bool
  104. isTouch: bool
  105. localEventX: int
  106. localEventY: int
  107. button: int
  108. buttons: int
  109. scrollEdge: tuple[int, int]
  110. class GridCell(TypedDict):
  111. span: Optional[List[int]]
  112. class GridColumn(TypedDict):
  113. title: str
  114. group: Optional[str]
  115. class DataEditor(NoSSRComponent):
  116. def add_imports(self) -> ImportDict: ...
  117. def add_hooks(self) -> list[str]: ...
  118. @overload
  119. @classmethod
  120. def create( # type: ignore
  121. cls,
  122. *children,
  123. rows: Optional[Union[Var[int], int]] = None,
  124. columns: Optional[
  125. Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]
  126. ] = None,
  127. data: Optional[Union[List[List[Any]], Var[List[List[Any]]]]] = None,
  128. get_cell_content: Optional[Union[Var[str], str]] = None,
  129. get_cells_for_selection: Optional[Union[Var[bool], bool]] = None,
  130. on_paste: Optional[Union[Var[bool], bool]] = None,
  131. draw_focus_ring: Optional[Union[Var[bool], bool]] = None,
  132. fixed_shadow_x: Optional[Union[Var[bool], bool]] = None,
  133. fixed_shadow_y: Optional[Union[Var[bool], bool]] = None,
  134. freeze_columns: Optional[Union[Var[int], int]] = None,
  135. group_header_height: Optional[Union[Var[int], int]] = None,
  136. header_height: Optional[Union[Var[int], int]] = None,
  137. max_column_auto_width: Optional[Union[Var[int], int]] = None,
  138. max_column_width: Optional[Union[Var[int], int]] = None,
  139. min_column_width: Optional[Union[Var[int], int]] = None,
  140. row_height: Optional[Union[Var[int], int]] = None,
  141. row_markers: Optional[
  142. Union[
  143. Literal["both", "checkbox", "clickable-number", "none", "number"],
  144. Var[Literal["both", "checkbox", "clickable-number", "none", "number"]],
  145. ]
  146. ] = None,
  147. row_marker_start_index: Optional[Union[Var[int], int]] = None,
  148. row_marker_width: Optional[Union[Var[int], int]] = None,
  149. smooth_scroll_x: Optional[Union[Var[bool], bool]] = None,
  150. smooth_scroll_y: Optional[Union[Var[bool], bool]] = None,
  151. vertical_border: Optional[Union[Var[bool], bool]] = None,
  152. column_select: Optional[
  153. Union[
  154. Literal["multi", "none", "single"],
  155. Var[Literal["multi", "none", "single"]],
  156. ]
  157. ] = None,
  158. prevent_diagonal_scrolling: Optional[Union[Var[bool], bool]] = None,
  159. overscroll_x: Optional[Union[Var[int], int]] = None,
  160. overscroll_y: Optional[Union[Var[int], int]] = None,
  161. scroll_offset_x: Optional[Union[Var[int], int]] = None,
  162. scroll_offset_y: Optional[Union[Var[int], int]] = None,
  163. theme: Optional[
  164. Union[DataEditorTheme, Dict, Var[Union[DataEditorTheme, Dict]]]
  165. ] = None,
  166. style: Optional[Style] = None,
  167. key: Optional[Any] = None,
  168. id: Optional[Any] = None,
  169. class_name: Optional[Any] = None,
  170. autofocus: Optional[bool] = None,
  171. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  172. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  173. on_cell_activated: Optional[
  174. Union[EventType[[], BASE_STATE], EventType[[tuple[int, int]], BASE_STATE]]
  175. ] = None,
  176. on_cell_clicked: Optional[
  177. Union[EventType[[], BASE_STATE], EventType[[tuple[int, int]], BASE_STATE]]
  178. ] = None,
  179. on_cell_context_menu: Optional[
  180. Union[EventType[[], BASE_STATE], EventType[[tuple[int, int]], BASE_STATE]]
  181. ] = None,
  182. on_cell_edited: Optional[
  183. Union[
  184. EventType[[], BASE_STATE],
  185. EventType[[tuple[int, int]], BASE_STATE],
  186. EventType[[tuple[int, int], GridCell], BASE_STATE],
  187. ]
  188. ] = None,
  189. on_click: Optional[EventType[[], BASE_STATE]] = None,
  190. on_column_resize: Optional[
  191. Union[
  192. EventType[[], BASE_STATE],
  193. EventType[[GridColumn], BASE_STATE],
  194. EventType[[GridColumn, int], BASE_STATE],
  195. ]
  196. ] = None,
  197. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  198. on_delete: Optional[
  199. Union[EventType[[], BASE_STATE], EventType[[GridSelection], BASE_STATE]]
  200. ] = None,
  201. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  202. on_finished_editing: Optional[
  203. Union[
  204. EventType[[], BASE_STATE],
  205. EventType[[Union[GridCell, None]], BASE_STATE],
  206. EventType[[Union[GridCell, None], tuple[int, int]], BASE_STATE],
  207. ]
  208. ] = None,
  209. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  210. on_group_header_clicked: Optional[
  211. Union[
  212. EventType[[], BASE_STATE],
  213. EventType[[tuple[int, int]], BASE_STATE],
  214. EventType[[tuple[int, int], GridCell], BASE_STATE],
  215. ]
  216. ] = None,
  217. on_group_header_context_menu: Optional[
  218. Union[
  219. EventType[[], BASE_STATE],
  220. EventType[[int], BASE_STATE],
  221. EventType[[int, GroupHeaderClickedEventArgs], BASE_STATE],
  222. ]
  223. ] = None,
  224. on_group_header_renamed: Optional[
  225. Union[
  226. EventType[[], BASE_STATE],
  227. EventType[[str], BASE_STATE],
  228. EventType[[str, str], BASE_STATE],
  229. ]
  230. ] = None,
  231. on_header_clicked: Optional[
  232. Union[EventType[[], BASE_STATE], EventType[[tuple[int, int]], BASE_STATE]]
  233. ] = None,
  234. on_header_context_menu: Optional[
  235. Union[EventType[[], BASE_STATE], EventType[[tuple[int, int]], BASE_STATE]]
  236. ] = None,
  237. on_header_menu_click: Optional[
  238. Union[
  239. EventType[[], BASE_STATE],
  240. EventType[[int], BASE_STATE],
  241. EventType[[int, Rectangle], BASE_STATE],
  242. ]
  243. ] = None,
  244. on_item_hovered: Optional[
  245. Union[EventType[[], BASE_STATE], EventType[[tuple[int, int]], BASE_STATE]]
  246. ] = None,
  247. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  248. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  249. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  250. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  251. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  252. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  253. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  254. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  255. on_row_appended: Optional[EventType[[], BASE_STATE]] = None,
  256. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  257. on_selection_cleared: Optional[EventType[[], BASE_STATE]] = None,
  258. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  259. **props,
  260. ) -> "DataEditor":
  261. """Create the DataEditor component.
  262. Args:
  263. *children: The children of the data editor.
  264. rows: Number of rows.
  265. columns: Headers of the columns for the data grid.
  266. data: The data.
  267. get_cell_content: The name of the callback used to find the data to display.
  268. get_cells_for_selection: Allow selection for copying.
  269. on_paste: Allow paste.
  270. draw_focus_ring: Controls the drawing of the focus ring.
  271. fixed_shadow_x: Enables or disables the overlay shadow when scrolling horizontally.
  272. fixed_shadow_y: Enables or disables the overlay shadow when scrolling vertically.
  273. freeze_columns: The number of columns which should remain in place when scrolling horizontally. Doesn't include rowMarkers.
  274. group_header_height: Controls the header of the group header row.
  275. header_height: Controls the height of the header row.
  276. max_column_auto_width: The maximum width a column can be automatically sized to.
  277. max_column_width: The maximum width a column can be resized to.
  278. min_column_width: The minimum width a column can be resized to.
  279. row_height: Determines the height of each row.
  280. row_markers: Kind of row markers.
  281. row_marker_start_index: Changes the starting index for row markers.
  282. row_marker_width: Sets the width of row markers in pixels, if unset row markers will automatically size.
  283. smooth_scroll_x: Enable horizontal smooth scrolling.
  284. smooth_scroll_y: Enable vertical smooth scrolling.
  285. vertical_border: Controls the drawing of the left hand vertical border of a column. If set to a boolean value it controls all borders.
  286. column_select: Allow columns selections. ("none", "single", "multi")
  287. prevent_diagonal_scrolling: Prevent diagonal scrolling.
  288. overscroll_x: Allow to scroll past the limit of the actual content on the horizontal axis.
  289. overscroll_y: Allow to scroll past the limit of the actual content on the vertical axis.
  290. scroll_offset_x: Initial scroll offset on the horizontal axis.
  291. scroll_offset_y: Initial scroll offset on the vertical axis.
  292. theme: global theme
  293. on_cell_activated: Fired when a cell is activated.
  294. on_cell_clicked: Fired when a cell is clicked.
  295. on_cell_context_menu: Fired when a cell is right-clicked.
  296. on_cell_edited: Fired when a cell is edited.
  297. on_group_header_clicked: Fired when a group header is clicked.
  298. on_group_header_context_menu: Fired when a group header is right-clicked.
  299. on_group_header_renamed: Fired when a group header is renamed.
  300. on_header_clicked: Fired when a header is clicked.
  301. on_header_context_menu: Fired when a header is right-clicked.
  302. on_header_menu_click: Fired when a header menu item is clicked.
  303. on_item_hovered: Fired when an item is hovered.
  304. on_delete: Fired when a selection is deleted.
  305. on_finished_editing: Fired when editing is finished.
  306. on_row_appended: Fired when a row is appended.
  307. on_selection_cleared: Fired when the selection is cleared.
  308. on_column_resize: Fired when a column is resized.
  309. style: The style of the component.
  310. key: A unique key for the component.
  311. id: The id for the component.
  312. class_name: The class name for the component.
  313. autofocus: Whether the component should take the focus once the page is loaded
  314. custom_attrs: custom attribute
  315. **props: The props of the data editor.
  316. Raises:
  317. ValueError: invalid input.
  318. Returns:
  319. The DataEditor component.&
  320. """
  321. ...
  322. @serializer
  323. def serialize_dataeditortheme(theme: DataEditorTheme): ...
  324. data_editor = DataEditor.create
  325. data_editor_theme = DataEditorTheme