Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all (API-exposed) dataclass kw-only #80

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mesop/components/checkbox/checkbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from mesop.events import MesopEvent


@dataclass
@dataclass(kw_only=True)
class CheckboxChangeEvent(MesopEvent):
"""Represents a checkbox state change event.
Expand All @@ -34,7 +34,7 @@ class CheckboxChangeEvent(MesopEvent):
)


@dataclass
@dataclass(kw_only=True)
class CheckboxIndeterminateChangeEvent(MesopEvent):
"""Represents a checkbox indeterminate state change event.
Expand Down
2 changes: 1 addition & 1 deletion mesop/components/progress_bar/progress_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from mesop.events import MesopEvent


@dataclass
@dataclass(kw_only=True)
class ProgressBarAnimationEndEvent(MesopEvent):
"""
Event emitted when the animation of the progress bar ends.
Expand Down
4 changes: 2 additions & 2 deletions mesop/components/radio/radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from mesop.events import MesopEvent


@dataclass
@dataclass(kw_only=True)
class RadioChangeEvent(MesopEvent):
"""Event representing a change in the radio component's value.
Expand All @@ -29,7 +29,7 @@ class RadioChangeEvent(MesopEvent):
)


@dataclass
@dataclass(kw_only=True)
class RadioOption:
"""
Attributes:
Expand Down
6 changes: 3 additions & 3 deletions mesop/components/select/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from mesop.events import MesopEvent


@dataclass
@dataclass(kw_only=True)
class SelectOpenedChangeEvent(MesopEvent):
"""Event representing the opened state change of the select component.
Expand All @@ -32,7 +32,7 @@ class SelectOpenedChangeEvent(MesopEvent):
)


@dataclass
@dataclass(kw_only=True)
class SelectSelectionChangeEvent(MesopEvent):
"""Event representing a change in the select component's value.
Expand All @@ -53,7 +53,7 @@ class SelectSelectionChangeEvent(MesopEvent):
)


@dataclass
@dataclass(kw_only=True)
class SelectOption:
"""Represents an option within a select component.
Expand Down
2 changes: 1 addition & 1 deletion mesop/components/slide_toggle/slide_toggle.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from mesop.events import MesopEvent


@dataclass
@dataclass(kw_only=True)
class SlideToggleChangeEvent(MesopEvent):
"""Event triggered when the slide toggle state changes.
Expand Down
2 changes: 1 addition & 1 deletion mesop/components/slider/slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from mesop.events.events import MesopEvent


@dataclass
@dataclass(kw_only=True)
class SliderValueChangeEvent(MesopEvent):
"""
Event triggered when the slider value changes.
Expand Down
6 changes: 3 additions & 3 deletions mesop/events/events.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from dataclasses import dataclass


@dataclass
@dataclass(kw_only=True)
class MesopEvent:
key: str


@dataclass
@dataclass(kw_only=True)
class ClickEvent(MesopEvent):
"""Represents a user click event.
Expand All @@ -17,7 +17,7 @@ class ClickEvent(MesopEvent):
pass


@dataclass
@dataclass(kw_only=True)
class InputEvent(MesopEvent):
"""Represents a user input event.
Expand Down
2 changes: 1 addition & 1 deletion mesop/key/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import mesop.protos.ui_pb2 as pb


@dataclass
@dataclass(kw_only=True)
class Key:
key: str

Expand Down
Loading