pininput.pyi 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. """Stub file for reflex/components/forms/pininput.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, Optional, Union
  10. from reflex.components.component import Component
  11. from reflex.components.libs.chakra import ChakraComponent, LiteralInputVariant
  12. from reflex.components.tags.tag import Tag
  13. from reflex.constants import EventTriggers
  14. from reflex.utils import format
  15. from reflex.utils.imports import ImportDict, merge_imports
  16. from reflex.vars import Var
  17. class PinInput(ChakraComponent):
  18. def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ...
  19. def get_ref(self) -> str | None: ...
  20. @overload
  21. @classmethod
  22. def create( # type: ignore
  23. cls,
  24. *children,
  25. value: Optional[Union[Var[str], str]] = None,
  26. auto_focus: Optional[Union[Var[bool], bool]] = None,
  27. default_value: Optional[Union[Var[str], str]] = None,
  28. error_border_color: Optional[Union[Var[str], str]] = None,
  29. focus_border_color: Optional[Union[Var[str], str]] = None,
  30. id_: Optional[Union[Var[str], str]] = None,
  31. length: Optional[Union[Var[int], int]] = None,
  32. is_disabled: Optional[Union[Var[bool], bool]] = None,
  33. is_invalid: Optional[Union[Var[bool], bool]] = None,
  34. manage_focus: Optional[Union[Var[bool], bool]] = None,
  35. mask: Optional[Union[Var[bool], bool]] = None,
  36. placeholder: Optional[Union[Var[str], str]] = None,
  37. type_: Optional[Union[Var[str], str]] = None,
  38. variant: Optional[
  39. Union[
  40. Var[Literal["outline", "filled", "flushed", "unstyled"]],
  41. Literal["outline", "filled", "flushed", "unstyled"],
  42. ]
  43. ] = None,
  44. name: Optional[Union[Var[str], str]] = None,
  45. style: Optional[Style] = None,
  46. key: Optional[Any] = None,
  47. id: Optional[Any] = None,
  48. class_name: Optional[Any] = None,
  49. autofocus: Optional[bool] = None,
  50. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  51. on_blur: Optional[
  52. Union[EventHandler, EventSpec, list, function, BaseVar]
  53. ] = None,
  54. on_change: Optional[
  55. Union[EventHandler, EventSpec, list, function, BaseVar]
  56. ] = None,
  57. on_click: Optional[
  58. Union[EventHandler, EventSpec, list, function, BaseVar]
  59. ] = None,
  60. on_complete: Optional[
  61. Union[EventHandler, EventSpec, list, function, BaseVar]
  62. ] = None,
  63. on_context_menu: Optional[
  64. Union[EventHandler, EventSpec, list, function, BaseVar]
  65. ] = None,
  66. on_double_click: Optional[
  67. Union[EventHandler, EventSpec, list, function, BaseVar]
  68. ] = None,
  69. on_focus: Optional[
  70. Union[EventHandler, EventSpec, list, function, BaseVar]
  71. ] = None,
  72. on_mount: Optional[
  73. Union[EventHandler, EventSpec, list, function, BaseVar]
  74. ] = None,
  75. on_mouse_down: Optional[
  76. Union[EventHandler, EventSpec, list, function, BaseVar]
  77. ] = None,
  78. on_mouse_enter: Optional[
  79. Union[EventHandler, EventSpec, list, function, BaseVar]
  80. ] = None,
  81. on_mouse_leave: Optional[
  82. Union[EventHandler, EventSpec, list, function, BaseVar]
  83. ] = None,
  84. on_mouse_move: Optional[
  85. Union[EventHandler, EventSpec, list, function, BaseVar]
  86. ] = None,
  87. on_mouse_out: Optional[
  88. Union[EventHandler, EventSpec, list, function, BaseVar]
  89. ] = None,
  90. on_mouse_over: Optional[
  91. Union[EventHandler, EventSpec, list, function, BaseVar]
  92. ] = None,
  93. on_mouse_up: Optional[
  94. Union[EventHandler, EventSpec, list, function, BaseVar]
  95. ] = None,
  96. on_scroll: Optional[
  97. Union[EventHandler, EventSpec, list, function, BaseVar]
  98. ] = None,
  99. on_unmount: Optional[
  100. Union[EventHandler, EventSpec, list, function, BaseVar]
  101. ] = None,
  102. **props
  103. ) -> "PinInput":
  104. """Create a pin input component.
  105. If no children are passed in, the component will create a default pin input
  106. based on the length prop.
  107. Args:
  108. *children: The children of the component.
  109. value: State var to bind the the input.
  110. auto_focus: If true, the pin input receives focus on mount
  111. default_value: The default value of the pin input
  112. error_border_color: The border color when the input is invalid.
  113. focus_border_color: The border color when the input is focused.
  114. id_: The top-level id string that will be applied to the input fields. The index of the input will be appended to this top-level id.
  115. length: The length of the number input.
  116. is_disabled: If true, the pin input component is put in the disabled state
  117. is_invalid: If true, the pin input component is put in the invalid state
  118. manage_focus: If true, focus will move automatically to the next input once filled
  119. mask: If true, the input's value will be masked just like `type=password`
  120. placeholder: The placeholder for the pin input
  121. type_: The type of values the pin-input should allow ("number" | "alphanumeric").
  122. variant: "outline" | "flushed" | "filled" | "unstyled"
  123. name: The name of the form field
  124. style: The style of the component.
  125. key: A unique key for the component.
  126. id: The id for the component.
  127. class_name: The class name for the component.
  128. autofocus: Whether the component should take the focus once the page is loaded
  129. custom_attrs: custom attribute
  130. **props: The props of the component.
  131. Returns:
  132. The pin input component.
  133. """
  134. ...
  135. class PinInputField(ChakraComponent):
  136. @classmethod
  137. def for_length(cls, length: Var | int, **props) -> Var: ...
  138. def get_ref(self): ...
  139. @overload
  140. @classmethod
  141. def create( # type: ignore
  142. cls,
  143. *children,
  144. index: Optional[Var[int]] = None,
  145. name: Optional[Union[Var[str], str]] = None,
  146. style: Optional[Style] = None,
  147. key: Optional[Any] = None,
  148. id: Optional[Any] = None,
  149. class_name: Optional[Any] = None,
  150. autofocus: Optional[bool] = None,
  151. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  152. on_blur: Optional[
  153. Union[EventHandler, EventSpec, list, function, BaseVar]
  154. ] = None,
  155. on_click: Optional[
  156. Union[EventHandler, EventSpec, list, function, BaseVar]
  157. ] = None,
  158. on_context_menu: Optional[
  159. Union[EventHandler, EventSpec, list, function, BaseVar]
  160. ] = None,
  161. on_double_click: Optional[
  162. Union[EventHandler, EventSpec, list, function, BaseVar]
  163. ] = None,
  164. on_focus: Optional[
  165. Union[EventHandler, EventSpec, list, function, BaseVar]
  166. ] = None,
  167. on_mount: Optional[
  168. Union[EventHandler, EventSpec, list, function, BaseVar]
  169. ] = None,
  170. on_mouse_down: Optional[
  171. Union[EventHandler, EventSpec, list, function, BaseVar]
  172. ] = None,
  173. on_mouse_enter: Optional[
  174. Union[EventHandler, EventSpec, list, function, BaseVar]
  175. ] = None,
  176. on_mouse_leave: Optional[
  177. Union[EventHandler, EventSpec, list, function, BaseVar]
  178. ] = None,
  179. on_mouse_move: Optional[
  180. Union[EventHandler, EventSpec, list, function, BaseVar]
  181. ] = None,
  182. on_mouse_out: Optional[
  183. Union[EventHandler, EventSpec, list, function, BaseVar]
  184. ] = None,
  185. on_mouse_over: Optional[
  186. Union[EventHandler, EventSpec, list, function, BaseVar]
  187. ] = None,
  188. on_mouse_up: Optional[
  189. Union[EventHandler, EventSpec, list, function, BaseVar]
  190. ] = None,
  191. on_scroll: Optional[
  192. Union[EventHandler, EventSpec, list, function, BaseVar]
  193. ] = None,
  194. on_unmount: Optional[
  195. Union[EventHandler, EventSpec, list, function, BaseVar]
  196. ] = None,
  197. **props
  198. ) -> "PinInputField":
  199. """Create the component.
  200. Args:
  201. *children: The children of the component.
  202. index: the position of the PinInputField inside the PinInput. Default to None because it is assigned by PinInput when created.
  203. name: The name of the form field
  204. style: The style of the component.
  205. key: A unique key for the component.
  206. id: The id for the component.
  207. class_name: The class name for the component.
  208. autofocus: Whether the component should take the focus once the page is loaded
  209. custom_attrs: custom attribute
  210. **props: The props of the component.
  211. Returns:
  212. The component.
  213. Raises:
  214. TypeError: If an invalid child is passed.
  215. """
  216. ...