a
    Df                     @   sR   d dl mZ d dlZd dlmZmZ ddlmZ ddlm	Z	 G dd	 d	e	eZ
dS )
    )PathN)iscoroutinefunctionresolve_ref   )ReactiveHTML   )ListLikec                       s   e Zd ZdZejdg dddZejdg dddZejdg d	d
dZejdg dddZ	ej
dddZejdg dddZeejd dZ fddZd fdd	Z  ZS )FlexBoxah  
    The `FlexBox` is a list-like layout (unlike `GridSpec`) that wraps objects
    into a CSS flex container.

    It has a list-like API with methods to `append`, `extend`, `clear`,
    `insert`, `pop`, `remove` and `__setitem__`, which makes it possible to
    interactively update and modify the layout. It exposes all the CSS options
    for controlling the behavior and layout of the flex box.

    Reference: https://panel.holoviz.org/reference/layouts/FlexBox.html

    :Example:

    >>> pn.FlexBox(
    ...    some_python_object, another_python_object, ...,
    ...    the_last_python_object
    ... )
    
flex-start)normalr
   flex-endcenterspace-betweenspace-aroundspace-evenlystretchstartendbaselinefirst baselinelast baselinezh
        Defines how a flex container's lines align when there is extra
        space in the cross-axis.)defaultobjectsdoc)r   r
   r   r   r   r   r   r   r   z
self-startzself-endzw
        Defines the default behavior for how flex items are laid
        out along the cross axis on the current line.row)r   zrow-reversecolumnzcolumn-reversezy
        This establishes the main-axis, thus defining the direction
        flex items are placed in the flex container.wrap)Znowrapr   zwrap-reversez=
        Whether and how to wrap items in the flex container. zb
        Defines the spacing between flex items, supporting various units (px, em, rem, %, vw/vh).)r   r   )
r
   r   r   r   r   r   r   r   leftrightz3
        Defines the alignment along the main axis.zflexbox.htmlzutf-8c                    s   ddl m  d|vr>|d| j}|dr6d|d< nd|d< |rtd|v r\td	t| j  fd
d|D |d< n6d|v r|d }t|rt	|r fdd|D |d< t
 jf i | d S )Nr   panelZsizing_modeflex_directionr   Zstretch_widthZstretch_heightr   z[A %s's objects should be supplied either as positional arguments or as a keyword, not both.c                    s   g | ]} |qS  r#   .0Zpaner    r#   ^/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/panel/layout/flex.py
<listcomp>M       z$FlexBox.__init__.<locals>.<listcomp>c                    s   g | ]} |qS r#   r#   r$   r    r#   r&   r'   Q   r(   )Z	pane.baser!   getr"   
startswith
ValueErrortype__name__r   r   super__init__)selfr   params	direction	__class__r    r&   r/   @   s"    

zFlexBox.__init__Nc                    s(   t  |}| D ]}|||7 }q|S )a  
        Iterates over the Viewable and any potential children in the
        applying the Selector.

        Arguments
        ---------
        selector: type or callable or None
          The selector allows selecting a subset of Viewables by
          declaring a type or callable function to filter by.

        Returns
        -------
        viewables: list(Viewable)
        )r.   select)r0   selectorr   objr3   r#   r&   r5   T   s    zFlexBox.select)N)r-   
__module____qualname____doc__paramZSelectorZalign_contentZalign_itemsr"   Z	flex_wrapStringZgapZjustify_contentr   __file__parent	read_text	_templater/   r5   __classcell__r#   r#   r3   r&   r	      s(   r	   )pathlibr   r;   Zparam.parameterizedr   r   Zreactiver   baser   r	   r#   r#   r#   r&   <module>   s
   