1
0

form.pyi 36 KB

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