slider.pyi 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. """Stub file for reflex/components/radix/primitives/slider.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, List, Literal, Optional, Tuple, Union, overload
  6. from reflex.components.component import Component, ComponentNamespace
  7. from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName
  8. from reflex.event import BASE_STATE, EventType
  9. from reflex.style import Style
  10. from reflex.vars.base import Var
  11. LiteralSliderOrientation = Literal["horizontal", "vertical"]
  12. LiteralSliderDir = Literal["ltr", "rtl"]
  13. class SliderComponent(RadixPrimitiveComponentWithClassName):
  14. @overload
  15. @classmethod
  16. def create( # type: ignore
  17. cls,
  18. *children,
  19. as_child: Optional[Union[Var[bool], bool]] = None,
  20. style: Optional[Style] = None,
  21. key: Optional[Any] = None,
  22. id: Optional[Any] = None,
  23. class_name: Optional[Any] = None,
  24. autofocus: Optional[bool] = None,
  25. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  26. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  27. on_click: Optional[EventType[[], BASE_STATE]] = None,
  28. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  29. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  30. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  31. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  32. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  33. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  34. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  35. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  36. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  37. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  38. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  39. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  40. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  41. **props,
  42. ) -> "SliderComponent":
  43. """Create the component.
  44. Args:
  45. *children: The children of the component.
  46. as_child: Change the default rendered element for the one passed as a child.
  47. style: The style of the component.
  48. key: A unique key for the component.
  49. id: The id for the component.
  50. class_name: The class name for the component.
  51. autofocus: Whether the component should take the focus once the page is loaded
  52. custom_attrs: custom attribute
  53. **props: The props of the component.
  54. Returns:
  55. The component.
  56. """
  57. ...
  58. def on_value_event_spec(value: Var[List[int]]) -> Tuple[Var[List[int]]]: ...
  59. class SliderRoot(SliderComponent):
  60. def add_style(self) -> dict[str, Any] | None: ...
  61. @overload
  62. @classmethod
  63. def create( # type: ignore
  64. cls,
  65. *children,
  66. default_value: Optional[Union[List[int], Var[List[int]]]] = None,
  67. value: Optional[Union[List[int], Var[List[int]]]] = None,
  68. name: Optional[Union[Var[str], str]] = None,
  69. disabled: Optional[Union[Var[bool], bool]] = None,
  70. orientation: Optional[
  71. Union[
  72. Literal["horizontal", "vertical"],
  73. Var[Literal["horizontal", "vertical"]],
  74. ]
  75. ] = None,
  76. dir: Optional[Union[Literal["ltr", "rtl"], Var[Literal["ltr", "rtl"]]]] = None,
  77. inverted: Optional[Union[Var[bool], bool]] = None,
  78. min: Optional[Union[Var[int], int]] = None,
  79. max: Optional[Union[Var[int], int]] = None,
  80. step: Optional[Union[Var[int], int]] = None,
  81. min_steps_between_thumbs: Optional[Union[Var[int], int]] = None,
  82. as_child: Optional[Union[Var[bool], bool]] = None,
  83. style: Optional[Style] = None,
  84. key: Optional[Any] = None,
  85. id: Optional[Any] = None,
  86. class_name: Optional[Any] = None,
  87. autofocus: Optional[bool] = None,
  88. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  89. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  90. on_click: Optional[EventType[[], BASE_STATE]] = None,
  91. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  92. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  93. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  94. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  95. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  96. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  97. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  98. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  99. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  100. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  101. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  102. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  103. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  104. on_value_change: Optional[
  105. Union[EventType[[], BASE_STATE], EventType[[List[int]], BASE_STATE]]
  106. ] = None,
  107. on_value_commit: Optional[
  108. Union[EventType[[], BASE_STATE], EventType[[List[int]], BASE_STATE]]
  109. ] = None,
  110. **props,
  111. ) -> "SliderRoot":
  112. """Create the component.
  113. Args:
  114. *children: The children of the component.
  115. on_value_change: Fired when the value of a thumb changes.
  116. on_value_commit: Fired when a thumb is released.
  117. as_child: Change the default rendered element for the one passed as a child.
  118. style: The style of the component.
  119. key: A unique key for the component.
  120. id: The id for the component.
  121. class_name: The class name for the component.
  122. autofocus: Whether the component should take the focus once the page is loaded
  123. custom_attrs: custom attribute
  124. **props: The props of the component.
  125. Returns:
  126. The component.
  127. """
  128. ...
  129. class SliderTrack(SliderComponent):
  130. def add_style(self) -> dict[str, Any] | None: ...
  131. @overload
  132. @classmethod
  133. def create( # type: ignore
  134. cls,
  135. *children,
  136. as_child: Optional[Union[Var[bool], bool]] = None,
  137. style: Optional[Style] = None,
  138. key: Optional[Any] = None,
  139. id: Optional[Any] = None,
  140. class_name: Optional[Any] = None,
  141. autofocus: Optional[bool] = None,
  142. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  143. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  144. on_click: Optional[EventType[[], BASE_STATE]] = None,
  145. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  146. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  147. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  148. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  149. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  150. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  151. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  152. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  153. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  154. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  155. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  156. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  157. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  158. **props,
  159. ) -> "SliderTrack":
  160. """Create the component.
  161. Args:
  162. *children: The children of the component.
  163. as_child: Change the default rendered element for the one passed as a child.
  164. style: The style of the component.
  165. key: A unique key for the component.
  166. id: The id for the component.
  167. class_name: The class name for the component.
  168. autofocus: Whether the component should take the focus once the page is loaded
  169. custom_attrs: custom attribute
  170. **props: The props of the component.
  171. Returns:
  172. The component.
  173. """
  174. ...
  175. class SliderRange(SliderComponent):
  176. def add_style(self) -> dict[str, Any] | None: ...
  177. @overload
  178. @classmethod
  179. def create( # type: ignore
  180. cls,
  181. *children,
  182. as_child: Optional[Union[Var[bool], bool]] = None,
  183. style: Optional[Style] = None,
  184. key: Optional[Any] = None,
  185. id: Optional[Any] = None,
  186. class_name: Optional[Any] = None,
  187. autofocus: Optional[bool] = None,
  188. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  189. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  190. on_click: Optional[EventType[[], BASE_STATE]] = None,
  191. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  192. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  193. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  194. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  195. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  196. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  197. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  198. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  199. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  200. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  201. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  202. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  203. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  204. **props,
  205. ) -> "SliderRange":
  206. """Create the component.
  207. Args:
  208. *children: The children of the component.
  209. as_child: Change the default rendered element for the one passed as a child.
  210. style: The style of the component.
  211. key: A unique key for the component.
  212. id: The id for the component.
  213. class_name: The class name for the component.
  214. autofocus: Whether the component should take the focus once the page is loaded
  215. custom_attrs: custom attribute
  216. **props: The props of the component.
  217. Returns:
  218. The component.
  219. """
  220. ...
  221. class SliderThumb(SliderComponent):
  222. def add_style(self) -> dict[str, Any] | None: ...
  223. @overload
  224. @classmethod
  225. def create( # type: ignore
  226. cls,
  227. *children,
  228. as_child: Optional[Union[Var[bool], bool]] = None,
  229. style: Optional[Style] = None,
  230. key: Optional[Any] = None,
  231. id: Optional[Any] = None,
  232. class_name: Optional[Any] = None,
  233. autofocus: Optional[bool] = None,
  234. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  235. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  236. on_click: Optional[EventType[[], BASE_STATE]] = None,
  237. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  238. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  239. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  240. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  241. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  242. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  243. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  244. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  245. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  246. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  247. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  248. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  249. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  250. **props,
  251. ) -> "SliderThumb":
  252. """Create the component.
  253. Args:
  254. *children: The children of the component.
  255. as_child: Change the default rendered element for the one passed as a child.
  256. style: The style of the component.
  257. key: A unique key for the component.
  258. id: The id for the component.
  259. class_name: The class name for the component.
  260. autofocus: Whether the component should take the focus once the page is loaded
  261. custom_attrs: custom attribute
  262. **props: The props of the component.
  263. Returns:
  264. The component.
  265. """
  266. ...
  267. class Slider(ComponentNamespace):
  268. root = staticmethod(SliderRoot.create)
  269. track = staticmethod(SliderTrack.create)
  270. range = staticmethod(SliderRange.create)
  271. thumb = staticmethod(SliderThumb.create)
  272. @staticmethod
  273. def __call__(**props) -> Component: ...
  274. slider = Slider()