
    hMh                     n    d Z ddlmZmZ ddlmZmZ ddlmZm	Z	 ddl
mZ ddlmZ  G d d	e          Zd
S )zContains the DOMWidget class    )BoolUnicode   )Widgetwidget_serialization)InstanceDict
TypedTuple)Layout)Stylec                       e Zd ZdZ ed                              d          Z e e            d                              d          Z e	ddd	                              d          Z
 eddd
                              d          Z  ee          j        dddieZd Zd Zd Zd Z fdZ xZS )	DOMWidgetzWidget that can be inserted into the DOM

    Parameters
    ----------
    tooltip: str
       tooltip caption
    layout: InstanceDict(Layout)
       widget layout
    DOMWidgetModelT)syncz)CSS classes applied to widget DOM element)traithelpzIs widget tabbable?N)r   
allow_nonedefault_valuezA tooltip caption.)r   r   r   c                 R    || j         vrt          | j                   |gz   | _         | S )z{
        Adds a class to the top level element of the widget.

        Doesn't add the class if it already exists.
        )_dom_classeslistself	classNames     \/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/ipywidgets/widgets/domwidget.py	add_classzDOMWidget.add_class   s1     D--- $T%6 7 79+ ED    c                 J    | j         v rfd| j         D             | _         | S )z
        Removes a class from the top level element of the widget.

        Doesn't remove the class if it doesn't exist.
        c                      g | ]
}|k    |S  r   ).0cr   s     r   
<listcomp>z*DOMWidget.remove_class.<locals>.<listcomp>/   s     P P Pqir   )r   r   s    `r   remove_classzDOMWidget.remove_class(   s7     ))) P P P PD,= P P PDr   c                 4    |                      ddi           dS )z&
        Focus on the widget.
        dofocusNsendr   s    r   r&   zDOMWidget.focus2   s      			4.!!!!!r   c                 4    |                      ddi           dS )z"
        Blur the widget.
        r%   blurNr'   r)   s    r   r+   zDOMWidget.blur8   s      			4-     r   c              #      K   t                                                      D ]=}|dk    r1t          | |          }t          |          d|j        j        z  k    r9|V  >| j        rdV  d S d S )Nlayoutz%s()r   )super
_repr_keysgetattrrepr	__class____name__r   )r   keyvaluer2   s      r   r/   zDOMWidget._repr_keys>   s      77%%'' 	 	Chc**;;&5?+C"CCCIIII 	!      	! 	!r   r   )r3   
__module____qualname____doc__r   tag_model_namer	   r   r   tabbabletooltipr   r
   r   r-   r   r#   r&   r+   r/   __classcell__)r2   s   @r   r   r      sH         '*++//T/::K:GGII4_```ddjndooLt.4tTTTXX^bXccHgdt2FGGGKKQUKVVG%\\&!!%HH4H3GHHF    " " "! ! !
! 
! 
! 
! 
! 
! 
! 
! 
!r   r   N)r8   	traitletsr   r   widgetr   r   trait_typesr   r	   widget_layoutr
   widget_styler   r   r   r   r   <module>rC      s    # " # # # # # # # # 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 ! ! ! ! ! !      ;! ;! ;! ;! ;! ;! ;! ;! ;! ;!r   