pininput.pyi 9.4 KB

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