dataeditor.pyi 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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, Callable, Dict, List, Literal, Optional, Union, overload
  7. from reflex.base import Base
  8. from reflex.components.component import NoSSRComponent
  9. from reflex.event import EventHandler, EventSpec
  10. from reflex.ivars.base import ImmutableVar
  11. from reflex.style import Style
  12. from reflex.utils.imports import ImportDict
  13. from reflex.utils.serializers import serializer
  14. from reflex.vars 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. def on_edit_spec(pos, data: dict[str, Any]): ...
  76. class DataEditor(NoSSRComponent):
  77. def add_imports(self) -> ImportDict: ...
  78. def add_hooks(self) -> list[str]: ...
  79. @overload
  80. @classmethod
  81. def create( # type: ignore
  82. cls,
  83. *children,
  84. rows: Optional[Union[Var[int], int]] = None,
  85. columns: Optional[
  86. Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]
  87. ] = None,
  88. data: Optional[Union[Var[List[List[Any]]], List[List[Any]]]] = None,
  89. get_cell_content: Optional[Union[Var[str], str]] = None,
  90. get_cell_for_selection: Optional[Union[Var[bool], bool]] = None,
  91. on_paste: Optional[Union[Var[bool], bool]] = None,
  92. draw_focus_ring: Optional[Union[Var[bool], bool]] = None,
  93. fixed_shadow_x: Optional[Union[Var[bool], bool]] = None,
  94. fixed_shadow_y: Optional[Union[Var[bool], bool]] = None,
  95. freeze_columns: Optional[Union[Var[int], int]] = None,
  96. group_header_height: Optional[Union[Var[int], int]] = None,
  97. header_height: Optional[Union[Var[int], int]] = None,
  98. max_column_auto_width: Optional[Union[Var[int], int]] = None,
  99. max_column_width: Optional[Union[Var[int], int]] = None,
  100. min_column_width: Optional[Union[Var[int], int]] = None,
  101. row_height: Optional[Union[Var[int], int]] = None,
  102. row_markers: Optional[
  103. Union[
  104. Var[Literal["none", "number", "checkbox", "both", "clickable-number"]],
  105. Literal["none", "number", "checkbox", "both", "clickable-number"],
  106. ]
  107. ] = None,
  108. row_marker_start_index: Optional[Union[Var[int], int]] = None,
  109. row_marker_width: Optional[Union[Var[int], int]] = None,
  110. smooth_scroll_x: Optional[Union[Var[bool], bool]] = None,
  111. smooth_scroll_y: Optional[Union[Var[bool], bool]] = None,
  112. vertical_border: Optional[Union[Var[bool], bool]] = None,
  113. column_select: Optional[
  114. Union[
  115. Var[Literal["none", "single", "multi"]],
  116. Literal["none", "single", "multi"],
  117. ]
  118. ] = None,
  119. prevent_diagonal_scrolling: Optional[Union[Var[bool], bool]] = None,
  120. overscroll_x: Optional[Union[Var[int], int]] = None,
  121. overscroll_y: Optional[Union[Var[int], int]] = None,
  122. scroll_offset_x: Optional[Union[Var[int], int]] = None,
  123. scroll_offset_y: Optional[Union[Var[int], int]] = None,
  124. theme: Optional[
  125. Union[Var[Union[DataEditorTheme, Dict]], DataEditorTheme, Dict]
  126. ] = None,
  127. style: Optional[Style] = None,
  128. key: Optional[Any] = None,
  129. id: Optional[Any] = None,
  130. class_name: Optional[Any] = None,
  131. autofocus: Optional[bool] = None,
  132. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  133. on_blur: Optional[
  134. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  135. ] = None,
  136. on_cell_activated: Optional[
  137. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  138. ] = None,
  139. on_cell_clicked: Optional[
  140. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  141. ] = None,
  142. on_cell_context_menu: Optional[
  143. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  144. ] = None,
  145. on_cell_edited: Optional[
  146. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  147. ] = None,
  148. on_click: Optional[
  149. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  150. ] = None,
  151. on_column_resize: Optional[
  152. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  153. ] = None,
  154. on_context_menu: Optional[
  155. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  156. ] = None,
  157. on_delete: Optional[
  158. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  159. ] = None,
  160. on_double_click: Optional[
  161. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  162. ] = None,
  163. on_finished_editing: Optional[
  164. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  165. ] = None,
  166. on_focus: Optional[
  167. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  168. ] = None,
  169. on_group_header_clicked: Optional[
  170. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  171. ] = None,
  172. on_group_header_context_menu: Optional[
  173. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  174. ] = None,
  175. on_group_header_renamed: Optional[
  176. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  177. ] = None,
  178. on_header_clicked: Optional[
  179. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  180. ] = None,
  181. on_header_context_menu: Optional[
  182. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  183. ] = None,
  184. on_header_menu_click: Optional[
  185. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  186. ] = None,
  187. on_item_hovered: Optional[
  188. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  189. ] = None,
  190. on_mount: Optional[
  191. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  192. ] = None,
  193. on_mouse_down: Optional[
  194. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  195. ] = None,
  196. on_mouse_enter: Optional[
  197. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  198. ] = None,
  199. on_mouse_leave: Optional[
  200. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  201. ] = None,
  202. on_mouse_move: Optional[
  203. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  204. ] = None,
  205. on_mouse_out: Optional[
  206. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  207. ] = None,
  208. on_mouse_over: Optional[
  209. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  210. ] = None,
  211. on_mouse_up: Optional[
  212. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  213. ] = None,
  214. on_row_appended: Optional[
  215. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  216. ] = None,
  217. on_scroll: Optional[
  218. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  219. ] = None,
  220. on_selection_cleared: Optional[
  221. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  222. ] = None,
  223. on_unmount: Optional[
  224. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  225. ] = None,
  226. **props,
  227. ) -> "DataEditor":
  228. """Create the DataEditor component.
  229. Args:
  230. *children: The children of the data editor.
  231. rows: Number of rows.
  232. columns: Headers of the columns for the data grid.
  233. data: The data.
  234. get_cell_content: The name of the callback used to find the data to display.
  235. get_cell_for_selection: Allow selection for copying.
  236. on_paste: Allow paste.
  237. draw_focus_ring: Controls the drawing of the focus ring.
  238. fixed_shadow_x: Enables or disables the overlay shadow when scrolling horizontally.
  239. fixed_shadow_y: Enables or disables the overlay shadow when scrolling vertically.
  240. freeze_columns: The number of columns which should remain in place when scrolling horizontally. Doesn't include rowMarkers.
  241. group_header_height: Controls the header of the group header row.
  242. header_height: Controls the height of the header row.
  243. max_column_auto_width: Additional header icons: header_icons: Var[Any] # (TODO: must be a map of name: svg) The maximum width a column can be automatically sized to.
  244. max_column_width: The maximum width a column can be resized to.
  245. min_column_width: The minimum width a column can be resized to.
  246. row_height: Determins the height of each row.
  247. row_markers: Kind of row markers.
  248. row_marker_start_index: Changes the starting index for row markers.
  249. row_marker_width: Sets the width of row markers in pixels, if unset row markers will automatically size.
  250. smooth_scroll_x: Enable horizontal smooth scrolling.
  251. smooth_scroll_y: Enable vertical smooth scrolling.
  252. vertical_border: Controls the drawing of the left hand vertical border of a column. If set to a boolean value it controls all borders.
  253. column_select: Allow columns selections. ("none", "single", "multi")
  254. prevent_diagonal_scrolling: Prevent diagonal scrolling.
  255. overscroll_x: Allow to scroll past the limit of the actual content on the horizontal axis.
  256. overscroll_y: Allow to scroll past the limit of the actual content on the vertical axis.
  257. scroll_offset_x: Initial scroll offset on the horizontal axis.
  258. scroll_offset_y: Initial scroll offset on the vertical axis.
  259. theme: global theme
  260. style: The style of the component.
  261. key: A unique key for the component.
  262. id: The id for the component.
  263. class_name: The class name for the component.
  264. autofocus: Whether the component should take the focus once the page is loaded
  265. custom_attrs: custom attribute
  266. **props: The props of the data editor.
  267. Raises:
  268. ValueError: invalid input.
  269. Returns:
  270. The DataEditor component.&
  271. """
  272. ...
  273. @serializer
  274. def serialize_dataeditortheme(theme: DataEditorTheme): ...
  275. data_editor = DataEditor.create
  276. data_editor_theme = DataEditorTheme