datatable.pyi 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. """Stub file for reflex/components/gridjs/datatable.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 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. _rename_props: Optional[Dict[str, str]] = 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. _rename_props: props to change the name of
  84. custom_attrs: custom attribute
  85. **props: The props of the component.
  86. Returns:
  87. The component.
  88. Raises:
  89. TypeError: If an invalid child is passed.
  90. """
  91. ...
  92. class DataTable(Gridjs):
  93. @overload
  94. @classmethod
  95. def create( # type: ignore
  96. cls,
  97. *children,
  98. data: Optional[Any] = None,
  99. columns: Optional[Union[Var[List], List]] = None,
  100. search: Optional[Union[Var[bool], bool]] = None,
  101. sort: Optional[Union[Var[bool], bool]] = None,
  102. resizable: Optional[Union[Var[bool], bool]] = None,
  103. pagination: Optional[Union[Var[Union[bool, Dict]], Union[bool, Dict]]] = 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. _rename_props: Optional[Dict[str, str]] = None,
  110. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  111. on_blur: Optional[
  112. Union[EventHandler, EventSpec, list, function, BaseVar]
  113. ] = None,
  114. on_click: Optional[
  115. Union[EventHandler, EventSpec, list, function, BaseVar]
  116. ] = None,
  117. on_context_menu: Optional[
  118. Union[EventHandler, EventSpec, list, function, BaseVar]
  119. ] = None,
  120. on_double_click: Optional[
  121. Union[EventHandler, EventSpec, list, function, BaseVar]
  122. ] = None,
  123. on_focus: Optional[
  124. Union[EventHandler, EventSpec, list, function, BaseVar]
  125. ] = None,
  126. on_mount: Optional[
  127. Union[EventHandler, EventSpec, list, function, BaseVar]
  128. ] = None,
  129. on_mouse_down: Optional[
  130. Union[EventHandler, EventSpec, list, function, BaseVar]
  131. ] = None,
  132. on_mouse_enter: Optional[
  133. Union[EventHandler, EventSpec, list, function, BaseVar]
  134. ] = None,
  135. on_mouse_leave: Optional[
  136. Union[EventHandler, EventSpec, list, function, BaseVar]
  137. ] = None,
  138. on_mouse_move: Optional[
  139. Union[EventHandler, EventSpec, list, function, BaseVar]
  140. ] = None,
  141. on_mouse_out: Optional[
  142. Union[EventHandler, EventSpec, list, function, BaseVar]
  143. ] = None,
  144. on_mouse_over: Optional[
  145. Union[EventHandler, EventSpec, list, function, BaseVar]
  146. ] = None,
  147. on_mouse_up: Optional[
  148. Union[EventHandler, EventSpec, list, function, BaseVar]
  149. ] = None,
  150. on_scroll: Optional[
  151. Union[EventHandler, EventSpec, list, function, BaseVar]
  152. ] = None,
  153. on_unmount: Optional[
  154. Union[EventHandler, EventSpec, list, function, BaseVar]
  155. ] = None,
  156. **props
  157. ) -> "DataTable":
  158. """Create a datatable component.
  159. Args:
  160. *children: The children of the component.
  161. data: The data to display. Either a list of lists or a pandas dataframe.
  162. 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
  163. search: Enable a search bar.
  164. sort: Enable sorting on columns.
  165. resizable: Enable resizable columns.
  166. pagination: Enable pagination.
  167. style: The style of the component.
  168. key: A unique key for the component.
  169. id: The id for the component.
  170. class_name: The class name for the component.
  171. autofocus: Whether the component should take the focus once the page is loaded
  172. _rename_props: props to change the name of
  173. custom_attrs: custom attribute
  174. **props: The props to pass to the component.
  175. Returns:
  176. The datatable component.
  177. Raises:
  178. ValueError: If a pandas dataframe is passed in and columns are also provided.
  179. """
  180. ...