datatable.pyi 6.9 KB

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