dataeditor.pyi 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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 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[()]] = None,
  173. on_cell_activated: Optional[
  174. Union[EventType[()], EventType[tuple[int, int]]]
  175. ] = None,
  176. on_cell_clicked: Optional[
  177. Union[EventType[()], EventType[tuple[int, int]]]
  178. ] = None,
  179. on_cell_context_menu: Optional[
  180. Union[EventType[()], EventType[tuple[int, int]]]
  181. ] = None,
  182. on_cell_edited: Optional[
  183. Union[
  184. EventType[()],
  185. EventType[tuple[int, int]],
  186. EventType[tuple[int, int], GridCell],
  187. ]
  188. ] = None,
  189. on_click: Optional[EventType[()]] = None,
  190. on_column_resize: Optional[
  191. Union[EventType[()], EventType[GridColumn], EventType[GridColumn, int]]
  192. ] = None,
  193. on_context_menu: Optional[EventType[()]] = None,
  194. on_delete: Optional[Union[EventType[()], EventType[GridSelection]]] = None,
  195. on_double_click: Optional[EventType[()]] = None,
  196. on_finished_editing: Optional[
  197. Union[
  198. EventType[()],
  199. EventType[Union[GridCell, None]],
  200. EventType[Union[GridCell, None], tuple[int, int]],
  201. ]
  202. ] = None,
  203. on_focus: Optional[EventType[()]] = None,
  204. on_group_header_clicked: Optional[
  205. Union[
  206. EventType[()],
  207. EventType[tuple[int, int]],
  208. EventType[tuple[int, int], GridCell],
  209. ]
  210. ] = None,
  211. on_group_header_context_menu: Optional[
  212. Union[
  213. EventType[()],
  214. EventType[int],
  215. EventType[int, GroupHeaderClickedEventArgs],
  216. ]
  217. ] = None,
  218. on_group_header_renamed: Optional[
  219. Union[EventType[()], EventType[str], EventType[str, str]]
  220. ] = None,
  221. on_header_clicked: Optional[
  222. Union[EventType[()], EventType[tuple[int, int]]]
  223. ] = None,
  224. on_header_context_menu: Optional[
  225. Union[EventType[()], EventType[tuple[int, int]]]
  226. ] = None,
  227. on_header_menu_click: Optional[
  228. Union[EventType[()], EventType[int], EventType[int, Rectangle]]
  229. ] = None,
  230. on_item_hovered: Optional[
  231. Union[EventType[()], EventType[tuple[int, int]]]
  232. ] = None,
  233. on_mount: Optional[EventType[()]] = None,
  234. on_mouse_down: Optional[EventType[()]] = None,
  235. on_mouse_enter: Optional[EventType[()]] = None,
  236. on_mouse_leave: Optional[EventType[()]] = None,
  237. on_mouse_move: Optional[EventType[()]] = None,
  238. on_mouse_out: Optional[EventType[()]] = None,
  239. on_mouse_over: Optional[EventType[()]] = None,
  240. on_mouse_up: Optional[EventType[()]] = None,
  241. on_row_appended: Optional[EventType[()]] = None,
  242. on_scroll: Optional[EventType[()]] = None,
  243. on_selection_cleared: Optional[EventType[()]] = None,
  244. on_unmount: Optional[EventType[()]] = None,
  245. **props,
  246. ) -> "DataEditor":
  247. """Create the DataEditor component.
  248. Args:
  249. *children: The children of the data editor.
  250. rows: Number of rows.
  251. columns: Headers of the columns for the data grid.
  252. data: The data.
  253. get_cell_content: The name of the callback used to find the data to display.
  254. get_cells_for_selection: Allow selection for copying.
  255. on_paste: Allow paste.
  256. draw_focus_ring: Controls the drawing of the focus ring.
  257. fixed_shadow_x: Enables or disables the overlay shadow when scrolling horizontally.
  258. fixed_shadow_y: Enables or disables the overlay shadow when scrolling vertically.
  259. freeze_columns: The number of columns which should remain in place when scrolling horizontally. Doesn't include rowMarkers.
  260. group_header_height: Controls the header of the group header row.
  261. header_height: Controls the height of the header row.
  262. max_column_auto_width: The maximum width a column can be automatically sized to.
  263. max_column_width: The maximum width a column can be resized to.
  264. min_column_width: The minimum width a column can be resized to.
  265. row_height: Determines the height of each row.
  266. row_markers: Kind of row markers.
  267. row_marker_start_index: Changes the starting index for row markers.
  268. row_marker_width: Sets the width of row markers in pixels, if unset row markers will automatically size.
  269. smooth_scroll_x: Enable horizontal smooth scrolling.
  270. smooth_scroll_y: Enable vertical smooth scrolling.
  271. vertical_border: Controls the drawing of the left hand vertical border of a column. If set to a boolean value it controls all borders.
  272. column_select: Allow columns selections. ("none", "single", "multi")
  273. prevent_diagonal_scrolling: Prevent diagonal scrolling.
  274. overscroll_x: Allow to scroll past the limit of the actual content on the horizontal axis.
  275. overscroll_y: Allow to scroll past the limit of the actual content on the vertical axis.
  276. scroll_offset_x: Initial scroll offset on the horizontal axis.
  277. scroll_offset_y: Initial scroll offset on the vertical axis.
  278. theme: global theme
  279. on_cell_activated: Fired when a cell is activated.
  280. on_cell_clicked: Fired when a cell is clicked.
  281. on_cell_context_menu: Fired when a cell is right-clicked.
  282. on_cell_edited: Fired when a cell is edited.
  283. on_group_header_clicked: Fired when a group header is clicked.
  284. on_group_header_context_menu: Fired when a group header is right-clicked.
  285. on_group_header_renamed: Fired when a group header is renamed.
  286. on_header_clicked: Fired when a header is clicked.
  287. on_header_context_menu: Fired when a header is right-clicked.
  288. on_header_menu_click: Fired when a header menu item is clicked.
  289. on_item_hovered: Fired when an item is hovered.
  290. on_delete: Fired when a selection is deleted.
  291. on_finished_editing: Fired when editing is finished.
  292. on_row_appended: Fired when a row is appended.
  293. on_selection_cleared: Fired when the selection is cleared.
  294. on_column_resize: Fired when a column is resized.
  295. style: The style of the component.
  296. key: A unique key for the component.
  297. id: The id for the component.
  298. class_name: The class name for the component.
  299. autofocus: Whether the component should take the focus once the page is loaded
  300. custom_attrs: custom attribute
  301. **props: The props of the data editor.
  302. Raises:
  303. ValueError: invalid input.
  304. Returns:
  305. The DataEditor component.&
  306. """
  307. ...
  308. @serializer
  309. def serialize_dataeditortheme(theme: DataEditorTheme): ...
  310. data_editor = DataEditor.create
  311. data_editor_theme = DataEditorTheme