form.pyi 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236
  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, 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: Var[bool] | bool | None = None,
  19. style: Style | None = None,
  20. key: Any | None = None,
  21. id: Any | None = None,
  22. class_name: Any | None = None,
  23. autofocus: bool | None = None,
  24. custom_attrs: dict[str, Var | Any] | None = 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: Var[bool] | bool | None = None,
  65. accept: Var[str] | str | None = None,
  66. accept_charset: Var[str] | str | None = None,
  67. action: Var[str] | str | None = None,
  68. auto_complete: Var[str] | str | None = None,
  69. enc_type: Var[str] | str | None = None,
  70. method: Var[str] | str | None = None,
  71. name: Var[str] | str | None = None,
  72. no_validate: Var[bool] | bool | None = None,
  73. target: Var[str] | str | None = None,
  74. reset_on_submit: Var[bool] | bool | None = None,
  75. handle_submit_unique_name: Var[str] | str | None = None,
  76. access_key: Var[str] | str | None = None,
  77. auto_capitalize: Literal[
  78. "characters", "none", "off", "on", "sentences", "words"
  79. ]
  80. | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
  81. | None = None,
  82. content_editable: Literal["inherit", "plaintext-only", False, True]
  83. | Var[Literal["inherit", "plaintext-only", False, True]]
  84. | None = None,
  85. context_menu: Var[str] | str | None = None,
  86. dir: Var[str] | str | None = None,
  87. draggable: Var[bool] | bool | None = None,
  88. enter_key_hint: Literal[
  89. "done", "enter", "go", "next", "previous", "search", "send"
  90. ]
  91. | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
  92. | None = None,
  93. hidden: Var[bool] | bool | None = None,
  94. input_mode: Literal[
  95. "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
  96. ]
  97. | Var[
  98. Literal[
  99. "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
  100. ]
  101. ]
  102. | None = None,
  103. item_prop: Var[str] | str | None = None,
  104. lang: Var[str] | str | None = None,
  105. role: Literal[
  106. "alert",
  107. "alertdialog",
  108. "application",
  109. "article",
  110. "banner",
  111. "button",
  112. "cell",
  113. "checkbox",
  114. "columnheader",
  115. "combobox",
  116. "complementary",
  117. "contentinfo",
  118. "definition",
  119. "dialog",
  120. "directory",
  121. "document",
  122. "feed",
  123. "figure",
  124. "form",
  125. "grid",
  126. "gridcell",
  127. "group",
  128. "heading",
  129. "img",
  130. "link",
  131. "list",
  132. "listbox",
  133. "listitem",
  134. "log",
  135. "main",
  136. "marquee",
  137. "math",
  138. "menu",
  139. "menubar",
  140. "menuitem",
  141. "menuitemcheckbox",
  142. "menuitemradio",
  143. "navigation",
  144. "none",
  145. "note",
  146. "option",
  147. "presentation",
  148. "progressbar",
  149. "radio",
  150. "radiogroup",
  151. "region",
  152. "row",
  153. "rowgroup",
  154. "rowheader",
  155. "scrollbar",
  156. "search",
  157. "searchbox",
  158. "separator",
  159. "slider",
  160. "spinbutton",
  161. "status",
  162. "switch",
  163. "tab",
  164. "table",
  165. "tablist",
  166. "tabpanel",
  167. "term",
  168. "textbox",
  169. "timer",
  170. "toolbar",
  171. "tooltip",
  172. "tree",
  173. "treegrid",
  174. "treeitem",
  175. ]
  176. | Var[
  177. Literal[
  178. "alert",
  179. "alertdialog",
  180. "application",
  181. "article",
  182. "banner",
  183. "button",
  184. "cell",
  185. "checkbox",
  186. "columnheader",
  187. "combobox",
  188. "complementary",
  189. "contentinfo",
  190. "definition",
  191. "dialog",
  192. "directory",
  193. "document",
  194. "feed",
  195. "figure",
  196. "form",
  197. "grid",
  198. "gridcell",
  199. "group",
  200. "heading",
  201. "img",
  202. "link",
  203. "list",
  204. "listbox",
  205. "listitem",
  206. "log",
  207. "main",
  208. "marquee",
  209. "math",
  210. "menu",
  211. "menubar",
  212. "menuitem",
  213. "menuitemcheckbox",
  214. "menuitemradio",
  215. "navigation",
  216. "none",
  217. "note",
  218. "option",
  219. "presentation",
  220. "progressbar",
  221. "radio",
  222. "radiogroup",
  223. "region",
  224. "row",
  225. "rowgroup",
  226. "rowheader",
  227. "scrollbar",
  228. "search",
  229. "searchbox",
  230. "separator",
  231. "slider",
  232. "spinbutton",
  233. "status",
  234. "switch",
  235. "tab",
  236. "table",
  237. "tablist",
  238. "tabpanel",
  239. "term",
  240. "textbox",
  241. "timer",
  242. "toolbar",
  243. "tooltip",
  244. "tree",
  245. "treegrid",
  246. "treeitem",
  247. ]
  248. ]
  249. | None = None,
  250. slot: Var[str] | str | None = None,
  251. spell_check: Var[bool] | bool | None = None,
  252. tab_index: Var[int] | int | None = None,
  253. title: Var[str] | str | None = None,
  254. style: Style | None = None,
  255. key: Any | None = None,
  256. id: Any | None = None,
  257. class_name: Any | None = None,
  258. autofocus: bool | None = None,
  259. custom_attrs: dict[str, Var | Any] | None = None,
  260. on_blur: Optional[EventType[()]] = None,
  261. on_clear_server_errors: Optional[EventType[()]] = None,
  262. on_click: Optional[EventType[()]] = None,
  263. on_context_menu: Optional[EventType[()]] = None,
  264. on_double_click: Optional[EventType[()]] = None,
  265. on_focus: Optional[EventType[()]] = None,
  266. on_mount: Optional[EventType[()]] = None,
  267. on_mouse_down: Optional[EventType[()]] = None,
  268. on_mouse_enter: Optional[EventType[()]] = None,
  269. on_mouse_leave: Optional[EventType[()]] = None,
  270. on_mouse_move: Optional[EventType[()]] = None,
  271. on_mouse_out: Optional[EventType[()]] = None,
  272. on_mouse_over: Optional[EventType[()]] = None,
  273. on_mouse_up: Optional[EventType[()]] = None,
  274. on_scroll: Optional[EventType[()]] = None,
  275. on_submit: Optional[
  276. Union[
  277. EventType[()] | EventType[dict[str, Any]],
  278. EventType[()] | EventType[dict[str, str]],
  279. ]
  280. ] = None,
  281. on_unmount: Optional[EventType[()]] = None,
  282. **props,
  283. ) -> "FormRoot":
  284. """Create a form component.
  285. Args:
  286. *children: The children of the form.
  287. on_clear_server_errors: Fired when the errors are cleared.
  288. as_child: Change the default rendered element for the one passed as a child.
  289. accept: MIME types the server accepts for file upload
  290. accept_charset: Character encodings to be used for form submission
  291. action: URL where the form's data should be submitted
  292. auto_complete: Whether the form should have autocomplete enabled
  293. enc_type: Encoding type for the form data when submitted
  294. method: HTTP method to use for form submission
  295. name: Name of the form
  296. no_validate: Indicates that the form should not be validated on submit
  297. target: Where to display the response after submitting the form
  298. reset_on_submit: If true, the form will be cleared after submit.
  299. handle_submit_unique_name: The name used to make this form's submit handler function unique.
  300. on_submit: Fired when the form is submitted
  301. access_key: Provides a hint for generating a keyboard shortcut for the current element.
  302. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
  303. content_editable: Indicates whether the element's content is editable.
  304. context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
  305. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
  306. draggable: Defines whether the element can be dragged.
  307. enter_key_hint: Hints what media types the media element is able to play.
  308. hidden: Defines whether the element is hidden.
  309. input_mode: Defines the type of the element.
  310. item_prop: Defines the name of the element for metadata purposes.
  311. lang: Defines the language used in the element.
  312. role: Defines the role of the element.
  313. slot: Assigns a slot in a shadow DOM shadow tree to an element.
  314. spell_check: Defines whether the element may be checked for spelling errors.
  315. tab_index: Defines the position of the current element in the tabbing order.
  316. title: Defines a tooltip for the element.
  317. style: The style of the component.
  318. key: A unique key for the component.
  319. id: The id for the component.
  320. class_name: The class name for the component.
  321. autofocus: Whether the component should take the focus once the page is loaded
  322. custom_attrs: custom attribute
  323. **props: The properties of the form.
  324. Returns:
  325. The form component.
  326. """
  327. ...
  328. class FormField(FormComponent):
  329. def add_style(self) -> dict[str, Any] | None: ...
  330. @overload
  331. @classmethod
  332. def create( # type: ignore
  333. cls,
  334. *children,
  335. name: Var[str] | str | None = None,
  336. server_invalid: Var[bool] | bool | None = None,
  337. as_child: Var[bool] | bool | None = None,
  338. style: Style | None = None,
  339. key: Any | None = None,
  340. id: Any | None = None,
  341. class_name: Any | None = None,
  342. autofocus: bool | None = None,
  343. custom_attrs: dict[str, Var | Any] | None = None,
  344. on_blur: Optional[EventType[()]] = None,
  345. on_click: Optional[EventType[()]] = None,
  346. on_context_menu: Optional[EventType[()]] = None,
  347. on_double_click: Optional[EventType[()]] = None,
  348. on_focus: Optional[EventType[()]] = None,
  349. on_mount: Optional[EventType[()]] = None,
  350. on_mouse_down: Optional[EventType[()]] = None,
  351. on_mouse_enter: Optional[EventType[()]] = None,
  352. on_mouse_leave: Optional[EventType[()]] = None,
  353. on_mouse_move: Optional[EventType[()]] = None,
  354. on_mouse_out: Optional[EventType[()]] = None,
  355. on_mouse_over: Optional[EventType[()]] = None,
  356. on_mouse_up: Optional[EventType[()]] = None,
  357. on_scroll: Optional[EventType[()]] = None,
  358. on_unmount: Optional[EventType[()]] = None,
  359. **props,
  360. ) -> "FormField":
  361. """Create the component.
  362. Args:
  363. *children: The children of the component.
  364. name: The name of the form field, that is passed down to the control and used to match with validation messages.
  365. server_invalid: Flag to mark the form field as invalid, for server side validation.
  366. as_child: Change the default rendered element for the one passed as a child.
  367. style: The style of the component.
  368. key: A unique key for the component.
  369. id: The id for the component.
  370. class_name: The class name for the component.
  371. autofocus: Whether the component should take the focus once the page is loaded
  372. custom_attrs: custom attribute
  373. **props: The props of the component.
  374. Returns:
  375. The component.
  376. """
  377. ...
  378. class FormLabel(FormComponent):
  379. def add_style(self) -> dict[str, Any] | None: ...
  380. @overload
  381. @classmethod
  382. def create( # type: ignore
  383. cls,
  384. *children,
  385. as_child: Var[bool] | bool | None = None,
  386. style: Style | None = None,
  387. key: Any | None = None,
  388. id: Any | None = None,
  389. class_name: Any | None = None,
  390. autofocus: bool | None = None,
  391. custom_attrs: dict[str, Var | Any] | None = None,
  392. on_blur: Optional[EventType[()]] = None,
  393. on_click: Optional[EventType[()]] = None,
  394. on_context_menu: Optional[EventType[()]] = None,
  395. on_double_click: Optional[EventType[()]] = None,
  396. on_focus: Optional[EventType[()]] = None,
  397. on_mount: Optional[EventType[()]] = None,
  398. on_mouse_down: Optional[EventType[()]] = None,
  399. on_mouse_enter: Optional[EventType[()]] = None,
  400. on_mouse_leave: Optional[EventType[()]] = None,
  401. on_mouse_move: Optional[EventType[()]] = None,
  402. on_mouse_out: Optional[EventType[()]] = None,
  403. on_mouse_over: Optional[EventType[()]] = None,
  404. on_mouse_up: Optional[EventType[()]] = None,
  405. on_scroll: Optional[EventType[()]] = None,
  406. on_unmount: Optional[EventType[()]] = None,
  407. **props,
  408. ) -> "FormLabel":
  409. """Create the component.
  410. Args:
  411. *children: The children of the component.
  412. as_child: Change the default rendered element for the one passed as a child.
  413. style: The style of the component.
  414. key: A unique key for the component.
  415. id: The id for the component.
  416. class_name: The class name for the component.
  417. autofocus: Whether the component should take the focus once the page is loaded
  418. custom_attrs: custom attribute
  419. **props: The props of the component.
  420. Returns:
  421. The component.
  422. """
  423. ...
  424. class FormControl(FormComponent):
  425. @overload
  426. @classmethod
  427. def create( # type: ignore
  428. cls,
  429. *children,
  430. as_child: Var[bool] | bool | None = None,
  431. style: Style | None = None,
  432. key: Any | None = None,
  433. id: Any | None = None,
  434. class_name: Any | None = None,
  435. autofocus: bool | None = None,
  436. custom_attrs: dict[str, Var | Any] | None = None,
  437. on_blur: Optional[EventType[()]] = None,
  438. on_click: Optional[EventType[()]] = None,
  439. on_context_menu: Optional[EventType[()]] = None,
  440. on_double_click: Optional[EventType[()]] = None,
  441. on_focus: Optional[EventType[()]] = None,
  442. on_mount: Optional[EventType[()]] = None,
  443. on_mouse_down: Optional[EventType[()]] = None,
  444. on_mouse_enter: Optional[EventType[()]] = None,
  445. on_mouse_leave: Optional[EventType[()]] = None,
  446. on_mouse_move: Optional[EventType[()]] = None,
  447. on_mouse_out: Optional[EventType[()]] = None,
  448. on_mouse_over: Optional[EventType[()]] = None,
  449. on_mouse_up: Optional[EventType[()]] = None,
  450. on_scroll: Optional[EventType[()]] = None,
  451. on_unmount: Optional[EventType[()]] = None,
  452. **props,
  453. ) -> "FormControl":
  454. """Create a Form Control component.
  455. Args:
  456. *children: The children of the form.
  457. as_child: Change the default rendered element for the one passed as a child.
  458. style: The style of the component.
  459. key: A unique key for the component.
  460. id: The id for the component.
  461. class_name: The class name for the component.
  462. autofocus: Whether the component should take the focus once the page is loaded
  463. custom_attrs: custom attribute
  464. **props: The properties of the form.
  465. Raises:
  466. ValueError: If the number of children is greater than 1.
  467. TypeError: If a child exists but it is not a TextFieldInput.
  468. Returns:
  469. The form control component.
  470. """
  471. ...
  472. LiteralMatcher = Literal[
  473. "badInput",
  474. "patternMismatch",
  475. "rangeOverflow",
  476. "rangeUnderflow",
  477. "stepMismatch",
  478. "tooLong",
  479. "tooShort",
  480. "typeMismatch",
  481. "valid",
  482. "valueMissing",
  483. ]
  484. class FormMessage(FormComponent):
  485. def add_style(self) -> dict[str, Any] | None: ...
  486. @overload
  487. @classmethod
  488. def create( # type: ignore
  489. cls,
  490. *children,
  491. name: Var[str] | str | None = None,
  492. match: Literal[
  493. "badInput",
  494. "patternMismatch",
  495. "rangeOverflow",
  496. "rangeUnderflow",
  497. "stepMismatch",
  498. "tooLong",
  499. "tooShort",
  500. "typeMismatch",
  501. "valid",
  502. "valueMissing",
  503. ]
  504. | Var[
  505. Literal[
  506. "badInput",
  507. "patternMismatch",
  508. "rangeOverflow",
  509. "rangeUnderflow",
  510. "stepMismatch",
  511. "tooLong",
  512. "tooShort",
  513. "typeMismatch",
  514. "valid",
  515. "valueMissing",
  516. ]
  517. ]
  518. | None = None,
  519. force_match: Var[bool] | bool | None = None,
  520. as_child: Var[bool] | bool | None = None,
  521. style: Style | None = None,
  522. key: Any | None = None,
  523. id: Any | None = None,
  524. class_name: Any | None = None,
  525. autofocus: bool | None = None,
  526. custom_attrs: dict[str, Var | Any] | None = None,
  527. on_blur: Optional[EventType[()]] = None,
  528. on_click: Optional[EventType[()]] = None,
  529. on_context_menu: Optional[EventType[()]] = None,
  530. on_double_click: Optional[EventType[()]] = None,
  531. on_focus: Optional[EventType[()]] = None,
  532. on_mount: Optional[EventType[()]] = None,
  533. on_mouse_down: Optional[EventType[()]] = None,
  534. on_mouse_enter: Optional[EventType[()]] = None,
  535. on_mouse_leave: Optional[EventType[()]] = None,
  536. on_mouse_move: Optional[EventType[()]] = None,
  537. on_mouse_out: Optional[EventType[()]] = None,
  538. on_mouse_over: Optional[EventType[()]] = None,
  539. on_mouse_up: Optional[EventType[()]] = None,
  540. on_scroll: Optional[EventType[()]] = None,
  541. on_unmount: Optional[EventType[()]] = None,
  542. **props,
  543. ) -> "FormMessage":
  544. """Create the component.
  545. Args:
  546. *children: The children of the component.
  547. name: Used to target a specific field by name when rendering outside of a Field part.
  548. match: Used to indicate on which condition the message should be visible.
  549. force_match: Forces the message to be shown. This is useful when using server-side validation.
  550. as_child: Change the default rendered element for the one passed as a child.
  551. style: The style of the component.
  552. key: A unique key for the component.
  553. id: The id for the component.
  554. class_name: The class name for the component.
  555. autofocus: Whether the component should take the focus once the page is loaded
  556. custom_attrs: custom attribute
  557. **props: The props of the component.
  558. Returns:
  559. The component.
  560. """
  561. ...
  562. class FormValidityState(FormComponent):
  563. @overload
  564. @classmethod
  565. def create( # type: ignore
  566. cls,
  567. *children,
  568. as_child: Var[bool] | bool | None = None,
  569. style: Style | None = None,
  570. key: Any | None = None,
  571. id: Any | None = None,
  572. class_name: Any | None = None,
  573. autofocus: bool | None = None,
  574. custom_attrs: dict[str, Var | Any] | None = None,
  575. on_blur: Optional[EventType[()]] = None,
  576. on_click: Optional[EventType[()]] = None,
  577. on_context_menu: Optional[EventType[()]] = None,
  578. on_double_click: Optional[EventType[()]] = None,
  579. on_focus: Optional[EventType[()]] = None,
  580. on_mount: Optional[EventType[()]] = None,
  581. on_mouse_down: Optional[EventType[()]] = None,
  582. on_mouse_enter: Optional[EventType[()]] = None,
  583. on_mouse_leave: Optional[EventType[()]] = None,
  584. on_mouse_move: Optional[EventType[()]] = None,
  585. on_mouse_out: Optional[EventType[()]] = None,
  586. on_mouse_over: Optional[EventType[()]] = None,
  587. on_mouse_up: Optional[EventType[()]] = None,
  588. on_scroll: Optional[EventType[()]] = None,
  589. on_unmount: Optional[EventType[()]] = None,
  590. **props,
  591. ) -> "FormValidityState":
  592. """Create the component.
  593. Args:
  594. *children: The children of the component.
  595. as_child: Change the default rendered element for the one passed as a child.
  596. style: The style of the component.
  597. key: A unique key for the component.
  598. id: The id for the component.
  599. class_name: The class name for the component.
  600. autofocus: Whether the component should take the focus once the page is loaded
  601. custom_attrs: custom attribute
  602. **props: The props of the component.
  603. Returns:
  604. The component.
  605. """
  606. ...
  607. class FormSubmit(FormComponent):
  608. @overload
  609. @classmethod
  610. def create( # type: ignore
  611. cls,
  612. *children,
  613. as_child: Var[bool] | bool | None = None,
  614. style: Style | None = None,
  615. key: Any | None = None,
  616. id: Any | None = None,
  617. class_name: Any | None = None,
  618. autofocus: bool | None = None,
  619. custom_attrs: dict[str, Var | Any] | None = None,
  620. on_blur: Optional[EventType[()]] = None,
  621. on_click: Optional[EventType[()]] = None,
  622. on_context_menu: Optional[EventType[()]] = None,
  623. on_double_click: Optional[EventType[()]] = None,
  624. on_focus: Optional[EventType[()]] = None,
  625. on_mount: Optional[EventType[()]] = None,
  626. on_mouse_down: Optional[EventType[()]] = None,
  627. on_mouse_enter: Optional[EventType[()]] = None,
  628. on_mouse_leave: Optional[EventType[()]] = None,
  629. on_mouse_move: Optional[EventType[()]] = None,
  630. on_mouse_out: Optional[EventType[()]] = None,
  631. on_mouse_over: Optional[EventType[()]] = None,
  632. on_mouse_up: Optional[EventType[()]] = None,
  633. on_scroll: Optional[EventType[()]] = None,
  634. on_unmount: Optional[EventType[()]] = None,
  635. **props,
  636. ) -> "FormSubmit":
  637. """Create the component.
  638. Args:
  639. *children: The children of the component.
  640. as_child: Change the default rendered element for the one passed as a child.
  641. style: The style of the component.
  642. key: A unique key for the component.
  643. id: The id for the component.
  644. class_name: The class name for the component.
  645. autofocus: Whether the component should take the focus once the page is loaded
  646. custom_attrs: custom attribute
  647. **props: The props of the component.
  648. Returns:
  649. The component.
  650. """
  651. ...
  652. class Form(FormRoot):
  653. pass
  654. @overload
  655. @classmethod
  656. def create( # type: ignore
  657. cls,
  658. *children,
  659. as_child: Var[bool] | bool | None = None,
  660. accept: Var[str] | str | None = None,
  661. accept_charset: Var[str] | str | None = None,
  662. action: Var[str] | str | None = None,
  663. auto_complete: Var[str] | str | None = None,
  664. enc_type: Var[str] | str | None = None,
  665. method: Var[str] | str | None = None,
  666. name: Var[str] | str | None = None,
  667. no_validate: Var[bool] | bool | None = None,
  668. target: Var[str] | str | None = None,
  669. reset_on_submit: Var[bool] | bool | None = None,
  670. handle_submit_unique_name: Var[str] | str | None = None,
  671. access_key: Var[str] | str | None = None,
  672. auto_capitalize: Literal[
  673. "characters", "none", "off", "on", "sentences", "words"
  674. ]
  675. | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
  676. | None = None,
  677. content_editable: Literal["inherit", "plaintext-only", False, True]
  678. | Var[Literal["inherit", "plaintext-only", False, True]]
  679. | None = None,
  680. context_menu: Var[str] | str | None = None,
  681. dir: Var[str] | str | None = None,
  682. draggable: Var[bool] | bool | None = None,
  683. enter_key_hint: Literal[
  684. "done", "enter", "go", "next", "previous", "search", "send"
  685. ]
  686. | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
  687. | None = None,
  688. hidden: Var[bool] | bool | None = None,
  689. input_mode: Literal[
  690. "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
  691. ]
  692. | Var[
  693. Literal[
  694. "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
  695. ]
  696. ]
  697. | None = None,
  698. item_prop: Var[str] | str | None = None,
  699. lang: Var[str] | str | None = None,
  700. role: Literal[
  701. "alert",
  702. "alertdialog",
  703. "application",
  704. "article",
  705. "banner",
  706. "button",
  707. "cell",
  708. "checkbox",
  709. "columnheader",
  710. "combobox",
  711. "complementary",
  712. "contentinfo",
  713. "definition",
  714. "dialog",
  715. "directory",
  716. "document",
  717. "feed",
  718. "figure",
  719. "form",
  720. "grid",
  721. "gridcell",
  722. "group",
  723. "heading",
  724. "img",
  725. "link",
  726. "list",
  727. "listbox",
  728. "listitem",
  729. "log",
  730. "main",
  731. "marquee",
  732. "math",
  733. "menu",
  734. "menubar",
  735. "menuitem",
  736. "menuitemcheckbox",
  737. "menuitemradio",
  738. "navigation",
  739. "none",
  740. "note",
  741. "option",
  742. "presentation",
  743. "progressbar",
  744. "radio",
  745. "radiogroup",
  746. "region",
  747. "row",
  748. "rowgroup",
  749. "rowheader",
  750. "scrollbar",
  751. "search",
  752. "searchbox",
  753. "separator",
  754. "slider",
  755. "spinbutton",
  756. "status",
  757. "switch",
  758. "tab",
  759. "table",
  760. "tablist",
  761. "tabpanel",
  762. "term",
  763. "textbox",
  764. "timer",
  765. "toolbar",
  766. "tooltip",
  767. "tree",
  768. "treegrid",
  769. "treeitem",
  770. ]
  771. | Var[
  772. Literal[
  773. "alert",
  774. "alertdialog",
  775. "application",
  776. "article",
  777. "banner",
  778. "button",
  779. "cell",
  780. "checkbox",
  781. "columnheader",
  782. "combobox",
  783. "complementary",
  784. "contentinfo",
  785. "definition",
  786. "dialog",
  787. "directory",
  788. "document",
  789. "feed",
  790. "figure",
  791. "form",
  792. "grid",
  793. "gridcell",
  794. "group",
  795. "heading",
  796. "img",
  797. "link",
  798. "list",
  799. "listbox",
  800. "listitem",
  801. "log",
  802. "main",
  803. "marquee",
  804. "math",
  805. "menu",
  806. "menubar",
  807. "menuitem",
  808. "menuitemcheckbox",
  809. "menuitemradio",
  810. "navigation",
  811. "none",
  812. "note",
  813. "option",
  814. "presentation",
  815. "progressbar",
  816. "radio",
  817. "radiogroup",
  818. "region",
  819. "row",
  820. "rowgroup",
  821. "rowheader",
  822. "scrollbar",
  823. "search",
  824. "searchbox",
  825. "separator",
  826. "slider",
  827. "spinbutton",
  828. "status",
  829. "switch",
  830. "tab",
  831. "table",
  832. "tablist",
  833. "tabpanel",
  834. "term",
  835. "textbox",
  836. "timer",
  837. "toolbar",
  838. "tooltip",
  839. "tree",
  840. "treegrid",
  841. "treeitem",
  842. ]
  843. ]
  844. | None = None,
  845. slot: Var[str] | str | None = None,
  846. spell_check: Var[bool] | bool | None = None,
  847. tab_index: Var[int] | int | None = None,
  848. title: Var[str] | str | None = None,
  849. style: Style | None = None,
  850. key: Any | None = None,
  851. id: Any | None = None,
  852. class_name: Any | None = None,
  853. autofocus: bool | None = None,
  854. custom_attrs: dict[str, Var | Any] | None = None,
  855. on_blur: Optional[EventType[()]] = None,
  856. on_clear_server_errors: Optional[EventType[()]] = None,
  857. on_click: Optional[EventType[()]] = None,
  858. on_context_menu: Optional[EventType[()]] = None,
  859. on_double_click: Optional[EventType[()]] = None,
  860. on_focus: Optional[EventType[()]] = None,
  861. on_mount: Optional[EventType[()]] = None,
  862. on_mouse_down: Optional[EventType[()]] = None,
  863. on_mouse_enter: Optional[EventType[()]] = None,
  864. on_mouse_leave: Optional[EventType[()]] = None,
  865. on_mouse_move: Optional[EventType[()]] = None,
  866. on_mouse_out: Optional[EventType[()]] = None,
  867. on_mouse_over: Optional[EventType[()]] = None,
  868. on_mouse_up: Optional[EventType[()]] = None,
  869. on_scroll: Optional[EventType[()]] = None,
  870. on_submit: Optional[
  871. Union[
  872. EventType[()] | EventType[dict[str, Any]],
  873. EventType[()] | EventType[dict[str, str]],
  874. ]
  875. ] = None,
  876. on_unmount: Optional[EventType[()]] = None,
  877. **props,
  878. ) -> "Form":
  879. """Create a form component.
  880. Args:
  881. *children: The children of the form.
  882. on_clear_server_errors: Fired when the errors are cleared.
  883. as_child: Change the default rendered element for the one passed as a child.
  884. accept: MIME types the server accepts for file upload
  885. accept_charset: Character encodings to be used for form submission
  886. action: URL where the form's data should be submitted
  887. auto_complete: Whether the form should have autocomplete enabled
  888. enc_type: Encoding type for the form data when submitted
  889. method: HTTP method to use for form submission
  890. name: Name of the form
  891. no_validate: Indicates that the form should not be validated on submit
  892. target: Where to display the response after submitting the form
  893. reset_on_submit: If true, the form will be cleared after submit.
  894. handle_submit_unique_name: The name used to make this form's submit handler function unique.
  895. on_submit: Fired when the form is submitted
  896. access_key: Provides a hint for generating a keyboard shortcut for the current element.
  897. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
  898. content_editable: Indicates whether the element's content is editable.
  899. context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
  900. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
  901. draggable: Defines whether the element can be dragged.
  902. enter_key_hint: Hints what media types the media element is able to play.
  903. hidden: Defines whether the element is hidden.
  904. input_mode: Defines the type of the element.
  905. item_prop: Defines the name of the element for metadata purposes.
  906. lang: Defines the language used in the element.
  907. role: Defines the role of the element.
  908. slot: Assigns a slot in a shadow DOM shadow tree to an element.
  909. spell_check: Defines whether the element may be checked for spelling errors.
  910. tab_index: Defines the position of the current element in the tabbing order.
  911. title: Defines a tooltip for the element.
  912. style: The style of the component.
  913. key: A unique key for the component.
  914. id: The id for the component.
  915. class_name: The class name for the component.
  916. autofocus: Whether the component should take the focus once the page is loaded
  917. custom_attrs: custom attribute
  918. **props: The properties of the form.
  919. Returns:
  920. The form component.
  921. """
  922. ...
  923. class FormNamespace(ComponentNamespace):
  924. root = staticmethod(FormRoot.create)
  925. control = staticmethod(FormControl.create)
  926. field = staticmethod(FormField.create)
  927. label = staticmethod(FormLabel.create)
  928. message = staticmethod(FormMessage.create)
  929. submit = staticmethod(FormSubmit.create)
  930. validity_state = staticmethod(FormValidityState.create)
  931. @staticmethod
  932. def __call__(
  933. *children,
  934. as_child: Var[bool] | bool | None = None,
  935. accept: Var[str] | str | None = None,
  936. accept_charset: Var[str] | str | None = None,
  937. action: Var[str] | str | None = None,
  938. auto_complete: Var[str] | str | None = None,
  939. enc_type: Var[str] | str | None = None,
  940. method: Var[str] | str | None = None,
  941. name: Var[str] | str | None = None,
  942. no_validate: Var[bool] | bool | None = None,
  943. target: Var[str] | str | None = None,
  944. reset_on_submit: Var[bool] | bool | None = None,
  945. handle_submit_unique_name: Var[str] | str | None = None,
  946. access_key: Var[str] | str | None = None,
  947. auto_capitalize: Literal[
  948. "characters", "none", "off", "on", "sentences", "words"
  949. ]
  950. | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
  951. | None = None,
  952. content_editable: Literal["inherit", "plaintext-only", False, True]
  953. | Var[Literal["inherit", "plaintext-only", False, True]]
  954. | None = None,
  955. context_menu: Var[str] | str | None = None,
  956. dir: Var[str] | str | None = None,
  957. draggable: Var[bool] | bool | None = None,
  958. enter_key_hint: Literal[
  959. "done", "enter", "go", "next", "previous", "search", "send"
  960. ]
  961. | Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
  962. | None = None,
  963. hidden: Var[bool] | bool | None = None,
  964. input_mode: Literal[
  965. "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
  966. ]
  967. | Var[
  968. Literal[
  969. "decimal", "email", "none", "numeric", "search", "tel", "text", "url"
  970. ]
  971. ]
  972. | None = None,
  973. item_prop: Var[str] | str | None = None,
  974. lang: Var[str] | str | None = None,
  975. role: Literal[
  976. "alert",
  977. "alertdialog",
  978. "application",
  979. "article",
  980. "banner",
  981. "button",
  982. "cell",
  983. "checkbox",
  984. "columnheader",
  985. "combobox",
  986. "complementary",
  987. "contentinfo",
  988. "definition",
  989. "dialog",
  990. "directory",
  991. "document",
  992. "feed",
  993. "figure",
  994. "form",
  995. "grid",
  996. "gridcell",
  997. "group",
  998. "heading",
  999. "img",
  1000. "link",
  1001. "list",
  1002. "listbox",
  1003. "listitem",
  1004. "log",
  1005. "main",
  1006. "marquee",
  1007. "math",
  1008. "menu",
  1009. "menubar",
  1010. "menuitem",
  1011. "menuitemcheckbox",
  1012. "menuitemradio",
  1013. "navigation",
  1014. "none",
  1015. "note",
  1016. "option",
  1017. "presentation",
  1018. "progressbar",
  1019. "radio",
  1020. "radiogroup",
  1021. "region",
  1022. "row",
  1023. "rowgroup",
  1024. "rowheader",
  1025. "scrollbar",
  1026. "search",
  1027. "searchbox",
  1028. "separator",
  1029. "slider",
  1030. "spinbutton",
  1031. "status",
  1032. "switch",
  1033. "tab",
  1034. "table",
  1035. "tablist",
  1036. "tabpanel",
  1037. "term",
  1038. "textbox",
  1039. "timer",
  1040. "toolbar",
  1041. "tooltip",
  1042. "tree",
  1043. "treegrid",
  1044. "treeitem",
  1045. ]
  1046. | Var[
  1047. Literal[
  1048. "alert",
  1049. "alertdialog",
  1050. "application",
  1051. "article",
  1052. "banner",
  1053. "button",
  1054. "cell",
  1055. "checkbox",
  1056. "columnheader",
  1057. "combobox",
  1058. "complementary",
  1059. "contentinfo",
  1060. "definition",
  1061. "dialog",
  1062. "directory",
  1063. "document",
  1064. "feed",
  1065. "figure",
  1066. "form",
  1067. "grid",
  1068. "gridcell",
  1069. "group",
  1070. "heading",
  1071. "img",
  1072. "link",
  1073. "list",
  1074. "listbox",
  1075. "listitem",
  1076. "log",
  1077. "main",
  1078. "marquee",
  1079. "math",
  1080. "menu",
  1081. "menubar",
  1082. "menuitem",
  1083. "menuitemcheckbox",
  1084. "menuitemradio",
  1085. "navigation",
  1086. "none",
  1087. "note",
  1088. "option",
  1089. "presentation",
  1090. "progressbar",
  1091. "radio",
  1092. "radiogroup",
  1093. "region",
  1094. "row",
  1095. "rowgroup",
  1096. "rowheader",
  1097. "scrollbar",
  1098. "search",
  1099. "searchbox",
  1100. "separator",
  1101. "slider",
  1102. "spinbutton",
  1103. "status",
  1104. "switch",
  1105. "tab",
  1106. "table",
  1107. "tablist",
  1108. "tabpanel",
  1109. "term",
  1110. "textbox",
  1111. "timer",
  1112. "toolbar",
  1113. "tooltip",
  1114. "tree",
  1115. "treegrid",
  1116. "treeitem",
  1117. ]
  1118. ]
  1119. | None = None,
  1120. slot: Var[str] | str | None = None,
  1121. spell_check: Var[bool] | bool | None = None,
  1122. tab_index: Var[int] | int | None = None,
  1123. title: Var[str] | str | None = None,
  1124. style: Style | None = None,
  1125. key: Any | None = None,
  1126. id: Any | None = None,
  1127. class_name: Any | None = None,
  1128. autofocus: bool | None = None,
  1129. custom_attrs: dict[str, Var | Any] | None = None,
  1130. on_blur: Optional[EventType[()]] = None,
  1131. on_clear_server_errors: Optional[EventType[()]] = None,
  1132. on_click: Optional[EventType[()]] = None,
  1133. on_context_menu: Optional[EventType[()]] = None,
  1134. on_double_click: Optional[EventType[()]] = None,
  1135. on_focus: Optional[EventType[()]] = None,
  1136. on_mount: Optional[EventType[()]] = None,
  1137. on_mouse_down: Optional[EventType[()]] = None,
  1138. on_mouse_enter: Optional[EventType[()]] = None,
  1139. on_mouse_leave: Optional[EventType[()]] = None,
  1140. on_mouse_move: Optional[EventType[()]] = None,
  1141. on_mouse_out: Optional[EventType[()]] = None,
  1142. on_mouse_over: Optional[EventType[()]] = None,
  1143. on_mouse_up: Optional[EventType[()]] = None,
  1144. on_scroll: Optional[EventType[()]] = None,
  1145. on_submit: Optional[
  1146. Union[
  1147. EventType[()] | EventType[dict[str, Any]],
  1148. EventType[()] | EventType[dict[str, str]],
  1149. ]
  1150. ] = None,
  1151. on_unmount: Optional[EventType[()]] = None,
  1152. **props,
  1153. ) -> "Form":
  1154. """Create a form component.
  1155. Args:
  1156. *children: The children of the form.
  1157. on_clear_server_errors: Fired when the errors are cleared.
  1158. as_child: Change the default rendered element for the one passed as a child.
  1159. accept: MIME types the server accepts for file upload
  1160. accept_charset: Character encodings to be used for form submission
  1161. action: URL where the form's data should be submitted
  1162. auto_complete: Whether the form should have autocomplete enabled
  1163. enc_type: Encoding type for the form data when submitted
  1164. method: HTTP method to use for form submission
  1165. name: Name of the form
  1166. no_validate: Indicates that the form should not be validated on submit
  1167. target: Where to display the response after submitting the form
  1168. reset_on_submit: If true, the form will be cleared after submit.
  1169. handle_submit_unique_name: The name used to make this form's submit handler function unique.
  1170. on_submit: Fired when the form is submitted
  1171. access_key: Provides a hint for generating a keyboard shortcut for the current element.
  1172. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
  1173. content_editable: Indicates whether the element's content is editable.
  1174. context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
  1175. dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
  1176. draggable: Defines whether the element can be dragged.
  1177. enter_key_hint: Hints what media types the media element is able to play.
  1178. hidden: Defines whether the element is hidden.
  1179. input_mode: Defines the type of the element.
  1180. item_prop: Defines the name of the element for metadata purposes.
  1181. lang: Defines the language used in the element.
  1182. role: Defines the role of the element.
  1183. slot: Assigns a slot in a shadow DOM shadow tree to an element.
  1184. spell_check: Defines whether the element may be checked for spelling errors.
  1185. tab_index: Defines the position of the current element in the tabbing order.
  1186. title: Defines a tooltip for the element.
  1187. style: The style of the component.
  1188. key: A unique key for the component.
  1189. id: The id for the component.
  1190. class_name: The class name for the component.
  1191. autofocus: Whether the component should take the focus once the page is loaded
  1192. custom_attrs: custom attribute
  1193. **props: The properties of the form.
  1194. Returns:
  1195. The form component.
  1196. """
  1197. ...
  1198. form = FormNamespace()