o
    ^i                     @   sh   d Z ddlmZmZmZmZ ddlmZmZ ddl	m
Z
 g dZeG dd	 d	eZG d
d deZdS )zContains the Layout class    )UnicodeInstanceCaselessStrEnumvalidate   )Widgetregister   ) __jupyter_widgets_base_version__)inheritinitialunsetc                       s  e Zd ZdZedjddZedjddZeejddZ	edjddZ
eg de ddd	jddZeg d
e ddd	jddZeg de ddd	jddZedddd	jddZedddd	jddZedddd	jddZedddd	jddZedddd	jddZedddd	jddZedddd	jddZedddd	jddZedddd	jddZeg de ddd	jddZeg de ddd	jddZedddd	jddZedddd	jddZedddd	jddZedddd	jddZeddd d	jddZeddd!d	jddZ eddd"d	jddZ!eddd#d	jddZ"eddd$d	jddZ#eddd%d	jddZ$eddd&d	jddZ%ed'd(ge dd)d	jddZ&eddd*d	jddZ'eg d+dd,d	jddZ(eddd-d	jddZ)eddd.d	jddZ*eg d/e dd0d	jddZ+eddd1d	jddZ,eddd2d	jddZ-eddd3d	jddZ.eddd4d	jddZ/eddd5d	jddZ0eddd6d	jddZ1eddd7d	jddZ2eddd8d	jddZ3 fd9d:Z4d;d< Z5d=d> Z6e7e5e6Z8  Z9S )?Layouta  Layout specification

    Defines a layout that can be expressed using CSS.  Supports a subset of
    https://developer.mozilla.org/en-US/docs/Web/CSS/Reference

    When a property is also accessible via a shorthand property, we only
    expose the shorthand.

    For example:
    - ``flex-grow``, ``flex-shrink`` and ``flex-basis`` are bound to ``flex``.
    - ``flex-wrap`` and ``flex-direction`` are bound to ``flex-flow``.
    - ``margin-[top/bottom/left/right]`` values are bound to ``margin``, etc.
    
LayoutViewT)syncz@jupyter-widgets/baseLayoutModel)
flex-startflex-endcenterspace-betweenspace-aroundzspace-evenlystretchz The align-content CSS attribute.)
allow_nonehelp)r   r   r   baseliner   zThe align-items CSS attribute.)autor   r   r   r   r   zThe align-self CSS attribute.NzThe border top CSS attribute.zThe border right CSS attribute.z The border bottom CSS attribute.zThe border left CSS attribute.zThe bottom CSS attribute.zThe display CSS attribute.zThe flex CSS attribute.zThe flex-flow CSS attribute.zThe height CSS attribute.)r   r   r   r   r   z"The justify-content CSS attribute.)r   r   r   z The justify-items CSS attribute.zThe left CSS attribute.zThe margin CSS attribute.zThe max-height CSS attribute.zThe max-width CSS attribute.zThe min-height CSS attribute.zThe min-width CSS attribute.zThe overflow CSS attribute.zThe order CSS attribute.zThe padding CSS attribute.zThe right CSS attribute.zThe top CSS attribute.visiblehiddenzThe visibility CSS attribute.zThe width CSS attribute.)containcoverfillz
scale-downnonezThe object-fit CSS attribute.z"The object-position CSS attribute.z$The grid-auto-columns CSS attribute.)columnrowz	row densezcolumn densez!The grid-auto-flow CSS attribute.z!The grid-auto-rows CSS attribute.zThe grid-gap CSS attribute.z%The grid-template-rows CSS attribute.z(The grid-template-columns CSS attribute.z&The grid-template-areas CSS attribute.zThe grid-row CSS attribute.zThe grid-column CSS attribute.zThe grid-area CSS attribute.c                    sD   d|v r| d}dD ]}|d| | qt jdi | d S )Nbordertoprightbottomleftborder_ )pop
setdefaultsuper__init__)selfkwargsr$   side	__class__r+   [/home/ubuntu/hpml_nyu/venv/lib/python3.10/site-packages/ipywidgets/widgets/widget_layout.pyr/   P   s
   
zLayout.__init__c                 C   sX   d}dD ]%}t | d| s dS |t| d| }}|du s&|dur)||kr) dS q|S )z
        `border` property getter. Return the common value of all side
        borders if they are identical. Otherwise return None.

        Nr%   r*   )hasattrgetattr)r0   foundr2   oldr+   r+   r5   _get_borderX   s   zLayout._get_borderc                 C   s   dD ]
}t | d| | qdS )zO
        `border` property setter. Set all 4 sides to `border` string.
        r%   r*   N)setattr)r0   r$   r2   r+   r+   r5   _set_borderg   s   zLayout._set_border):__name__
__module____qualname____doc__r   tag
_view_name_view_moduler
   _view_module_version_model_namer   CSS_PROPERTIESalign_contentalign_items
align_self
border_topborder_rightborder_bottomborder_leftr(   displayflex	flex_flowheightjustify_contentjustify_itemsr)   margin
max_height	max_width
min_height	min_widthoverfloworderpaddingr'   r&   
visibilitywidth
object_fitobject_positiongrid_auto_columnsgrid_auto_flowgrid_auto_rowsgrid_gapgrid_template_rowsgrid_template_columnsgrid_template_areasgrid_rowgrid_column	grid_arear/   r:   r<   propertyr$   __classcell__r+   r+   r3   r5   r      s    r   c                       s    e Zd ZeZ fddZ  ZS )LayoutTraitTypec                    s2   t |trt || jdi |S t ||S )Nr+   )
isinstancedictr.   r   klass)r0   objvaluer3   r+   r5   r   u   s   
zLayoutTraitType.validate)r=   r>   r?   r   ro   r   rk   r+   r+   r3   r5   rl   q   s    rl   N)r@   	traitletsr   r   r   r   widgetr   r   _versionr
   rF   r   rl   r+   r+   r+   r5   <module>   s   d