datatable.pyi 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. """Stub file for reflex/components/gridjs/datatable.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, Literal, Optional, Union, overload
  6. import reflex
  7. from reflex.vars import Var, BaseVar, ComputedVar
  8. from reflex.event import EventChain, EventHandler, EventSpec
  9. from reflex.style import Style
  10. from typing import Any, Dict, List, Union
  11. from reflex.components.component import Component
  12. from reflex.components.tags import Tag
  13. from reflex.utils import types
  14. from reflex.utils.imports import ImportDict
  15. from reflex.utils.serializers import serialize
  16. from reflex.vars import BaseVar, ComputedVar, Var
  17. class Gridjs(Component):
  18. @overload
  19. @classmethod
  20. def create( # type: ignore
  21. cls,
  22. *children,
  23. style: Optional[Style] = None,
  24. key: Optional[Any] = None,
  25. id: Optional[Any] = None,
  26. class_name: Optional[Any] = None,
  27. autofocus: Optional[bool] = None,
  28. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  29. on_blur: Optional[
  30. Union[EventHandler, EventSpec, list, function, BaseVar]
  31. ] = None,
  32. on_click: Optional[
  33. Union[EventHandler, EventSpec, list, function, BaseVar]
  34. ] = None,
  35. on_context_menu: Optional[
  36. Union[EventHandler, EventSpec, list, function, BaseVar]
  37. ] = None,
  38. on_double_click: Optional[
  39. Union[EventHandler, EventSpec, list, function, BaseVar]
  40. ] = None,
  41. on_focus: Optional[
  42. Union[EventHandler, EventSpec, list, function, BaseVar]
  43. ] = None,
  44. on_mount: Optional[
  45. Union[EventHandler, EventSpec, list, function, BaseVar]
  46. ] = None,
  47. on_mouse_down: Optional[
  48. Union[EventHandler, EventSpec, list, function, BaseVar]
  49. ] = None,
  50. on_mouse_enter: Optional[
  51. Union[EventHandler, EventSpec, list, function, BaseVar]
  52. ] = None,
  53. on_mouse_leave: Optional[
  54. Union[EventHandler, EventSpec, list, function, BaseVar]
  55. ] = None,
  56. on_mouse_move: Optional[
  57. Union[EventHandler, EventSpec, list, function, BaseVar]
  58. ] = None,
  59. on_mouse_out: Optional[
  60. Union[EventHandler, EventSpec, list, function, BaseVar]
  61. ] = None,
  62. on_mouse_over: Optional[
  63. Union[EventHandler, EventSpec, list, function, BaseVar]
  64. ] = None,
  65. on_mouse_up: Optional[
  66. Union[EventHandler, EventSpec, list, function, BaseVar]
  67. ] = None,
  68. on_scroll: Optional[
  69. Union[EventHandler, EventSpec, list, function, BaseVar]
  70. ] = None,
  71. on_unmount: Optional[
  72. Union[EventHandler, EventSpec, list, function, BaseVar]
  73. ] = None,
  74. **props
  75. ) -> "Gridjs":
  76. """Create the component.
  77. Args:
  78. *children: The children of the component.
  79. style: The style of the component.
  80. key: A unique key for the component.
  81. id: The id for the component.
  82. class_name: The class name for the component.
  83. autofocus: Whether the component should take the focus once the page is loaded
  84. custom_attrs: custom attribute
  85. **props: The props of the component.
  86. Returns:
  87. The component.
  88. """
  89. ...
  90. class DataTable(Gridjs):
  91. @overload
  92. @classmethod
  93. def create( # type: ignore
  94. cls,
  95. *children,
  96. data: Optional[Any] = None,
  97. columns: Optional[Union[reflex.vars.Var[List], List]] = None,
  98. search: Optional[Union[reflex.vars.Var[bool], bool]] = None,
  99. sort: Optional[Union[reflex.vars.Var[bool], bool]] = None,
  100. resizable: Optional[Union[reflex.vars.Var[bool], bool]] = None,
  101. pagination: Optional[
  102. Union[reflex.vars.Var[Union[Dict, bool]], bool, Dict]
  103. ] = None,
  104. style: Optional[Style] = None,
  105. key: Optional[Any] = None,
  106. id: Optional[Any] = None,
  107. class_name: Optional[Any] = None,
  108. autofocus: Optional[bool] = None,
  109. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  110. on_blur: Optional[
  111. Union[EventHandler, EventSpec, list, function, BaseVar]
  112. ] = None,
  113. on_click: Optional[
  114. Union[EventHandler, EventSpec, list, function, BaseVar]
  115. ] = None,
  116. on_context_menu: Optional[
  117. Union[EventHandler, EventSpec, list, function, BaseVar]
  118. ] = None,
  119. on_double_click: Optional[
  120. Union[EventHandler, EventSpec, list, function, BaseVar]
  121. ] = None,
  122. on_focus: Optional[
  123. Union[EventHandler, EventSpec, list, function, BaseVar]
  124. ] = None,
  125. on_mount: Optional[
  126. Union[EventHandler, EventSpec, list, function, BaseVar]
  127. ] = None,
  128. on_mouse_down: Optional[
  129. Union[EventHandler, EventSpec, list, function, BaseVar]
  130. ] = None,
  131. on_mouse_enter: Optional[
  132. Union[EventHandler, EventSpec, list, function, BaseVar]
  133. ] = None,
  134. on_mouse_leave: Optional[
  135. Union[EventHandler, EventSpec, list, function, BaseVar]
  136. ] = None,
  137. on_mouse_move: Optional[
  138. Union[EventHandler, EventSpec, list, function, BaseVar]
  139. ] = None,
  140. on_mouse_out: Optional[
  141. Union[EventHandler, EventSpec, list, function, BaseVar]
  142. ] = None,
  143. on_mouse_over: Optional[
  144. Union[EventHandler, EventSpec, list, function, BaseVar]
  145. ] = None,
  146. on_mouse_up: Optional[
  147. Union[EventHandler, EventSpec, list, function, BaseVar]
  148. ] = None,
  149. on_scroll: Optional[
  150. Union[EventHandler, EventSpec, list, function, BaseVar]
  151. ] = None,
  152. on_unmount: Optional[
  153. Union[EventHandler, EventSpec, list, function, BaseVar]
  154. ] = None,
  155. **props
  156. ) -> "DataTable":
  157. """Create a datatable component.
  158. Args:
  159. *children: The children of the component.
  160. data: The data to display. Either a list of lists or a pandas dataframe.
  161. columns: The list of columns to display. Required if data is a list and should not be provided if the data field is a dataframe
  162. search: Enable a search bar.
  163. sort: Enable sorting on columns.
  164. resizable: Enable resizable columns.
  165. pagination: Enable pagination.
  166. style: The style of the component.
  167. key: A unique key for the component.
  168. id: The id for the component.
  169. class_name: The class name for the component.
  170. autofocus: Whether the component should take the focus once the page is loaded
  171. custom_attrs: custom attribute
  172. **props: The props to pass to the component.
  173. Returns:
  174. The datatable component.
  175. Raises:
  176. ValueError: If a pandas dataframe is passed in and columns are also provided.
  177. """
  178. ...
  179. def add_imports(self) -> ImportDict: ...