a
    DfZ                     @  sd   d Z ddlmZ ddlmZmZmZmZ ddlZddl	m
Z
 ddlmZ g d	ZG d
d deZdS )zU
Bootstrap inspired Alerts

See https://getbootstrap.com/docs/4.0/components/alerts/
    )annotations)AnyClassVarListMappingN   )CDN_DIST   )Markdown)primaryZ	secondarysuccessZdangerwarninginfolightZdarkc                      s   e Zd ZU dZejdedZdZde	d< ddiZ
d	e	d
< e dgZde	d< edddddZd fdd	Z fddZ  ZS )Alerta  
    The `Alert` pane allows providing contextual feedback messages for typical
    user actions. The Alert supports markdown strings.

    Reference: https://panel.holoviz.org/reference/panes/Alert.html

    :Example:

    >>> Alert('Some important message', alert_type='warning')
    r   )defaultZobjectsr   zClassVar[float | bool | None]priority
alert_typeNz"ClassVar[Mapping[str, str | None]]_renamezcss/alerts.csszClassVar[List[str]]_stylesheetsr   zfloat | bool | None)objreturnc                 C  s   t |}|rdS dS )Nr   F)r
   applies)clsr   r    r   ]/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/panel/pane/alert.pyr   -   s    
zAlert.appliesc                   s0   d|vrd|vrd|d< t  j|fi | d S )NZsizing_modewidthZstretch_width)super__init__)selfobjectparams	__class__r   r   r   2   s    zAlert.__init__c                   s6   d|v sd|v r*| j dd| j g |d< t |S )Ncss_classesr   alertzalert-)r$   r   r   _process_param_change)r   r!   r"   r   r   r&   7   s
    
zAlert._process_param_change)N)__name__
__module____qualname____doc__paramZObjectSelectorALERT_TYPESr   r   __annotations__r   r   r   classmethodr   r   r&   __classcell__r   r   r"   r   r      s   
r   )r*   
__future__r   typingr   r   r   r   r+   Zio.resourcesr   Zmarkupr
   r,   r   r   r   r   r   <module>   s   