moment.pyi 6.7 KB

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