form.pyi 39 KB

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