o
    tf                     @   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.
    Z
LayoutViewT)syncz@jupyter-widgets/baseZ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.visibleZhiddenzThe visibility CSS attribute.zThe width CSS attribute.)ZcontainZ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&   i/var/www/html/software/conda/envs/catlas/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)r+   foundr-   oldr&   r&   r0   _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)r+   r   r-   r&   r&   r0   _set_borderg   s   zLayout._set_border):__name__
__module____qualname____doc__r   tagZ
_view_nameZ_view_moduler
   Z_view_module_versionZ_model_namer   CSS_PROPERTIESZalign_contentZalign_itemsZ
align_selfZ
border_topZborder_rightZborder_bottomZborder_leftr#   displayZflexZ	flex_flowheightZjustify_contentZjustify_itemsr$   margin
max_height	max_widthZ
min_height	min_widthoverfloworderpaddingr"   r!   Z
visibilitywidthZ
object_fitZobject_positionZgrid_auto_columnsZgrid_auto_flowZgrid_auto_rowsZgrid_gapZgrid_template_rowsZgrid_template_columnsZgrid_template_areasZgrid_rowZgrid_columnZ	grid_arear*   r5   r7   propertyr   __classcell__r&   r&   r.   r0   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)r+   objvaluer.   r&   r0   r   u   s   
zLayoutTraitType.validate)r8   r9   r:   r   rM   r   rI   r&   r&   r.   r0   rJ   q   s    rJ   N)r;   Z	traitletsr   r   r   r   Zwidgetr   r   _versionr
   r=   r   rJ   r&   r&   r&   r0   <module>   s   d