#-----------------------------------------------------------------------------# Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors.# All rights reserved.## The full license is in the file LICENSE.txt, distributed with this software.#-----------------------------------------------------------------------------""""""#-----------------------------------------------------------------------------# Boilerplate#-----------------------------------------------------------------------------from__future__importannotationsimportlogging# isort:skiplog=logging.getLogger(__name__)#-----------------------------------------------------------------------------# Imports#-----------------------------------------------------------------------------# Bokeh importsfrom...core.has_propsimportabstractfrom...core.propertiesimport(Bool,Dict,Either,Instance,List,Nullable,Seq,String,)from...modelimportModelfrom..cssimportStyles,StyleSheet#-----------------------------------------------------------------------------# Globals and constants#-----------------------------------------------------------------------------__all__=("UIElement",)#-----------------------------------------------------------------------------# General API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Dev API#-----------------------------------------------------------------------------
[docs]@abstractclassUIElement(Model):""" Base class for user interface elements. """# explicit __init__ to support Init signaturesdef__init__(self,*args,**kwargs)->None:super().__init__(*args,**kwargs)visible=Bool(default=True,help=""" Whether the component should be displayed on screen. """)css_classes=List(String,default=[],help=""" A list of additional CSS classes to add to the underlying DOM element. """).accepts(Seq(String),lambdax:list(x))styles=Either(Dict(String,Nullable(String)),Instance(Styles),default={},help=""" Inline CSS styles applied to the underlying DOM element. """)stylesheets=List(Either(Instance(StyleSheet),String,Dict(String,Either(Dict(String,Nullable(String)),Instance(Styles)),),),help=""" Additional style-sheets to use for the underlying DOM element. Note that all bokeh's components use shadow DOM, thus any included style sheets must reflect that, e.g. use ``:host`` CSS pseudo selector to access the root DOM element. """)