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