input.pyi 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. """Stub file for reflex/components/forms/input.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
  10. from reflex.components.component import Component
  11. from reflex.components.forms.debounce import DebounceInput
  12. from reflex.components.libs.chakra import (
  13. ChakraComponent,
  14. LiteralButtonSize,
  15. LiteralInputVariant,
  16. )
  17. from reflex.constants import EventTriggers
  18. from reflex.utils import imports
  19. from reflex.vars import Var
  20. class Input(ChakraComponent):
  21. def get_event_triggers(self) -> Dict[str, Any]: ...
  22. @overload
  23. @classmethod
  24. def create( # type: ignore
  25. cls,
  26. *children,
  27. value: Optional[Union[Var[str], str]] = None,
  28. default_value: Optional[Union[Var[str], str]] = None,
  29. placeholder: Optional[Union[Var[str], str]] = None,
  30. type_: Optional[Union[Var[str], str]] = None,
  31. error_border_color: Optional[Union[Var[str], str]] = None,
  32. focus_border_color: Optional[Union[Var[str], str]] = None,
  33. is_disabled: Optional[Union[Var[bool], bool]] = None,
  34. is_invalid: Optional[Union[Var[bool], bool]] = None,
  35. is_read_only: Optional[Union[Var[bool], bool]] = None,
  36. is_required: Optional[Union[Var[bool], bool]] = None,
  37. variant: Optional[
  38. Union[
  39. Var[Literal["outline", "filled", "flushed", "unstyled"]],
  40. Literal["outline", "filled", "flushed", "unstyled"],
  41. ]
  42. ] = None,
  43. size: Optional[
  44. Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
  45. ] = None,
  46. name: Optional[Union[Var[str], str]] = None,
  47. style: Optional[Style] = None,
  48. key: Optional[Any] = None,
  49. id: Optional[Any] = None,
  50. class_name: Optional[Any] = None,
  51. autofocus: Optional[bool] = None,
  52. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  53. on_blur: Optional[
  54. Union[EventHandler, EventSpec, list, function, BaseVar]
  55. ] = None,
  56. on_change: Optional[
  57. Union[EventHandler, EventSpec, list, function, BaseVar]
  58. ] = None,
  59. on_click: Optional[
  60. Union[EventHandler, EventSpec, list, function, BaseVar]
  61. ] = None,
  62. on_context_menu: Optional[
  63. Union[EventHandler, EventSpec, list, function, BaseVar]
  64. ] = None,
  65. on_double_click: Optional[
  66. Union[EventHandler, EventSpec, list, function, BaseVar]
  67. ] = None,
  68. on_focus: Optional[
  69. Union[EventHandler, EventSpec, list, function, BaseVar]
  70. ] = None,
  71. on_key_down: Optional[
  72. Union[EventHandler, EventSpec, list, function, BaseVar]
  73. ] = None,
  74. on_key_up: Optional[
  75. Union[EventHandler, EventSpec, list, function, BaseVar]
  76. ] = None,
  77. on_mount: Optional[
  78. Union[EventHandler, EventSpec, list, function, BaseVar]
  79. ] = None,
  80. on_mouse_down: Optional[
  81. Union[EventHandler, EventSpec, list, function, BaseVar]
  82. ] = None,
  83. on_mouse_enter: Optional[
  84. Union[EventHandler, EventSpec, list, function, BaseVar]
  85. ] = None,
  86. on_mouse_leave: Optional[
  87. Union[EventHandler, EventSpec, list, function, BaseVar]
  88. ] = None,
  89. on_mouse_move: Optional[
  90. Union[EventHandler, EventSpec, list, function, BaseVar]
  91. ] = None,
  92. on_mouse_out: Optional[
  93. Union[EventHandler, EventSpec, list, function, BaseVar]
  94. ] = None,
  95. on_mouse_over: Optional[
  96. Union[EventHandler, EventSpec, list, function, BaseVar]
  97. ] = None,
  98. on_mouse_up: Optional[
  99. Union[EventHandler, EventSpec, list, function, BaseVar]
  100. ] = None,
  101. on_scroll: Optional[
  102. Union[EventHandler, EventSpec, list, function, BaseVar]
  103. ] = None,
  104. on_unmount: Optional[
  105. Union[EventHandler, EventSpec, list, function, BaseVar]
  106. ] = None,
  107. **props
  108. ) -> "Input":
  109. """Create an Input component.
  110. Args:
  111. *children: The children of the component.
  112. value: State var to bind the input.
  113. default_value: The default value of the input.
  114. placeholder: The placeholder text.
  115. type_: The type of input.
  116. error_border_color: The border color when the input is invalid.
  117. focus_border_color: The border color when the input is focused.
  118. is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled
  119. 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
  120. is_read_only: If true, the form control will be readonly.
  121. 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
  122. variant: "outline" | "filled" | "flushed" | "unstyled"
  123. size: "lg" | "md" | "sm" | "xs"
  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. custom_attrs: custom attribute
  131. **props: The properties of the component.
  132. Returns:
  133. The component.
  134. """
  135. ...
  136. class InputGroup(ChakraComponent):
  137. @overload
  138. @classmethod
  139. def create( # type: ignore
  140. cls,
  141. *children,
  142. style: Optional[Style] = None,
  143. key: Optional[Any] = None,
  144. id: Optional[Any] = None,
  145. class_name: Optional[Any] = None,
  146. autofocus: Optional[bool] = None,
  147. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  148. on_blur: Optional[
  149. Union[EventHandler, EventSpec, list, function, BaseVar]
  150. ] = None,
  151. on_click: Optional[
  152. Union[EventHandler, EventSpec, list, function, BaseVar]
  153. ] = None,
  154. on_context_menu: Optional[
  155. Union[EventHandler, EventSpec, list, function, BaseVar]
  156. ] = None,
  157. on_double_click: Optional[
  158. Union[EventHandler, EventSpec, list, function, BaseVar]
  159. ] = None,
  160. on_focus: Optional[
  161. Union[EventHandler, EventSpec, list, function, BaseVar]
  162. ] = None,
  163. on_mount: Optional[
  164. Union[EventHandler, EventSpec, list, function, BaseVar]
  165. ] = None,
  166. on_mouse_down: Optional[
  167. Union[EventHandler, EventSpec, list, function, BaseVar]
  168. ] = None,
  169. on_mouse_enter: Optional[
  170. Union[EventHandler, EventSpec, list, function, BaseVar]
  171. ] = None,
  172. on_mouse_leave: Optional[
  173. Union[EventHandler, EventSpec, list, function, BaseVar]
  174. ] = None,
  175. on_mouse_move: Optional[
  176. Union[EventHandler, EventSpec, list, function, BaseVar]
  177. ] = None,
  178. on_mouse_out: Optional[
  179. Union[EventHandler, EventSpec, list, function, BaseVar]
  180. ] = None,
  181. on_mouse_over: Optional[
  182. Union[EventHandler, EventSpec, list, function, BaseVar]
  183. ] = None,
  184. on_mouse_up: Optional[
  185. Union[EventHandler, EventSpec, list, function, BaseVar]
  186. ] = None,
  187. on_scroll: Optional[
  188. Union[EventHandler, EventSpec, list, function, BaseVar]
  189. ] = None,
  190. on_unmount: Optional[
  191. Union[EventHandler, EventSpec, list, function, BaseVar]
  192. ] = None,
  193. **props
  194. ) -> "InputGroup":
  195. """Create the component.
  196. Args:
  197. *children: The children of the component.
  198. style: The style of the component.
  199. key: A unique key for the component.
  200. id: The id for the component.
  201. class_name: The class name for the component.
  202. autofocus: Whether the component should take the focus once the page is loaded
  203. custom_attrs: custom attribute
  204. **props: The props of the component.
  205. Returns:
  206. The component.
  207. Raises:
  208. TypeError: If an invalid child is passed.
  209. """
  210. ...
  211. class InputLeftAddon(ChakraComponent):
  212. @overload
  213. @classmethod
  214. def create( # type: ignore
  215. cls,
  216. *children,
  217. style: Optional[Style] = None,
  218. key: Optional[Any] = None,
  219. id: Optional[Any] = None,
  220. class_name: Optional[Any] = None,
  221. autofocus: Optional[bool] = None,
  222. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  223. on_blur: Optional[
  224. Union[EventHandler, EventSpec, list, function, BaseVar]
  225. ] = None,
  226. on_click: Optional[
  227. Union[EventHandler, EventSpec, list, function, BaseVar]
  228. ] = None,
  229. on_context_menu: Optional[
  230. Union[EventHandler, EventSpec, list, function, BaseVar]
  231. ] = None,
  232. on_double_click: Optional[
  233. Union[EventHandler, EventSpec, list, function, BaseVar]
  234. ] = None,
  235. on_focus: Optional[
  236. Union[EventHandler, EventSpec, list, function, BaseVar]
  237. ] = None,
  238. on_mount: Optional[
  239. Union[EventHandler, EventSpec, list, function, BaseVar]
  240. ] = None,
  241. on_mouse_down: Optional[
  242. Union[EventHandler, EventSpec, list, function, BaseVar]
  243. ] = None,
  244. on_mouse_enter: Optional[
  245. Union[EventHandler, EventSpec, list, function, BaseVar]
  246. ] = None,
  247. on_mouse_leave: Optional[
  248. Union[EventHandler, EventSpec, list, function, BaseVar]
  249. ] = None,
  250. on_mouse_move: Optional[
  251. Union[EventHandler, EventSpec, list, function, BaseVar]
  252. ] = None,
  253. on_mouse_out: Optional[
  254. Union[EventHandler, EventSpec, list, function, BaseVar]
  255. ] = None,
  256. on_mouse_over: Optional[
  257. Union[EventHandler, EventSpec, list, function, BaseVar]
  258. ] = None,
  259. on_mouse_up: Optional[
  260. Union[EventHandler, EventSpec, list, function, BaseVar]
  261. ] = None,
  262. on_scroll: Optional[
  263. Union[EventHandler, EventSpec, list, function, BaseVar]
  264. ] = None,
  265. on_unmount: Optional[
  266. Union[EventHandler, EventSpec, list, function, BaseVar]
  267. ] = None,
  268. **props
  269. ) -> "InputLeftAddon":
  270. """Create the component.
  271. Args:
  272. *children: The children of the component.
  273. style: The style of the component.
  274. key: A unique key for the component.
  275. id: The id for the component.
  276. class_name: The class name for the component.
  277. autofocus: Whether the component should take the focus once the page is loaded
  278. custom_attrs: custom attribute
  279. **props: The props of the component.
  280. Returns:
  281. The component.
  282. Raises:
  283. TypeError: If an invalid child is passed.
  284. """
  285. ...
  286. class InputRightAddon(ChakraComponent):
  287. @overload
  288. @classmethod
  289. def create( # type: ignore
  290. cls,
  291. *children,
  292. style: Optional[Style] = None,
  293. key: Optional[Any] = None,
  294. id: Optional[Any] = None,
  295. class_name: Optional[Any] = None,
  296. autofocus: Optional[bool] = None,
  297. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  298. on_blur: Optional[
  299. Union[EventHandler, EventSpec, list, function, BaseVar]
  300. ] = None,
  301. on_click: Optional[
  302. Union[EventHandler, EventSpec, list, function, BaseVar]
  303. ] = None,
  304. on_context_menu: Optional[
  305. Union[EventHandler, EventSpec, list, function, BaseVar]
  306. ] = None,
  307. on_double_click: Optional[
  308. Union[EventHandler, EventSpec, list, function, BaseVar]
  309. ] = None,
  310. on_focus: Optional[
  311. Union[EventHandler, EventSpec, list, function, BaseVar]
  312. ] = None,
  313. on_mount: Optional[
  314. Union[EventHandler, EventSpec, list, function, BaseVar]
  315. ] = None,
  316. on_mouse_down: Optional[
  317. Union[EventHandler, EventSpec, list, function, BaseVar]
  318. ] = None,
  319. on_mouse_enter: Optional[
  320. Union[EventHandler, EventSpec, list, function, BaseVar]
  321. ] = None,
  322. on_mouse_leave: Optional[
  323. Union[EventHandler, EventSpec, list, function, BaseVar]
  324. ] = None,
  325. on_mouse_move: Optional[
  326. Union[EventHandler, EventSpec, list, function, BaseVar]
  327. ] = None,
  328. on_mouse_out: Optional[
  329. Union[EventHandler, EventSpec, list, function, BaseVar]
  330. ] = None,
  331. on_mouse_over: Optional[
  332. Union[EventHandler, EventSpec, list, function, BaseVar]
  333. ] = None,
  334. on_mouse_up: Optional[
  335. Union[EventHandler, EventSpec, list, function, BaseVar]
  336. ] = None,
  337. on_scroll: Optional[
  338. Union[EventHandler, EventSpec, list, function, BaseVar]
  339. ] = None,
  340. on_unmount: Optional[
  341. Union[EventHandler, EventSpec, list, function, BaseVar]
  342. ] = None,
  343. **props
  344. ) -> "InputRightAddon":
  345. """Create the component.
  346. Args:
  347. *children: The children of the component.
  348. style: The style of the component.
  349. key: A unique key for the component.
  350. id: The id for the component.
  351. class_name: The class name for the component.
  352. autofocus: Whether the component should take the focus once the page is loaded
  353. custom_attrs: custom attribute
  354. **props: The props of the component.
  355. Returns:
  356. The component.
  357. Raises:
  358. TypeError: If an invalid child is passed.
  359. """
  360. ...
  361. class InputLeftElement(ChakraComponent):
  362. @overload
  363. @classmethod
  364. def create( # type: ignore
  365. cls,
  366. *children,
  367. style: Optional[Style] = None,
  368. key: Optional[Any] = None,
  369. id: Optional[Any] = None,
  370. class_name: Optional[Any] = None,
  371. autofocus: Optional[bool] = None,
  372. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  373. on_blur: Optional[
  374. Union[EventHandler, EventSpec, list, function, BaseVar]
  375. ] = None,
  376. on_click: Optional[
  377. Union[EventHandler, EventSpec, list, function, BaseVar]
  378. ] = None,
  379. on_context_menu: Optional[
  380. Union[EventHandler, EventSpec, list, function, BaseVar]
  381. ] = None,
  382. on_double_click: Optional[
  383. Union[EventHandler, EventSpec, list, function, BaseVar]
  384. ] = None,
  385. on_focus: Optional[
  386. Union[EventHandler, EventSpec, list, function, BaseVar]
  387. ] = None,
  388. on_mount: Optional[
  389. Union[EventHandler, EventSpec, list, function, BaseVar]
  390. ] = None,
  391. on_mouse_down: Optional[
  392. Union[EventHandler, EventSpec, list, function, BaseVar]
  393. ] = None,
  394. on_mouse_enter: Optional[
  395. Union[EventHandler, EventSpec, list, function, BaseVar]
  396. ] = None,
  397. on_mouse_leave: Optional[
  398. Union[EventHandler, EventSpec, list, function, BaseVar]
  399. ] = None,
  400. on_mouse_move: Optional[
  401. Union[EventHandler, EventSpec, list, function, BaseVar]
  402. ] = None,
  403. on_mouse_out: Optional[
  404. Union[EventHandler, EventSpec, list, function, BaseVar]
  405. ] = None,
  406. on_mouse_over: Optional[
  407. Union[EventHandler, EventSpec, list, function, BaseVar]
  408. ] = None,
  409. on_mouse_up: Optional[
  410. Union[EventHandler, EventSpec, list, function, BaseVar]
  411. ] = None,
  412. on_scroll: Optional[
  413. Union[EventHandler, EventSpec, list, function, BaseVar]
  414. ] = None,
  415. on_unmount: Optional[
  416. Union[EventHandler, EventSpec, list, function, BaseVar]
  417. ] = None,
  418. **props
  419. ) -> "InputLeftElement":
  420. """Create the component.
  421. Args:
  422. *children: The children of the component.
  423. style: The style of the component.
  424. key: A unique key for the component.
  425. id: The id for the component.
  426. class_name: The class name for the component.
  427. autofocus: Whether the component should take the focus once the page is loaded
  428. custom_attrs: custom attribute
  429. **props: The props of the component.
  430. Returns:
  431. The component.
  432. Raises:
  433. TypeError: If an invalid child is passed.
  434. """
  435. ...
  436. class InputRightElement(ChakraComponent):
  437. @overload
  438. @classmethod
  439. def create( # type: ignore
  440. cls,
  441. *children,
  442. style: Optional[Style] = None,
  443. key: Optional[Any] = None,
  444. id: Optional[Any] = None,
  445. class_name: Optional[Any] = None,
  446. autofocus: Optional[bool] = None,
  447. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  448. on_blur: Optional[
  449. Union[EventHandler, EventSpec, list, function, BaseVar]
  450. ] = None,
  451. on_click: Optional[
  452. Union[EventHandler, EventSpec, list, function, BaseVar]
  453. ] = None,
  454. on_context_menu: Optional[
  455. Union[EventHandler, EventSpec, list, function, BaseVar]
  456. ] = None,
  457. on_double_click: Optional[
  458. Union[EventHandler, EventSpec, list, function, BaseVar]
  459. ] = None,
  460. on_focus: Optional[
  461. Union[EventHandler, EventSpec, list, function, BaseVar]
  462. ] = None,
  463. on_mount: Optional[
  464. Union[EventHandler, EventSpec, list, function, BaseVar]
  465. ] = None,
  466. on_mouse_down: Optional[
  467. Union[EventHandler, EventSpec, list, function, BaseVar]
  468. ] = None,
  469. on_mouse_enter: Optional[
  470. Union[EventHandler, EventSpec, list, function, BaseVar]
  471. ] = None,
  472. on_mouse_leave: Optional[
  473. Union[EventHandler, EventSpec, list, function, BaseVar]
  474. ] = None,
  475. on_mouse_move: Optional[
  476. Union[EventHandler, EventSpec, list, function, BaseVar]
  477. ] = None,
  478. on_mouse_out: Optional[
  479. Union[EventHandler, EventSpec, list, function, BaseVar]
  480. ] = None,
  481. on_mouse_over: Optional[
  482. Union[EventHandler, EventSpec, list, function, BaseVar]
  483. ] = None,
  484. on_mouse_up: Optional[
  485. Union[EventHandler, EventSpec, list, function, BaseVar]
  486. ] = None,
  487. on_scroll: Optional[
  488. Union[EventHandler, EventSpec, list, function, BaseVar]
  489. ] = None,
  490. on_unmount: Optional[
  491. Union[EventHandler, EventSpec, list, function, BaseVar]
  492. ] = None,
  493. **props
  494. ) -> "InputRightElement":
  495. """Create the component.
  496. Args:
  497. *children: The children of the component.
  498. style: The style of the component.
  499. key: A unique key for the component.
  500. id: The id for the component.
  501. class_name: The class name for the component.
  502. autofocus: Whether the component should take the focus once the page is loaded
  503. custom_attrs: custom attribute
  504. **props: The props of the component.
  505. Returns:
  506. The component.
  507. Raises:
  508. TypeError: If an invalid child is passed.
  509. """
  510. ...