Skip to content
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

ui.picker Implementation with constant data provided from server #292

Closed
Tracked by #200
mofojed opened this issue Feb 20, 2024 · 1 comment · Fixed by deephaven/web-client-ui#1821, #333 or deephaven/web-client-ui#1847
Assignees
Milestone

Comments

@mofojed
Copy link
Member

mofojed commented Feb 20, 2024

Implement spec defined in #247 for ui.picker with constant data. Specifically, the examples where you are providing a number of constant items, e.g.

from deephaven import ui

def PickerExample():
  # simple picker that takes picker options directly and is controlled
  option, set_option = ui.use_state("Option 2")
  
  picker2 = ui.picker(
      "Option 1",
      "Option 2",
      "Option 3",
      "Option 4",
      selected_key=option,
      on_selection_change=set_option
  )

p = PickerExample()
@mofojed mofojed mentioned this issue Feb 20, 2024
6 tasks
@mofojed mofojed changed the title Implementation with constant data provided from server ui.picker Implementation with constant data provided from server Feb 20, 2024
@mofojed mofojed added this to the February 2024 milestone Feb 20, 2024
bmingles added a commit to deephaven/web-client-ui that referenced this issue Feb 27, 2024
@bmingles
Copy link
Contributor

DHC component implemented by: deephaven/web-client-ui#1821

@bmingles bmingles linked a pull request Feb 27, 2024 that will close this issue
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Feb 28, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Feb 28, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Feb 28, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Feb 28, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Feb 28, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Feb 29, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Feb 29, 2024
@bmingles bmingles linked a pull request Feb 29, 2024 that will close this issue
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 1, 2024
@bmingles bmingles linked a pull request Mar 4, 2024 that will close this issue
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 4, 2024
bmingles added a commit to deephaven/web-client-ui that referenced this issue Mar 4, 2024
- Picker component now supports <Section> children
- Re-exported Spectrum Item + Section components

Supports deephaven/deephaven-plugins/issues/292
@bmingles bmingles reopened this Mar 4, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 4, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 4, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 4, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 4, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 4, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 5, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 5, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 5, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 5, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 5, 2024
bmingles added a commit to bmingles/deephaven-plugins that referenced this issue Mar 5, 2024
bmingles added a commit that referenced this issue Mar 5, 2024
- @adobe/react-spectrum upgrade to ^3.34.1
- DH version bump to ^0.67.0
- Split out element constants from various utils into centralized
location + simplified the component type mapping
- Picker React component + event handler serialization
- Fixed minor issue in `update-dh-packages` script

**Test Example**
Shows primitive, Item, and Section children + event handlers
```
import deephaven.ui as ui
from deephaven.ui import use_state, use_callback, use_effect

@ui.component
def picker():
    value, set_value = use_state('')

    def handle_change(v):
        print(v)
        set_value(v)

    on_selection_change = use_callback(handle_change, [])

    return ui.fragment(
        ui.picker(
            label="Picker Example",
            selected_key=value,
            on_focus=lambda e : print('on_focus:', e),
            on_blur=lambda e : print('on_blur:', e),
            on_key_down=lambda e : print('on_key_down:', e),
            on_key_up=lambda e : print('on_key_up:', e),
            on_selection_change=on_selection_change,
            children = [
                'Text 1', 
                999,
                True,
                False,
                'Really long text items should be truncated',
                ui.item('Item'),
                ui.section(
                    'Subtext 1', 
                    'Subtext 2', 
                    title='Section'
                ),
            ],
        )
    )

pick = picker()
```

resolves #292
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants