dataeditor.pyi 12 KB

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