moment.pyi 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. """Stub file for reflex/components/moment/moment.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. import dataclasses
  6. from typing import Any, Callable, Dict, Optional, Union, overload
  7. from reflex.components.component import NoSSRComponent
  8. from reflex.event import EventHandler, EventSpec
  9. from reflex.style import Style
  10. from reflex.utils.imports import ImportDict
  11. from reflex.vars.base import Var
  12. @dataclasses.dataclass(frozen=True)
  13. class MomentDelta:
  14. years: Optional[int]
  15. quarters: Optional[int]
  16. months: Optional[int]
  17. weeks: Optional[int]
  18. days: Optional[int]
  19. hours: Optional[int]
  20. minutess: Optional[int]
  21. seconds: Optional[int]
  22. milliseconds: Optional[int]
  23. class Moment(NoSSRComponent):
  24. def add_imports(self) -> ImportDict: ...
  25. @overload
  26. @classmethod
  27. def create( # type: ignore
  28. cls,
  29. *children,
  30. interval: Optional[Union[Var[int], int]] = None,
  31. format: Optional[Union[Var[str], str]] = None,
  32. trim: Optional[Union[Var[bool], bool]] = None,
  33. parse: Optional[Union[Var[str], str]] = None,
  34. add: Optional[Union[MomentDelta, Var[MomentDelta]]] = None,
  35. subtract: Optional[Union[MomentDelta, Var[MomentDelta]]] = None,
  36. from_now: Optional[Union[Var[bool], bool]] = None,
  37. from_now_during: Optional[Union[Var[int], int]] = None,
  38. to_now: Optional[Union[Var[bool], bool]] = None,
  39. with_title: Optional[Union[Var[bool], bool]] = None,
  40. title_format: Optional[Union[Var[str], str]] = None,
  41. diff: Optional[Union[Var[str], str]] = None,
  42. decimal: Optional[Union[Var[bool], bool]] = None,
  43. unit: Optional[Union[Var[str], str]] = None,
  44. duration: Optional[Union[Var[str], str]] = None,
  45. date: Optional[Union[Var[str], str]] = None,
  46. duration_from_now: Optional[Union[Var[bool], bool]] = None,
  47. unix: Optional[Union[Var[bool], bool]] = None,
  48. local: Optional[Union[Var[bool], bool]] = None,
  49. tz: Optional[Union[Var[str], str]] = None,
  50. style: Optional[Style] = None,
  51. key: Optional[Any] = None,
  52. id: Optional[Any] = None,
  53. class_name: Optional[Any] = None,
  54. autofocus: Optional[bool] = None,
  55. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  56. on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
  57. on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
  58. on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
  59. on_context_menu: Optional[
  60. Union[EventHandler, EventSpec, list, Callable, Var]
  61. ] = None,
  62. on_double_click: Optional[
  63. Union[EventHandler, EventSpec, list, Callable, Var]
  64. ] = None,
  65. on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
  66. on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
  67. on_mouse_down: Optional[
  68. Union[EventHandler, EventSpec, list, Callable, Var]
  69. ] = None,
  70. on_mouse_enter: Optional[
  71. Union[EventHandler, EventSpec, list, Callable, Var]
  72. ] = None,
  73. on_mouse_leave: Optional[
  74. Union[EventHandler, EventSpec, list, Callable, Var]
  75. ] = None,
  76. on_mouse_move: Optional[
  77. Union[EventHandler, EventSpec, list, Callable, Var]
  78. ] = None,
  79. on_mouse_out: Optional[
  80. Union[EventHandler, EventSpec, list, Callable, Var]
  81. ] = None,
  82. on_mouse_over: Optional[
  83. Union[EventHandler, EventSpec, list, Callable, Var]
  84. ] = None,
  85. on_mouse_up: Optional[
  86. Union[EventHandler, EventSpec, list, Callable, Var]
  87. ] = None,
  88. on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
  89. on_unmount: Optional[
  90. Union[EventHandler, EventSpec, list, Callable, Var]
  91. ] = None,
  92. **props,
  93. ) -> "Moment":
  94. """Create a Moment component.
  95. Args:
  96. *children: The children of the component.
  97. interval: How often the date update (how often time update / 0 to disable).
  98. format: Formats the date according to the given format string.
  99. trim: When formatting duration time, the largest-magnitude tokens are automatically trimmed when they have no value.
  100. parse: Use the parse attribute to tell moment how to parse the given date when non-standard.
  101. add: Add a delta to the base date (keys are "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds")
  102. subtract: Subtract a delta to the base date (keys are "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds")
  103. from_now: Displays the date as the time from now, e.g. "5 minutes ago".
  104. from_now_during: Setting fromNowDuring will display the relative time as with fromNow but just during its value in milliseconds, after that format will be used instead.
  105. to_now: Similar to fromNow, but gives the opposite interval.
  106. with_title: Adds a title attribute to the element with the complete date.
  107. title_format: How the title date is formatted when using the withTitle attribute.
  108. diff: Show the different between this date and the rendered child.
  109. decimal: Display the diff as decimal.
  110. unit: Display the diff in given unit.
  111. duration: Shows the duration (elapsed time) between two dates. duration property should be behind date property time-wise.
  112. date: The date to display (also work if passed as children).
  113. duration_from_now: Shows the duration (elapsed time) between now and the provided datetime.
  114. unix: Tells Moment to parse the given date value as a unix timestamp.
  115. local: Outputs the result in local time.
  116. tz: Display the date in the given timezone.
  117. style: The style of the component.
  118. key: A unique key for the component.
  119. id: The id for the component.
  120. class_name: The class name for the component.
  121. autofocus: Whether the component should take the focus once the page is loaded
  122. custom_attrs: custom attribute
  123. **props: The properties of the component.
  124. Returns:
  125. The Moment Component.
  126. """
  127. ...