reflex/reflex/components/moment/moment.pyi
Khaleel Al-Adhami 085b761f6b
replace old var system with immutable one (#3916)
* delete most references to varr

* [REF-3562][REF-3563] Replace chakra usage (#3872)

* only one mention of var

* delete vars.py why not

* remove reflex.vars

* rename immutable var to var

* rename ivars to vars

* add vars back smh

* ruff

* no more create_safe

* reorder deprecated

* remove raises

* remove all Var.create

* move to new api

* fix unit tests

* fix pyi hopefully

* sort literals

* fix event handler issues

* update poetry

* fix silly issues i'm very silly

* add var_operation_return

* rename immutable to not immutable

* add str type

* it's ruff out there

---------

Co-authored-by: Elijah Ahianyo <elijahahianyo@gmail.com>
2024-09-13 16:01:52 -07:00

134 lines
6.4 KiB
Python

"""Stub file for reflex/components/moment/moment.py"""
# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
import dataclasses
from typing import Any, Callable, Dict, Optional, Union, overload
from reflex.components.component import NoSSRComponent
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.utils.imports import ImportDict
from reflex.vars.base import Var
@dataclasses.dataclass(frozen=True)
class MomentDelta:
years: Optional[int]
quarters: Optional[int]
months: Optional[int]
weeks: Optional[int]
days: Optional[int]
hours: Optional[int]
minutess: Optional[int]
seconds: Optional[int]
milliseconds: Optional[int]
class Moment(NoSSRComponent):
def add_imports(self) -> ImportDict: ...
@overload
@classmethod
def create( # type: ignore
cls,
*children,
interval: Optional[Union[Var[int], int]] = None,
format: Optional[Union[Var[str], str]] = None,
trim: Optional[Union[Var[bool], bool]] = None,
parse: Optional[Union[Var[str], str]] = None,
add: Optional[Union[MomentDelta, Var[MomentDelta]]] = None,
subtract: Optional[Union[MomentDelta, Var[MomentDelta]]] = None,
from_now: Optional[Union[Var[bool], bool]] = None,
from_now_during: Optional[Union[Var[int], int]] = None,
to_now: Optional[Union[Var[bool], bool]] = None,
with_title: Optional[Union[Var[bool], bool]] = None,
title_format: Optional[Union[Var[str], str]] = None,
diff: Optional[Union[Var[str], str]] = None,
decimal: Optional[Union[Var[bool], bool]] = None,
unit: Optional[Union[Var[str], str]] = None,
duration: Optional[Union[Var[str], str]] = None,
date: Optional[Union[Var[str], str]] = None,
duration_from_now: Optional[Union[Var[bool], bool]] = None,
unix: Optional[Union[Var[bool], bool]] = None,
local: Optional[Union[Var[bool], bool]] = None,
tz: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_context_menu: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_double_click: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_mouse_down: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_enter: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_leave: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_move: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_out: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_over: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_mouse_up: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
on_unmount: Optional[
Union[EventHandler, EventSpec, list, Callable, Var]
] = None,
**props,
) -> "Moment":
"""Create a Moment 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.
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 properties of the component.
Returns:
The Moment Component.
"""
...