numberinput.pyi 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. """Stub file for reflex/components/forms/numberinput.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `scripts/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, Literal, Optional, Union, overload
  6. from reflex.vars import Var, BaseVar, ComputedVar
  7. from reflex.event import EventChain, EventHandler, EventSpec
  8. from reflex.style import Style
  9. from numbers import Number
  10. from typing import Any, Dict
  11. from reflex.components.component import Component
  12. from reflex.components.libs.chakra import ChakraComponent, LiteralInputVariant
  13. from reflex.constants import EventTriggers
  14. from reflex.vars import Var
  15. class NumberInput(ChakraComponent):
  16. def get_event_triggers(self) -> Dict[str, Any]: ...
  17. @overload
  18. @classmethod
  19. def create( # type: ignore
  20. cls,
  21. *children,
  22. value: Optional[Union[Var[Number], Number]] = None,
  23. allow_mouse_wheel: Optional[Union[Var[bool], bool]] = None,
  24. clamped_value_on_blur: Optional[Union[Var[bool], bool]] = None,
  25. default_value: Optional[Union[Var[Number], Number]] = None,
  26. error_border_color: Optional[Union[Var[str], str]] = None,
  27. focus_border_color: Optional[Union[Var[str], str]] = None,
  28. focus_input_on_change: Optional[Union[Var[bool], bool]] = None,
  29. is_disabled: Optional[Union[Var[bool], bool]] = None,
  30. is_invalid: Optional[Union[Var[bool], bool]] = None,
  31. is_read_only: Optional[Union[Var[bool], bool]] = None,
  32. is_required: Optional[Union[Var[bool], bool]] = None,
  33. is_valid_character: Optional[Union[Var[str], str]] = None,
  34. keep_within_range: Optional[Union[Var[bool], bool]] = None,
  35. max_: Optional[Union[Var[Number], Number]] = None,
  36. min_: Optional[Union[Var[Number], Number]] = None,
  37. variant: Optional[
  38. Union[
  39. Var[Literal["outline", "filled", "flushed", "unstyled"]],
  40. Literal["outline", "filled", "flushed", "unstyled"],
  41. ]
  42. ] = None,
  43. name: Optional[Union[Var[str], str]] = None,
  44. style: Optional[Style] = None,
  45. key: Optional[Any] = None,
  46. id: Optional[Any] = None,
  47. class_name: Optional[Any] = None,
  48. autofocus: Optional[bool] = None,
  49. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  50. on_blur: Optional[
  51. Union[EventHandler, EventSpec, list, function, BaseVar]
  52. ] = None,
  53. on_change: Optional[
  54. Union[EventHandler, EventSpec, list, function, BaseVar]
  55. ] = None,
  56. on_click: Optional[
  57. Union[EventHandler, EventSpec, list, function, BaseVar]
  58. ] = None,
  59. on_context_menu: Optional[
  60. Union[EventHandler, EventSpec, list, function, BaseVar]
  61. ] = None,
  62. on_double_click: Optional[
  63. Union[EventHandler, EventSpec, list, function, BaseVar]
  64. ] = None,
  65. on_focus: Optional[
  66. Union[EventHandler, EventSpec, list, function, BaseVar]
  67. ] = None,
  68. on_mount: Optional[
  69. Union[EventHandler, EventSpec, list, function, BaseVar]
  70. ] = None,
  71. on_mouse_down: Optional[
  72. Union[EventHandler, EventSpec, list, function, BaseVar]
  73. ] = None,
  74. on_mouse_enter: Optional[
  75. Union[EventHandler, EventSpec, list, function, BaseVar]
  76. ] = None,
  77. on_mouse_leave: Optional[
  78. Union[EventHandler, EventSpec, list, function, BaseVar]
  79. ] = None,
  80. on_mouse_move: Optional[
  81. Union[EventHandler, EventSpec, list, function, BaseVar]
  82. ] = None,
  83. on_mouse_out: Optional[
  84. Union[EventHandler, EventSpec, list, function, BaseVar]
  85. ] = None,
  86. on_mouse_over: Optional[
  87. Union[EventHandler, EventSpec, list, function, BaseVar]
  88. ] = None,
  89. on_mouse_up: Optional[
  90. Union[EventHandler, EventSpec, list, function, BaseVar]
  91. ] = None,
  92. on_scroll: Optional[
  93. Union[EventHandler, EventSpec, list, function, BaseVar]
  94. ] = None,
  95. on_unmount: Optional[
  96. Union[EventHandler, EventSpec, list, function, BaseVar]
  97. ] = None,
  98. **props
  99. ) -> "NumberInput":
  100. """Create a number input component.
  101. If no children are provided, a default stepper will be used.
  102. Args:
  103. *children: The children of the component.
  104. value: State var to bind the input.
  105. allow_mouse_wheel: If true, the input's value will change based on mouse wheel.
  106. clamped_value_on_blur: This controls the value update when you blur out of the input. - If true and the value is greater than max, the value will be reset to max - Else, the value remains the same.
  107. default_value: The initial value of the counter. Should be less than max and greater than min
  108. error_border_color: The border color when the input is invalid.
  109. focus_border_color: The border color when the input is focused.
  110. focus_input_on_change: If true, the input will be focused as you increment or decrement the value with the stepper
  111. is_disabled: Hints at the type of data that might be entered by the user. It also determines the type of keyboard shown to the user on mobile devices ("text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal") input_mode: Var[LiteralInputNumberMode] Whether the input should be disabled.
  112. is_invalid: If true, the input will have `aria-invalid` set to true
  113. is_read_only: If true, the input will be in readonly mode
  114. is_required: Whether the input is required
  115. is_valid_character: Whether the pressed key should be allowed in the input. The default behavior is to allow DOM floating point characters defined by /^[Ee0-9+\\-.]$/
  116. keep_within_range: This controls the value update behavior in general. - If true and you use the stepper or up/down arrow keys, the value will not exceed the max or go lower than min - If false, the value will be allowed to go out of range.
  117. max_: The maximum value of the counter
  118. min_: The minimum value of the counter
  119. variant: "outline" | "filled" | "flushed" | "unstyled"
  120. name: The name of the form field
  121. style: The style of the component.
  122. key: A unique key for the component.
  123. id: The id for the component.
  124. class_name: The class name for the component.
  125. autofocus: Whether the component should take the focus once the page is loaded
  126. custom_attrs: custom attribute
  127. **props: The props of the component.
  128. Returns:
  129. The component.
  130. """
  131. ...
  132. class NumberInputField(ChakraComponent):
  133. @overload
  134. @classmethod
  135. def create( # type: ignore
  136. cls,
  137. *children,
  138. style: Optional[Style] = None,
  139. key: Optional[Any] = None,
  140. id: Optional[Any] = None,
  141. class_name: Optional[Any] = None,
  142. autofocus: Optional[bool] = None,
  143. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  144. on_blur: Optional[
  145. Union[EventHandler, EventSpec, list, function, BaseVar]
  146. ] = None,
  147. on_click: Optional[
  148. Union[EventHandler, EventSpec, list, function, BaseVar]
  149. ] = None,
  150. on_context_menu: Optional[
  151. Union[EventHandler, EventSpec, list, function, BaseVar]
  152. ] = None,
  153. on_double_click: Optional[
  154. Union[EventHandler, EventSpec, list, function, BaseVar]
  155. ] = None,
  156. on_focus: Optional[
  157. Union[EventHandler, EventSpec, list, function, BaseVar]
  158. ] = None,
  159. on_mount: Optional[
  160. Union[EventHandler, EventSpec, list, function, BaseVar]
  161. ] = None,
  162. on_mouse_down: Optional[
  163. Union[EventHandler, EventSpec, list, function, BaseVar]
  164. ] = None,
  165. on_mouse_enter: Optional[
  166. Union[EventHandler, EventSpec, list, function, BaseVar]
  167. ] = None,
  168. on_mouse_leave: Optional[
  169. Union[EventHandler, EventSpec, list, function, BaseVar]
  170. ] = None,
  171. on_mouse_move: Optional[
  172. Union[EventHandler, EventSpec, list, function, BaseVar]
  173. ] = None,
  174. on_mouse_out: Optional[
  175. Union[EventHandler, EventSpec, list, function, BaseVar]
  176. ] = None,
  177. on_mouse_over: Optional[
  178. Union[EventHandler, EventSpec, list, function, BaseVar]
  179. ] = None,
  180. on_mouse_up: Optional[
  181. Union[EventHandler, EventSpec, list, function, BaseVar]
  182. ] = None,
  183. on_scroll: Optional[
  184. Union[EventHandler, EventSpec, list, function, BaseVar]
  185. ] = None,
  186. on_unmount: Optional[
  187. Union[EventHandler, EventSpec, list, function, BaseVar]
  188. ] = None,
  189. **props
  190. ) -> "NumberInputField":
  191. """Create the component.
  192. Args:
  193. *children: The children of the component.
  194. style: The style of the component.
  195. key: A unique key for the component.
  196. id: The id for the component.
  197. class_name: The class name for the component.
  198. autofocus: Whether the component should take the focus once the page is loaded
  199. custom_attrs: custom attribute
  200. **props: The props of the component.
  201. Returns:
  202. The component.
  203. Raises:
  204. TypeError: If an invalid child is passed.
  205. """
  206. ...
  207. class NumberInputStepper(ChakraComponent):
  208. @overload
  209. @classmethod
  210. def create( # type: ignore
  211. cls,
  212. *children,
  213. style: Optional[Style] = None,
  214. key: Optional[Any] = None,
  215. id: Optional[Any] = None,
  216. class_name: Optional[Any] = None,
  217. autofocus: Optional[bool] = None,
  218. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  219. on_blur: Optional[
  220. Union[EventHandler, EventSpec, list, function, BaseVar]
  221. ] = None,
  222. on_click: Optional[
  223. Union[EventHandler, EventSpec, list, function, BaseVar]
  224. ] = None,
  225. on_context_menu: Optional[
  226. Union[EventHandler, EventSpec, list, function, BaseVar]
  227. ] = None,
  228. on_double_click: Optional[
  229. Union[EventHandler, EventSpec, list, function, BaseVar]
  230. ] = None,
  231. on_focus: Optional[
  232. Union[EventHandler, EventSpec, list, function, BaseVar]
  233. ] = None,
  234. on_mount: Optional[
  235. Union[EventHandler, EventSpec, list, function, BaseVar]
  236. ] = None,
  237. on_mouse_down: Optional[
  238. Union[EventHandler, EventSpec, list, function, BaseVar]
  239. ] = None,
  240. on_mouse_enter: Optional[
  241. Union[EventHandler, EventSpec, list, function, BaseVar]
  242. ] = None,
  243. on_mouse_leave: Optional[
  244. Union[EventHandler, EventSpec, list, function, BaseVar]
  245. ] = None,
  246. on_mouse_move: Optional[
  247. Union[EventHandler, EventSpec, list, function, BaseVar]
  248. ] = None,
  249. on_mouse_out: Optional[
  250. Union[EventHandler, EventSpec, list, function, BaseVar]
  251. ] = None,
  252. on_mouse_over: Optional[
  253. Union[EventHandler, EventSpec, list, function, BaseVar]
  254. ] = None,
  255. on_mouse_up: Optional[
  256. Union[EventHandler, EventSpec, list, function, BaseVar]
  257. ] = None,
  258. on_scroll: Optional[
  259. Union[EventHandler, EventSpec, list, function, BaseVar]
  260. ] = None,
  261. on_unmount: Optional[
  262. Union[EventHandler, EventSpec, list, function, BaseVar]
  263. ] = None,
  264. **props
  265. ) -> "NumberInputStepper":
  266. """Create the component.
  267. Args:
  268. *children: The children of the component.
  269. style: The style of the component.
  270. key: A unique key for the component.
  271. id: The id for the component.
  272. class_name: The class name for the component.
  273. autofocus: Whether the component should take the focus once the page is loaded
  274. custom_attrs: custom attribute
  275. **props: The props of the component.
  276. Returns:
  277. The component.
  278. Raises:
  279. TypeError: If an invalid child is passed.
  280. """
  281. ...
  282. class NumberIncrementStepper(ChakraComponent):
  283. @overload
  284. @classmethod
  285. def create( # type: ignore
  286. cls,
  287. *children,
  288. style: Optional[Style] = None,
  289. key: Optional[Any] = None,
  290. id: Optional[Any] = None,
  291. class_name: Optional[Any] = None,
  292. autofocus: Optional[bool] = None,
  293. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  294. on_blur: Optional[
  295. Union[EventHandler, EventSpec, list, function, BaseVar]
  296. ] = None,
  297. on_click: Optional[
  298. Union[EventHandler, EventSpec, list, function, BaseVar]
  299. ] = None,
  300. on_context_menu: Optional[
  301. Union[EventHandler, EventSpec, list, function, BaseVar]
  302. ] = None,
  303. on_double_click: Optional[
  304. Union[EventHandler, EventSpec, list, function, BaseVar]
  305. ] = None,
  306. on_focus: Optional[
  307. Union[EventHandler, EventSpec, list, function, BaseVar]
  308. ] = None,
  309. on_mount: Optional[
  310. Union[EventHandler, EventSpec, list, function, BaseVar]
  311. ] = None,
  312. on_mouse_down: Optional[
  313. Union[EventHandler, EventSpec, list, function, BaseVar]
  314. ] = None,
  315. on_mouse_enter: Optional[
  316. Union[EventHandler, EventSpec, list, function, BaseVar]
  317. ] = None,
  318. on_mouse_leave: Optional[
  319. Union[EventHandler, EventSpec, list, function, BaseVar]
  320. ] = None,
  321. on_mouse_move: Optional[
  322. Union[EventHandler, EventSpec, list, function, BaseVar]
  323. ] = None,
  324. on_mouse_out: Optional[
  325. Union[EventHandler, EventSpec, list, function, BaseVar]
  326. ] = None,
  327. on_mouse_over: Optional[
  328. Union[EventHandler, EventSpec, list, function, BaseVar]
  329. ] = None,
  330. on_mouse_up: Optional[
  331. Union[EventHandler, EventSpec, list, function, BaseVar]
  332. ] = None,
  333. on_scroll: Optional[
  334. Union[EventHandler, EventSpec, list, function, BaseVar]
  335. ] = None,
  336. on_unmount: Optional[
  337. Union[EventHandler, EventSpec, list, function, BaseVar]
  338. ] = None,
  339. **props
  340. ) -> "NumberIncrementStepper":
  341. """Create the component.
  342. Args:
  343. *children: The children of the component.
  344. style: The style of the component.
  345. key: A unique key for the component.
  346. id: The id for the component.
  347. class_name: The class name for the component.
  348. autofocus: Whether the component should take the focus once the page is loaded
  349. custom_attrs: custom attribute
  350. **props: The props of the component.
  351. Returns:
  352. The component.
  353. Raises:
  354. TypeError: If an invalid child is passed.
  355. """
  356. ...
  357. class NumberDecrementStepper(ChakraComponent):
  358. @overload
  359. @classmethod
  360. def create( # type: ignore
  361. cls,
  362. *children,
  363. style: Optional[Style] = None,
  364. key: Optional[Any] = None,
  365. id: Optional[Any] = None,
  366. class_name: Optional[Any] = None,
  367. autofocus: Optional[bool] = None,
  368. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  369. on_blur: Optional[
  370. Union[EventHandler, EventSpec, list, function, BaseVar]
  371. ] = None,
  372. on_click: Optional[
  373. Union[EventHandler, EventSpec, list, function, BaseVar]
  374. ] = None,
  375. on_context_menu: Optional[
  376. Union[EventHandler, EventSpec, list, function, BaseVar]
  377. ] = None,
  378. on_double_click: Optional[
  379. Union[EventHandler, EventSpec, list, function, BaseVar]
  380. ] = None,
  381. on_focus: Optional[
  382. Union[EventHandler, EventSpec, list, function, BaseVar]
  383. ] = None,
  384. on_mount: Optional[
  385. Union[EventHandler, EventSpec, list, function, BaseVar]
  386. ] = None,
  387. on_mouse_down: Optional[
  388. Union[EventHandler, EventSpec, list, function, BaseVar]
  389. ] = None,
  390. on_mouse_enter: Optional[
  391. Union[EventHandler, EventSpec, list, function, BaseVar]
  392. ] = None,
  393. on_mouse_leave: Optional[
  394. Union[EventHandler, EventSpec, list, function, BaseVar]
  395. ] = None,
  396. on_mouse_move: Optional[
  397. Union[EventHandler, EventSpec, list, function, BaseVar]
  398. ] = None,
  399. on_mouse_out: Optional[
  400. Union[EventHandler, EventSpec, list, function, BaseVar]
  401. ] = None,
  402. on_mouse_over: Optional[
  403. Union[EventHandler, EventSpec, list, function, BaseVar]
  404. ] = None,
  405. on_mouse_up: Optional[
  406. Union[EventHandler, EventSpec, list, function, BaseVar]
  407. ] = None,
  408. on_scroll: Optional[
  409. Union[EventHandler, EventSpec, list, function, BaseVar]
  410. ] = None,
  411. on_unmount: Optional[
  412. Union[EventHandler, EventSpec, list, function, BaseVar]
  413. ] = None,
  414. **props
  415. ) -> "NumberDecrementStepper":
  416. """Create the component.
  417. Args:
  418. *children: The children of the component.
  419. style: The style of the component.
  420. key: A unique key for the component.
  421. id: The id for the component.
  422. class_name: The class name for the component.
  423. autofocus: Whether the component should take the focus once the page is loaded
  424. custom_attrs: custom attribute
  425. **props: The props of the component.
  426. Returns:
  427. The component.
  428. Raises:
  429. TypeError: If an invalid child is passed.
  430. """
  431. ...