-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
190 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Cascader | ||
|
||
Cascade selection box. See [Ant Design](https://ant.design/components/cascader/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> | ||
<demo name="panel" title="Panel"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Cascader | ||
|
||
Cascade selection box. See [Ant Design](https://ant.design/components/cascader/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> | ||
<demo name="panel" title="Panel"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from helper.Docs import Docs | ||
|
||
docs = Docs(__file__) | ||
|
||
if __name__ == "__main__": | ||
docs.render().queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import gradio as gr | ||
|
||
import modelscope_studio.components.antd as antd | ||
import modelscope_studio.components.base as ms | ||
|
||
with gr.Blocks() as demo: | ||
with ms.Application(): | ||
with antd.ConfigProvider(): | ||
antd.Cascader(elem_style=dict(width=300), | ||
options=[{ | ||
"value": | ||
'zhejiang', | ||
"label": | ||
'Zhejiang', | ||
"children": [{ | ||
"value": 'hangzhou', | ||
"label": 'Hangzhou' | ||
}], | ||
}, { | ||
"value": | ||
'jiangsu', | ||
"label": | ||
'Jiangsu', | ||
"children": [{ | ||
"value": 'nanjing', | ||
"label": 'Nanjing' | ||
}], | ||
}, { | ||
"value": 'shanghai', | ||
"label": 'Shanghai', | ||
"disabled": True | ||
}]) | ||
antd.Divider("Multiple") | ||
with antd.Cascader(elem_style=dict(width='100%'), | ||
multiple=True, | ||
max_tag_count="responsive"): | ||
antd.Cascader.Option(label="Light", value="light") | ||
with antd.Cascader.Option(label="Bamboo", value="bamboo"): | ||
with antd.Cascader.Option(label="Little", value="little"): | ||
antd.Cascader.Option(label="Toy Fish", | ||
value="fish", | ||
disabled=True) | ||
antd.Cascader.Option(label="Toy Bird", value="bird") | ||
with antd.Cascader.Option(value="cat"): | ||
with ms.Slot("label"): | ||
antd.Typography.Text("Toy Cat", type="success") | ||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import gradio as gr | ||
|
||
import modelscope_studio.components.antd as antd | ||
import modelscope_studio.components.base as ms | ||
|
||
with gr.Blocks() as demo: | ||
with ms.Application(): | ||
with antd.ConfigProvider(): | ||
antd.Cascader.Panel(options=[ | ||
{ | ||
"value": 'zhejiang', | ||
"label": 'Zhejiang', | ||
"children": [{ | ||
"value": 'hangzhou', | ||
"label": 'Hangzhou' | ||
}], | ||
}, { | ||
"value": 'jiangsu', | ||
"label": 'Jiangsu', | ||
"children": [{ | ||
"value": 'nanjing', | ||
"label": 'Nanjing' | ||
}], | ||
}, { | ||
"value": 'shanghai', | ||
"label": 'Shanghai', | ||
"disabled": True | ||
} | ||
]) | ||
|
||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Tour | ||
|
||
A popup component for guiding users through a product. See [Ant Design](https://ant.design/components/tour/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Tour | ||
|
||
A popup component for guiding users through a product. See [Ant Design](https://ant.design/components/tour/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from helper.Docs import Docs | ||
|
||
docs = Docs(__file__) | ||
|
||
if __name__ == "__main__": | ||
docs.render().queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import gradio as gr | ||
|
||
import modelscope_studio.components.antd as antd | ||
import modelscope_studio.components.base as ms | ||
|
||
with gr.Blocks() as demo: | ||
with ms.Application(): | ||
with antd.ConfigProvider(): | ||
btn = antd.Button("Begin Tour", | ||
type="primary", | ||
elem_id="tour-begin-btn") | ||
with antd.Tour(open=False) as tour: | ||
antd.Tour.Step( | ||
title="Center", | ||
description="Displayed in the center of screen.", | ||
get_target=None) | ||
antd.Tour.Step( | ||
title="Right", | ||
description="On the right of target.", | ||
get_target= | ||
"() => document.querySelector('#tour-begin-btn')", | ||
placement="right") | ||
with antd.Tour.Step( | ||
title="Top", | ||
get_target= | ||
"() => document.querySelector('#tour-begin-btn')", | ||
placement="top"): | ||
with ms.Slot("description"): | ||
antd.Typography.Text("On the top of target.", | ||
type="success") | ||
|
||
btn.click(lambda: gr.update(open=True), outputs=[tour]) | ||
gr.on([tour.close, tour.finish], | ||
lambda: gr.update(open=False), | ||
outputs=[tour]) | ||
|
||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters