#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2024, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-----------------------------------------------------------------------------
'''
'''
#-----------------------------------------------------------------------------
# Boilerplate
#-----------------------------------------------------------------------------
from __future__ import annotations
import logging # isort:skip
log = logging.getLogger(__name__)
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Bokeh imports
from ...core.has_props import abstract
from ...core.properties import (
Bool,
Enum,
Int,
List,
Nullable,
String,
)
from .buttons import ButtonLike
from .widget import Widget
#-----------------------------------------------------------------------------
# Globals and constants
#-----------------------------------------------------------------------------
__all__ = (
'AbstractGroup',
'CheckboxButtonGroup',
'CheckboxGroup',
'RadioButtonGroup',
'RadioGroup',
'ToggleButtonGroup',
'ToggleInputGroup',
)
#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------
[docs]
@abstract
class AbstractGroup(Widget):
''' Abstract base class for all kinds of groups.
'''
# explicit __init__ to support Init signatures
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
labels = List(String, help="""
List of text labels contained in this group.
""")
#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------
[docs]
class CheckboxGroup(ToggleInputGroup):
''' A group of check boxes.
'''
# explicit __init__ to support Init signatures
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
active = List(Int, help="""
The list of indices of selected check boxes.
""")
[docs]
class RadioGroup(ToggleInputGroup):
''' A group of radio boxes.
'''
# explicit __init__ to support Init signatures
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
active = Nullable(Int, help="""
The index of the selected radio box, or ``None`` if nothing is selected.
""")
#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------