datatable.pyi 7.0 KB

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