dataeditor.pyi 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. """Stub file for reflex/components/datadisplay/dataeditor.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `scripts/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, Literal, Optional, Union, overload
  6. from reflex.vars import Var, BaseVar, ComputedVar
  7. from reflex.event import EventChain, EventHandler, EventSpec
  8. from reflex.style import Style
  9. from enum import Enum
  10. from typing import Any, Callable, Dict, List, Literal, Optional, Union
  11. from reflex.base import Base
  12. from reflex.components.component import Component, NoSSRComponent
  13. from reflex.components.literals import LiteralRowMarker
  14. from reflex.utils import console, format, imports, types
  15. from reflex.utils.imports import ImportVar
  16. from reflex.utils.serializers import serializer
  17. from reflex.vars import Var, get_unique_variable_name
  18. class GridColumnIcons(Enum):
  19. Array = "array"
  20. AudioUri = "audio_uri"
  21. Boolean = "boolean"
  22. HeaderCode = "code"
  23. Date = "date"
  24. Email = "email"
  25. Emoji = "emoji"
  26. GeoDistance = "geo_distance"
  27. IfThenElse = "if_then_else"
  28. Image = "image"
  29. JoinStrings = "join_strings"
  30. Lookup = "lookup"
  31. Markdown = "markdown"
  32. Math = "math"
  33. Number = "number"
  34. Phone = "phone"
  35. Reference = "reference"
  36. Rollup = "rollup"
  37. RowID = "row_id"
  38. SingleValue = "single_value"
  39. SplitString = "split_string"
  40. String = "string"
  41. TextTemplate = "text_template"
  42. Time = "time"
  43. Uri = "uri"
  44. VideoUri = "video_uri"
  45. class DataEditorTheme(Base):
  46. accent_color: Optional[str]
  47. accent_fg: Optional[str]
  48. accent_light: Optional[str]
  49. base_font_style: Optional[str]
  50. bg_bubble: Optional[str]
  51. bg_bubble_selected: Optional[str]
  52. bg_cell: Optional[str]
  53. bg_cell_medium: Optional[str]
  54. bg_header: Optional[str]
  55. bg_header_has_focus: Optional[str]
  56. bg_header_hovered: Optional[str]
  57. bg_icon_header: Optional[str]
  58. bg_search_result: Optional[str]
  59. border_color: Optional[str]
  60. cell_horizontal_padding: Optional[int]
  61. cell_vertical_padding: Optional[int]
  62. drilldown_border: Optional[str]
  63. editor_font_size: Optional[str]
  64. fg_icon_header: Optional[str]
  65. font_family: Optional[str]
  66. header_bottom_border_color: Optional[str]
  67. header_font_style: Optional[str]
  68. horizontal_border_color: Optional[str]
  69. line_height: Optional[int]
  70. link_color: Optional[str]
  71. text_bubble: Optional[str]
  72. text_dark: Optional[str]
  73. text_group_header: Optional[str]
  74. text_header: Optional[str]
  75. text_header_selected: Optional[str]
  76. text_light: Optional[str]
  77. text_medium: Optional[str]
  78. class DataEditor(NoSSRComponent):
  79. def get_event_triggers(self) -> Dict[str, Callable]: ...
  80. @overload
  81. @classmethod
  82. def create( # type: ignore
  83. cls,
  84. *children,
  85. rows: Optional[Union[Var[int], int]] = None,
  86. columns: Optional[
  87. Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]
  88. ] = None,
  89. data: Optional[Union[Var[List[List[Any]]], List[List[Any]]]] = None,
  90. get_cell_content: Optional[Union[Var[str], str]] = None,
  91. get_cell_for_selection: Optional[Union[Var[bool], bool]] = None,
  92. on_paste: Optional[Union[Var[bool], bool]] = None,
  93. draw_focus_ring: Optional[Union[Var[bool], bool]] = None,
  94. fixed_shadow_x: Optional[Union[Var[bool], bool]] = None,
  95. fixed_shadow_y: Optional[Union[Var[bool], bool]] = None,
  96. freeze_columns: Optional[Union[Var[int], int]] = None,
  97. group_header_height: Optional[Union[Var[int], int]] = None,
  98. header_height: Optional[Union[Var[int], int]] = None,
  99. max_column_auto_width: Optional[Union[Var[int], int]] = None,
  100. max_column_width: Optional[Union[Var[int], int]] = None,
  101. min_column_width: Optional[Union[Var[int], int]] = None,
  102. row_height: Optional[Union[Var[int], int]] = None,
  103. row_markers: Optional[
  104. Union[
  105. Var[Literal["none", "number", "checkbox", "both", "clickable-number"]],
  106. Literal["none", "number", "checkbox", "both", "clickable-number"],
  107. ]
  108. ] = None,
  109. row_marker_start_index: Optional[Union[Var[int], int]] = None,
  110. row_marker_width: Optional[Union[Var[int], int]] = None,
  111. smooth_scroll_x: Optional[Union[Var[bool], bool]] = None,
  112. smooth_scroll_y: Optional[Union[Var[bool], bool]] = None,
  113. vertical_border: Optional[Union[Var[bool], bool]] = None,
  114. column_select: Optional[
  115. Union[
  116. Var[Literal["none", "single", "multi"]],
  117. Literal["none", "single", "multi"],
  118. ]
  119. ] = None,
  120. prevent_diagonal_scrolling: Optional[Union[Var[bool], bool]] = None,
  121. overscroll_x: Optional[Union[Var[int], int]] = None,
  122. overscroll_y: Optional[Union[Var[int], int]] = None,
  123. scroll_offset_x: Optional[Union[Var[int], int]] = None,
  124. scroll_offset_y: Optional[Union[Var[int], int]] = None,
  125. theme: Optional[
  126. Union[Var[Union[DataEditorTheme, Dict]], Union[DataEditorTheme, Dict]]
  127. ] = None,
  128. style: Optional[Style] = None,
  129. key: Optional[Any] = None,
  130. id: Optional[Any] = None,
  131. class_name: Optional[Any] = None,
  132. autofocus: Optional[bool] = None,
  133. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  134. on_cell_activated: Optional[
  135. Union[EventHandler, EventSpec, list, function, BaseVar]
  136. ] = None,
  137. on_cell_clicked: Optional[
  138. Union[EventHandler, EventSpec, list, function, BaseVar]
  139. ] = None,
  140. on_cell_context_menu: Optional[
  141. Union[EventHandler, EventSpec, list, function, BaseVar]
  142. ] = None,
  143. on_cell_edited: Optional[
  144. Union[EventHandler, EventSpec, list, function, BaseVar]
  145. ] = None,
  146. on_column_resize: Optional[
  147. Union[EventHandler, EventSpec, list, function, BaseVar]
  148. ] = None,
  149. on_delete: Optional[
  150. Union[EventHandler, EventSpec, list, function, BaseVar]
  151. ] = None,
  152. on_finished_editing: Optional[
  153. Union[EventHandler, EventSpec, list, function, BaseVar]
  154. ] = None,
  155. on_group_header_clicked: Optional[
  156. Union[EventHandler, EventSpec, list, function, BaseVar]
  157. ] = None,
  158. on_group_header_context_menu: Optional[
  159. Union[EventHandler, EventSpec, list, function, BaseVar]
  160. ] = None,
  161. on_group_header_renamed: Optional[
  162. Union[EventHandler, EventSpec, list, function, BaseVar]
  163. ] = None,
  164. on_header_clicked: Optional[
  165. Union[EventHandler, EventSpec, list, function, BaseVar]
  166. ] = None,
  167. on_header_context_menu: Optional[
  168. Union[EventHandler, EventSpec, list, function, BaseVar]
  169. ] = None,
  170. on_header_menu_click: Optional[
  171. Union[EventHandler, EventSpec, list, function, BaseVar]
  172. ] = None,
  173. on_item_hovered: Optional[
  174. Union[EventHandler, EventSpec, list, function, BaseVar]
  175. ] = None,
  176. on_row_appended: Optional[
  177. Union[EventHandler, EventSpec, list, function, BaseVar]
  178. ] = None,
  179. on_selection_cleared: Optional[
  180. Union[EventHandler, EventSpec, list, function, BaseVar]
  181. ] = None,
  182. **props
  183. ) -> "DataEditor":
  184. """Create the DataEditor component.
  185. Args:
  186. *children: The children of the data editor.
  187. rows: Number of rows.
  188. columns: Headers of the columns for the data grid.
  189. data: The data.
  190. get_cell_content: The name of the callback used to find the data to display.
  191. get_cell_for_selection: Allow selection for copying.
  192. on_paste: Allow paste.
  193. draw_focus_ring: Controls the drawing of the focus ring.
  194. fixed_shadow_x: Enables or disables the overlay shadow when scrolling horizontally.
  195. fixed_shadow_y: Enables or disables the overlay shadow when scrolling vertically.
  196. freeze_columns: The number of columns which should remain in place when scrolling horizontally. Doesn't include rowMarkers.
  197. group_header_height: Controls the header of the group header row.
  198. header_height: Controls the height of the header row.
  199. 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.
  200. max_column_width: The maximum width a column can be resized to.
  201. min_column_width: The minimum width a column can be resized to.
  202. row_height: Determins the height of each row.
  203. row_markers: Kind of row markers.
  204. row_marker_start_index: Changes the starting index for row markers.
  205. row_marker_width: Sets the width of row markers in pixels, if unset row markers will automatically size.
  206. smooth_scroll_x: Enable horizontal smooth scrolling.
  207. smooth_scroll_y: Enable vertical smooth scrolling.
  208. vertical_border: Controls the drawing of the left hand vertical border of a column. If set to a boolean value it controls all borders.
  209. column_select: Allow columns selections. ("none", "single", "multi")
  210. prevent_diagonal_scrolling: Prevent diagonal scrolling.
  211. overscroll_x: Allow to scroll past the limit of the actual content on the horizontal axis.
  212. overscroll_y: Allow to scroll past the limit of the actual content on the vertical axis.
  213. scroll_offset_x: Initial scroll offset on the horizontal axis.
  214. scroll_offset_y: Initial scroll offset on the vertical axis.
  215. theme: global theme
  216. style: The style of the component.
  217. key: A unique key for the component.
  218. id: The id for the component.
  219. class_name: The class name for the component.
  220. autofocus: Whether the component should take the focus once the page is loaded
  221. custom_attrs: custom attribute
  222. **props: The props of the data editor.
  223. Raises:
  224. ValueError: invalid input.
  225. Returns:
  226. The DataEditor component.&
  227. """
  228. ...
  229. @serializer
  230. def serialize_dataeditortheme(theme: DataEditorTheme): ...