input.pyi 21 KB

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