form.pyi 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. """Stub file for reflex/components/radix/primitives/form.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 hashlib import md5
  10. from typing import Any, Dict, Iterator, Literal
  11. from jinja2 import Environment
  12. from reflex.components.component import Component
  13. from reflex.components.radix.themes.components.textfield import TextFieldInput
  14. from reflex.components.tags.tag import Tag
  15. from reflex.constants.base import Dirs
  16. from reflex.constants.event import EventTriggers
  17. from reflex.event import EventChain
  18. from reflex.utils import imports
  19. from reflex.utils.format import format_event_chain, to_camel_case
  20. from reflex.vars import BaseVar, Var
  21. from .base import RadixPrimitiveComponentWithClassName
  22. FORM_DATA = Var.create("form_data")
  23. HANDLE_SUBMIT_JS_JINJA2 = Environment().from_string(
  24. "\n const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => {\n const $form = ev.target\n ev.preventDefault()\n const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}}\n\n {{ on_submit_event_chain }}\n\n if ({{ reset_on_submit }}) {\n $form.reset()\n }\n })\n "
  25. )
  26. class FormComponent(RadixPrimitiveComponentWithClassName):
  27. @overload
  28. @classmethod
  29. def create( # type: ignore
  30. cls,
  31. *children,
  32. as_child: Optional[Union[Var[bool], bool]] = None,
  33. style: Optional[Style] = None,
  34. key: Optional[Any] = None,
  35. id: Optional[Any] = None,
  36. class_name: Optional[Any] = None,
  37. autofocus: Optional[bool] = None,
  38. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  39. on_blur: Optional[
  40. Union[EventHandler, EventSpec, list, function, BaseVar]
  41. ] = None,
  42. on_click: Optional[
  43. Union[EventHandler, EventSpec, list, function, BaseVar]
  44. ] = None,
  45. on_context_menu: Optional[
  46. Union[EventHandler, EventSpec, list, function, BaseVar]
  47. ] = None,
  48. on_double_click: Optional[
  49. Union[EventHandler, EventSpec, list, function, BaseVar]
  50. ] = None,
  51. on_focus: Optional[
  52. Union[EventHandler, EventSpec, list, function, BaseVar]
  53. ] = None,
  54. on_mount: Optional[
  55. Union[EventHandler, EventSpec, list, function, BaseVar]
  56. ] = None,
  57. on_mouse_down: Optional[
  58. Union[EventHandler, EventSpec, list, function, BaseVar]
  59. ] = None,
  60. on_mouse_enter: Optional[
  61. Union[EventHandler, EventSpec, list, function, BaseVar]
  62. ] = None,
  63. on_mouse_leave: Optional[
  64. Union[EventHandler, EventSpec, list, function, BaseVar]
  65. ] = None,
  66. on_mouse_move: Optional[
  67. Union[EventHandler, EventSpec, list, function, BaseVar]
  68. ] = None,
  69. on_mouse_out: Optional[
  70. Union[EventHandler, EventSpec, list, function, BaseVar]
  71. ] = None,
  72. on_mouse_over: Optional[
  73. Union[EventHandler, EventSpec, list, function, BaseVar]
  74. ] = None,
  75. on_mouse_up: Optional[
  76. Union[EventHandler, EventSpec, list, function, BaseVar]
  77. ] = None,
  78. on_scroll: Optional[
  79. Union[EventHandler, EventSpec, list, function, BaseVar]
  80. ] = None,
  81. on_unmount: Optional[
  82. Union[EventHandler, EventSpec, list, function, BaseVar]
  83. ] = None,
  84. **props
  85. ) -> "FormComponent":
  86. """Create the component.
  87. Args:
  88. *children: The children of the component.
  89. as_child: Change the default rendered element for the one passed as a child.
  90. style: The style of the component.
  91. key: A unique key for the component.
  92. id: The id for the component.
  93. class_name: The class name for the component.
  94. autofocus: Whether the component should take the focus once the page is loaded
  95. custom_attrs: custom attribute
  96. **props: The props of the component.
  97. Returns:
  98. The component.
  99. Raises:
  100. TypeError: If an invalid child is passed.
  101. """
  102. ...
  103. class FormRoot(FormComponent):
  104. def get_event_triggers(self) -> Dict[str, Any]: ...
  105. @overload
  106. @classmethod
  107. def create( # type: ignore
  108. cls,
  109. *children,
  110. reset_on_submit: Optional[Union[Var[bool], bool]] = None,
  111. handle_submit_unique_name: Optional[Union[Var[str], str]] = None,
  112. as_child: Optional[Union[Var[bool], bool]] = None,
  113. style: Optional[Style] = None,
  114. key: Optional[Any] = None,
  115. id: Optional[Any] = None,
  116. class_name: Optional[Any] = None,
  117. autofocus: Optional[bool] = None,
  118. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  119. on_blur: Optional[
  120. Union[EventHandler, EventSpec, list, function, BaseVar]
  121. ] = None,
  122. on_clear_server_errors: Optional[
  123. Union[EventHandler, EventSpec, list, function, BaseVar]
  124. ] = None,
  125. on_click: Optional[
  126. Union[EventHandler, EventSpec, list, function, BaseVar]
  127. ] = None,
  128. on_context_menu: Optional[
  129. Union[EventHandler, EventSpec, list, function, BaseVar]
  130. ] = None,
  131. on_double_click: Optional[
  132. Union[EventHandler, EventSpec, list, function, BaseVar]
  133. ] = None,
  134. on_focus: Optional[
  135. Union[EventHandler, EventSpec, list, function, BaseVar]
  136. ] = None,
  137. on_mount: Optional[
  138. Union[EventHandler, EventSpec, list, function, BaseVar]
  139. ] = None,
  140. on_mouse_down: Optional[
  141. Union[EventHandler, EventSpec, list, function, BaseVar]
  142. ] = None,
  143. on_mouse_enter: Optional[
  144. Union[EventHandler, EventSpec, list, function, BaseVar]
  145. ] = None,
  146. on_mouse_leave: Optional[
  147. Union[EventHandler, EventSpec, list, function, BaseVar]
  148. ] = None,
  149. on_mouse_move: Optional[
  150. Union[EventHandler, EventSpec, list, function, BaseVar]
  151. ] = None,
  152. on_mouse_out: Optional[
  153. Union[EventHandler, EventSpec, list, function, BaseVar]
  154. ] = None,
  155. on_mouse_over: Optional[
  156. Union[EventHandler, EventSpec, list, function, BaseVar]
  157. ] = None,
  158. on_mouse_up: Optional[
  159. Union[EventHandler, EventSpec, list, function, BaseVar]
  160. ] = None,
  161. on_scroll: Optional[
  162. Union[EventHandler, EventSpec, list, function, BaseVar]
  163. ] = None,
  164. on_submit: Optional[
  165. Union[EventHandler, EventSpec, list, function, BaseVar]
  166. ] = None,
  167. on_unmount: Optional[
  168. Union[EventHandler, EventSpec, list, function, BaseVar]
  169. ] = None,
  170. **props
  171. ) -> "FormRoot":
  172. """Create a form component.
  173. Args:
  174. *children: The children of the form.
  175. reset_on_submit: If true, the form will be cleared after submit.
  176. handle_submit_unique_name: The name used to make this form's submit handler function unique.
  177. as_child: Change the default rendered element for the one passed as a child.
  178. style: The style of the component.
  179. key: A unique key for the component.
  180. id: The id for the component.
  181. class_name: The class name for the component.
  182. autofocus: Whether the component should take the focus once the page is loaded
  183. custom_attrs: custom attribute
  184. **props: The properties of the form.
  185. Returns:
  186. The form component.
  187. """
  188. ...
  189. class FormField(FormComponent):
  190. @overload
  191. @classmethod
  192. def create( # type: ignore
  193. cls,
  194. *children,
  195. name: Optional[Union[Var[str], str]] = None,
  196. server_invalid: Optional[Union[Var[bool], bool]] = None,
  197. as_child: Optional[Union[Var[bool], bool]] = None,
  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. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  204. on_blur: Optional[
  205. Union[EventHandler, EventSpec, list, function, BaseVar]
  206. ] = None,
  207. on_click: Optional[
  208. Union[EventHandler, EventSpec, list, function, BaseVar]
  209. ] = None,
  210. on_context_menu: Optional[
  211. Union[EventHandler, EventSpec, list, function, BaseVar]
  212. ] = None,
  213. on_double_click: Optional[
  214. Union[EventHandler, EventSpec, list, function, BaseVar]
  215. ] = None,
  216. on_focus: Optional[
  217. Union[EventHandler, EventSpec, list, function, BaseVar]
  218. ] = None,
  219. on_mount: Optional[
  220. Union[EventHandler, EventSpec, list, function, BaseVar]
  221. ] = None,
  222. on_mouse_down: Optional[
  223. Union[EventHandler, EventSpec, list, function, BaseVar]
  224. ] = None,
  225. on_mouse_enter: Optional[
  226. Union[EventHandler, EventSpec, list, function, BaseVar]
  227. ] = None,
  228. on_mouse_leave: Optional[
  229. Union[EventHandler, EventSpec, list, function, BaseVar]
  230. ] = None,
  231. on_mouse_move: Optional[
  232. Union[EventHandler, EventSpec, list, function, BaseVar]
  233. ] = None,
  234. on_mouse_out: Optional[
  235. Union[EventHandler, EventSpec, list, function, BaseVar]
  236. ] = None,
  237. on_mouse_over: Optional[
  238. Union[EventHandler, EventSpec, list, function, BaseVar]
  239. ] = None,
  240. on_mouse_up: Optional[
  241. Union[EventHandler, EventSpec, list, function, BaseVar]
  242. ] = None,
  243. on_scroll: Optional[
  244. Union[EventHandler, EventSpec, list, function, BaseVar]
  245. ] = None,
  246. on_unmount: Optional[
  247. Union[EventHandler, EventSpec, list, function, BaseVar]
  248. ] = None,
  249. **props
  250. ) -> "FormField":
  251. """Create the component.
  252. Args:
  253. *children: The children of the component.
  254. name: The name of the form field, that is passed down to the control and used to match with validation messages.
  255. server_invalid: Flag to mark the form field as invalid, for server side validation.
  256. as_child: Change the default rendered element for the one passed as a child.
  257. style: The style of the component.
  258. key: A unique key for the component.
  259. id: The id for the component.
  260. class_name: The class name for the component.
  261. autofocus: Whether the component should take the focus once the page is loaded
  262. custom_attrs: custom attribute
  263. **props: The props of the component.
  264. Returns:
  265. The component.
  266. Raises:
  267. TypeError: If an invalid child is passed.
  268. """
  269. ...
  270. class FormLabel(FormComponent):
  271. @overload
  272. @classmethod
  273. def create( # type: ignore
  274. cls,
  275. *children,
  276. as_child: Optional[Union[Var[bool], bool]] = None,
  277. style: Optional[Style] = None,
  278. key: Optional[Any] = None,
  279. id: Optional[Any] = None,
  280. class_name: Optional[Any] = None,
  281. autofocus: Optional[bool] = None,
  282. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  283. on_blur: Optional[
  284. Union[EventHandler, EventSpec, list, function, BaseVar]
  285. ] = None,
  286. on_click: Optional[
  287. Union[EventHandler, EventSpec, list, function, BaseVar]
  288. ] = None,
  289. on_context_menu: Optional[
  290. Union[EventHandler, EventSpec, list, function, BaseVar]
  291. ] = None,
  292. on_double_click: Optional[
  293. Union[EventHandler, EventSpec, list, function, BaseVar]
  294. ] = None,
  295. on_focus: Optional[
  296. Union[EventHandler, EventSpec, list, function, BaseVar]
  297. ] = None,
  298. on_mount: Optional[
  299. Union[EventHandler, EventSpec, list, function, BaseVar]
  300. ] = None,
  301. on_mouse_down: Optional[
  302. Union[EventHandler, EventSpec, list, function, BaseVar]
  303. ] = None,
  304. on_mouse_enter: Optional[
  305. Union[EventHandler, EventSpec, list, function, BaseVar]
  306. ] = None,
  307. on_mouse_leave: Optional[
  308. Union[EventHandler, EventSpec, list, function, BaseVar]
  309. ] = None,
  310. on_mouse_move: Optional[
  311. Union[EventHandler, EventSpec, list, function, BaseVar]
  312. ] = None,
  313. on_mouse_out: Optional[
  314. Union[EventHandler, EventSpec, list, function, BaseVar]
  315. ] = None,
  316. on_mouse_over: Optional[
  317. Union[EventHandler, EventSpec, list, function, BaseVar]
  318. ] = None,
  319. on_mouse_up: Optional[
  320. Union[EventHandler, EventSpec, list, function, BaseVar]
  321. ] = None,
  322. on_scroll: Optional[
  323. Union[EventHandler, EventSpec, list, function, BaseVar]
  324. ] = None,
  325. on_unmount: Optional[
  326. Union[EventHandler, EventSpec, list, function, BaseVar]
  327. ] = None,
  328. **props
  329. ) -> "FormLabel":
  330. """Create the component.
  331. Args:
  332. *children: The children of the component.
  333. as_child: Change the default rendered element for the one passed as a child.
  334. style: The style of the component.
  335. key: A unique key for the component.
  336. id: The id for the component.
  337. class_name: The class name for the component.
  338. autofocus: Whether the component should take the focus once the page is loaded
  339. custom_attrs: custom attribute
  340. **props: The props of the component.
  341. Returns:
  342. The component.
  343. Raises:
  344. TypeError: If an invalid child is passed.
  345. """
  346. ...
  347. class FormControl(FormComponent):
  348. @overload
  349. @classmethod
  350. def create( # type: ignore
  351. cls,
  352. *children,
  353. as_child: Optional[Union[Var[bool], bool]] = None,
  354. style: Optional[Style] = None,
  355. key: Optional[Any] = None,
  356. id: Optional[Any] = None,
  357. class_name: Optional[Any] = None,
  358. autofocus: Optional[bool] = None,
  359. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  360. on_blur: Optional[
  361. Union[EventHandler, EventSpec, list, function, BaseVar]
  362. ] = None,
  363. on_click: Optional[
  364. Union[EventHandler, EventSpec, list, function, BaseVar]
  365. ] = None,
  366. on_context_menu: Optional[
  367. Union[EventHandler, EventSpec, list, function, BaseVar]
  368. ] = None,
  369. on_double_click: Optional[
  370. Union[EventHandler, EventSpec, list, function, BaseVar]
  371. ] = None,
  372. on_focus: Optional[
  373. Union[EventHandler, EventSpec, list, function, BaseVar]
  374. ] = None,
  375. on_mount: Optional[
  376. Union[EventHandler, EventSpec, list, function, BaseVar]
  377. ] = None,
  378. on_mouse_down: Optional[
  379. Union[EventHandler, EventSpec, list, function, BaseVar]
  380. ] = None,
  381. on_mouse_enter: Optional[
  382. Union[EventHandler, EventSpec, list, function, BaseVar]
  383. ] = None,
  384. on_mouse_leave: Optional[
  385. Union[EventHandler, EventSpec, list, function, BaseVar]
  386. ] = None,
  387. on_mouse_move: Optional[
  388. Union[EventHandler, EventSpec, list, function, BaseVar]
  389. ] = None,
  390. on_mouse_out: Optional[
  391. Union[EventHandler, EventSpec, list, function, BaseVar]
  392. ] = None,
  393. on_mouse_over: Optional[
  394. Union[EventHandler, EventSpec, list, function, BaseVar]
  395. ] = None,
  396. on_mouse_up: Optional[
  397. Union[EventHandler, EventSpec, list, function, BaseVar]
  398. ] = None,
  399. on_scroll: Optional[
  400. Union[EventHandler, EventSpec, list, function, BaseVar]
  401. ] = None,
  402. on_unmount: Optional[
  403. Union[EventHandler, EventSpec, list, function, BaseVar]
  404. ] = None,
  405. **props
  406. ) -> "FormControl":
  407. """Create a Form Control component.
  408. Args:
  409. *children: The children of the form.
  410. as_child: Change the default rendered element for the one passed as a child.
  411. style: The style of the component.
  412. key: A unique key for the component.
  413. id: The id for the component.
  414. class_name: The class name for the component.
  415. autofocus: Whether the component should take the focus once the page is loaded
  416. custom_attrs: custom attribute
  417. **props: The properties of the form.
  418. Raises:
  419. ValueError: If the number of children is greater than 1.
  420. TypeError: If a child exists but it is not a TextFieldInput.
  421. Returns:
  422. The form control component.
  423. """
  424. ...
  425. LiteralMatcher = Literal[
  426. "badInput",
  427. "patternMismatch",
  428. "rangeOverflow",
  429. "rangeUnderflow",
  430. "stepMismatch",
  431. "tooLong",
  432. "tooShort",
  433. "typeMismatch",
  434. "valid",
  435. "valueMissing",
  436. ]
  437. class FormMessage(FormComponent):
  438. @overload
  439. @classmethod
  440. def create( # type: ignore
  441. cls,
  442. *children,
  443. name: Optional[Union[Var[str], str]] = None,
  444. match: Optional[
  445. Union[
  446. Var[
  447. Literal[
  448. "badInput",
  449. "patternMismatch",
  450. "rangeOverflow",
  451. "rangeUnderflow",
  452. "stepMismatch",
  453. "tooLong",
  454. "tooShort",
  455. "typeMismatch",
  456. "valid",
  457. "valueMissing",
  458. ]
  459. ],
  460. Literal[
  461. "badInput",
  462. "patternMismatch",
  463. "rangeOverflow",
  464. "rangeUnderflow",
  465. "stepMismatch",
  466. "tooLong",
  467. "tooShort",
  468. "typeMismatch",
  469. "valid",
  470. "valueMissing",
  471. ],
  472. ]
  473. ] = None,
  474. force_match: Optional[Union[Var[bool], bool]] = None,
  475. as_child: Optional[Union[Var[bool], bool]] = None,
  476. style: Optional[Style] = None,
  477. key: Optional[Any] = None,
  478. id: Optional[Any] = None,
  479. class_name: Optional[Any] = None,
  480. autofocus: Optional[bool] = None,
  481. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  482. on_blur: Optional[
  483. Union[EventHandler, EventSpec, list, function, BaseVar]
  484. ] = None,
  485. on_click: Optional[
  486. Union[EventHandler, EventSpec, list, function, BaseVar]
  487. ] = None,
  488. on_context_menu: Optional[
  489. Union[EventHandler, EventSpec, list, function, BaseVar]
  490. ] = None,
  491. on_double_click: Optional[
  492. Union[EventHandler, EventSpec, list, function, BaseVar]
  493. ] = None,
  494. on_focus: Optional[
  495. Union[EventHandler, EventSpec, list, function, BaseVar]
  496. ] = None,
  497. on_mount: Optional[
  498. Union[EventHandler, EventSpec, list, function, BaseVar]
  499. ] = None,
  500. on_mouse_down: Optional[
  501. Union[EventHandler, EventSpec, list, function, BaseVar]
  502. ] = None,
  503. on_mouse_enter: Optional[
  504. Union[EventHandler, EventSpec, list, function, BaseVar]
  505. ] = None,
  506. on_mouse_leave: Optional[
  507. Union[EventHandler, EventSpec, list, function, BaseVar]
  508. ] = None,
  509. on_mouse_move: Optional[
  510. Union[EventHandler, EventSpec, list, function, BaseVar]
  511. ] = None,
  512. on_mouse_out: Optional[
  513. Union[EventHandler, EventSpec, list, function, BaseVar]
  514. ] = None,
  515. on_mouse_over: Optional[
  516. Union[EventHandler, EventSpec, list, function, BaseVar]
  517. ] = None,
  518. on_mouse_up: Optional[
  519. Union[EventHandler, EventSpec, list, function, BaseVar]
  520. ] = None,
  521. on_scroll: Optional[
  522. Union[EventHandler, EventSpec, list, function, BaseVar]
  523. ] = None,
  524. on_unmount: Optional[
  525. Union[EventHandler, EventSpec, list, function, BaseVar]
  526. ] = None,
  527. **props
  528. ) -> "FormMessage":
  529. """Create the component.
  530. Args:
  531. *children: The children of the component.
  532. name: Used to target a specific field by name when rendering outside of a Field part.
  533. match: Used to indicate on which condition the message should be visible.
  534. force_match: Forces the message to be shown. This is useful when using server-side validation.
  535. as_child: Change the default rendered element for the one passed as a child.
  536. style: The style of the component.
  537. key: A unique key for the component.
  538. id: The id for the component.
  539. class_name: The class name for the component.
  540. autofocus: Whether the component should take the focus once the page is loaded
  541. custom_attrs: custom attribute
  542. **props: The props of the component.
  543. Returns:
  544. The component.
  545. Raises:
  546. TypeError: If an invalid child is passed.
  547. """
  548. ...
  549. class FormValidityState(FormComponent):
  550. @overload
  551. @classmethod
  552. def create( # type: ignore
  553. cls,
  554. *children,
  555. as_child: Optional[Union[Var[bool], bool]] = None,
  556. style: Optional[Style] = None,
  557. key: Optional[Any] = None,
  558. id: Optional[Any] = None,
  559. class_name: Optional[Any] = None,
  560. autofocus: Optional[bool] = None,
  561. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  562. on_blur: Optional[
  563. Union[EventHandler, EventSpec, list, function, BaseVar]
  564. ] = None,
  565. on_click: Optional[
  566. Union[EventHandler, EventSpec, list, function, BaseVar]
  567. ] = None,
  568. on_context_menu: Optional[
  569. Union[EventHandler, EventSpec, list, function, BaseVar]
  570. ] = None,
  571. on_double_click: Optional[
  572. Union[EventHandler, EventSpec, list, function, BaseVar]
  573. ] = None,
  574. on_focus: Optional[
  575. Union[EventHandler, EventSpec, list, function, BaseVar]
  576. ] = None,
  577. on_mount: Optional[
  578. Union[EventHandler, EventSpec, list, function, BaseVar]
  579. ] = None,
  580. on_mouse_down: Optional[
  581. Union[EventHandler, EventSpec, list, function, BaseVar]
  582. ] = None,
  583. on_mouse_enter: Optional[
  584. Union[EventHandler, EventSpec, list, function, BaseVar]
  585. ] = None,
  586. on_mouse_leave: Optional[
  587. Union[EventHandler, EventSpec, list, function, BaseVar]
  588. ] = None,
  589. on_mouse_move: Optional[
  590. Union[EventHandler, EventSpec, list, function, BaseVar]
  591. ] = None,
  592. on_mouse_out: Optional[
  593. Union[EventHandler, EventSpec, list, function, BaseVar]
  594. ] = None,
  595. on_mouse_over: Optional[
  596. Union[EventHandler, EventSpec, list, function, BaseVar]
  597. ] = None,
  598. on_mouse_up: Optional[
  599. Union[EventHandler, EventSpec, list, function, BaseVar]
  600. ] = None,
  601. on_scroll: Optional[
  602. Union[EventHandler, EventSpec, list, function, BaseVar]
  603. ] = None,
  604. on_unmount: Optional[
  605. Union[EventHandler, EventSpec, list, function, BaseVar]
  606. ] = None,
  607. **props
  608. ) -> "FormValidityState":
  609. """Create the component.
  610. Args:
  611. *children: The children of the component.
  612. as_child: Change the default rendered element for the one passed as a child.
  613. style: The style of the component.
  614. key: A unique key for the component.
  615. id: The id for the component.
  616. class_name: The class name for the component.
  617. autofocus: Whether the component should take the focus once the page is loaded
  618. custom_attrs: custom attribute
  619. **props: The props of the component.
  620. Returns:
  621. The component.
  622. Raises:
  623. TypeError: If an invalid child is passed.
  624. """
  625. ...
  626. class FormSubmit(FormComponent):
  627. @overload
  628. @classmethod
  629. def create( # type: ignore
  630. cls,
  631. *children,
  632. as_child: Optional[Union[Var[bool], bool]] = None,
  633. style: Optional[Style] = None,
  634. key: Optional[Any] = None,
  635. id: Optional[Any] = None,
  636. class_name: Optional[Any] = None,
  637. autofocus: Optional[bool] = None,
  638. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  639. on_blur: Optional[
  640. Union[EventHandler, EventSpec, list, function, BaseVar]
  641. ] = None,
  642. on_click: Optional[
  643. Union[EventHandler, EventSpec, list, function, BaseVar]
  644. ] = None,
  645. on_context_menu: Optional[
  646. Union[EventHandler, EventSpec, list, function, BaseVar]
  647. ] = None,
  648. on_double_click: Optional[
  649. Union[EventHandler, EventSpec, list, function, BaseVar]
  650. ] = None,
  651. on_focus: Optional[
  652. Union[EventHandler, EventSpec, list, function, BaseVar]
  653. ] = None,
  654. on_mount: Optional[
  655. Union[EventHandler, EventSpec, list, function, BaseVar]
  656. ] = None,
  657. on_mouse_down: Optional[
  658. Union[EventHandler, EventSpec, list, function, BaseVar]
  659. ] = None,
  660. on_mouse_enter: Optional[
  661. Union[EventHandler, EventSpec, list, function, BaseVar]
  662. ] = None,
  663. on_mouse_leave: Optional[
  664. Union[EventHandler, EventSpec, list, function, BaseVar]
  665. ] = None,
  666. on_mouse_move: Optional[
  667. Union[EventHandler, EventSpec, list, function, BaseVar]
  668. ] = None,
  669. on_mouse_out: Optional[
  670. Union[EventHandler, EventSpec, list, function, BaseVar]
  671. ] = None,
  672. on_mouse_over: Optional[
  673. Union[EventHandler, EventSpec, list, function, BaseVar]
  674. ] = None,
  675. on_mouse_up: Optional[
  676. Union[EventHandler, EventSpec, list, function, BaseVar]
  677. ] = None,
  678. on_scroll: Optional[
  679. Union[EventHandler, EventSpec, list, function, BaseVar]
  680. ] = None,
  681. on_unmount: Optional[
  682. Union[EventHandler, EventSpec, list, function, BaseVar]
  683. ] = None,
  684. **props
  685. ) -> "FormSubmit":
  686. """Create the component.
  687. Args:
  688. *children: The children of the component.
  689. as_child: Change the default rendered element for the one passed as a child.
  690. style: The style of the component.
  691. key: A unique key for the component.
  692. id: The id for the component.
  693. class_name: The class name for the component.
  694. autofocus: Whether the component should take the focus once the page is loaded
  695. custom_attrs: custom attribute
  696. **props: The props of the component.
  697. Returns:
  698. The component.
  699. Raises:
  700. TypeError: If an invalid child is passed.
  701. """
  702. ...
  703. form_root = FormRoot.create
  704. form_field = FormField.create
  705. form_label = FormLabel.create
  706. form_control = FormControl.create
  707. form_message = FormMessage.create
  708. form_validity_state = FormValidityState.create
  709. form_submit = FormSubmit.create