datatable.pyi 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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, List, Optional, Union, overload
  6. from reflex.components.component import Component
  7. from reflex.event import BASE_STATE, EventType
  8. from reflex.style import Style
  9. from reflex.utils.imports import ImportDict
  10. from reflex.vars.base 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, Any]]] = None,
  23. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  24. on_click: Optional[EventType[[], BASE_STATE]] = None,
  25. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  26. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  27. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  28. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  29. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  30. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  31. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  32. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  33. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  34. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  35. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  36. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  37. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  38. **props,
  39. ) -> "Gridjs":
  40. """Create the component.
  41. Args:
  42. *children: The children of the component.
  43. style: The style of the component.
  44. key: A unique key for the component.
  45. id: The id for the component.
  46. class_name: The class name for the component.
  47. autofocus: Whether the component should take the focus once the page is loaded
  48. custom_attrs: custom attribute
  49. **props: The props of the component.
  50. Returns:
  51. The component.
  52. """
  53. ...
  54. class DataTable(Gridjs):
  55. @overload
  56. @classmethod
  57. def create( # type: ignore
  58. cls,
  59. *children,
  60. data: Optional[Any] = None,
  61. columns: Optional[Union[List, Var[List]]] = None,
  62. search: Optional[Union[Var[bool], bool]] = None,
  63. sort: Optional[Union[Var[bool], bool]] = None,
  64. resizable: Optional[Union[Var[bool], bool]] = None,
  65. pagination: Optional[Union[Dict, Var[Union[Dict, bool]], bool]] = None,
  66. style: Optional[Style] = None,
  67. key: Optional[Any] = None,
  68. id: Optional[Any] = None,
  69. class_name: Optional[Any] = None,
  70. autofocus: Optional[bool] = None,
  71. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  72. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  73. on_click: Optional[EventType[[], BASE_STATE]] = None,
  74. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  75. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  76. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  77. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  78. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  79. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  80. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  81. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  82. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  83. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  84. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  85. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  86. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  87. **props,
  88. ) -> "DataTable":
  89. """Create a datatable component.
  90. Args:
  91. *children: The children of the component.
  92. data: The data to display. Either a list of lists or a pandas dataframe.
  93. 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
  94. search: Enable a search bar.
  95. sort: Enable sorting on columns.
  96. resizable: Enable resizable columns.
  97. pagination: Enable pagination.
  98. style: The style of the component.
  99. key: A unique key for the component.
  100. id: The id for the component.
  101. class_name: The class name for the component.
  102. autofocus: Whether the component should take the focus once the page is loaded
  103. custom_attrs: custom attribute
  104. **props: The props to pass to the component.
  105. Returns:
  106. The datatable component.
  107. Raises:
  108. ValueError: If a pandas dataframe is passed in and columns are also provided.
  109. """
  110. ...
  111. def add_imports(self) -> ImportDict: ...