moment.pyi 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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 datetime import date, datetime, time, timedelta
  7. from typing import Any, Dict, Optional, Union, overload
  8. from reflex.components.component import NoSSRComponent
  9. from reflex.event import EventType
  10. from reflex.style import Style
  11. from reflex.utils.imports import ImportDict
  12. from reflex.vars.base import Var
  13. @dataclasses.dataclass(frozen=True)
  14. class MomentDelta:
  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. minutes: Optional[int]
  22. seconds: Optional[int]
  23. milliseconds: Optional[int]
  24. class Moment(NoSSRComponent):
  25. def add_imports(self) -> ImportDict: ...
  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[MomentDelta, Var[MomentDelta]]] = None,
  36. subtract: Optional[Union[MomentDelta, Var[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[
  47. Union[
  48. Var[Union[date, datetime, str, time, timedelta]],
  49. date,
  50. datetime,
  51. str,
  52. time,
  53. timedelta,
  54. ]
  55. ] = None,
  56. duration_from_now: Optional[Union[Var[bool], bool]] = None,
  57. unix: Optional[Union[Var[bool], bool]] = None,
  58. local: Optional[Union[Var[bool], bool]] = None,
  59. tz: Optional[Union[Var[str], str]] = None,
  60. locale: Optional[Union[Var[str], str]] = None,
  61. style: Optional[Style] = None,
  62. key: Optional[Any] = None,
  63. id: Optional[Any] = None,
  64. class_name: Optional[Any] = None,
  65. autofocus: Optional[bool] = None,
  66. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  67. on_blur: Optional[EventType[()]] = None,
  68. on_change: Optional[Union[EventType[()], EventType[str]]] = None,
  69. on_click: Optional[EventType[()]] = None,
  70. on_context_menu: Optional[EventType[()]] = None,
  71. on_double_click: Optional[EventType[()]] = None,
  72. on_focus: Optional[EventType[()]] = None,
  73. on_mount: Optional[EventType[()]] = None,
  74. on_mouse_down: Optional[EventType[()]] = None,
  75. on_mouse_enter: Optional[EventType[()]] = None,
  76. on_mouse_leave: Optional[EventType[()]] = None,
  77. on_mouse_move: Optional[EventType[()]] = None,
  78. on_mouse_out: Optional[EventType[()]] = None,
  79. on_mouse_over: Optional[EventType[()]] = None,
  80. on_mouse_up: Optional[EventType[()]] = None,
  81. on_scroll: Optional[EventType[()]] = None,
  82. on_unmount: Optional[EventType[()]] = None,
  83. **props,
  84. ) -> "Moment":
  85. """Create the component.
  86. Args:
  87. *children: The children of the component.
  88. interval: How often the date update (how often time update / 0 to disable).
  89. format: Formats the date according to the given format string.
  90. trim: When formatting duration time, the largest-magnitude tokens are automatically trimmed when they have no value.
  91. parse: Use the parse attribute to tell moment how to parse the given date when non-standard.
  92. add: Add a delta to the base date (keys are "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds")
  93. subtract: Subtract a delta to the base date (keys are "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds")
  94. from_now: Displays the date as the time from now, e.g. "5 minutes ago".
  95. 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.
  96. to_now: Similar to fromNow, but gives the opposite interval.
  97. with_title: Adds a title attribute to the element with the complete date.
  98. title_format: How the title date is formatted when using the withTitle attribute.
  99. diff: Show the different between this date and the rendered child.
  100. decimal: Display the diff as decimal.
  101. unit: Display the diff in given unit.
  102. duration: Shows the duration (elapsed time) between two dates. duration property should be behind date property time-wise.
  103. date: The date to display (also work if passed as children).
  104. duration_from_now: Shows the duration (elapsed time) between now and the provided datetime.
  105. unix: Tells Moment to parse the given date value as a unix timestamp.
  106. local: Outputs the result in local time.
  107. tz: Display the date in the given timezone.
  108. locale: The locale to use when rendering.
  109. on_change: Fires when the date changes.
  110. style: The style of the component.
  111. key: A unique key for the component.
  112. id: The id for the component.
  113. class_name: The class name for the component.
  114. autofocus: Whether the component should take the focus once the page is loaded
  115. custom_attrs: custom attribute
  116. **props: The props of the component.
  117. Returns:
  118. The component.
  119. """
  120. ...