8000 Add shoelace radio component (#1961) · pyscript/pyscript@9edb318 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9edb318

Browse files
Add shoelace radio component (#1961)
* add shoelace radio component * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent d370450 commit 9edb318

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

pyscript.core/src/stdlib/pyweb/ui/shoelace.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,19 @@ def __init__(
374374
)
375375

376376

377+
class Radio(ShoeBase):
378+
tag = "sl-radio"
379+
value = js_property("value")
380+
size = js_property("size")
381+
disabled = js_property("disabled")
382+
update_complete = js_property("updateComplete")
383+
384+
def __init__(self, value=None, size=None, disabled=None, style=None, **kwargs):
385+
super().__init__(
386+
value=value, size=size, disabled=disabled, style=style, **kwargs
387+
)
388+
389+
377390
# Load resources...
378391
CSS = """
379392
.card-overview {

pyscript.core/test/ui/examples.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Dialog,
1010
Divider,
1111
Icon,
12+
Radio,
1213
Rating,
1314
)
1415

@@ -82,5 +83,9 @@ def toggle_dialog():
8283
"instance": Rating(),
8384
"code": el.code("Rating()"),
8485
},
86+
"Radio": {
87+
"instance": Radio(),
88+
"code": el.code("Radio()"),
89+
},
8590
}
8691
}

0 commit comments

Comments
 (0)
0