1
0

input.pyi 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. """Stub file for reflex/components/chakra/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.chakra import (
  11. ChakraComponent,
  12. LiteralButtonSize,
  13. LiteralInputVariant,
  14. )
  15. from reflex.components.component import Component
  16. from reflex.components.core.debounce import DebounceInput
  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. _rename_props: Optional[Dict[str, str]] = None,
  107. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  108. on_blur: Optional[
  109. Union[EventHandler, EventSpec, list, function, BaseVar]
  110. ] = None,
  111. on_change: Optional[
  112. Union[EventHandler, EventSpec, list, function, BaseVar]
  113. ] = None,
  114. on_click: Optional[
  115. Union[EventHandler, EventSpec, list, function, BaseVar]
  116. ] = None,
  117. on_context_menu: Optional[
  118. Union[EventHandler, EventSpec, list, function, BaseVar]
  119. ] = None,
  120. on_double_click: Optional[
  121. Union[EventHandler, EventSpec, list, function, BaseVar]
  122. ] = None,
  123. on_focus: Optional[
  124. Union[EventHandler, EventSpec, list, function, BaseVar]
  125. ] = None,
  126. on_key_down: Optional[
  127. Union[EventHandler, EventSpec, list, function, BaseVar]
  128. ] = None,
  129. on_key_up: Optional[
  130. Union[EventHandler, EventSpec, list, function, BaseVar]
  131. ] = None,
  132. on_mount: Optional[
  133. Union[EventHandler, EventSpec, list, function, BaseVar]
  134. ] = None,
  135. on_mouse_down: Optional[
  136. Union[EventHandler, EventSpec, list, function, BaseVar]
  137. ] = None,
  138. on_mouse_enter: Optional[
  139. Union[EventHandler, EventSpec, list, function, BaseVar]
  140. ] = None,
  141. on_mouse_leave: Optional[
  142. Union[EventHandler, EventSpec, list, function, BaseVar]
  143. ] = None,
  144. on_mouse_move: Optional[
  145. Union[EventHandler, EventSpec, list, function, BaseVar]
  146. ] = None,
  147. on_mouse_out: Optional[
  148. Union[EventHandler, EventSpec, list, function, BaseVar]
  149. ] = None,
  150. on_mouse_over: Optional[
  151. Union[EventHandler, EventSpec, list, function, BaseVar]
  152. ] = None,
  153. on_mouse_up: Optional[
  154. Union[EventHandler, EventSpec, list, function, BaseVar]
  155. ] = None,
  156. on_scroll: Optional[
  157. Union[EventHandler, EventSpec, list, function, BaseVar]
  158. ] = None,
  159. on_unmount: Optional[
  160. Union[EventHandler, EventSpec, list, function, BaseVar]
  161. ] = None,
  162. **props
  163. ) -> "Input":
  164. """Create an Input component.
  165. Args:
  166. *children: The children of the component.
  167. value: State var to bind the input.
  168. default_value: The default value of the input.
  169. placeholder: The placeholder text.
  170. type_: The type of input.
  171. error_border_color: The border color when the input is invalid.
  172. focus_border_color: The border color when the input is focused.
  173. 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
  174. 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
  175. is_read_only: If true, the form control will be readonly.
  176. 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
  177. variant: "outline" | "filled" | "flushed" | "unstyled"
  178. size: "lg" | "md" | "sm" | "xs"
  179. name: The name of the form field
  180. style: The style of the component.
  181. key: A unique key for the component.
  182. id: The id for the component.
  183. class_name: The class name for the component.
  184. autofocus: Whether the component should take the focus once the page is loaded
  185. _rename_props: props to change the name of
  186. custom_attrs: custom attribute
  187. **props: The properties of the component.
  188. Returns:
  189. The component.
  190. """
  191. ...
  192. class InputGroup(ChakraComponent):
  193. @overload
  194. @classmethod
  195. def create( # type: ignore
  196. cls,
  197. *children,
  198. style: Optional[Style] = None,
  199. key: Optional[Any] = None,
  200. id: Optional[Any] = None,
  201. class_name: Optional[Any] = None,
  202. autofocus: Optional[bool] = None,
  203. _rename_props: Optional[Dict[str, str]] = None,
  204. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  205. on_blur: Optional[
  206. Union[EventHandler, EventSpec, list, function, BaseVar]
  207. ] = None,
  208. on_click: Optional[
  209. Union[EventHandler, EventSpec, list, function, BaseVar]
  210. ] = None,
  211. on_context_menu: Optional[
  212. Union[EventHandler, EventSpec, list, function, BaseVar]
  213. ] = None,
  214. on_double_click: Optional[
  215. Union[EventHandler, EventSpec, list, function, BaseVar]
  216. ] = None,
  217. on_focus: Optional[
  218. Union[EventHandler, EventSpec, list, function, BaseVar]
  219. ] = None,
  220. on_mount: Optional[
  221. Union[EventHandler, EventSpec, list, function, BaseVar]
  222. ] = None,
  223. on_mouse_down: Optional[
  224. Union[EventHandler, EventSpec, list, function, BaseVar]
  225. ] = None,
  226. on_mouse_enter: Optional[
  227. Union[EventHandler, EventSpec, list, function, BaseVar]
  228. ] = None,
  229. on_mouse_leave: Optional[
  230. Union[EventHandler, EventSpec, list, function, BaseVar]
  231. ] = None,
  232. on_mouse_move: Optional[
  233. Union[EventHandler, EventSpec, list, function, BaseVar]
  234. ] = None,
  235. on_mouse_out: Optional[
  236. Union[EventHandler, EventSpec, list, function, BaseVar]
  237. ] = None,
  238. on_mouse_over: Optional[
  239. Union[EventHandler, EventSpec, list, function, BaseVar]
  240. ] = None,
  241. on_mouse_up: Optional[
  242. Union[EventHandler, EventSpec, list, function, BaseVar]
  243. ] = None,
  244. on_scroll: Optional[
  245. Union[EventHandler, EventSpec, list, function, BaseVar]
  246. ] = None,
  247. on_unmount: Optional[
  248. Union[EventHandler, EventSpec, list, function, BaseVar]
  249. ] = None,
  250. **props
  251. ) -> "InputGroup":
  252. """Create the component.
  253. Args:
  254. *children: The children of the component.
  255. style: The style of the component.
  256. key: A unique key for the component.
  257. id: The id for the component.
  258. class_name: The class name for the component.
  259. autofocus: Whether the component should take the focus once the page is loaded
  260. _rename_props: props to change the name of
  261. custom_attrs: custom attribute
  262. **props: The props of the component.
  263. Returns:
  264. The component.
  265. Raises:
  266. TypeError: If an invalid child is passed.
  267. """
  268. ...
  269. class InputLeftAddon(ChakraComponent):
  270. @overload
  271. @classmethod
  272. def create( # type: ignore
  273. cls,
  274. *children,
  275. style: Optional[Style] = None,
  276. key: Optional[Any] = None,
  277. id: Optional[Any] = None,
  278. class_name: Optional[Any] = None,
  279. autofocus: Optional[bool] = None,
  280. _rename_props: Optional[Dict[str, str]] = None,
  281. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  282. on_blur: Optional[
  283. Union[EventHandler, EventSpec, list, function, BaseVar]
  284. ] = None,
  285. on_click: Optional[
  286. Union[EventHandler, EventSpec, list, function, BaseVar]
  287. ] = None,
  288. on_context_menu: Optional[
  289. Union[EventHandler, EventSpec, list, function, BaseVar]
  290. ] = None,
  291. on_double_click: Optional[
  292. Union[EventHandler, EventSpec, list, function, BaseVar]
  293. ] = None,
  294. on_focus: Optional[
  295. Union[EventHandler, EventSpec, list, function, BaseVar]
  296. ] = None,
  297. on_mount: Optional[
  298. Union[EventHandler, EventSpec, list, function, BaseVar]
  299. ] = None,
  300. on_mouse_down: Optional[
  301. Union[EventHandler, EventSpec, list, function, BaseVar]
  302. ] = None,
  303. on_mouse_enter: Optional[
  304. Union[EventHandler, EventSpec, list, function, BaseVar]
  305. ] = None,
  306. on_mouse_leave: Optional[
  307. Union[EventHandler, EventSpec, list, function, BaseVar]
  308. ] = None,
  309. on_mouse_move: Optional[
  310. Union[EventHandler, EventSpec, list, function, BaseVar]
  311. ] = None,
  312. on_mouse_out: Optional[
  313. Union[EventHandler, EventSpec, list, function, BaseVar]
  314. ] = None,
  315. on_mouse_over: Optional[
  316. Union[EventHandler, EventSpec, list, function, BaseVar]
  317. ] = None,
  318. on_mouse_up: Optional[
  319. Union[EventHandler, EventSpec, list, function, BaseVar]
  320. ] = None,
  321. on_scroll: Optional[
  322. Union[EventHandler, EventSpec, list, function, BaseVar]
  323. ] = None,
  324. on_unmount: Optional[
  325. Union[EventHandler, EventSpec, list, function, BaseVar]
  326. ] = None,
  327. **props
  328. ) -> "InputLeftAddon":
  329. """Create the component.
  330. Args:
  331. *children: The children of the component.
  332. style: The style of the component.
  333. key: A unique key for the component.
  334. id: The id for the component.
  335. class_name: The class name for the component.
  336. autofocus: Whether the component should take the focus once the page is loaded
  337. _rename_props: props to change the name of
  338. custom_attrs: custom attribute
  339. **props: The props of the component.
  340. Returns:
  341. The component.
  342. Raises:
  343. TypeError: If an invalid child is passed.
  344. """
  345. ...
  346. class InputRightAddon(ChakraComponent):
  347. @overload
  348. @classmethod
  349. def create( # type: ignore
  350. cls,
  351. *children,
  352. style: Optional[Style] = None,
  353. key: Optional[Any] = None,
  354. id: Optional[Any] = None,
  355. class_name: Optional[Any] = None,
  356. autofocus: Optional[bool] = None,
  357. _rename_props: Optional[Dict[str, str]] = None,
  358. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  359. on_blur: Optional[
  360. Union[EventHandler, EventSpec, list, function, BaseVar]
  361. ] = None,
  362. on_click: Optional[
  363. Union[EventHandler, EventSpec, list, function, BaseVar]
  364. ] = None,
  365. on_context_menu: Optional[
  366. Union[EventHandler, EventSpec, list, function, BaseVar]
  367. ] = None,
  368. on_double_click: Optional[
  369. Union[EventHandler, EventSpec, list, function, BaseVar]
  370. ] = None,
  371. on_focus: Optional[
  372. Union[EventHandler, EventSpec, list, function, BaseVar]
  373. ] = None,
  374. on_mount: Optional[
  375. Union[EventHandler, EventSpec, list, function, BaseVar]
  376. ] = None,
  377. on_mouse_down: Optional[
  378. Union[EventHandler, EventSpec, list, function, BaseVar]
  379. ] = None,
  380. on_mouse_enter: Optional[
  381. Union[EventHandler, EventSpec, list, function, BaseVar]
  382. ] = None,
  383. on_mouse_leave: Optional[
  384. Union[EventHandler, EventSpec, list, function, BaseVar]
  385. ] = None,
  386. on_mouse_move: Optional[
  387. Union[EventHandler, EventSpec, list, function, BaseVar]
  388. ] = None,
  389. on_mouse_out: Optional[
  390. Union[EventHandler, EventSpec, list, function, BaseVar]
  391. ] = None,
  392. on_mouse_over: Optional[
  393. Union[EventHandler, EventSpec, list, function, BaseVar]
  394. ] = None,
  395. on_mouse_up: Optional[
  396. Union[EventHandler, EventSpec, list, function, BaseVar]
  397. ] = None,
  398. on_scroll: Optional[
  399. Union[EventHandler, EventSpec, list, function, BaseVar]
  400. ] = None,
  401. on_unmount: Optional[
  402. Union[EventHandler, EventSpec, list, function, BaseVar]
  403. ] = None,
  404. **props
  405. ) -> "InputRightAddon":
  406. """Create the component.
  407. Args:
  408. *children: The children of the component.
  409. style: The style of the component.
  410. key: A unique key for the component.
  411. id: The id for the component.
  412. class_name: The class name for the component.
  413. autofocus: Whether the component should take the focus once the page is loaded
  414. _rename_props: props to change the name of
  415. custom_attrs: custom attribute
  416. **props: The props of the component.
  417. Returns:
  418. The component.
  419. Raises:
  420. TypeError: If an invalid child is passed.
  421. """
  422. ...
  423. class InputLeftElement(ChakraComponent):
  424. @overload
  425. @classmethod
  426. def create( # type: ignore
  427. cls,
  428. *children,
  429. style: Optional[Style] = None,
  430. key: Optional[Any] = None,
  431. id: Optional[Any] = None,
  432. class_name: Optional[Any] = None,
  433. autofocus: Optional[bool] = None,
  434. _rename_props: Optional[Dict[str, str]] = None,
  435. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  436. on_blur: Optional[
  437. Union[EventHandler, EventSpec, list, function, BaseVar]
  438. ] = None,
  439. on_click: Optional[
  440. Union[EventHandler, EventSpec, list, function, BaseVar]
  441. ] = None,
  442. on_context_menu: Optional[
  443. Union[EventHandler, EventSpec, list, function, BaseVar]
  444. ] = None,
  445. on_double_click: Optional[
  446. Union[EventHandler, EventSpec, list, function, BaseVar]
  447. ] = None,
  448. on_focus: Optional[
  449. Union[EventHandler, EventSpec, list, function, BaseVar]
  450. ] = None,
  451. on_mount: Optional[
  452. Union[EventHandler, EventSpec, list, function, BaseVar]
  453. ] = None,
  454. on_mouse_down: Optional[
  455. Union[EventHandler, EventSpec, list, function, BaseVar]
  456. ] = None,
  457. on_mouse_enter: Optional[
  458. Union[EventHandler, EventSpec, list, function, BaseVar]
  459. ] = None,
  460. on_mouse_leave: Optional[
  461. Union[EventHandler, EventSpec, list, function, BaseVar]
  462. ] = None,
  463. on_mouse_move: Optional[
  464. Union[EventHandler, EventSpec, list, function, BaseVar]
  465. ] = None,
  466. on_mouse_out: Optional[
  467. Union[EventHandler, EventSpec, list, function, BaseVar]
  468. ] = None,
  469. on_mouse_over: Optional[
  470. Union[EventHandler, EventSpec, list, function, BaseVar]
  471. ] = None,
  472. on_mouse_up: Optional[
  473. Union[EventHandler, EventSpec, list, function, BaseVar]
  474. ] = None,
  475. on_scroll: Optional[
  476. Union[EventHandler, EventSpec, list, function, BaseVar]
  477. ] = None,
  478. on_unmount: Optional[
  479. Union[EventHandler, EventSpec, list, function, BaseVar]
  480. ] = None,
  481. **props
  482. ) -> "InputLeftElement":
  483. """Create the component.
  484. Args:
  485. *children: The children of the component.
  486. style: The style of the component.
  487. key: A unique key for the component.
  488. id: The id for the component.
  489. class_name: The class name for the component.
  490. autofocus: Whether the component should take the focus once the page is loaded
  491. _rename_props: props to change the name of
  492. custom_attrs: custom attribute
  493. **props: The props of the component.
  494. Returns:
  495. The component.
  496. Raises:
  497. TypeError: If an invalid child is passed.
  498. """
  499. ...
  500. class InputRightElement(ChakraComponent):
  501. @overload
  502. @classmethod
  503. def create( # type: ignore
  504. cls,
  505. *children,
  506. style: Optional[Style] = None,
  507. key: Optional[Any] = None,
  508. id: Optional[Any] = None,
  509. class_name: Optional[Any] = None,
  510. autofocus: Optional[bool] = None,
  511. _rename_props: Optional[Dict[str, str]] = None,
  512. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  513. on_blur: Optional[
  514. Union[EventHandler, EventSpec, list, function, BaseVar]
  515. ] = None,
  516. on_click: Optional[
  517. Union[EventHandler, EventSpec, list, function, BaseVar]
  518. ] = None,
  519. on_context_menu: Optional[
  520. Union[EventHandler, EventSpec, list, function, BaseVar]
  521. ] = None,
  522. on_double_click: Optional[
  523. Union[EventHandler, EventSpec, list, function, BaseVar]
  524. ] = None,
  525. on_focus: Optional[
  526. Union[EventHandler, EventSpec, list, function, BaseVar]
  527. ] = None,
  528. on_mount: Optional[
  529. Union[EventHandler, EventSpec, list, function, BaseVar]
  530. ] = None,
  531. on_mouse_down: Optional[
  532. Union[EventHandler, EventSpec, list, function, BaseVar]
  533. ] = None,
  534. on_mouse_enter: Optional[
  535. Union[EventHandler, EventSpec, list, function, BaseVar]
  536. ] = None,
  537. on_mouse_leave: Optional[
  538. Union[EventHandler, EventSpec, list, function, BaseVar]
  539. ] = None,
  540. on_mouse_move: Optional[
  541. Union[EventHandler, EventSpec, list, function, BaseVar]
  542. ] = None,
  543. on_mouse_out: Optional[
  544. Union[EventHandler, EventSpec, list, function, BaseVar]
  545. ] = None,
  546. on_mouse_over: Optional[
  547. Union[EventHandler, EventSpec, list, function, BaseVar]
  548. ] = None,
  549. on_mouse_up: Optional[
  550. Union[EventHandler, EventSpec, list, function, BaseVar]
  551. ] = None,
  552. on_scroll: Optional[
  553. Union[EventHandler, EventSpec, list, function, BaseVar]
  554. ] = None,
  555. on_unmount: Optional[
  556. Union[EventHandler, EventSpec, list, function, BaseVar]
  557. ] = None,
  558. **props
  559. ) -> "InputRightElement":
  560. """Create the component.
  561. Args:
  562. *children: The children of the component.
  563. style: The style of the component.
  564. key: A unique key for the component.
  565. id: The id for the component.
  566. class_name: The class name for the component.
  567. autofocus: Whether the component should take the focus once the page is loaded
  568. _rename_props: props to change the name of
  569. custom_attrs: custom attribute
  570. **props: The props of the component.
  571. Returns:
  572. The component.
  573. Raises:
  574. TypeError: If an invalid child is passed.
  575. """
  576. ...