
    ;3hD                        d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ  G d dee	      Z e        G d
 dee	             ZeZy)    )annotations)document)BlockContext)ComponentMeta)Events)I18nDatac                  t    e Zd ZdZej
                  ej                  gZdddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)Tabsz\
    Tabs is a layout element within Blocks that can contain multiple "Tab" Components.
    NT)selectedvisibleelem_idelem_classesrenderkeypreserved_by_keyc          	     J    t        j                  | ||||||       || _        y)a  
        Parameters:
            selected: The currently selected tab. Must correspond to an id passed to the one of the child TabItems. Defaults to the first TabItem.
            visible: If False, Tabs will be hidden.
            elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
            elem_classes: An optional string or list of strings that are assigned as the class of this component in the HTML DOM. Can be used for targeting CSS styles.
            render: If False, this layout will not be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
            key: in a gr.render, Components with the same key across re-renders are treated as the same component, not a new component. Properties set in 'preserved_by_key' are not reset across a re-render.
            preserved_by_key: A list of parameters from this component's constructor. Inside a gr.render() function, if a component is re-rendered with the same key, these (and only these) parameters will be preserved in the UI (if they have been changed by the user or an event listener) instead of re-rendered based on the values provided during constructor.
        )r   r   r   r   r   r   N)r   __init__r   )selfr   r   r   r   r   r   r   s           S/var/www/html/audio-gradio/venv/lib/python3.12/site-packages/gradio/layouts/tabs.pyr   zTabs.__init__   s0    * 	%-	
 !    )r   int | str | Noner   boolr   
str | Noner   list[str] | str | Noner   r   r   (int | str | tuple[int | str, ...] | Noner   r   )	__name__
__module____qualname____doc__r   changeselectEVENTSr    r   r   r
   r
      s}     mmV]]+F
 &*"/38<37! #! 	!
 ! -! ! 6! 1!r   r
   )	metaclassc            	          e Zd ZdZej
                  gZ	 	 	 ddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	dZd
dZd Z	y)Taba  
    Tab (or its alias TabItem) is a layout element. Components defined within the Tab will be visible when this tab is selected tab.
    Example:
        with gr.Blocks() as demo:
            with gr.Tab("Lion"):
                gr.Image("lion.jpg")
                gr.Button("New Lion")
            with gr.Tab("Tiger"):
                gr.Image("tiger.jpg")
                gr.Button("New Tiger")
    Guides: controlling-layout
    NT)idr   r   scaler   r   r   c                   t        j                  | ||||	|
       || _        || _        || _        || _        || _        y)a  
        Parameters:
            label: The visual label for the tab
            id: An optional identifier for the tab, required if you wish to control the selected tab from a predict function.
            elem_id: An optional string that is assigned as the id of the <div> containing the contents of the Tab layout. The same string followed by "-button" is attached to the Tab button. Can be used for targeting CSS styles.
            elem_classes: An optional string or list of strings that are assigned as the class of this component in the HTML DOM. Can be used for targeting CSS styles.
            render: If False, this layout will not be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
            scale: relative size compared to adjacent elements. 1 or greater indicates the Tab will expand in size.
            visible: If False, Tab will be hidden.
            interactive: If False, Tab will not be clickable.
        )r   r   r   r   r   N)r   r   labelr'   r   r(   interactive)r   r*   r   r+   r'   r   r   r(   r   r   r   s              r   r   zTab.__init__D   sJ    2 	%-	
 

&r   c                    t         S )N)r
   r   s    r   get_expected_parentzTab.get_expected_parentk   s    r   c                     y)Ntabitemr#   r-   s    r   get_block_namezTab.get_block_namen   s    r   )NTT)r*   zstr | I18nData | Noner   r   r+   r   r'   r   r   r   r   r   r(   z
int | Noner   r   r   r   r   r   )returnz
type[Tabs])
r   r   r   r   r   r!   r"   r   r.   r1   r#   r   r   r&   r&   3   s     mm_F (, 	%'  $"/3 8<37%'$%' %' 	%' %' %' -%' %' %' 6%' 1%'Nr   r&   N)
__future__r   gradio_client.documentationr   gradio.blocksr   gradio.component_metar   gradio.eventsr   gradio.i18nr   r
   r&   TabItemr#   r   r   <module>r:      sM    " 0 & /    %!<= %!P 
;,- ; ;| r   