moment.pyi 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 BASE_STATE, 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[[], BASE_STATE]] = None,
  68. on_change: Optional[
  69. Union[EventType[[], BASE_STATE], EventType[[str], BASE_STATE]]
  70. ] = None,
  71. on_click: Optional[EventType[[], BASE_STATE]] = None,
  72. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  73. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  74. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  75. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  76. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  77. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  78. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  79. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  80. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  81. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  82. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  83. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  84. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  85. **props,
  86. ) -> "Moment":
  87. """Create the component.
  88. Args:
  89. *children: The children of the component.
  90. interval: How often the date update (how often time update / 0 to disable).
  91. format: Formats the date according to the given format string.
  92. trim: When formatting duration time, the largest-magnitude tokens are automatically trimmed when they have no value.
  93. parse: Use the parse attribute to tell moment how to parse the given date when non-standard.
  94. add: Add a delta to the base date (keys are "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds")
  95. subtract: Subtract a delta to the base date (keys are "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds")
  96. from_now: Displays the date as the time from now, e.g. "5 minutes ago".
  97. 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.
  98. to_now: Similar to fromNow, but gives the opposite interval.
  99. with_title: Adds a title attribute to the element with the complete date.
  100. title_format: How the title date is formatted when using the withTitle attribute.
  101. diff: Show the different between this date and the rendered child.
  102. decimal: Display the diff as decimal.
  103. unit: Display the diff in given unit.
  104. duration: Shows the duration (elapsed time) between two dates. duration property should be behind date property time-wise.
  105. date: The date to display (also work if passed as children).
  106. duration_from_now: Shows the duration (elapsed time) between now and the provided datetime.
  107. unix: Tells Moment to parse the given date value as a unix timestamp.
  108. local: Outputs the result in local time.
  109. tz: Display the date in the given timezone.
  110. locale: The locale to use when rendering.
  111. on_change: Fires when the date changes.
  112. style: The style of the component.
  113. key: A unique key for the component.
  114. id: The id for the component.
  115. class_name: The class name for the component.
  116. autofocus: Whether the component should take the focus once the page is loaded
  117. custom_attrs: custom attribute
  118. **props: The props of the component.
  119. Returns:
  120. The component.
  121. """
  122. ...