-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: UI ComboBox component #588
Merged
Merged
Conversation
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
mofojed
requested changes
Jul 3, 2024
bmingles
added a commit
to deephaven/web-client-ui
that referenced
this pull request
Jul 3, 2024
Jsapi support for ComboBox. Includes some splitting out of existing Picker logic to make code re-usable. Should be testable with plugins PR deephaven/deephaven-plugins#588 I have also deployed an alpha [0.83.1-alpha-combobox.8](https://www.npmjs.com/package/@deephaven/components/v/0.83.1-alpha-combobox.8) if you need it, although should only matter for types I think. ```python from deephaven import empty_table, ui, time_table import datetime # Change this to test different data types key_column="Timestamp" initial_row_count=5 * 8760 # 5 years in hours # Tick every 6 hours (makes it easier to test Timestamp filters for a whole day like `2024-01-02`) _items = time_table("PT6H", start_time=datetime.datetime.now() - datetime.timedelta(hours=initial_row_count)).update([ # Timestamp column also implicitly included in `time_table` "Int=new Integer(i)", "Long=new Long(i)", "BigInt=new java.math.BigInteger(``+i)", "String=new String(`a`+i * 1000)", ]) @ui.component def ui_combo_box(items): value, set_value = ui.use_state("") combo = ui.combo_box( ui.item_table_source( items, key_column=key_column, label_column=key_column, ), label=key_column, on_selection_change=set_value, menu_trigger="focus", selected_key=value, ) # Show current selection in a ui.text component text = ui.text("Selection: " + str(value)) return combo, text my_combo_box = ui_combo_box(_items) ``` There is a known issue with inconsistent open as you type for table data sources. #2115 resolves #2074
bmingles
force-pushed
the
201-ui-combobox
branch
2 times, most recently
from
July 5, 2024 16:23
c95cea5
to
1e4140f
Compare
mofojed
requested changes
Jul 9, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change, looks good
Co-authored-by: Mike Bender <mikebender@deephaven.io>
mofojed
approved these changes
Jul 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ui.combo_box
Testing
resolves #201