streamlit-component-loader 0.7.8__tar.gz → 0.7.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamlit-component-loader
3
- Version: 0.7.8
3
+ Version: 0.7.10
4
4
  Summary: Components and Frameworks to give new features to streamlit
5
5
  Home-page: https://github.com/quiradev/streamlit-plugins
6
6
  Author: Victor Quilon Ranera
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamlit-component-loader
3
- Version: 0.7.8
3
+ Version: 0.7.10
4
4
  Summary: Components and Frameworks to give new features to streamlit
5
5
  Home-page: https://github.com/quiradev/streamlit-plugins
6
6
  Author: Victor Quilon Ranera
@@ -4446,10 +4446,11 @@ class DefaultLoader(BaseLoader):
4446
4446
  loader_container=None,
4447
4447
  label='', height=256,
4448
4448
  primary_color=None, background_color=None,
4449
- loader_lib: LoadersLib | Callable[..., Tuple[str, str ,str], ] = LoadersLib.book_loader, index=0, loader_lib_kwargs: dict = None
4449
+ loader_lib: LoadersLib | Callable[..., Tuple[str, str ,str], ] = LoadersLib.book_loader, index=0, loader_lib_kwargs: dict = None,
4450
+ sleep_animation_time: float = 0.1
4450
4451
  ):
4451
4452
  super().__init__(loader_container=loader_container)
4452
-
4453
+ self.sleep_animation_time = sleep_animation_time
4453
4454
  if primary_color is None:
4454
4455
  if st.get_option('theme.primaryColor') is None:
4455
4456
  primary_color = '#F63366'
@@ -4524,16 +4525,17 @@ class DefaultLoader(BaseLoader):
4524
4525
 
4525
4526
  with self.loader_container:
4526
4527
  self.display_element_out.empty()
4527
- time.sleep(0.2) # Pequeña pausa para evitar parpadeos
4528
+ if self.sleep_animation_time:
4529
+ time.sleep(self.sleep_animation_time) # Pequeña pausa para evitar parpadeos
4528
4530
  self.display_element.markdown(element_style+element_code, unsafe_allow_html=True)
4529
- time.sleep(5)
4530
4531
 
4531
4532
  def stop_loader(self):
4532
4533
  if self.running:
4533
4534
  with self.loader_container:
4534
4535
  self.display_element_out.markdown(self.element_out_style, unsafe_allow_html=True)
4535
4536
  # Para que se termine la animacion de salida y no se vea como parpadeos
4536
- time.sleep(0.3)
4537
+ if self.sleep_animation_time:
4538
+ time.sleep(self.sleep_animation_time)
4537
4539
  self.display_element.empty()
4538
4540
  self.display_element_out.empty()
4539
4541
  self.running = False