123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- """Stub file for reflex/components/moment/moment.py"""
- # ------------------- DO NOT EDIT ----------------------
- # This file was generated by `reflex/utils/pyi_generator.py`!
- # ------------------------------------------------------
- import dataclasses
- from datetime import date, datetime, time, timedelta
- from typing import Any, Optional, overload
- from reflex.components.component import NoSSRComponent
- from reflex.event import EventType
- from reflex.style import Style
- from reflex.utils.imports import ImportDict
- from reflex.vars.base import Var
- @dataclasses.dataclass(frozen=True)
- class MomentDelta:
- years: int | None
- quarters: int | None
- months: int | None
- weeks: int | None
- days: int | None
- hours: int | None
- minutes: int | None
- seconds: int | None
- milliseconds: int | None
- class Moment(NoSSRComponent):
- def add_imports(self) -> ImportDict: ...
- @overload
- @classmethod
- def create( # type: ignore
- cls,
- *children,
- interval: Var[int] | int | None = None,
- format: Var[str] | str | None = None,
- trim: Var[bool] | bool | None = None,
- parse: Var[str] | str | None = None,
- add: MomentDelta | Var[MomentDelta] | None = None,
- subtract: MomentDelta | Var[MomentDelta] | None = None,
- from_now: Var[bool] | bool | None = None,
- from_now_during: Var[int] | int | None = None,
- to_now: Var[bool] | bool | None = None,
- with_title: Var[bool] | bool | None = None,
- title_format: Var[str] | str | None = None,
- diff: Var[str] | str | None = None,
- decimal: Var[bool] | bool | None = None,
- unit: Var[str] | str | None = None,
- duration: Var[str] | str | None = None,
- date: Var[date | datetime | str | time | timedelta]
- | date
- | datetime
- | str
- | time
- | timedelta
- | None = None,
- duration_from_now: Var[bool] | bool | None = None,
- unix: Var[bool] | bool | None = None,
- local: Var[bool] | bool | None = None,
- tz: Var[str] | str | None = None,
- locale: Var[str] | str | None = None,
- style: Style | None = None,
- key: Any | None = None,
- id: Any | None = None,
- class_name: Any | None = None,
- autofocus: bool | None = None,
- custom_attrs: dict[str, Var | Any] | None = None,
- on_blur: Optional[EventType[()]] = None,
- on_change: Optional[EventType[()] | EventType[str]] = None,
- on_click: Optional[EventType[()]] = None,
- on_context_menu: Optional[EventType[()]] = None,
- on_double_click: Optional[EventType[()]] = None,
- on_focus: Optional[EventType[()]] = None,
- on_mount: Optional[EventType[()]] = None,
- on_mouse_down: Optional[EventType[()]] = None,
- on_mouse_enter: Optional[EventType[()]] = None,
- on_mouse_leave: Optional[EventType[()]] = None,
- on_mouse_move: Optional[EventType[()]] = None,
- on_mouse_out: Optional[EventType[()]] = None,
- on_mouse_over: Optional[EventType[()]] = None,
- on_mouse_up: Optional[EventType[()]] = None,
- on_scroll: Optional[EventType[()]] = None,
- on_unmount: Optional[EventType[()]] = None,
- **props,
- ) -> "Moment":
- """Create the component.
- Args:
- *children: The children of the component.
- interval: How often the date update (how often time update / 0 to disable).
- format: Formats the date according to the given format string.
- trim: When formatting duration time, the largest-magnitude tokens are automatically trimmed when they have no value.
- parse: Use the parse attribute to tell moment how to parse the given date when non-standard.
- add: Add a delta to the base date (keys are "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds")
- subtract: Subtract a delta to the base date (keys are "years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds")
- from_now: Displays the date as the time from now, e.g. "5 minutes ago".
- 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.
- to_now: Similar to fromNow, but gives the opposite interval.
- with_title: Adds a title attribute to the element with the complete date.
- title_format: How the title date is formatted when using the withTitle attribute.
- diff: Show the different between this date and the rendered child.
- decimal: Display the diff as decimal.
- unit: Display the diff in given unit.
- duration: Shows the duration (elapsed time) between two dates. duration property should be behind date property time-wise.
- date: The date to display (also work if passed as children).
- duration_from_now: Shows the duration (elapsed time) between now and the provided datetime.
- unix: Tells Moment to parse the given date value as a unix timestamp.
- local: Outputs the result in local time.
- tz: Display the date in the given timezone.
- locale: The locale to use when rendering.
- on_change: Fires when the date changes.
- style: The style of the component.
- key: A unique key for the component.
- id: The id for the component.
- class_name: The class name for the component.
- autofocus: Whether the component should take the focus once the page is loaded
- custom_attrs: custom attribute
- **props: The props of the component.
- Returns:
- The component.
- """
- ...
|