datatable.pyi 4.7 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, Optional, Sequence, overload
  6. from reflex.components.component import Component
  7. from reflex.event import 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: Style | None = None,
  18. key: Any | None = None,
  19. id: Any | None = None,
  20. class_name: Any | None = None,
  21. autofocus: bool | None = None,
  22. custom_attrs: dict[str, Var | Any] | None = None,
  23. on_blur: Optional[EventType[()]] = None,
  24. on_click: Optional[EventType[()]] = None,
  25. on_context_menu: Optional[EventType[()]] = None,
  26. on_double_click: Optional[EventType[()]] = None,
  27. on_focus: Optional[EventType[()]] = None,
  28. on_mount: Optional[EventType[()]] = None,
  29. on_mouse_down: Optional[EventType[()]] = None,
  30. on_mouse_enter: Optional[EventType[()]] = None,
  31. on_mouse_leave: Optional[EventType[()]] = None,
  32. on_mouse_move: Optional[EventType[()]] = None,
  33. on_mouse_out: Optional[EventType[()]] = None,
  34. on_mouse_over: Optional[EventType[()]] = None,
  35. on_mouse_up: Optional[EventType[()]] = None,
  36. on_scroll: Optional[EventType[()]] = None,
  37. on_unmount: Optional[EventType[()]] = 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: Any | None = None,
  61. columns: Sequence | Var[Sequence] | None = None,
  62. search: Var[bool] | bool | None = None,
  63. sort: Var[bool] | bool | None = None,
  64. resizable: Var[bool] | bool | None = None,
  65. pagination: Dict | Var[Dict | bool] | bool | None = None,
  66. style: Style | None = None,
  67. key: Any | None = None,
  68. id: Any | None = None,
  69. class_name: Any | None = None,
  70. autofocus: bool | None = None,
  71. custom_attrs: dict[str, Var | Any] | None = None,
  72. on_blur: Optional[EventType[()]] = None,
  73. on_click: Optional[EventType[()]] = None,
  74. on_context_menu: Optional[EventType[()]] = None,
  75. on_double_click: Optional[EventType[()]] = None,
  76. on_focus: Optional[EventType[()]] = None,
  77. on_mount: Optional[EventType[()]] = None,
  78. on_mouse_down: Optional[EventType[()]] = None,
  79. on_mouse_enter: Optional[EventType[()]] = None,
  80. on_mouse_leave: Optional[EventType[()]] = None,
  81. on_mouse_move: Optional[EventType[()]] = None,
  82. on_mouse_out: Optional[EventType[()]] = None,
  83. on_mouse_over: Optional[EventType[()]] = None,
  84. on_mouse_up: Optional[EventType[()]] = None,
  85. on_scroll: Optional[EventType[()]] = None,
  86. on_unmount: Optional[EventType[()]] = 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: ...