solara 1.30.1__py2.py3-none-any.whl → 1.32.0__py2.py3-none-any.whl
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.
- {solara-1.30.1.dist-info → solara-1.32.0.dist-info}/METADATA +12 -42
- solara-1.32.0.dist-info/RECORD +5 -0
- {solara-1.30.1.dist-info → solara-1.32.0.dist-info}/WHEEL +1 -1
- {solara/template/portal → solara-1.32.0.dist-info/licenses}/LICENSE +1 -1
- solara/__init__.py +0 -123
- solara/__main__.py +0 -734
- solara/alias.py +0 -6
- solara/autorouting.py +0 -545
- solara/cache.py +0 -294
- solara/checks.html +0 -71
- solara/checks.py +0 -224
- solara/comm.py +0 -28
- solara/components/__init__.py +0 -59
- solara/components/alert.py +0 -155
- solara/components/applayout.py +0 -393
- solara/components/button.py +0 -85
- solara/components/card.py +0 -87
- solara/components/checkbox.py +0 -50
- solara/components/code_highlight_css.py +0 -11
- solara/components/code_highlight_css.vue +0 -63
- solara/components/columns.py +0 -159
- solara/components/component_vue.py +0 -110
- solara/components/cross_filter.py +0 -335
- solara/components/dataframe.py +0 -546
- solara/components/datatable.py +0 -221
- solara/components/datatable.vue +0 -175
- solara/components/details.py +0 -21
- solara/components/download.vue +0 -35
- solara/components/echarts.py +0 -75
- solara/components/echarts.vue +0 -128
- solara/components/figure_altair.py +0 -39
- solara/components/file_browser.py +0 -182
- solara/components/file_download.py +0 -199
- solara/components/file_drop.py +0 -139
- solara/components/file_drop.vue +0 -83
- solara/components/file_list_widget.vue +0 -78
- solara/components/head.py +0 -27
- solara/components/head_tag.py +0 -49
- solara/components/head_tag.vue +0 -60
- solara/components/image.py +0 -173
- solara/components/input.py +0 -440
- solara/components/link.py +0 -55
- solara/components/markdown.py +0 -371
- solara/components/markdown_editor.py +0 -25
- solara/components/markdown_editor.vue +0 -362
- solara/components/matplotlib.py +0 -74
- solara/components/meta.py +0 -47
- solara/components/misc.py +0 -333
- solara/components/pivot_table.py +0 -258
- solara/components/pivot_table.vue +0 -158
- solara/components/progress.py +0 -47
- solara/components/select.py +0 -186
- solara/components/select.vue +0 -27
- solara/components/slider.py +0 -442
- solara/components/slider_date.vue +0 -56
- solara/components/spinner-solara.vue +0 -105
- solara/components/spinner.py +0 -30
- solara/components/sql_code.py +0 -33
- solara/components/sql_code.vue +0 -128
- solara/components/style.py +0 -105
- solara/components/switch.py +0 -68
- solara/components/tab_navigation.py +0 -37
- solara/components/title.py +0 -90
- solara/components/title.vue +0 -38
- solara/components/togglebuttons.py +0 -202
- solara/components/tooltip.py +0 -61
- solara/datatypes.py +0 -143
- solara/express.py +0 -241
- solara/hooks/__init__.py +0 -4
- solara/hooks/dataframe.py +0 -99
- solara/hooks/misc.py +0 -263
- solara/hooks/use_reactive.py +0 -129
- solara/hooks/use_thread.py +0 -129
- solara/kitchensink.py +0 -8
- solara/lab/__init__.py +0 -34
- solara/lab/components/__init__.py +0 -6
- solara/lab/components/chat.py +0 -203
- solara/lab/components/confirmation_dialog.py +0 -165
- solara/lab/components/cross_filter.py +0 -7
- solara/lab/components/input_date.py +0 -298
- solara/lab/components/menu.py +0 -181
- solara/lab/components/menu.vue +0 -38
- solara/lab/components/tabs.py +0 -274
- solara/lab/components/theming.py +0 -98
- solara/lab/components/theming.vue +0 -72
- solara/lab/hooks/__init__.py +0 -0
- solara/lab/hooks/dataframe.py +0 -12
- solara/lab/toestand.py +0 -3
- solara/lab/utils/__init__.py +0 -2
- solara/lab/utils/cookies.py +0 -5
- solara/lab/utils/dataframe.py +0 -115
- solara/lab/utils/headers.py +0 -5
- solara/layout.py +0 -44
- solara/minisettings.py +0 -133
- solara/py.typed +0 -0
- solara/reactive.py +0 -93
- solara/routing.py +0 -268
- solara/scope/__init__.py +0 -88
- solara/scope/types.py +0 -55
- solara/server/__init__.py +0 -0
- solara/server/app.py +0 -490
- solara/server/assets/custom.css +0 -1
- solara/server/assets/custom.js +0 -1
- solara/server/assets/favicon.png +0 -0
- solara/server/assets/favicon.svg +0 -5
- solara/server/assets/style.css +0 -1665
- solara/server/assets/theme-dark.css +0 -437
- solara/server/assets/theme-light.css +0 -420
- solara/server/assets/theme.js +0 -3
- solara/server/cdn_helper.py +0 -77
- solara/server/esm.py +0 -69
- solara/server/fastapi.py +0 -5
- solara/server/flask.py +0 -286
- solara/server/jupyter/__init__.py +0 -2
- solara/server/jupyter/cdn_handler.py +0 -28
- solara/server/jupyter/server_extension.py +0 -29
- solara/server/jupytertools.py +0 -46
- solara/server/kernel.py +0 -319
- solara/server/kernel_context.py +0 -396
- solara/server/patch.py +0 -552
- solara/server/reload.py +0 -242
- solara/server/server.py +0 -437
- solara/server/settings.py +0 -212
- solara/server/shell.py +0 -240
- solara/server/starlette.py +0 -597
- solara/server/static/ansi.js +0 -270
- solara/server/static/highlight-dark.css +0 -82
- solara/server/static/highlight.css +0 -43
- solara/server/static/main-vuetify.js +0 -260
- solara/server/static/main.js +0 -163
- solara/server/static/solara_bootstrap.py +0 -129
- solara/server/static/sun.svg +0 -23
- solara/server/static/webworker.js +0 -42
- solara/server/telemetry.py +0 -212
- solara/server/templates/index.html.j2 +0 -1
- solara/server/templates/loader-plain.css +0 -11
- solara/server/templates/loader-plain.html +0 -20
- solara/server/templates/loader-solara.css +0 -111
- solara/server/templates/loader-solara.html +0 -40
- solara/server/templates/plain.html +0 -82
- solara/server/templates/solara.html.j2 +0 -446
- solara/server/threaded.py +0 -75
- solara/server/utils.py +0 -30
- solara/server/websocket.py +0 -44
- solara/settings.py +0 -56
- solara/tasks.py +0 -847
- solara/template/button.py +0 -16
- solara/template/markdown.py +0 -42
- solara/template/portal/.flake8 +0 -6
- solara/template/portal/.pre-commit-config.yaml +0 -28
- solara/template/portal/Procfile +0 -7
- solara/template/portal/mypy.ini +0 -3
- solara/template/portal/pyproject.toml +0 -26
- solara/template/portal/solara_portal/__init__.py +0 -3
- solara/template/portal/solara_portal/components/__init__.py +0 -2
- solara/template/portal/solara_portal/components/article.py +0 -28
- solara/template/portal/solara_portal/components/data.py +0 -28
- solara/template/portal/solara_portal/components/header.py +0 -6
- solara/template/portal/solara_portal/components/layout.py +0 -6
- solara/template/portal/solara_portal/content/articles/equis-in-vidi.md +0 -85
- solara/template/portal/solara_portal/content/articles/substiterat-vati.md +0 -70
- solara/template/portal/solara_portal/data.py +0 -60
- solara/template/portal/solara_portal/pages/__init__.py +0 -67
- solara/template/portal/solara_portal/pages/article/__init__.py +0 -26
- solara/template/portal/solara_portal/pages/tabular.py +0 -29
- solara/template/portal/solara_portal/pages/viz/__init__.py +0 -69
- solara/template/portal/solara_portal/pages/viz/overview.py +0 -14
- solara/test/__init__.py +0 -0
- solara/test/pytest_plugin.py +0 -698
- solara/toestand.py +0 -772
- solara/util.py +0 -308
- solara/website/__init__.py +0 -0
- solara/website/assets/custom.css +0 -462
- solara/website/assets/images/logo-small.png +0 -0
- solara/website/assets/images/logo.svg +0 -17
- solara/website/assets/images/logo_white.svg +0 -50
- solara/website/assets/theme.js +0 -8
- solara/website/components/__init__.py +0 -5
- solara/website/components/algolia.vue +0 -24
- solara/website/components/algolia_api.vue +0 -157
- solara/website/components/docs.py +0 -118
- solara/website/components/header.py +0 -72
- solara/website/components/hero.py +0 -15
- solara/website/components/mailchimp.py +0 -12
- solara/website/components/mailchimp.vue +0 -47
- solara/website/components/markdown.py +0 -30
- solara/website/components/notebook.py +0 -172
- solara/website/pages/__init__.py +0 -575
- solara/website/pages/apps/__init__.py +0 -16
- solara/website/pages/apps/authorization/__init__.py +0 -118
- solara/website/pages/apps/authorization/admin.py +0 -12
- solara/website/pages/apps/authorization/users.py +0 -12
- solara/website/pages/apps/jupyter-dashboard-1.py +0 -116
- solara/website/pages/apps/layout-demo.py +0 -40
- solara/website/pages/apps/multipage/__init__.py +0 -38
- solara/website/pages/apps/multipage/page1.py +0 -26
- solara/website/pages/apps/multipage/page2.py +0 -34
- solara/website/pages/apps/scatter.py +0 -136
- solara/website/pages/apps/scrolling.py +0 -63
- solara/website/pages/apps/tutorial-streamlit.py +0 -18
- solara/website/pages/changelog/__init__.py +0 -8
- solara/website/pages/changelog/changelog.md +0 -195
- solara/website/pages/contact/__init__.py +0 -8
- solara/website/pages/contact/contact.md +0 -17
- solara/website/pages/doc_use_download.py +0 -85
- solara/website/pages/documentation/__init__.py +0 -184
- solara/website/pages/documentation/advanced/__init__.py +0 -9
- solara/website/pages/documentation/advanced/content/00-overview.md +0 -1
- solara/website/pages/documentation/advanced/content/10-howto/00-overview.md +0 -6
- solara/website/pages/documentation/advanced/content/10-howto/10-multipage.md +0 -196
- solara/website/pages/documentation/advanced/content/10-howto/20-layout.md +0 -125
- solara/website/pages/documentation/advanced/content/10-howto/30-testing.md +0 -154
- solara/website/pages/documentation/advanced/content/10-howto/31-debugging.md +0 -69
- solara/website/pages/documentation/advanced/content/10-howto/40-embed.md +0 -49
- solara/website/pages/documentation/advanced/content/10-howto/50-ipywidget_libraries.md +0 -124
- solara/website/pages/documentation/advanced/content/20-understanding/00-introduction.md +0 -10
- solara/website/pages/documentation/advanced/content/20-understanding/05-ipywidgets.md +0 -35
- solara/website/pages/documentation/advanced/content/20-understanding/06-ipyvuetify.md +0 -42
- solara/website/pages/documentation/advanced/content/20-understanding/10-reacton.md +0 -28
- solara/website/pages/documentation/advanced/content/20-understanding/12-reacton-basics.md +0 -108
- solara/website/pages/documentation/advanced/content/20-understanding/15-anatomy.md +0 -23
- solara/website/pages/documentation/advanced/content/20-understanding/17-rules-of-hooks.md +0 -7
- solara/website/pages/documentation/advanced/content/20-understanding/18-containers.md +0 -166
- solara/website/pages/documentation/advanced/content/20-understanding/20-solara.md +0 -18
- solara/website/pages/documentation/advanced/content/20-understanding/40-routing.md +0 -240
- solara/website/pages/documentation/advanced/content/20-understanding/50-solara-server.md +0 -86
- solara/website/pages/documentation/advanced/content/20-understanding/60-voila.md +0 -12
- solara/website/pages/documentation/advanced/content/30-enterprise/00-overview.md +0 -1
- solara/website/pages/documentation/advanced/content/30-enterprise/10-oauth.md +0 -171
- solara/website/pages/documentation/advanced/content/40-development/00-overview.md +0 -0
- solara/website/pages/documentation/advanced/content/40-development/01-contribute.md +0 -45
- solara/website/pages/documentation/advanced/content/40-development/10-setup.md +0 -76
- solara/website/pages/documentation/api/__init__.py +0 -19
- solara/website/pages/documentation/api/cross_filter/__init__.py +0 -9
- solara/website/pages/documentation/api/cross_filter/cross_filter_dataframe.py +0 -23
- solara/website/pages/documentation/api/cross_filter/cross_filter_report.py +0 -22
- solara/website/pages/documentation/api/cross_filter/cross_filter_select.py +0 -22
- solara/website/pages/documentation/api/cross_filter/cross_filter_slider.py +0 -22
- solara/website/pages/documentation/api/hooks/__init__.py +0 -9
- solara/website/pages/documentation/api/hooks/use_cross_filter.py +0 -25
- solara/website/pages/documentation/api/hooks/use_dark_effective.py +0 -13
- solara/website/pages/documentation/api/hooks/use_effect.md +0 -43
- solara/website/pages/documentation/api/hooks/use_effect.py +0 -9
- solara/website/pages/documentation/api/hooks/use_exception.py +0 -33
- solara/website/pages/documentation/api/hooks/use_memo.md +0 -16
- solara/website/pages/documentation/api/hooks/use_memo.py +0 -9
- solara/website/pages/documentation/api/hooks/use_previous.py +0 -32
- solara/website/pages/documentation/api/hooks/use_reactive.py +0 -15
- solara/website/pages/documentation/api/hooks/use_state.py +0 -11
- solara/website/pages/documentation/api/hooks/use_state_or_update.py +0 -68
- solara/website/pages/documentation/api/hooks/use_thread.md +0 -58
- solara/website/pages/documentation/api/hooks/use_thread.py +0 -44
- solara/website/pages/documentation/api/hooks/use_trait_observe.py +0 -13
- solara/website/pages/documentation/api/routing/__init__.py +0 -9
- solara/website/pages/documentation/api/routing/generate_routes.py +0 -11
- solara/website/pages/documentation/api/routing/generate_routes_directory.py +0 -11
- solara/website/pages/documentation/api/routing/resolve_path.py +0 -36
- solara/website/pages/documentation/api/routing/route.py +0 -32
- solara/website/pages/documentation/api/routing/use_route.py +0 -80
- solara/website/pages/documentation/api/routing/use_router.py +0 -15
- solara/website/pages/documentation/api/utilities/__init__.py +0 -9
- solara/website/pages/documentation/api/utilities/component_vue.py +0 -11
- solara/website/pages/documentation/api/utilities/computed.py +0 -16
- solara/website/pages/documentation/api/utilities/display.py +0 -15
- solara/website/pages/documentation/api/utilities/get_kernel_id.py +0 -16
- solara/website/pages/documentation/api/utilities/get_session_id.py +0 -16
- solara/website/pages/documentation/api/utilities/memoize.py +0 -36
- solara/website/pages/documentation/api/utilities/on_kernel_start.py +0 -27
- solara/website/pages/documentation/api/utilities/reactive.py +0 -15
- solara/website/pages/documentation/api/utilities/widget.py +0 -104
- solara/website/pages/documentation/components/__init__.py +0 -12
- solara/website/pages/documentation/components/advanced/__init__.py +0 -9
- solara/website/pages/documentation/components/advanced/link.py +0 -28
- solara/website/pages/documentation/components/advanced/meta.py +0 -21
- solara/website/pages/documentation/components/advanced/style.py +0 -44
- solara/website/pages/documentation/components/common.py +0 -9
- solara/website/pages/documentation/components/data/__init__.py +0 -9
- solara/website/pages/documentation/components/data/dataframe.py +0 -44
- solara/website/pages/documentation/components/data/pivot_table.py +0 -81
- solara/website/pages/documentation/components/enterprise/__init__.py +0 -9
- solara/website/pages/documentation/components/enterprise/avatar.py +0 -19
- solara/website/pages/documentation/components/enterprise/avatar_menu.py +0 -20
- solara/website/pages/documentation/components/input/__init__.py +0 -9
- solara/website/pages/documentation/components/input/button.py +0 -22
- solara/website/pages/documentation/components/input/checkbox.py +0 -12
- solara/website/pages/documentation/components/input/file_browser.py +0 -33
- solara/website/pages/documentation/components/input/file_drop.py +0 -75
- solara/website/pages/documentation/components/input/input.py +0 -18
- solara/website/pages/documentation/components/input/select.py +0 -21
- solara/website/pages/documentation/components/input/slider.py +0 -28
- solara/website/pages/documentation/components/input/switch.py +0 -12
- solara/website/pages/documentation/components/input/togglebuttons.py +0 -20
- solara/website/pages/documentation/components/lab/__init__.py +0 -9
- solara/website/pages/documentation/components/lab/chat.py +0 -108
- solara/website/pages/documentation/components/lab/confirmation_dialog.py +0 -55
- solara/website/pages/documentation/components/lab/cookies_headers.py +0 -48
- solara/website/pages/documentation/components/lab/input_date.py +0 -19
- solara/website/pages/documentation/components/lab/menu.py +0 -21
- solara/website/pages/documentation/components/lab/tab.py +0 -24
- solara/website/pages/documentation/components/lab/tabs.py +0 -44
- solara/website/pages/documentation/components/lab/task.py +0 -12
- solara/website/pages/documentation/components/lab/theming.py +0 -72
- solara/website/pages/documentation/components/lab/use_task.py +0 -12
- solara/website/pages/documentation/components/layout/__init__.py +0 -9
- solara/website/pages/documentation/components/layout/app_bar.py +0 -15
- solara/website/pages/documentation/components/layout/app_bar_title.py +0 -15
- solara/website/pages/documentation/components/layout/app_layout.py +0 -23
- solara/website/pages/documentation/components/layout/card.py +0 -14
- solara/website/pages/documentation/components/layout/card_actions.py +0 -15
- solara/website/pages/documentation/components/layout/column.py +0 -29
- solara/website/pages/documentation/components/layout/columns.py +0 -26
- solara/website/pages/documentation/components/layout/columns_responsive.py +0 -67
- solara/website/pages/documentation/components/layout/griddraggable.py +0 -61
- solara/website/pages/documentation/components/layout/gridfixed.py +0 -21
- solara/website/pages/documentation/components/layout/hbox.py +0 -17
- solara/website/pages/documentation/components/layout/row.py +0 -29
- solara/website/pages/documentation/components/layout/sidebar.py +0 -23
- solara/website/pages/documentation/components/layout/vbox.py +0 -19
- solara/website/pages/documentation/components/output/__init__.py +0 -9
- solara/website/pages/documentation/components/output/file_download.py +0 -12
- solara/website/pages/documentation/components/output/html.py +0 -22
- solara/website/pages/documentation/components/output/image.py +0 -12
- solara/website/pages/documentation/components/output/markdown.py +0 -59
- solara/website/pages/documentation/components/output/markdown_editor.py +0 -53
- solara/website/pages/documentation/components/output/sql_code.py +0 -84
- solara/website/pages/documentation/components/output/tooltip.py +0 -12
- solara/website/pages/documentation/components/page/__init__.py +0 -9
- solara/website/pages/documentation/components/page/head.py +0 -19
- solara/website/pages/documentation/components/page/title.py +0 -28
- solara/website/pages/documentation/components/status/__init__.py +0 -9
- solara/website/pages/documentation/components/status/error.py +0 -40
- solara/website/pages/documentation/components/status/info.py +0 -40
- solara/website/pages/documentation/components/status/progress.py +0 -10
- solara/website/pages/documentation/components/status/spinner.py +0 -10
- solara/website/pages/documentation/components/status/success.py +0 -40
- solara/website/pages/documentation/components/status/warning.py +0 -47
- solara/website/pages/documentation/components/viz/__init__.py +0 -9
- solara/website/pages/documentation/components/viz/altair.py +0 -44
- solara/website/pages/documentation/components/viz/echarts.py +0 -78
- solara/website/pages/documentation/components/viz/matplotlib.py +0 -32
- solara/website/pages/documentation/components/viz/plotly.py +0 -63
- solara/website/pages/documentation/components/viz/plotly_express.py +0 -41
- solara/website/pages/documentation/examples/__init__.py +0 -52
- solara/website/pages/documentation/examples/ai/__init__.py +0 -10
- solara/website/pages/documentation/examples/ai/chatbot.py +0 -96
- solara/website/pages/documentation/examples/ai/tokenizer.py +0 -106
- solara/website/pages/documentation/examples/basics/__init__.py +0 -2
- solara/website/pages/documentation/examples/basics/sine.py +0 -28
- solara/website/pages/documentation/examples/fullscreen/__init__.py +0 -9
- solara/website/pages/documentation/examples/fullscreen/authorization.py +0 -3
- solara/website/pages/documentation/examples/fullscreen/layout_demo.py +0 -3
- solara/website/pages/documentation/examples/fullscreen/multipage.py +0 -3
- solara/website/pages/documentation/examples/fullscreen/scatter.py +0 -3
- solara/website/pages/documentation/examples/fullscreen/scrolling.py +0 -3
- solara/website/pages/documentation/examples/fullscreen/tutorial_streamlit.py +0 -3
- solara/website/pages/documentation/examples/general/__init__.py +0 -9
- solara/website/pages/documentation/examples/general/custom_storage.py +0 -69
- solara/website/pages/documentation/examples/general/deploy_model.py +0 -114
- solara/website/pages/documentation/examples/general/live_update.py +0 -38
- solara/website/pages/documentation/examples/general/login_oauth.py +0 -76
- solara/website/pages/documentation/examples/general/mycard.vue +0 -58
- solara/website/pages/documentation/examples/general/pokemon_search.py +0 -51
- solara/website/pages/documentation/examples/general/vue_component.py +0 -50
- solara/website/pages/documentation/examples/ipycanvas.py +0 -49
- solara/website/pages/documentation/examples/libraries/__init__.py +0 -9
- solara/website/pages/documentation/examples/libraries/altair.py +0 -63
- solara/website/pages/documentation/examples/libraries/bqplot.py +0 -39
- solara/website/pages/documentation/examples/libraries/ipyleaflet.py +0 -32
- solara/website/pages/documentation/examples/libraries/ipyleaflet_advanced.py +0 -65
- solara/website/pages/documentation/examples/utilities/__init__.py +0 -9
- solara/website/pages/documentation/examples/utilities/calculator.py +0 -157
- solara/website/pages/documentation/examples/utilities/countdown_timer.py +0 -64
- solara/website/pages/documentation/examples/utilities/todo.py +0 -195
- solara/website/pages/documentation/examples/visualization/__init__.py +0 -6
- solara/website/pages/documentation/examples/visualization/annotator.py +0 -68
- solara/website/pages/documentation/examples/visualization/linked_views.py +0 -84
- solara/website/pages/documentation/examples/visualization/plotly.py +0 -43
- solara/website/pages/documentation/faq/__init__.py +0 -12
- solara/website/pages/documentation/faq/content/99-faq.md +0 -76
- solara/website/pages/documentation/getting_started/__init__.py +0 -9
- solara/website/pages/documentation/getting_started/content/00-quickstart.md +0 -89
- solara/website/pages/documentation/getting_started/content/01-introduction.md +0 -125
- solara/website/pages/documentation/getting_started/content/02-installing.md +0 -85
- solara/website/pages/documentation/getting_started/content/04-tutorials/00-overview.md +0 -14
- solara/website/pages/documentation/getting_started/content/04-tutorials/10_data_science.py +0 -13
- solara/website/pages/documentation/getting_started/content/04-tutorials/20-web-app.md +0 -89
- solara/website/pages/documentation/getting_started/content/04-tutorials/30-ipywidgets.md +0 -124
- solara/website/pages/documentation/getting_started/content/04-tutorials/40-streamlit.md +0 -146
- solara/website/pages/documentation/getting_started/content/04-tutorials/50-dash.md +0 -144
- solara/website/pages/documentation/getting_started/content/04-tutorials/60-jupyter-dashboard-part1.py +0 -64
- solara/website/pages/documentation/getting_started/content/04-tutorials/SF_crime_sample.csv.gz +0 -0
- solara/website/pages/documentation/getting_started/content/04-tutorials/_data_science.ipynb +0 -445
- solara/website/pages/documentation/getting_started/content/04-tutorials/_jupyter_dashboard_1.ipynb +0 -1000
- solara/website/pages/documentation/getting_started/content/05-fundamentals/00-overview.md +0 -11
- solara/website/pages/documentation/getting_started/content/05-fundamentals/10-components.md +0 -223
- solara/website/pages/documentation/getting_started/content/05-fundamentals/50-state-management.md +0 -88
- solara/website/pages/documentation/getting_started/content/06-reference/00-overview.md +0 -3
- solara/website/pages/documentation/getting_started/content/06-reference/40-static_files.md +0 -31
- solara/website/pages/documentation/getting_started/content/06-reference/41-asset-files.md +0 -36
- solara/website/pages/documentation/getting_started/content/06-reference/60-static-site-generation.md +0 -59
- solara/website/pages/documentation/getting_started/content/06-reference/70-search.md +0 -34
- solara/website/pages/documentation/getting_started/content/06-reference/80-reloading.md +0 -34
- solara/website/pages/documentation/getting_started/content/06-reference/90-notebook-support.md +0 -7
- solara/website/pages/documentation/getting_started/content/06-reference/95-caching.md +0 -148
- solara/website/pages/documentation/getting_started/content/07-deploying/00-overview.md +0 -7
- solara/website/pages/documentation/getting_started/content/07-deploying/10-self-hosted.md +0 -273
- solara/website/pages/documentation/getting_started/content/07-deploying/20-cloud-hosted.md +0 -80
- solara/website/pages/documentation/getting_started/content/80-what-is-lab.md +0 -7
- solara/website/pages/documentation/getting_started/content/90-troubleshoot.md +0 -26
- solara/website/pages/docutils.py +0 -38
- solara/website/pages/showcase/__init__.py +0 -105
- solara/website/pages/showcase/domino_code_assist.py +0 -60
- solara/website/pages/showcase/planeto_tessa.py +0 -19
- solara/website/pages/showcase/solara_dev.py +0 -54
- solara/website/pages/showcase/solarathon_2023_team_2.py +0 -22
- solara/website/pages/showcase/solarathon_2023_team_4.py +0 -22
- solara/website/pages/showcase/solarathon_2023_team_5.py +0 -23
- solara/website/pages/showcase/solarathon_2023_team_6.py +0 -34
- solara/website/pages/showcase/wanderlust.py +0 -27
- solara/website/public/beach.jpeg +0 -0
- solara/website/public/logo.svg +0 -6
- solara/website/public/social/discord.svg +0 -1
- solara/website/public/social/github.svg +0 -1
- solara/website/public/social/twitter.svg +0 -3
- solara/website/public/success.html +0 -25
- solara/website/templates/index.html.j2 +0 -117
- solara/website/utils.py +0 -51
- solara/widgets/__init__.py +0 -1
- solara/widgets/vue/gridlayout.vue +0 -110
- solara/widgets/vue/html.vue +0 -4
- solara/widgets/vue/navigator.vue +0 -104
- solara/widgets/vue/vegalite.vue +0 -115
- solara/widgets/widgets.py +0 -65
- solara-1.30.1.data/data/etc/jupyter/jupyter_notebook_config.d/solara.json +0 -7
- solara-1.30.1.data/data/etc/jupyter/jupyter_server_config.d/solara.json +0 -7
- solara-1.30.1.dist-info/RECORD +0 -437
- solara-1.30.1.dist-info/entry_points.txt +0 -5
- /solara-1.30.1.dist-info/licenses/LICENSE → /LICENSE +0 -0
solara/components/input.py
DELETED
|
@@ -1,440 +0,0 @@
|
|
|
1
|
-
from typing import Any, Callable, Optional, TypeVar, Union, cast, overload, List, Dict
|
|
2
|
-
|
|
3
|
-
import ipyvue
|
|
4
|
-
import ipyvuetify as vw
|
|
5
|
-
import reacton
|
|
6
|
-
from typing_extensions import Literal
|
|
7
|
-
|
|
8
|
-
import solara
|
|
9
|
-
from solara.alias import rv as v
|
|
10
|
-
|
|
11
|
-
T = TypeVar("T")
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def use_change(el: reacton.core.Element, on_value: Callable[[Any], Any], enabled=True, update_events=["blur", "keyup.enter"]):
|
|
15
|
-
"""Trigger a callback when a blur events occurs or the enter key is pressed."""
|
|
16
|
-
on_value_ref = solara.use_ref(on_value)
|
|
17
|
-
on_value_ref.current = on_value
|
|
18
|
-
|
|
19
|
-
def add_events():
|
|
20
|
-
def on_change(widget, event, data):
|
|
21
|
-
if enabled:
|
|
22
|
-
on_value_ref.current(widget.v_model)
|
|
23
|
-
|
|
24
|
-
widget = cast(ipyvue.VueWidget, solara.get_widget(el))
|
|
25
|
-
if enabled:
|
|
26
|
-
for event in update_events:
|
|
27
|
-
widget.on_event(event, on_change)
|
|
28
|
-
|
|
29
|
-
def cleanup():
|
|
30
|
-
if enabled:
|
|
31
|
-
for event in update_events:
|
|
32
|
-
widget.on_event(event, on_change, remove=True)
|
|
33
|
-
|
|
34
|
-
return cleanup
|
|
35
|
-
|
|
36
|
-
solara.use_effect(add_events, [enabled])
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
@solara.component
|
|
40
|
-
def InputText(
|
|
41
|
-
label: str,
|
|
42
|
-
value: Union[str, solara.Reactive[str]] = "",
|
|
43
|
-
on_value: Callable[[str], None] = None,
|
|
44
|
-
disabled: bool = False,
|
|
45
|
-
password: bool = False,
|
|
46
|
-
continuous_update: bool = False,
|
|
47
|
-
update_events: List[str] = ["blur", "keyup.enter"],
|
|
48
|
-
error: Union[bool, str] = False,
|
|
49
|
-
message: Optional[str] = None,
|
|
50
|
-
classes: List[str] = [],
|
|
51
|
-
style: Optional[Union[str, Dict[str, str]]] = None,
|
|
52
|
-
):
|
|
53
|
-
"""Free form text input.
|
|
54
|
-
|
|
55
|
-
### Basic example:
|
|
56
|
-
|
|
57
|
-
```solara
|
|
58
|
-
import solara
|
|
59
|
-
|
|
60
|
-
text = solara.reactive("Hello world!")
|
|
61
|
-
continuous_update = solara.reactive(True)
|
|
62
|
-
|
|
63
|
-
@solara.component
|
|
64
|
-
def Page():
|
|
65
|
-
solara.Checkbox(label="Continuous update", value=continuous_update)
|
|
66
|
-
solara.InputText("Enter some text", value=text, continuous_update=continuous_update.value)
|
|
67
|
-
with solara.Row():
|
|
68
|
-
solara.Button("Clear", on_click=lambda: text.set(""))
|
|
69
|
-
solara.Button("Reset", on_click=lambda: text.set("Hello world"))
|
|
70
|
-
solara.Markdown(f"**You entered**: {text.value}")
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Password input:
|
|
74
|
-
|
|
75
|
-
This will not show the entered text.
|
|
76
|
-
|
|
77
|
-
```solara
|
|
78
|
-
import solara
|
|
79
|
-
|
|
80
|
-
password = solara.reactive("Super secret")
|
|
81
|
-
continuous_update = solara.reactive(True)
|
|
82
|
-
|
|
83
|
-
@solara.component
|
|
84
|
-
def Page():
|
|
85
|
-
solara.Checkbox(label="Continuous update", value=continuous_update)
|
|
86
|
-
solara.InputText("Enter a passsword", value=password, continuous_update=continuous_update.value, password=True)
|
|
87
|
-
with solara.Row():
|
|
88
|
-
solara.Button("Clear", on_click=lambda: password.set(""))
|
|
89
|
-
solara.Button("Reset", on_click=lambda: password.set("Super secret"))
|
|
90
|
-
solara.Markdown(f"**You entered**: {password.value}")
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
## Arguments
|
|
95
|
-
|
|
96
|
-
* `label`: Label to display next to the slider.
|
|
97
|
-
* `value`: The currently entered value.
|
|
98
|
-
* `on_value`: Callback to call when the value changes.
|
|
99
|
-
* `disabled`: Whether the input is disabled.
|
|
100
|
-
* `password`: Whether the input is a password input (typically shows input text obscured with an asterisk).
|
|
101
|
-
* `continuous_update`: Whether to call the `on_value` callback on every change or only when the input loses focus or the enter key is pressed.
|
|
102
|
-
* `update_events`: A list of events that should trigger `on_value`. If continuous update is enabled, this will effectively be ignored,
|
|
103
|
-
since updates will happen every change.
|
|
104
|
-
* `error`: If truthy, show the input as having an error (in red). If a string is passed, it will be shown as the error message.
|
|
105
|
-
* `message`: Message to show below the input. If `error` is a string, this will be ignored.
|
|
106
|
-
* `classes`: List of CSS classes to apply to the input.
|
|
107
|
-
* `style`: CSS style to apply to the input.
|
|
108
|
-
"""
|
|
109
|
-
reactive_value = solara.use_reactive(value, on_value)
|
|
110
|
-
del value, on_value
|
|
111
|
-
style_flat = solara.util._flatten_style(style)
|
|
112
|
-
classes_flat = solara.util._combine_classes(classes)
|
|
113
|
-
|
|
114
|
-
def set_value_cast(value):
|
|
115
|
-
reactive_value.value = str(value)
|
|
116
|
-
|
|
117
|
-
def on_v_model(value):
|
|
118
|
-
if continuous_update:
|
|
119
|
-
set_value_cast(value)
|
|
120
|
-
|
|
121
|
-
messages = []
|
|
122
|
-
if error and isinstance(error, str):
|
|
123
|
-
messages.append(error)
|
|
124
|
-
elif message:
|
|
125
|
-
messages.append(message)
|
|
126
|
-
text_field = v.TextField(
|
|
127
|
-
v_model=reactive_value.value,
|
|
128
|
-
on_v_model=on_v_model,
|
|
129
|
-
label=label,
|
|
130
|
-
disabled=disabled,
|
|
131
|
-
type="password" if password else None,
|
|
132
|
-
error=bool(error),
|
|
133
|
-
messages=messages,
|
|
134
|
-
class_=classes_flat,
|
|
135
|
-
style_=style_flat,
|
|
136
|
-
)
|
|
137
|
-
use_change(text_field, set_value_cast, enabled=not continuous_update, update_events=update_events)
|
|
138
|
-
return text_field
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
@overload
|
|
142
|
-
@solara.component
|
|
143
|
-
def InputFloat(
|
|
144
|
-
label: str,
|
|
145
|
-
value: Union[float, solara.Reactive[float]] = 0,
|
|
146
|
-
on_value: Optional[Callable[[float], None]] = ...,
|
|
147
|
-
disabled: bool = ...,
|
|
148
|
-
optional: Literal[False] = ...,
|
|
149
|
-
continuous_update: bool = ...,
|
|
150
|
-
clearable: bool = ...,
|
|
151
|
-
classes: List[str] = ...,
|
|
152
|
-
style: Optional[Union[str, Dict[str, str]]] = ...,
|
|
153
|
-
) -> reacton.core.ValueElement[vw.TextField, Any]:
|
|
154
|
-
...
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
@overload
|
|
158
|
-
@solara.component
|
|
159
|
-
def InputFloat(
|
|
160
|
-
label: str,
|
|
161
|
-
value: Union[Optional[float], solara.Reactive[Optional[float]]] = 0,
|
|
162
|
-
on_value: Optional[Callable[[Optional[float]], None]] = ...,
|
|
163
|
-
disabled: bool = ...,
|
|
164
|
-
optional: Literal[True] = ...,
|
|
165
|
-
continuous_update: bool = ...,
|
|
166
|
-
clearable: bool = ...,
|
|
167
|
-
classes: List[str] = ...,
|
|
168
|
-
style: Optional[Union[str, Dict[str, str]]] = ...,
|
|
169
|
-
) -> reacton.core.ValueElement[vw.TextField, Any]:
|
|
170
|
-
...
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
@solara.component
|
|
174
|
-
def InputFloat(
|
|
175
|
-
label: str,
|
|
176
|
-
value: Union[None, float, solara.Reactive[float], solara.Reactive[Optional[float]]] = 0,
|
|
177
|
-
on_value: Union[None, Callable[[Optional[float]], None], Callable[[float], None]] = None,
|
|
178
|
-
disabled: bool = False,
|
|
179
|
-
optional: bool = False,
|
|
180
|
-
continuous_update: bool = False,
|
|
181
|
-
clearable: bool = False,
|
|
182
|
-
classes: List[str] = [],
|
|
183
|
-
style: Optional[Union[str, Dict[str, str]]] = None,
|
|
184
|
-
):
|
|
185
|
-
"""Numeric input (floats).
|
|
186
|
-
|
|
187
|
-
Basic example:
|
|
188
|
-
|
|
189
|
-
```solara
|
|
190
|
-
import solara
|
|
191
|
-
|
|
192
|
-
float_value = solara.reactive(42.0)
|
|
193
|
-
continuous_update = solara.reactive(True)
|
|
194
|
-
|
|
195
|
-
@solara.component
|
|
196
|
-
def Page():
|
|
197
|
-
solara.Checkbox(label="Continuous update", value=continuous_update)
|
|
198
|
-
solara.InputFloat("Enter a float number", value=float_value, continuous_update=continuous_update.value)
|
|
199
|
-
with solara.Row():
|
|
200
|
-
solara.Button("Clear", on_click=lambda: float_value.set(42.0))
|
|
201
|
-
solara.Markdown(f"**You entered**: {float_value.value}")
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
## Arguments
|
|
206
|
-
|
|
207
|
-
* `label`: Label to display next to the slider.
|
|
208
|
-
* `value`: The currently entered value.
|
|
209
|
-
* `on_value`: Callback to call when the value changes.
|
|
210
|
-
* `disabled`: Whether the input is disabled.
|
|
211
|
-
* `optional`: Whether the value can be None.
|
|
212
|
-
* `continuous_update`: Whether to call the `on_value` callback on every change or only when the input loses focus or the enter key is pressed.
|
|
213
|
-
* `clearable`: Whether the input can be cleared.
|
|
214
|
-
* `classes`: List of CSS classes to apply to the input.
|
|
215
|
-
* `style`: CSS style to apply to the input.
|
|
216
|
-
|
|
217
|
-
"""
|
|
218
|
-
|
|
219
|
-
def str_to_float(value: Optional[str]):
|
|
220
|
-
if value:
|
|
221
|
-
try:
|
|
222
|
-
value = value.replace(",", ".")
|
|
223
|
-
return float(value)
|
|
224
|
-
except ValueError:
|
|
225
|
-
raise ValueError("Value must be a number")
|
|
226
|
-
else:
|
|
227
|
-
if optional:
|
|
228
|
-
return None
|
|
229
|
-
else:
|
|
230
|
-
raise ValueError("Value cannot be empty")
|
|
231
|
-
|
|
232
|
-
return _InputNumeric(
|
|
233
|
-
str_to_float,
|
|
234
|
-
label=label,
|
|
235
|
-
value=value,
|
|
236
|
-
on_value=on_value,
|
|
237
|
-
disabled=disabled,
|
|
238
|
-
continuous_update=continuous_update,
|
|
239
|
-
clearable=clearable,
|
|
240
|
-
classes=classes,
|
|
241
|
-
style=style,
|
|
242
|
-
)
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
@overload
|
|
246
|
-
@solara.component
|
|
247
|
-
def InputInt(
|
|
248
|
-
label: str,
|
|
249
|
-
value: Union[int, solara.Reactive[int]] = 0,
|
|
250
|
-
on_value: Optional[Callable[[int], None]] = ...,
|
|
251
|
-
disabled: bool = ...,
|
|
252
|
-
optional: Literal[False] = ...,
|
|
253
|
-
continuous_update: bool = ...,
|
|
254
|
-
clearable: bool = ...,
|
|
255
|
-
classes: List[str] = ...,
|
|
256
|
-
style: Optional[Union[str, Dict[str, str]]] = ...,
|
|
257
|
-
) -> reacton.core.ValueElement[vw.TextField, Any]:
|
|
258
|
-
...
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
@overload
|
|
262
|
-
@solara.component
|
|
263
|
-
def InputInt(
|
|
264
|
-
label: str,
|
|
265
|
-
value: Union[Optional[int], solara.Reactive[Optional[int]]] = 0,
|
|
266
|
-
on_value: Optional[Callable[[Optional[int]], None]] = ...,
|
|
267
|
-
disabled: bool = ...,
|
|
268
|
-
optional: Literal[True] = ...,
|
|
269
|
-
continuous_update: bool = ...,
|
|
270
|
-
clearable: bool = ...,
|
|
271
|
-
classes: List[str] = ...,
|
|
272
|
-
style: Optional[Union[str, Dict[str, str]]] = ...,
|
|
273
|
-
) -> reacton.core.ValueElement[vw.TextField, Any]:
|
|
274
|
-
...
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
@solara.component
|
|
278
|
-
def InputInt(
|
|
279
|
-
label: str,
|
|
280
|
-
value: Union[None, int, solara.Reactive[int], solara.Reactive[Optional[int]]] = 0,
|
|
281
|
-
on_value: Union[None, Callable[[Optional[int]], None], Callable[[int], None]] = None,
|
|
282
|
-
disabled: bool = False,
|
|
283
|
-
optional: bool = False,
|
|
284
|
-
continuous_update: bool = False,
|
|
285
|
-
clearable: bool = False,
|
|
286
|
-
classes: List[str] = [],
|
|
287
|
-
style: Optional[Union[str, Dict[str, str]]] = None,
|
|
288
|
-
):
|
|
289
|
-
"""Numeric input (integers).
|
|
290
|
-
|
|
291
|
-
Basic example:
|
|
292
|
-
|
|
293
|
-
```solara
|
|
294
|
-
import solara
|
|
295
|
-
|
|
296
|
-
int_value = solara.reactive(42)
|
|
297
|
-
continuous_update = solara.reactive(True)
|
|
298
|
-
|
|
299
|
-
@solara.component
|
|
300
|
-
def Page():
|
|
301
|
-
solara.Checkbox(label="Continuous update", value=continuous_update)
|
|
302
|
-
solara.InputInt("Enter an integer number", value=int_value, continuous_update=continuous_update.value)
|
|
303
|
-
with solara.Row():
|
|
304
|
-
solara.Button("Clear", on_click=lambda: int_value.set(42))
|
|
305
|
-
solara.Markdown(f"**You entered**: {int_value.value}")
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
## Arguments
|
|
309
|
-
|
|
310
|
-
* `label`: Label to display next to the slider.
|
|
311
|
-
* `value`: The currently entered value.
|
|
312
|
-
* `on_value`: Callback to call when the value changes.
|
|
313
|
-
* `disabled`: Whether the input is disabled.
|
|
314
|
-
* `optional`: Whether the value can be None.
|
|
315
|
-
* `continuous_update`: Whether to call the `on_value` callback on every change or only when the input loses focus or the enter key is pressed.
|
|
316
|
-
* `clearable`: Whether the input can be cleared.
|
|
317
|
-
* `classes`: List of CSS classes to apply to the input.
|
|
318
|
-
* `style`: CSS style to apply to the input.
|
|
319
|
-
"""
|
|
320
|
-
|
|
321
|
-
def str_to_int(value: Optional[str]):
|
|
322
|
-
if value:
|
|
323
|
-
try:
|
|
324
|
-
return int(value)
|
|
325
|
-
except ValueError:
|
|
326
|
-
raise ValueError("Value must be an integer")
|
|
327
|
-
else:
|
|
328
|
-
if optional:
|
|
329
|
-
return None
|
|
330
|
-
else:
|
|
331
|
-
raise ValueError("Value cannot be empty")
|
|
332
|
-
|
|
333
|
-
return _InputNumeric(
|
|
334
|
-
str_to_int,
|
|
335
|
-
label=label,
|
|
336
|
-
value=value,
|
|
337
|
-
on_value=on_value,
|
|
338
|
-
disabled=disabled,
|
|
339
|
-
continuous_update=continuous_update,
|
|
340
|
-
clearable=clearable,
|
|
341
|
-
classes=classes,
|
|
342
|
-
style=style,
|
|
343
|
-
)
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
def _use_input_type(
|
|
347
|
-
input_value: Union[None, T, solara.Reactive[Optional[T]], solara.Reactive[T]],
|
|
348
|
-
parse: Callable[[Optional[str]], T],
|
|
349
|
-
stringify: Callable[[Optional[T]], str],
|
|
350
|
-
on_value: Union[None, Callable[[Optional[T]], None], Callable[[T], None]] = None,
|
|
351
|
-
):
|
|
352
|
-
reactive_value = solara.use_reactive(input_value, on_value) # type: ignore
|
|
353
|
-
del input_value, on_value
|
|
354
|
-
string_value, set_string_value = solara.use_state(stringify(reactive_value.value) if reactive_value.value is not None else None)
|
|
355
|
-
# Use a ref to make sure sync_back_input_value() does not get a stale string_value
|
|
356
|
-
string_value_ref = solara.use_ref(string_value)
|
|
357
|
-
string_value_ref.current = string_value
|
|
358
|
-
|
|
359
|
-
error_message = cast(Union[str, None], None)
|
|
360
|
-
|
|
361
|
-
try:
|
|
362
|
-
reactive_value.set(parse(string_value))
|
|
363
|
-
except ValueError as e:
|
|
364
|
-
error_message = str(e.args[0])
|
|
365
|
-
|
|
366
|
-
def sync_back_input_value():
|
|
367
|
-
def on_external_value_change(new_value: Optional[T]):
|
|
368
|
-
new_string_value = stringify(new_value)
|
|
369
|
-
try:
|
|
370
|
-
parse(string_value_ref.current)
|
|
371
|
-
except ValueError:
|
|
372
|
-
# String value could be invalid when external value is changed by a different component
|
|
373
|
-
set_string_value(new_string_value)
|
|
374
|
-
else:
|
|
375
|
-
if new_value != parse(string_value_ref.current):
|
|
376
|
-
set_string_value(new_string_value)
|
|
377
|
-
|
|
378
|
-
return reactive_value.subscribe(on_external_value_change)
|
|
379
|
-
|
|
380
|
-
solara.use_effect(sync_back_input_value, [reactive_value])
|
|
381
|
-
|
|
382
|
-
return string_value, error_message, set_string_value
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
@solara.component
|
|
386
|
-
def _InputNumeric(
|
|
387
|
-
str_to_numeric: Callable[[Optional[str]], T],
|
|
388
|
-
label: str,
|
|
389
|
-
value: Union[None, T, solara.Reactive[Optional[T]], solara.Reactive[T]],
|
|
390
|
-
on_value: Union[None, Callable[[Optional[T]], None], Callable[[T], None]] = None,
|
|
391
|
-
disabled: bool = False,
|
|
392
|
-
continuous_update: bool = False,
|
|
393
|
-
clearable: bool = False,
|
|
394
|
-
classes: List[str] = [],
|
|
395
|
-
style: Optional[Union[str, Dict[str, str]]] = None,
|
|
396
|
-
):
|
|
397
|
-
"""Numeric input.
|
|
398
|
-
|
|
399
|
-
## Arguments
|
|
400
|
-
|
|
401
|
-
* `label`: Label to display next to the slider.
|
|
402
|
-
* `value`: The currently entered value.
|
|
403
|
-
* `on_value`: Callback to call when the value changes.
|
|
404
|
-
* `disabled`: Whether the input is disabled.
|
|
405
|
-
* `continuous_update`: Whether to call the `on_value` callback on every change or only when the input loses focus or the enter key is pressed.
|
|
406
|
-
* `classes`: List of CSS classes to apply to the input.
|
|
407
|
-
* `style`: CSS style to apply to the input.
|
|
408
|
-
"""
|
|
409
|
-
style_flat = solara.util._flatten_style(style)
|
|
410
|
-
classes_flat = solara.util._combine_classes(classes)
|
|
411
|
-
|
|
412
|
-
internal_value, error, set_value_cast = _use_input_type(
|
|
413
|
-
value,
|
|
414
|
-
str_to_numeric,
|
|
415
|
-
str,
|
|
416
|
-
on_value,
|
|
417
|
-
)
|
|
418
|
-
|
|
419
|
-
def on_v_model(value):
|
|
420
|
-
if continuous_update:
|
|
421
|
-
set_value_cast(value)
|
|
422
|
-
|
|
423
|
-
if error:
|
|
424
|
-
label += f" ({error})"
|
|
425
|
-
text_field = v.TextField(
|
|
426
|
-
v_model=internal_value,
|
|
427
|
-
on_v_model=on_v_model,
|
|
428
|
-
label=label,
|
|
429
|
-
disabled=disabled,
|
|
430
|
-
# we are not using the number type, since we cannot validate invalid input
|
|
431
|
-
# see https://stackoverflow.blog/2022/12/26/why-the-number-input-is-the-worst-input/
|
|
432
|
-
# type="number",
|
|
433
|
-
hide_details=True,
|
|
434
|
-
clearable=clearable,
|
|
435
|
-
error=bool(error),
|
|
436
|
-
class_=classes_flat,
|
|
437
|
-
style_=style_flat,
|
|
438
|
-
)
|
|
439
|
-
use_change(text_field, set_value_cast, enabled=not continuous_update)
|
|
440
|
-
return text_field
|
solara/components/link.py
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
from typing import Dict, List, Union
|
|
2
|
-
|
|
3
|
-
import ipyvue as vue
|
|
4
|
-
import reacton.ipyvue as vuer
|
|
5
|
-
import solara
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@solara.component
|
|
9
|
-
def Link(
|
|
10
|
-
path_or_route: Union[str, solara.Route],
|
|
11
|
-
children=[],
|
|
12
|
-
nofollow=False,
|
|
13
|
-
style: Union[str, Dict[str, str], None] = None,
|
|
14
|
-
classes: List[str] = [],
|
|
15
|
-
):
|
|
16
|
-
"""Makes clicking on child elements navigate to a route.
|
|
17
|
-
|
|
18
|
-
See also:
|
|
19
|
-
|
|
20
|
-
* [Multipage](/documentation/advanced/howto/multipage).
|
|
21
|
-
* [Understanding Routing](/documentation/advanced/understanding/routing).
|
|
22
|
-
|
|
23
|
-
Most common usage is in combination with a button, e.g.:
|
|
24
|
-
|
|
25
|
-
```python
|
|
26
|
-
with solara.Link("/fruit/banana"):
|
|
27
|
-
solara.Button("Go to banana")
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## Arguments
|
|
32
|
-
|
|
33
|
-
* path_or_route: the path or route to navigate to. Paths should be absolute, e.g. '/fruit/banana'.
|
|
34
|
-
If a route is given, [`resolve_path`](/documentation/api/routing/resolve_path)] will be used to resolve to the absolute path.
|
|
35
|
-
* children: the children of the link. If a child is clicked, the link will be followed.
|
|
36
|
-
* nofollow: If True, the link will not be followed by web crawlers (such as google).
|
|
37
|
-
* style: CSS styles to apply to the HTML link element. Either a string or a dictionary.
|
|
38
|
-
* classes: A list of CSS classes to apply to the link.
|
|
39
|
-
|
|
40
|
-
"""
|
|
41
|
-
path = solara.resolve_path(path_or_route, level=0)
|
|
42
|
-
attributes = {"href": path}
|
|
43
|
-
if nofollow:
|
|
44
|
-
attributes["rel"] = "nofollow"
|
|
45
|
-
style_flat = solara.util._flatten_style(style)
|
|
46
|
-
classes_flat = solara.util._combine_classes(classes)
|
|
47
|
-
|
|
48
|
-
link = vue.Html.element(tag="a", children=children, attributes=attributes, style_=style_flat, class_=classes_flat)
|
|
49
|
-
location = solara.use_context(solara.routing._location_context)
|
|
50
|
-
|
|
51
|
-
def go(*ignore):
|
|
52
|
-
location.pathname = path
|
|
53
|
-
|
|
54
|
-
vuer.use_event(link, "click.prevent.stop", go)
|
|
55
|
-
return link
|