mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 11:15:36 -05:00
Add radio group (#1963)
* add radio group * [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> Co-authored-by: Fabio Pliger <fpliger@users.noreply.github.com>
This commit is contained in:
@@ -377,19 +377,68 @@ class Icon(ShoeBase):
|
||||
)
|
||||
|
||||
|
||||
class Radio(ShoeBase):
|
||||
class Radio(TextShoeBase):
|
||||
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):
|
||||
def __init__(
|
||||
self, content, value=None, size=None, disabled=None, style=None, **kwargs
|
||||
):
|
||||
super().__init__(
|
||||
value=value, size=size, disabled=disabled, style=style, **kwargs
|
||||
content, value=value, size=size, disabled=disabled, style=style, **kwargs
|
||||
)
|
||||
|
||||
|
||||
class RadioGroup(ShoeBase):
|
||||
tag = "sl-radio-group"
|
||||
label = js_property("label")
|
||||
help_text = js_property("helpText")
|
||||
name = js_property("name")
|
||||
value = js_property("value")
|
||||
size = js_property("size")
|
||||
form = js_property("form")
|
||||
required = js_property("required")
|
||||
validity = js_property("validity")
|
||||
validation_message = js_property("validationMessage")
|
||||
update_complete = js_property("updateComplete")
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
children: list[Radio] = None,
|
||||
label=None,
|
||||
help_text=None,
|
||||
name=None,
|
||||
value=None,
|
||||
size=None,
|
||||
form=None,
|
||||
required=None,
|
||||
validity=None,
|
||||
validation_message=None,
|
||||
update_complete=None,
|
||||
**kwargs,
|
||||
):
|
||||
super().__init__(
|
||||
label=label,
|
||||
help_text=help_text,
|
||||
name=name,
|
||||
value=value,
|
||||
size=size,
|
||||
form=form,
|
||||
required=required,
|
||||
validity=validity,
|
||||
validation_message=validation_message,
|
||||
update_complete=update_complete,
|
||||
**kwargs,
|
||||
)
|
||||
if children:
|
||||
for radio in children:
|
||||
if isinstance(radio, Radio):
|
||||
self.append(radio)
|
||||
|
||||
|
||||
class CopyButton(ShoeBase):
|
||||
tag = "sl-copy-button"
|
||||
value = js_property("value")
|
||||
|
||||
Reference in New Issue
Block a user