
    ɯei0                     l   d dl mZ d dlmZmZmZmZmZ d dlZ	d dl
mc mZ  ee      j                  j                         dz  Z ej"                  d ee            Z	 	 	 	 	 	 	 	 dddd	d
dededee   dee   dedee   dee   deeedf      deeeef      dededefdZd Zedk(  r e        yy)    )Path)AnyCallableDictOptionalTupleNfrontendst_keyup)path Fvisible)placeholderdisabledlabel_visibilitylabelvalue	max_charskeytypedebounce	on_changeargs.kwargsr   r   r   c	                   ||
|||||	g}ddj                  d |D              z   }t        | |||||||	|
|
      }||t        j                  |<   |d| z   }|qdt        j                  vri t        j                  d<   |t        j                  d   j	                  ||      k7  r&|t        j                  d   |<   |d}|i } ||i | |S )a  
    Generate a text input that renders on keyup, debouncing the input by the
    specified amount of milliseconds.

    Debounce means that it will wait at least the specified amount of milliseconds
    before updating the value. This is useful for preventing excessive updates
    when the user is typing. Since the input updating will cause the app to rerun,
    if you are having performance issues, you should consider setting a debounce
    value.

    on_change is a callback function that will be called when the value changes.

    args and kwargs are optional arguments which are passed to the on_change callback
    function
    	st_keyup___c              3   8   K   | ]  }|t        |        y w)N)str).0parts     S/var/www/html/glpi_dashboard/venv/lib/python3.12/site-packages/st_keyup/__init__.py	<genexpr>zst_keyup.<locals>.<genexpr>4   s      +4+;D	+s   )
r   r   r   r   defaultr   r   r   r   r   __previous_values__ )join_component_funcstsession_stateget)r   r   r   r   r   r   r   r   r   r   r   r   	key_partscomputed_keycomponent_values                  r!   r
   r
      s   @ 	I  +'+ " L &)O  /
{E! (8(8868B23b../DEII#uUU;JB23C8|~t&v&    c                     ddl m  t        j                  d       t        d      } t        j                  |        	 t        dd      } 	 t        dd	      } 	 t        d
d      } 	 t        ddd      } 	 t        ddd      } 	 t        dd      } 	 t        dd      } 	 t        dd      } t        j                  |        fd}d }	 t        d|      } 	 t        d |d!"      } t        j                  |        	 t        d#|d$d%d&i'      } t        j                  |        	 t        j                  d      } t        j                  |        t        j                  t        j
                         y )(Nr   datetimez## Default keyup inputzEnter a valuezYou can't see thishidden)r   zThis either	collapsedzKeyup with max chars   )r   PasswordzHello Worldpassword)r   r   DisabledT)r   r   zDefault value)r   zHas placeholderzA placeholder)r   zEnter a second value debouncedi  )r   c                  N    t        j                  d j                                y NzValue changed!)r(   writenowr0   s   r!   r   zmain.<locals>.on_change}   s    
!8<<>2r.   c                  2    t        j                  d| |       y r9   )r(   r:   )r   r   s     r!   
on_change2zmain.<locals>.on_change2   s    
!40r.   zHas an on_change)r   zOn_change + debouncei  )r   r   zEnter a fourth value...)HelloWorldfoobar)r   r   r   )r1   r(   r:   r
   
text_inputr)   )r   r   r=   r1   s      @r!   mainrC   [   sD   !HH%&_%EHHUO&)HEE)][AE+q9E'Z}:FE"Z}tDE'_M:E%&ODE25DEHHUO31 -'9=E9+y4PEHHUO!u~	E HHUO+MM/*EHHUOHHRr.   __main__)r   NNr#   NNNN)pathlibr   typingr   r   r   r   r   	streamlitr(   streamlit.components.v1
componentsv1__file__parentabsolute	build_dirdeclare_componentr   r'   intboolr
   rC   __name__r%   r.   r!   <module>rS      sC    7 7  , ,N!!**,z9	.*..zIO
 #"$(&*'+M %MMM }M 
#	M
 M smM !M 5c?
#M T#s(^$M M M M`=@ zF r.   