datatable.pyi 6.4 KB

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