From bf358ab43206ad6b014c890cac90e518f24599e6 Mon Sep 17 00:00:00 2001 From: Javier Luraschi Date: Sun, 3 Mar 2024 14:21:54 -0800 Subject: [PATCH] add carrousel --- setup.py | 2 +- streamfy/__init__.py | 13 +++++++++++++ streamfy/frontend/src/Streamfy.vue | 27 ++++++++++++++++++++++++--- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index e229697..7ca9835 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setuptools.setup( name="streamfy", - version="0.1.7", + version="0.1.8", author="", author_email="", description="", diff --git a/streamfy/__init__.py b/streamfy/__init__.py index 618bf0f..3087c4c 100644 --- a/streamfy/__init__.py +++ b/streamfy/__init__.py @@ -37,6 +37,11 @@ def button(**kwargs): component_value = _component_func(component="button", **hyphened) return component_value +def carousel(**kwargs): + hyphened = hyphen_case_keys(kwargs) + component_value = _component_func(component="carousel", **hyphened) + return component_value + def taginput(**kwargs): hyphened = hyphen_case_keys(kwargs) component_value = _component_func(component="taginput", **hyphened) @@ -56,6 +61,14 @@ def table(**kwargs): if button(text = "Click!"): st.write("Clicked!") + st.subheader("Carousel") + selection = carousel(items=[ + "https://picsum.photos/id/1051/1230/500", + "https://picsum.photos/id/1052/1230/500", + "https://picsum.photos/id/1053/1230/500", + ]) + st.write(selection) + st.subheader("Tags") tags = taginput(data=["A", "B", "C"], allow_new=True, open_on_focus=True, type="is-info", aria_close_label="Remove", placeholder="Choose letter") st.write(tags) diff --git a/streamfy/frontend/src/Streamfy.vue b/streamfy/frontend/src/Streamfy.vue index 5c7ee4c..0ff4819 100644 --- a/streamfy/frontend/src/Streamfy.vue +++ b/streamfy/frontend/src/Streamfy.vue @@ -5,8 +5,7 @@ v-if="args.component == 'breadcrumb' && args.items != undefined" > {{item.text}} @@ -15,9 +14,30 @@ + @click="click(args)" + > {{ args.text}} + + + + + + + + Streamlit.setFrameHeight(), 1000); return { result: [], jdata: undefined,