select.pyi 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. """Stub file for reflex/components/forms/select.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `scripts/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, Literal, Optional, Union, overload
  6. from reflex.vars import Var, BaseVar, ComputedVar
  7. from reflex.event import EventChain, EventHandler, EventSpec
  8. from reflex.style import Style
  9. from typing import Any, Dict, List, Union
  10. from reflex.components.component import Component
  11. from reflex.components.layout.foreach import Foreach
  12. from reflex.components.libs.chakra import ChakraComponent, LiteralInputVariant
  13. from reflex.components.typography.text import Text
  14. from reflex.constants import EventTriggers
  15. from reflex.utils.types import _issubclass
  16. from reflex.vars import Var
  17. class Select(ChakraComponent):
  18. def get_event_triggers(self) -> Dict[str, Union[Var, Any]]: ...
  19. @overload
  20. @classmethod
  21. def create( # type: ignore
  22. cls,
  23. *children,
  24. value: Optional[Union[Var[str], str]] = None,
  25. default_value: Optional[Union[Var[str], str]] = None,
  26. placeholder: Optional[Union[Var[str], str]] = None,
  27. error_border_color: Optional[Union[Var[str], str]] = None,
  28. focus_border_color: Optional[Union[Var[str], str]] = None,
  29. is_disabled: Optional[Union[Var[bool], bool]] = None,
  30. is_invalid: Optional[Union[Var[bool], bool]] = None,
  31. is_required: Optional[Union[Var[bool], bool]] = None,
  32. variant: Optional[
  33. Union[
  34. Var[Literal["outline", "filled", "flushed", "unstyled"]],
  35. Literal["outline", "filled", "flushed", "unstyled"],
  36. ]
  37. ] = None,
  38. size: Optional[Union[Var[str], str]] = None,
  39. name: Optional[Union[Var[str], str]] = None,
  40. style: Optional[Style] = None,
  41. key: Optional[Any] = None,
  42. id: Optional[Any] = None,
  43. class_name: Optional[Any] = None,
  44. autofocus: Optional[bool] = None,
  45. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  46. on_blur: Optional[
  47. Union[EventHandler, EventSpec, list, function, BaseVar]
  48. ] = None,
  49. on_change: Optional[
  50. Union[EventHandler, EventSpec, list, function, BaseVar]
  51. ] = None,
  52. on_click: Optional[
  53. Union[EventHandler, EventSpec, list, function, BaseVar]
  54. ] = None,
  55. on_context_menu: Optional[
  56. Union[EventHandler, EventSpec, list, function, BaseVar]
  57. ] = None,
  58. on_double_click: Optional[
  59. Union[EventHandler, EventSpec, list, function, BaseVar]
  60. ] = None,
  61. on_focus: Optional[
  62. Union[EventHandler, EventSpec, list, function, BaseVar]
  63. ] = None,
  64. on_mount: Optional[
  65. Union[EventHandler, EventSpec, list, function, BaseVar]
  66. ] = None,
  67. on_mouse_down: Optional[
  68. Union[EventHandler, EventSpec, list, function, BaseVar]
  69. ] = None,
  70. on_mouse_enter: Optional[
  71. Union[EventHandler, EventSpec, list, function, BaseVar]
  72. ] = None,
  73. on_mouse_leave: Optional[
  74. Union[EventHandler, EventSpec, list, function, BaseVar]
  75. ] = None,
  76. on_mouse_move: Optional[
  77. Union[EventHandler, EventSpec, list, function, BaseVar]
  78. ] = None,
  79. on_mouse_out: Optional[
  80. Union[EventHandler, EventSpec, list, function, BaseVar]
  81. ] = None,
  82. on_mouse_over: Optional[
  83. Union[EventHandler, EventSpec, list, function, BaseVar]
  84. ] = None,
  85. on_mouse_up: Optional[
  86. Union[EventHandler, EventSpec, list, function, BaseVar]
  87. ] = None,
  88. on_scroll: Optional[
  89. Union[EventHandler, EventSpec, list, function, BaseVar]
  90. ] = None,
  91. on_unmount: Optional[
  92. Union[EventHandler, EventSpec, list, function, BaseVar]
  93. ] = None,
  94. **props
  95. ) -> "Select":
  96. """Create a select component.
  97. If a list is provided as the first children, a default component
  98. will be created for each item in the list.
  99. Args:
  100. *children: The children of the component.
  101. value: State var to bind the select.
  102. default_value: The default value of the select.
  103. placeholder: The placeholder text.
  104. error_border_color: The border color when the select is invalid.
  105. focus_border_color: The border color when the select is focused.
  106. is_disabled: If true, the select will be disabled.
  107. is_invalid: If true, the form control will be invalid. This has 2 side effects: - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
  108. is_required: If true, the form control will be required. This has 2 side effects: - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
  109. variant: "outline" | "filled" | "flushed" | "unstyled"
  110. size: The size of the select.
  111. name: The name of the form field
  112. style: The style of the component.
  113. key: A unique key for the component.
  114. id: The id for the component.
  115. class_name: The class name for the component.
  116. autofocus: Whether the component should take the focus once the page is loaded
  117. custom_attrs: custom attribute
  118. **props: The props of the component.
  119. Returns:
  120. The component.
  121. """
  122. ...
  123. class Option(Text):
  124. @overload
  125. @classmethod
  126. def create( # type: ignore
  127. cls,
  128. *children,
  129. value: Optional[Union[Var[Any], Any]] = None,
  130. as_: Optional[Union[Var[str], str]] = None,
  131. no_of_lines: Optional[Union[Var[int], int]] = None,
  132. style: Optional[Style] = None,
  133. key: Optional[Any] = None,
  134. id: Optional[Any] = None,
  135. class_name: Optional[Any] = None,
  136. autofocus: Optional[bool] = None,
  137. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  138. on_blur: Optional[
  139. Union[EventHandler, EventSpec, list, function, BaseVar]
  140. ] = None,
  141. on_click: Optional[
  142. Union[EventHandler, EventSpec, list, function, BaseVar]
  143. ] = None,
  144. on_context_menu: Optional[
  145. Union[EventHandler, EventSpec, list, function, BaseVar]
  146. ] = None,
  147. on_double_click: Optional[
  148. Union[EventHandler, EventSpec, list, function, BaseVar]
  149. ] = None,
  150. on_focus: Optional[
  151. Union[EventHandler, EventSpec, list, function, BaseVar]
  152. ] = None,
  153. on_mount: Optional[
  154. Union[EventHandler, EventSpec, list, function, BaseVar]
  155. ] = None,
  156. on_mouse_down: Optional[
  157. Union[EventHandler, EventSpec, list, function, BaseVar]
  158. ] = None,
  159. on_mouse_enter: Optional[
  160. Union[EventHandler, EventSpec, list, function, BaseVar]
  161. ] = None,
  162. on_mouse_leave: Optional[
  163. Union[EventHandler, EventSpec, list, function, BaseVar]
  164. ] = None,
  165. on_mouse_move: Optional[
  166. Union[EventHandler, EventSpec, list, function, BaseVar]
  167. ] = None,
  168. on_mouse_out: Optional[
  169. Union[EventHandler, EventSpec, list, function, BaseVar]
  170. ] = None,
  171. on_mouse_over: Optional[
  172. Union[EventHandler, EventSpec, list, function, BaseVar]
  173. ] = None,
  174. on_mouse_up: Optional[
  175. Union[EventHandler, EventSpec, list, function, BaseVar]
  176. ] = None,
  177. on_scroll: Optional[
  178. Union[EventHandler, EventSpec, list, function, BaseVar]
  179. ] = None,
  180. on_unmount: Optional[
  181. Union[EventHandler, EventSpec, list, function, BaseVar]
  182. ] = None,
  183. **props
  184. ) -> "Option":
  185. """Create a select option component.
  186. By default, the value of the option is the text of the option.
  187. Args:
  188. *children: The children of the component.
  189. as_: Override the tag. The default tag is `<p>`.
  190. no_of_lines: Truncate text after a specific number of lines. It will render an ellipsis when the text exceeds the width of the viewport or max_width prop.
  191. style: The style of the component.
  192. key: A unique key for the component.
  193. id: The id for the component.
  194. class_name: The class name for the component.
  195. autofocus: Whether the component should take the focus once the page is loaded
  196. custom_attrs: custom attribute
  197. **props: The props of the component.
  198. Returns:
  199. The component.
  200. """
  201. ...