8000 Add shoelace radio component by aaskat · Pull Request #1961 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

Add shoelace radio component #1961

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

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
add shoelace radio component
  • Loading branch information
aaskat committed Feb 1, 2024
commit 5a37e824be838a67ef437dc946f7f9266a611d8c
14 changes: 14 additions & 0 deletions pyscript.core/src/stdlib/pyweb/ui/shoelace.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,20 @@ def __init__(
)


class Radio(ShoeBase):
tag = "sl-radio"
value = js_property("value")
size = js_property("size")
disabled = js_property("disabled")
update_complete = js_property("updateComplete")

def __init__(
self, value=None, size=None, disabled=None, style=None, **kwargs
):
super().__init__(
value=value, size=size, disabled=disabled, style=style, **kwargs
)

# Load resources...
CSS = """
.card-overview {
Expand Down
5 changes: 5 additions & 0 deletions pyscript.core/test/ui/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
Divider,
Icon,
Rating,
Radio
)

LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
Expand Down Expand Up @@ -82,5 +83,9 @@ def toggle_dialog():
"instance": Rating(),
"code": el.code("Rating()"),
},
"Radio": {
"instance": Radio(),
"code": el.code("Radio()"),
},
}
}
0