@@ -23,13 +23,19 @@ def __init__(self, **kwargs):
2323 self ._button_options = None
2424 self ._events = None
2525 self ._icons_url = None
26+ self ._menu_item_hover_style = None
27+ self ._menu_item_style = None
28+ self ._menu_style = None
2629
2730 self .annotation_options = kwargs .get ('annotation_options' , None )
2831 self .bindings = kwargs .get ('bindings' , None )
2932 self .bindings_class_name = kwargs .get ('bindings_class_name' , None )
3033 self .button_options = kwargs .get ('button_options' , None )
3134 self .events = kwargs .get ('events' , None )
3235 self .icons_url = kwargs .get ('icons_url' , None )
36+ self .menu_item_hover_style = kwargs .get ('menu_item_hover_style' , None )
37+ self .menu_item_style = kwargs .get ('menu_item_style' , None )
38+ self .menu_style = kwargs .get ('menu_style' , None )
3339
3440 super ().__init__ (** kwargs )
3541
@@ -118,6 +124,74 @@ def icons_url(self) -> Optional[str]:
118124 def icons_url (self , value ):
119125 self ._icons_url = validators .string (value , allow_empty = True )
120126
127+ @property
128+ def menu_item_hover_style (self ) -> Optional [str | dict ]:
129+ """CSS styles for the individual items within the popup menu when the user's mouse hovers over them.
130+
131+ .. note::
132+
133+ Font size defaults to 11px on desktop and 14px on touch devices.
134+
135+ Defaults to:
136+ ``{"background": "#f2f2f2" }``.
137+
138+ :rtype: :class:`str <python:str>` or :class:`dict <python:dict>` or :obj:`None <python:None>`
139+ """
140+ return self ._menu_item_hover_style
141+
142+ @menu_item_hover_style .setter
143+ def menu_item_hover_style (self , value ):
144+ try :
145+ self ._menu_item_hover_style = validators .dict (value , allow_empty = True )
146+ except (ValueError , TypeError ):
147+ self ._menu_item_hover_style = validators .string (value ,
148+ allow_empty = True ,
149+ coerce_value = True )
150+
151+ @property
152+ def menu_item_style (self ) -> Optional [str | dict ]:
153+ """CSS styles for the individual items within the popup menu.
154+
155+ .. note::
156+
157+ Font size defaults to 11px on desktop and 14px on touch devices.
158+
159+ Defaults to:
160+ ``{"padding": "0.5em", "color": "#333333", "background": "none", "borderRadius": "3px", "fontSize": "0.8em", "transition": "background 250ms, color 250ms"}``.
161+
162+ :rtype: :class:`str <python:str>` or :class:`dict <python:dict>` or :obj:`None <python:None>`
163+ """
164+ return self ._menu_item_style
165+
166+ @menu_item_style .setter
167+ def menu_item_style (self , value ):
168+ try :
169+ self ._menu_item_style = validators .dict (value , allow_empty = True )
170+ except (ValueError , TypeError ):
171+ self ._menu_item_style = validators .string (value ,
172+ allow_empty = True ,
173+ coerce_value = True )
174+
175+ @property
176+ def menu_style (self ) -> Optional [str | dict ]:
177+ """CSS styles for the popup menu appearing when the popup button is clicked.
178+
179+ Defaults to:
180+ ``{"background": "#ffffff", "borderRadius": "3px", "padding": "0.5em"}``.
181+
182+ :rtype: :class:`str <python:str>` or :class:`dict <python:dict>` or :obj:`None <python:None>`
183+ """
184+ return self ._menu_style
185+
186+ @menu_style .setter
187+ def menu_style (self , value ):
188+ try :
189+ self ._menu_style = validators .dict (value , allow_empty = True )
190+ except (ValueError , TypeError ):
191+ self ._menu_style = validators .string (value ,
192+ allow_empty = True ,
193+ coerce_value = True )
194+
121195 @classmethod
122196 def _get_kwargs_from_dict (cls , as_dict ):
123197 kwargs = {
@@ -127,6 +201,9 @@ def _get_kwargs_from_dict(cls, as_dict):
127201 'button_options' : as_dict .get ('buttonOptions' , None ),
128202 'events' : as_dict .get ('events' , None ),
129203 'icons_url' : as_dict .get ('iconsURL' , None ),
204+ 'menu_item_hover_style' : as_dict .get ('menuItemHoverStyle' , None ),
205+ 'menu_item_style' : as_dict .get ('menuItemStyle' , None ),
206+ 'menu_style' : as_dict .get ('menuStyle' , None ),
130207 }
131208
132209 return kwargs
@@ -138,7 +215,10 @@ def _to_untrimmed_dict(self, in_cls = None) -> dict:
138215 'bindingsClassName' : self .bindings_class_name ,
139216 'buttonOptions' : self .button_options ,
140217 'events' : self .events ,
141- 'iconsURL' : self .icons_url
218+ 'iconsURL' : self .icons_url ,
219+ 'menuItemHoverStyle' : self .menu_item_hover_style ,
220+ 'menuItemStyle' : self .menu_item_style ,
221+ 'menuStyle' : self .menu_style ,
142222 }
143223
144224 return untrimmed
@@ -194,6 +274,9 @@ def _get_kwargs_from_dict(cls, as_dict):
194274 'button_options' : as_dict .get ('buttonOptions' , None ),
195275 'events' : as_dict .get ('events' , None ),
196276 'icons_url' : as_dict .get ('iconsURL' , None ),
277+ 'menu_item_hover_style' : as_dict .get ('menuItemHoverStyle' , None ),
278+ 'menu_item_style' : as_dict .get ('menuItemStyle' , None ),
279+ 'menu_style' : as_dict .get ('menuStyle' , None ),
197280
198281 'breadcrumbs' : as_dict .get ('breadcrumbs' , None ),
199282 }
0 commit comments