mirror of
https://github.com/pyscript/pyscript.git
synced 2026-04-30 16:00:32 -04:00
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>
This commit is contained in:
@@ -374,6 +374,19 @@ class Icon(ShoeBase):
|
||||
)
|
||||
|
||||
|
||||
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 {
|
||||
|
||||
@@ -9,6 +9,7 @@ from pyweb.ui.shoelace import (
|
||||
Dialog,
|
||||
Divider,
|
||||
Icon,
|
||||
Radio,
|
||||
Rating,
|
||||
)
|
||||
|
||||
@@ -82,5 +83,9 @@ Card(el.p("This is a cool card!"), image="https://pyscript.net/assets/images/pys
|
||||
"instance": Rating(),
|
||||
"code": el.code("Rating()"),
|
||||
},
|
||||
"Radio": {
|
||||
"instance": Radio(),
|
||||
"code": el.code("Radio()"),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user