Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4d31c54
Pass options to input_selectize
Oct 3, 2023
4db2772
Linting
Oct 3, 2023
eb7f40c
Merge remote-tracking branch 'origin/main' into selectize-options-2
Jan 14, 2024
6950d7c
Use JS function
Jan 14, 2024
b010e4b
Export ui.JS
Jan 15, 2024
159a417
Docs
Jan 16, 2024
5cbb6ea
JS options extract utility, app with plugin
Jan 17, 2024
893ea3d
Add remove button argument
Jan 18, 2024
e0cd23b
Supply just JS keys to data_eval
Jan 18, 2024
14248a0
Typing
Jan 18, 2024
5ace1a0
Update shiny/api-examples/input_selectize/app.py
Jan 18, 2024
67ec753
PR Review comments
Jan 18, 2024
f22f506
Merge remote-tracking branch 'origin/main' into selectize-options-2
Jan 19, 2024
40c68d2
Checks
Jan 19, 2024
58d23c7
Checks
Jan 19, 2024
3048207
CI
Jan 19, 2024
06667ab
Fix unused inputs
Jan 19, 2024
1d5bf0b
Docs
Jan 19, 2024
2ef02aa
Fix pyright error
Jan 19, 2024
a9bd499
Merge remote-tracking branch 'origin/main' into selectize-options-2
Jan 19, 2024
1cc716c
Cast value
Jan 19, 2024
bb88baf
Don't include clear button for single selection by default.
Jan 19, 2024
e2c7bac
Add js_eval to express.ui
Jan 19, 2024
3f34f66
Typing
Jan 19, 2024
cc5af52
Merge remote-tracking branch 'origin/main' into selectize-options-2
Jan 22, 2024
2889584
Fix bad merge
Jan 22, 2024
04bbbf1
Delete shiny/api-examples/Calc directory
Jan 22, 2024
5ecfbdc
Delete shiny/api-examples/Effect directory
Jan 22, 2024
d86a856
Replace effect and calc examples
Jan 22, 2024
9ca2b75
Merge branch 'main' into selectize-options-2
schloerke Jan 22, 2024
6d90aad
Merge remote-tracking branch 'origin/main' into selectize-options-2
Jan 22, 2024
090e845
Merge branch 'selectize-options-2' of https://github.com/rstudio/py-s…
Jan 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Added `App.on_shutdown` method for registering a callback to be called when the app is shutting down. (#907)

* You can now pass options to `ui.input_selectize` see the [selectize.js](https://selectize.dev/docs/API/selectize) docs for available options. (#914, #158)

* `ui.input_selectize` gains the `remove_button` argument which allows you to control the visibility of the remove button.

### Bug fixes

* CLI command `shiny create`... (#965)
Expand Down
36 changes: 0 additions & 36 deletions shiny/api-examples/Calc/app.py

This file was deleted.

17 changes: 0 additions & 17 deletions shiny/api-examples/Effect/app.py

This file was deleted.

36 changes: 31 additions & 5 deletions shiny/api-examples/input_selectize/app.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,43 @@
from html import escape # noqa: F401

from shiny import App, Inputs, Outputs, Session, render, ui

states = {
"East Coast": {"NY": "New York", "NJ": "New Jersey", "CT": "Connecticut"},
"West Coast": {"WA": "Washington", "OR": "Oregon", "CA": "California"},
"Midwest": {"MN": "Minnesota", "WI": "Wisconsin", "IA": "Iowa"},
}

app_ui = ui.page_fluid(
ui.input_selectize(
"state",
"Choose a state:",
{
"East Coast": {"NY": "New York", "NJ": "New Jersey", "CT": "Connecticut"},
"West Coast": {"WA": "Washington", "OR": "Oregon", "CA": "California"},
"Midwest": {"MN": "Minnesota", "WI": "Wisconsin", "IA": "Iowa"},
},
states,
multiple=True,
),
ui.output_text("value"),
ui.input_selectize(
"state",
"Selectize Options",
states,
multiple=True,
options=(
{
"placeholder": "Enter text",
"render": ui.js_eval(
'{option: function(item, escape) {return "<div><strong>Select " + escape(item.label) + "</strong></div>";}}'
),
"create": True,
}
),
),
ui.input_selectize(
"state",
"Selectize plugins",
states,
multiple=True,
options={"plugins": ["clear_button"]},
),
)


Expand Down
2 changes: 2 additions & 0 deletions shiny/express/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
nav_spacer,
Progress,
value_box_theme,
js_eval,
)

from ._cm_components import (
Expand Down Expand Up @@ -269,6 +270,7 @@
"page_opts",
# Imports from ._hold
"hold",
"js_eval",
)


Expand Down
186 changes: 89 additions & 97 deletions shiny/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,36 @@
layout helpers, page-level containers, and more.
"""

from ._bootstrap import (
row,
column,
panel_well,
panel_conditional,
panel_title,
panel_fixed,
panel_absolute,
help_text,
)
from ._sidebar import (
Sidebar,
sidebar,
layout_sidebar,
update_sidebar,
panel_sidebar,
panel_main,
from htmltools import (
HTML,
Tag,
TagAttrs,
TagAttrValue,
TagChild,
TagList,
a,
br,
code,
div,
em,
h1,
h2,
h3,
h4,
h5,
h6,
head_content,
hr,
img,
p,
pre,
span,
strong,
tags,
)

from ._layout import layout_column_wrap
from ._layout_columns import layout_columns


# Expose the following modules for extended usage: ex: ui.fill.as_fill_item(x)
from . import css # noqa: F401 # pyright: ignore[reportUnusedImport]
from . import fill # noqa: F401 # pyright: ignore[reportUnusedImport]

from ._card import (
card,
CardItem,
card_header,
card_footer,
)

from . import css, fill # noqa: F401 # pyright: ignore[reportUnusedImport]
from ._accordion import (
AccordionPanel,
accordion,
Expand All @@ -46,132 +42,126 @@
update_accordion,
update_accordion_panel,
)

from ._bootstrap import (
column,
help_text,
panel_absolute,
panel_conditional,
panel_fixed,
panel_title,
panel_well,
row,
)
from ._card import (
CardItem,
card,
card_footer,
card_header,
)
from ._download_button import download_button, download_link
from ._plot_output_opts import brush_opts, click_opts, dblclick_opts, hover_opts
from ._include_helpers import include_css, include_js
from ._input_action_button import input_action_button, input_action_link
from ._input_check_radio import (
input_checkbox,
input_checkbox_group,
input_switch,
input_radio_buttons,
input_switch,
)
from ._input_date import input_date, input_date_range
from ._input_file import input_file
from ._input_numeric import input_numeric
from ._input_password import input_password
from ._input_select import input_select, input_selectize
from ._input_slider import input_slider, SliderValueArg, SliderStepArg, AnimationOptions
from ._input_slider import AnimationOptions, SliderStepArg, SliderValueArg, input_slider
from ._input_task_button import bind_task_button, input_task_button
from ._input_text import input_text, input_text_area
from ._input_update import (
update_action_button,
update_action_link,
update_checkbox,
update_switch,
update_checkbox_group,
update_radio_buttons,
update_date,
update_date_range,
update_navs,
update_numeric,
update_popover,
update_radio_buttons,
update_select,
update_selectize,
update_slider,
update_switch,
update_task_button,
update_text,
update_text_area,
update_navs,
update_tooltip,
update_popover,
)
from ._insert import insert_ui, remove_ui
from ._layout import layout_column_wrap
from ._layout_columns import layout_columns
from ._markdown import markdown
from ._modal import modal_button, modal, modal_show, modal_remove
from ._modal import modal, modal_button, modal_remove, modal_show
from ._navs import (
nav_panel,
nav_menu,
nav,
nav_control,
nav_menu,
nav_panel,
nav_spacer,
navset_tab,
navset_pill,
navset_underline,
navset_bar,
navset_card_pill,
navset_card_underline,
navset_card_tab,
navset_pill_list,
navset_card_underline,
navset_hidden,
navset_bar,
navset_pill,
# Deprecated
navset_pill_card,
navset_pill_list,
navset_tab,
navset_tab_card,
nav,
navset_underline,
)
from ._notification import notification_show, notification_remove
from ._notification import notification_remove, notification_show
from ._output import (
output_plot,
output_code,
output_image,
output_plot,
output_table,
output_text,
output_code,
output_text_verbatim,
output_table,
output_ui,
)
from ._page import (
page_sidebar,
page_navbar,
page_auto,
page_bootstrap,
page_fillable,
page_fluid,
page_fixed,
page_bootstrap,
page_auto,
page_fluid,
page_navbar,
page_output,
page_sidebar,
)
from ._progress import Progress

from .dataframe import output_data_frame

from ._plot_output_opts import brush_opts, click_opts, dblclick_opts, hover_opts
from ._popover import popover
from ._progress import Progress
from ._sidebar import (
Sidebar,
layout_sidebar,
panel_main,
panel_sidebar,
sidebar,
update_sidebar,
)
from ._tooltip import tooltip
from ._utils import js_eval
from ._valuebox import (
value_box,
value_box_theme,
ShowcaseLayout,
ValueBoxTheme,
showcase_bottom,
showcase_left_center,
showcase_top_right,
ValueBoxTheme,
ShowcaseLayout,
)
from ._tooltip import tooltip


from htmltools import (
TagList,
Tag,
TagChild,
TagAttrs,
TagAttrValue,
tags,
HTML,
head_content,
p,
h1,
h2,
h3,
h4,
h5,
h6,
a,
br,
div,
span,
pre,
code,
img,
strong,
em,
hr,
value_box,
value_box_theme,
)

from .dataframe import output_data_frame

__all__ = (
# _bootstrap
Expand Down Expand Up @@ -356,4 +346,6 @@
"strong",
"em",
"hr",
# utils
"js_eval",
)
Loading