form.pyi 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789
  1. """Stub file for reflex/components/radix/primitives/form.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, Literal, Optional, Union, overload
  6. from reflex.components.component import ComponentNamespace
  7. from reflex.components.el.elements.forms import Form as HTMLForm
  8. from reflex.event import EventType
  9. from reflex.style import Style
  10. from reflex.vars.base import Var
  11. from .base import RadixPrimitiveComponentWithClassName
  12. class FormComponent(RadixPrimitiveComponentWithClassName):
  13. @overload
  14. @classmethod
  15. def create( # type: ignore
  16. cls,
  17. *children,
  18. as_child: Optional[Union[Var[bool], bool]] = None,
  19. style: Optional[Style] = None,
  20. key: Optional[Any] = None,
  21. id: Optional[Any] = None,
  22. class_name: Optional[Any] = None,
  23. autofocus: Optional[bool] = None,
  24. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  25. on_blur: Optional[EventType[()]] = None,
  26. on_click: Optional[EventType[()]] = None,
  27. on_context_menu: Optional[EventType[()]] = None,
  28. on_double_click: Optional[EventType[()]] = None,
  29. on_focus: Optional[EventType[()]] = None,
  30. on_mount: Optional[EventType[()]] = None,
  31. on_mouse_down: Optional[EventType[()]] = None,
  32. on_mouse_enter: Optional[EventType[()]] = None,
  33. on_mouse_leave: Optional[EventType[()]] = None,
  34. on_mouse_move: Optional[EventType[()]] = None,
  35. on_mouse_out: Optional[EventType[()]] = None,
  36. on_mouse_over: Optional[EventType[()]] = None,
  37. on_mouse_up: Optional[EventType[()]] = None,
  38. on_scroll: Optional[EventType[()]] = None,
  39. on_unmount: Optional[EventType[()]] = None,
  40. **props,
  41. ) -> "FormComponent":
  42. """Create the component.
  43. Args:
  44. *children: The children of the component.
  45. as_child: Change the default rendered element for the one passed as a child.
  46. style: The style of the component.
  47. key: A unique key for the component.
  48. id: The id for the component.
  49. class_name: The class name for the component.
  50. autofocus: Whether the component should take the focus once the page is loaded
  51. custom_attrs: custom attribute
  52. **props: The props of the component.
  53. Returns:
  54. The component.
  55. """
  56. ...
  57. class FormRoot(FormComponent, HTMLForm):
  58. def add_style(self) -> dict[str, Any] | None: ...
  59. @overload
  60. @classmethod
  61. def create( # type: ignore
  62. cls,
  63. *children,
  64. as_child: Optional[Union[Var[bool], bool]] = None,
  65. accept: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  66. accept_charset: Optional[
  67. Union[Var[Union[bool, int, str]], bool, int, str]
  68. ] = None,
  69. action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  70. auto_complete: Optional[
  71. Union[Var[Union[bool, int, str]], bool, int, str]
  72. ] = None,
  73. enc_type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  74. method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  75. name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  76. no_validate: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  77. target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  78. reset_on_submit: Optional[Union[Var[bool], bool]] = None,
  79. handle_submit_unique_name: Optional[Union[Var[str], str]] = None,
  80. access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  81. auto_capitalize: Optional[
  82. Union[Var[Union[bool, int, str]], bool, int, str]
  83. ] = None,
  84. content_editable: Optional[
  85. Union[Var[Union[bool, int, str]], bool, int, str]
  86. ] = None,
  87. context_menu: Optional[
  88. Union[Var[Union[bool, int, str]], bool, int, str]
  89. ] = None,
  90. dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  91. draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  92. enter_key_hint: Optional[
  93. Union[Var[Union[bool, int, str]], bool, int, str]
  94. ] = None,
  95. hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  96. input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  97. item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  98. lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  99. role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  100. slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  101. spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  102. tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  103. title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  104. style: Optional[Style] = None,
  105. key: Optional[Any] = None,
  106. id: Optional[Any] = None,
  107. class_name: Optional[Any] = None,
  108. autofocus: Optional[bool] = None,
  109. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  110. on_blur: Optional[EventType[()]] = None,
  111. on_clear_server_errors: Optional[EventType[()]] = None,
  112. on_click: Optional[EventType[()]] = None,
  113. on_context_menu: Optional[EventType[()]] = None,
  114. on_double_click: Optional[EventType[()]] = None,
  115. on_focus: Optional[EventType[()]] = None,
  116. on_mount: Optional[EventType[()]] = None,
  117. on_mouse_down: Optional[EventType[()]] = None,
  118. on_mouse_enter: Optional[EventType[()]] = None,
  119. on_mouse_leave: Optional[EventType[()]] = None,
  120. on_mouse_move: Optional[EventType[()]] = None,
  121. on_mouse_out: Optional[EventType[()]] = None,
  122. on_mouse_over: Optional[EventType[()]] = None,
  123. on_mouse_up: Optional[EventType[()]] = None,
  124. on_scroll: Optional[EventType[()]] = None,
  125. on_submit: Optional[
  126. Union[
  127. Union[EventType[()], EventType[dict[str, Any]]],
  128. Union[EventType[()], EventType[dict[str, str]]],
  129. ]
  130. ] = None,
  131. on_unmount: Optional[EventType[()]] = None,
  132. **props,
  133. ) -> "FormRoot":
  134. """Create a form component.
  135. Args:
  136. *children: The children of the form.
  137. on_clear_server_errors: Fired when the errors are cleared.
  138. as_child: Change the default rendered element for the one passed as a child.
  139. accept: MIME types the server accepts for file upload
  140. accept_charset: Character encodings to be used for form submission
  141. action: URL where the form's data should be submitted
  142. auto_complete: Whether the form should have autocomplete enabled
  143. enc_type: Encoding type for the form data when submitted
  144. method: HTTP method to use for form submission
  145. name: Name of the form
  146. no_validate: Indicates that the form should not be validated on submit
  147. target: Where to display the response after submitting the form
  148. reset_on_submit: If true, the form will be cleared after submit.
  149. handle_submit_unique_name: The name used to make this form's submit handler function unique.
  150. on_submit: Fired when the form is submitted
  151. access_key: Provides a hint for generating a keyboard shortcut for the current element.
  152. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
  153. content_editable: Indicates whether the element's content is editable.
  154. context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
  155. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
  156. draggable: Defines whether the element can be dragged.
  157. enter_key_hint: Hints what media types the media element is able to play.
  158. hidden: Defines whether the element is hidden.
  159. input_mode: Defines the type of the element.
  160. item_prop: Defines the name of the element for metadata purposes.
  161. lang: Defines the language used in the element.
  162. role: Defines the role of the element.
  163. slot: Assigns a slot in a shadow DOM shadow tree to an element.
  164. spell_check: Defines whether the element may be checked for spelling errors.
  165. tab_index: Defines the position of the current element in the tabbing order.
  166. title: Defines a tooltip for the element.
  167. style: The style of the component.
  168. key: A unique key for the component.
  169. id: The id for the component.
  170. class_name: The class name for the component.
  171. autofocus: Whether the component should take the focus once the page is loaded
  172. custom_attrs: custom attribute
  173. **props: The properties of the form.
  174. Returns:
  175. The form component.
  176. """
  177. ...
  178. class FormField(FormComponent):
  179. def add_style(self) -> dict[str, Any] | None: ...
  180. @overload
  181. @classmethod
  182. def create( # type: ignore
  183. cls,
  184. *children,
  185. name: Optional[Union[Var[str], str]] = None,
  186. server_invalid: Optional[Union[Var[bool], bool]] = None,
  187. as_child: Optional[Union[Var[bool], bool]] = None,
  188. style: Optional[Style] = None,
  189. key: Optional[Any] = None,
  190. id: Optional[Any] = None,
  191. class_name: Optional[Any] = None,
  192. autofocus: Optional[bool] = None,
  193. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  194. on_blur: Optional[EventType[()]] = None,
  195. on_click: Optional[EventType[()]] = None,
  196. on_context_menu: Optional[EventType[()]] = None,
  197. on_double_click: Optional[EventType[()]] = None,
  198. on_focus: Optional[EventType[()]] = None,
  199. on_mount: Optional[EventType[()]] = None,
  200. on_mouse_down: Optional[EventType[()]] = None,
  201. on_mouse_enter: Optional[EventType[()]] = None,
  202. on_mouse_leave: Optional[EventType[()]] = None,
  203. on_mouse_move: Optional[EventType[()]] = None,
  204. on_mouse_out: Optional[EventType[()]] = None,
  205. on_mouse_over: Optional[EventType[()]] = None,
  206. on_mouse_up: Optional[EventType[()]] = None,
  207. on_scroll: Optional[EventType[()]] = None,
  208. on_unmount: Optional[EventType[()]] = None,
  209. **props,
  210. ) -> "FormField":
  211. """Create the component.
  212. Args:
  213. *children: The children of the component.
  214. name: The name of the form field, that is passed down to the control and used to match with validation messages.
  215. server_invalid: Flag to mark the form field as invalid, for server side validation.
  216. as_child: Change the default rendered element for the one passed as a child.
  217. style: The style of the component.
  218. key: A unique key for the component.
  219. id: The id for the component.
  220. class_name: The class name for the component.
  221. autofocus: Whether the component should take the focus once the page is loaded
  222. custom_attrs: custom attribute
  223. **props: The props of the component.
  224. Returns:
  225. The component.
  226. """
  227. ...
  228. class FormLabel(FormComponent):
  229. def add_style(self) -> dict[str, Any] | None: ...
  230. @overload
  231. @classmethod
  232. def create( # type: ignore
  233. cls,
  234. *children,
  235. as_child: Optional[Union[Var[bool], bool]] = None,
  236. style: Optional[Style] = None,
  237. key: Optional[Any] = None,
  238. id: Optional[Any] = None,
  239. class_name: Optional[Any] = None,
  240. autofocus: Optional[bool] = None,
  241. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  242. on_blur: Optional[EventType[()]] = None,
  243. on_click: Optional[EventType[()]] = None,
  244. on_context_menu: Optional[EventType[()]] = None,
  245. on_double_click: Optional[EventType[()]] = None,
  246. on_focus: Optional[EventType[()]] = None,
  247. on_mount: Optional[EventType[()]] = None,
  248. on_mouse_down: Optional[EventType[()]] = None,
  249. on_mouse_enter: Optional[EventType[()]] = None,
  250. on_mouse_leave: Optional[EventType[()]] = None,
  251. on_mouse_move: Optional[EventType[()]] = None,
  252. on_mouse_out: Optional[EventType[()]] = None,
  253. on_mouse_over: Optional[EventType[()]] = None,
  254. on_mouse_up: Optional[EventType[()]] = None,
  255. on_scroll: Optional[EventType[()]] = None,
  256. on_unmount: Optional[EventType[()]] = None,
  257. **props,
  258. ) -> "FormLabel":
  259. """Create the component.
  260. Args:
  261. *children: The children of the component.
  262. as_child: Change the default rendered element for the one passed as a child.
  263. style: The style of the component.
  264. key: A unique key for the component.
  265. id: The id for the component.
  266. class_name: The class name for the component.
  267. autofocus: Whether the component should take the focus once the page is loaded
  268. custom_attrs: custom attribute
  269. **props: The props of the component.
  270. Returns:
  271. The component.
  272. """
  273. ...
  274. class FormControl(FormComponent):
  275. @overload
  276. @classmethod
  277. def create( # type: ignore
  278. cls,
  279. *children,
  280. as_child: Optional[Union[Var[bool], bool]] = None,
  281. style: Optional[Style] = None,
  282. key: Optional[Any] = None,
  283. id: Optional[Any] = None,
  284. class_name: Optional[Any] = None,
  285. autofocus: Optional[bool] = None,
  286. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  287. on_blur: Optional[EventType[()]] = None,
  288. on_click: Optional[EventType[()]] = None,
  289. on_context_menu: Optional[EventType[()]] = None,
  290. on_double_click: Optional[EventType[()]] = None,
  291. on_focus: Optional[EventType[()]] = None,
  292. on_mount: Optional[EventType[()]] = None,
  293. on_mouse_down: Optional[EventType[()]] = None,
  294. on_mouse_enter: Optional[EventType[()]] = None,
  295. on_mouse_leave: Optional[EventType[()]] = None,
  296. on_mouse_move: Optional[EventType[()]] = None,
  297. on_mouse_out: Optional[EventType[()]] = None,
  298. on_mouse_over: Optional[EventType[()]] = None,
  299. on_mouse_up: Optional[EventType[()]] = None,
  300. on_scroll: Optional[EventType[()]] = None,
  301. on_unmount: Optional[EventType[()]] = None,
  302. **props,
  303. ) -> "FormControl":
  304. """Create a Form Control component.
  305. Args:
  306. *children: The children of the form.
  307. as_child: Change the default rendered element for the one passed as a child.
  308. style: The style of the component.
  309. key: A unique key for the component.
  310. id: The id for the component.
  311. class_name: The class name for the component.
  312. autofocus: Whether the component should take the focus once the page is loaded
  313. custom_attrs: custom attribute
  314. **props: The properties of the form.
  315. Raises:
  316. ValueError: If the number of children is greater than 1.
  317. TypeError: If a child exists but it is not a TextFieldInput.
  318. Returns:
  319. The form control component.
  320. """
  321. ...
  322. LiteralMatcher = Literal[
  323. "badInput",
  324. "patternMismatch",
  325. "rangeOverflow",
  326. "rangeUnderflow",
  327. "stepMismatch",
  328. "tooLong",
  329. "tooShort",
  330. "typeMismatch",
  331. "valid",
  332. "valueMissing",
  333. ]
  334. class FormMessage(FormComponent):
  335. def add_style(self) -> dict[str, Any] | None: ...
  336. @overload
  337. @classmethod
  338. def create( # type: ignore
  339. cls,
  340. *children,
  341. name: Optional[Union[Var[str], str]] = None,
  342. match: Optional[
  343. Union[
  344. Literal[
  345. "badInput",
  346. "patternMismatch",
  347. "rangeOverflow",
  348. "rangeUnderflow",
  349. "stepMismatch",
  350. "tooLong",
  351. "tooShort",
  352. "typeMismatch",
  353. "valid",
  354. "valueMissing",
  355. ],
  356. Var[
  357. Literal[
  358. "badInput",
  359. "patternMismatch",
  360. "rangeOverflow",
  361. "rangeUnderflow",
  362. "stepMismatch",
  363. "tooLong",
  364. "tooShort",
  365. "typeMismatch",
  366. "valid",
  367. "valueMissing",
  368. ]
  369. ],
  370. ]
  371. ] = None,
  372. force_match: Optional[Union[Var[bool], bool]] = None,
  373. as_child: Optional[Union[Var[bool], bool]] = None,
  374. style: Optional[Style] = None,
  375. key: Optional[Any] = None,
  376. id: Optional[Any] = None,
  377. class_name: Optional[Any] = None,
  378. autofocus: Optional[bool] = None,
  379. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  380. on_blur: Optional[EventType[()]] = None,
  381. on_click: Optional[EventType[()]] = None,
  382. on_context_menu: Optional[EventType[()]] = None,
  383. on_double_click: Optional[EventType[()]] = None,
  384. on_focus: Optional[EventType[()]] = None,
  385. on_mount: Optional[EventType[()]] = None,
  386. on_mouse_down: Optional[EventType[()]] = None,
  387. on_mouse_enter: Optional[EventType[()]] = None,
  388. on_mouse_leave: Optional[EventType[()]] = None,
  389. on_mouse_move: Optional[EventType[()]] = None,
  390. on_mouse_out: Optional[EventType[()]] = None,
  391. on_mouse_over: Optional[EventType[()]] = None,
  392. on_mouse_up: Optional[EventType[()]] = None,
  393. on_scroll: Optional[EventType[()]] = None,
  394. on_unmount: Optional[EventType[()]] = None,
  395. **props,
  396. ) -> "FormMessage":
  397. """Create the component.
  398. Args:
  399. *children: The children of the component.
  400. name: Used to target a specific field by name when rendering outside of a Field part.
  401. match: Used to indicate on which condition the message should be visible.
  402. force_match: Forces the message to be shown. This is useful when using server-side validation.
  403. as_child: Change the default rendered element for the one passed as a child.
  404. style: The style of the component.
  405. key: A unique key for the component.
  406. id: The id for the component.
  407. class_name: The class name for the component.
  408. autofocus: Whether the component should take the focus once the page is loaded
  409. custom_attrs: custom attribute
  410. **props: The props of the component.
  411. Returns:
  412. The component.
  413. """
  414. ...
  415. class FormValidityState(FormComponent):
  416. @overload
  417. @classmethod
  418. def create( # type: ignore
  419. cls,
  420. *children,
  421. as_child: Optional[Union[Var[bool], bool]] = None,
  422. style: Optional[Style] = None,
  423. key: Optional[Any] = None,
  424. id: Optional[Any] = None,
  425. class_name: Optional[Any] = None,
  426. autofocus: Optional[bool] = None,
  427. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  428. on_blur: Optional[EventType[()]] = None,
  429. on_click: Optional[EventType[()]] = None,
  430. on_context_menu: Optional[EventType[()]] = None,
  431. on_double_click: Optional[EventType[()]] = None,
  432. on_focus: Optional[EventType[()]] = None,
  433. on_mount: Optional[EventType[()]] = None,
  434. on_mouse_down: Optional[EventType[()]] = None,
  435. on_mouse_enter: Optional[EventType[()]] = None,
  436. on_mouse_leave: Optional[EventType[()]] = None,
  437. on_mouse_move: Optional[EventType[()]] = None,
  438. on_mouse_out: Optional[EventType[()]] = None,
  439. on_mouse_over: Optional[EventType[()]] = None,
  440. on_mouse_up: Optional[EventType[()]] = None,
  441. on_scroll: Optional[EventType[()]] = None,
  442. on_unmount: Optional[EventType[()]] = None,
  443. **props,
  444. ) -> "FormValidityState":
  445. """Create the component.
  446. Args:
  447. *children: The children of the component.
  448. as_child: Change the default rendered element for the one passed as a child.
  449. style: The style of the component.
  450. key: A unique key for the component.
  451. id: The id for the component.
  452. class_name: The class name for the component.
  453. autofocus: Whether the component should take the focus once the page is loaded
  454. custom_attrs: custom attribute
  455. **props: The props of the component.
  456. Returns:
  457. The component.
  458. """
  459. ...
  460. class FormSubmit(FormComponent):
  461. @overload
  462. @classmethod
  463. def create( # type: ignore
  464. cls,
  465. *children,
  466. as_child: Optional[Union[Var[bool], bool]] = None,
  467. style: Optional[Style] = None,
  468. key: Optional[Any] = None,
  469. id: Optional[Any] = None,
  470. class_name: Optional[Any] = None,
  471. autofocus: Optional[bool] = None,
  472. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  473. on_blur: Optional[EventType[()]] = None,
  474. on_click: Optional[EventType[()]] = None,
  475. on_context_menu: Optional[EventType[()]] = None,
  476. on_double_click: Optional[EventType[()]] = None,
  477. on_focus: Optional[EventType[()]] = None,
  478. on_mount: Optional[EventType[()]] = None,
  479. on_mouse_down: Optional[EventType[()]] = None,
  480. on_mouse_enter: Optional[EventType[()]] = None,
  481. on_mouse_leave: Optional[EventType[()]] = None,
  482. on_mouse_move: Optional[EventType[()]] = None,
  483. on_mouse_out: Optional[EventType[()]] = None,
  484. on_mouse_over: Optional[EventType[()]] = None,
  485. on_mouse_up: Optional[EventType[()]] = None,
  486. on_scroll: Optional[EventType[()]] = None,
  487. on_unmount: Optional[EventType[()]] = None,
  488. **props,
  489. ) -> "FormSubmit":
  490. """Create the component.
  491. Args:
  492. *children: The children of the component.
  493. as_child: Change the default rendered element for the one passed as a child.
  494. style: The style of the component.
  495. key: A unique key for the component.
  496. id: The id for the component.
  497. class_name: The class name for the component.
  498. autofocus: Whether the component should take the focus once the page is loaded
  499. custom_attrs: custom attribute
  500. **props: The props of the component.
  501. Returns:
  502. The component.
  503. """
  504. ...
  505. class Form(FormRoot):
  506. pass
  507. @overload
  508. @classmethod
  509. def create( # type: ignore
  510. cls,
  511. *children,
  512. as_child: Optional[Union[Var[bool], bool]] = None,
  513. accept: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  514. accept_charset: Optional[
  515. Union[Var[Union[bool, int, str]], bool, int, str]
  516. ] = None,
  517. action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  518. auto_complete: Optional[
  519. Union[Var[Union[bool, int, str]], bool, int, str]
  520. ] = None,
  521. enc_type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  522. method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  523. name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  524. no_validate: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  525. target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  526. reset_on_submit: Optional[Union[Var[bool], bool]] = None,
  527. handle_submit_unique_name: Optional[Union[Var[str], str]] = None,
  528. access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  529. auto_capitalize: Optional[
  530. Union[Var[Union[bool, int, str]], bool, int, str]
  531. ] = None,
  532. content_editable: Optional[
  533. Union[Var[Union[bool, int, str]], bool, int, str]
  534. ] = None,
  535. context_menu: Optional[
  536. Union[Var[Union[bool, int, str]], bool, int, str]
  537. ] = None,
  538. dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  539. draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  540. enter_key_hint: Optional[
  541. Union[Var[Union[bool, int, str]], bool, int, str]
  542. ] = None,
  543. hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  544. input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  545. item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  546. lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  547. role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  548. slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  549. spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  550. tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  551. title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  552. style: Optional[Style] = None,
  553. key: Optional[Any] = None,
  554. id: Optional[Any] = None,
  555. class_name: Optional[Any] = None,
  556. autofocus: Optional[bool] = None,
  557. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  558. on_blur: Optional[EventType[()]] = None,
  559. on_clear_server_errors: Optional[EventType[()]] = None,
  560. on_click: Optional[EventType[()]] = None,
  561. on_context_menu: Optional[EventType[()]] = None,
  562. on_double_click: Optional[EventType[()]] = None,
  563. on_focus: Optional[EventType[()]] = None,
  564. on_mount: Optional[EventType[()]] = None,
  565. on_mouse_down: Optional[EventType[()]] = None,
  566. on_mouse_enter: Optional[EventType[()]] = None,
  567. on_mouse_leave: Optional[EventType[()]] = None,
  568. on_mouse_move: Optional[EventType[()]] = None,
  569. on_mouse_out: Optional[EventType[()]] = None,
  570. on_mouse_over: Optional[EventType[()]] = None,
  571. on_mouse_up: Optional[EventType[()]] = None,
  572. on_scroll: Optional[EventType[()]] = None,
  573. on_submit: Optional[
  574. Union[
  575. Union[EventType[()], EventType[dict[str, Any]]],
  576. Union[EventType[()], EventType[dict[str, str]]],
  577. ]
  578. ] = None,
  579. on_unmount: Optional[EventType[()]] = None,
  580. **props,
  581. ) -> "Form":
  582. """Create a form component.
  583. Args:
  584. *children: The children of the form.
  585. on_clear_server_errors: Fired when the errors are cleared.
  586. as_child: Change the default rendered element for the one passed as a child.
  587. accept: MIME types the server accepts for file upload
  588. accept_charset: Character encodings to be used for form submission
  589. action: URL where the form's data should be submitted
  590. auto_complete: Whether the form should have autocomplete enabled
  591. enc_type: Encoding type for the form data when submitted
  592. method: HTTP method to use for form submission
  593. name: Name of the form
  594. no_validate: Indicates that the form should not be validated on submit
  595. target: Where to display the response after submitting the form
  596. reset_on_submit: If true, the form will be cleared after submit.
  597. handle_submit_unique_name: The name used to make this form's submit handler function unique.
  598. on_submit: Fired when the form is submitted
  599. access_key: Provides a hint for generating a keyboard shortcut for the current element.
  600. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
  601. content_editable: Indicates whether the element's content is editable.
  602. context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
  603. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
  604. draggable: Defines whether the element can be dragged.
  605. enter_key_hint: Hints what media types the media element is able to play.
  606. hidden: Defines whether the element is hidden.
  607. input_mode: Defines the type of the element.
  608. item_prop: Defines the name of the element for metadata purposes.
  609. lang: Defines the language used in the element.
  610. role: Defines the role of the element.
  611. slot: Assigns a slot in a shadow DOM shadow tree to an element.
  612. spell_check: Defines whether the element may be checked for spelling errors.
  613. tab_index: Defines the position of the current element in the tabbing order.
  614. title: Defines a tooltip for the element.
  615. style: The style of the component.
  616. key: A unique key for the component.
  617. id: The id for the component.
  618. class_name: The class name for the component.
  619. autofocus: Whether the component should take the focus once the page is loaded
  620. custom_attrs: custom attribute
  621. **props: The properties of the form.
  622. Returns:
  623. The form component.
  624. """
  625. ...
  626. class FormNamespace(ComponentNamespace):
  627. root = staticmethod(FormRoot.create)
  628. control = staticmethod(FormControl.create)
  629. field = staticmethod(FormField.create)
  630. label = staticmethod(FormLabel.create)
  631. message = staticmethod(FormMessage.create)
  632. submit = staticmethod(FormSubmit.create)
  633. validity_state = staticmethod(FormValidityState.create)
  634. @staticmethod
  635. def __call__(
  636. *children,
  637. as_child: Optional[Union[Var[bool], bool]] = None,
  638. accept: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  639. accept_charset: Optional[
  640. Union[Var[Union[bool, int, str]], bool, int, str]
  641. ] = None,
  642. action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  643. auto_complete: Optional[
  644. Union[Var[Union[bool, int, str]], bool, int, str]
  645. ] = None,
  646. enc_type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  647. method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  648. name: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  649. no_validate: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  650. target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  651. reset_on_submit: Optional[Union[Var[bool], bool]] = None,
  652. handle_submit_unique_name: Optional[Union[Var[str], str]] = None,
  653. access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  654. auto_capitalize: Optional[
  655. Union[Var[Union[bool, int, str]], bool, int, str]
  656. ] = None,
  657. content_editable: Optional[
  658. Union[Var[Union[bool, int, str]], bool, int, str]
  659. ] = None,
  660. context_menu: Optional[
  661. Union[Var[Union[bool, int, str]], bool, int, str]
  662. ] = None,
  663. dir: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  664. draggable: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  665. enter_key_hint: Optional[
  666. Union[Var[Union[bool, int, str]], bool, int, str]
  667. ] = None,
  668. hidden: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  669. input_mode: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  670. item_prop: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  671. lang: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  672. role: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  673. slot: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  674. spell_check: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  675. tab_index: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  676. title: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
  677. style: Optional[Style] = None,
  678. key: Optional[Any] = None,
  679. id: Optional[Any] = None,
  680. class_name: Optional[Any] = None,
  681. autofocus: Optional[bool] = None,
  682. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  683. on_blur: Optional[EventType[()]] = None,
  684. on_clear_server_errors: Optional[EventType[()]] = None,
  685. on_click: Optional[EventType[()]] = None,
  686. on_context_menu: Optional[EventType[()]] = None,
  687. on_double_click: Optional[EventType[()]] = None,
  688. on_focus: Optional[EventType[()]] = None,
  689. on_mount: Optional[EventType[()]] = None,
  690. on_mouse_down: Optional[EventType[()]] = None,
  691. on_mouse_enter: Optional[EventType[()]] = None,
  692. on_mouse_leave: Optional[EventType[()]] = None,
  693. on_mouse_move: Optional[EventType[()]] = None,
  694. on_mouse_out: Optional[EventType[()]] = None,
  695. on_mouse_over: Optional[EventType[()]] = None,
  696. on_mouse_up: Optional[EventType[()]] = None,
  697. on_scroll: Optional[EventType[()]] = None,
  698. on_submit: Optional[
  699. Union[
  700. Union[EventType[()], EventType[dict[str, Any]]],
  701. Union[EventType[()], EventType[dict[str, str]]],
  702. ]
  703. ] = None,
  704. on_unmount: Optional[EventType[()]] = None,
  705. **props,
  706. ) -> "Form":
  707. """Create a form component.
  708. Args:
  709. *children: The children of the form.
  710. on_clear_server_errors: Fired when the errors are cleared.
  711. as_child: Change the default rendered element for the one passed as a child.
  712. accept: MIME types the server accepts for file upload
  713. accept_charset: Character encodings to be used for form submission
  714. action: URL where the form's data should be submitted
  715. auto_complete: Whether the form should have autocomplete enabled
  716. enc_type: Encoding type for the form data when submitted
  717. method: HTTP method to use for form submission
  718. name: Name of the form
  719. no_validate: Indicates that the form should not be validated on submit
  720. target: Where to display the response after submitting the form
  721. reset_on_submit: If true, the form will be cleared after submit.
  722. handle_submit_unique_name: The name used to make this form's submit handler function unique.
  723. on_submit: Fired when the form is submitted
  724. access_key: Provides a hint for generating a keyboard shortcut for the current element.
  725. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
  726. content_editable: Indicates whether the element's content is editable.
  727. context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
  728. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
  729. draggable: Defines whether the element can be dragged.
  730. enter_key_hint: Hints what media types the media element is able to play.
  731. hidden: Defines whether the element is hidden.
  732. input_mode: Defines the type of the element.
  733. item_prop: Defines the name of the element for metadata purposes.
  734. lang: Defines the language used in the element.
  735. role: Defines the role of the element.
  736. slot: Assigns a slot in a shadow DOM shadow tree to an element.
  737. spell_check: Defines whether the element may be checked for spelling errors.
  738. tab_index: Defines the position of the current element in the tabbing order.
  739. title: Defines a tooltip for the element.
  740. style: The style of the component.
  741. key: A unique key for the component.
  742. id: The id for the component.
  743. class_name: The class name for the component.
  744. autofocus: Whether the component should take the focus once the page is loaded
  745. custom_attrs: custom attribute
  746. **props: The properties of the form.
  747. Returns:
  748. The form component.
  749. """
  750. ...
  751. form = FormNamespace()