From 0f4e776d7c2fe639c0cacb9f82fde70d571630ce Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Fri, 1 Nov 2024 17:11:15 -0400 Subject: [PATCH 01/13] undefined --- .../ui/src/deephaven/ui/_internal/utils.py | 35 ++-- .../deephaven/ui/components/action_button.py | 127 ++++++------- .../deephaven/ui/components/action_group.py | 134 +++++++------- .../deephaven/ui/components/action_menu.py | 120 ++++++------- .../ui/src/deephaven/ui/components/button.py | 139 +++++++------- .../deephaven/ui/components/button_group.py | 83 ++++----- .../src/deephaven/ui/components/calendar.py | 122 ++++++------- .../src/deephaven/ui/components/checkbox.py | 129 ++++++------- .../deephaven/ui/components/checkbox_group.py | 132 +++++++------- .../ui/src/deephaven/ui/components/column.py | 5 +- .../src/deephaven/ui/components/combo_box.py | 160 ++++++++--------- .../ui/src/deephaven/ui/components/content.py | 81 ++++----- .../ui/components/contextual_help.py | 109 +++++------ .../src/deephaven/ui/components/date_field.py | 160 ++++++++--------- .../deephaven/ui/components/date_picker.py | 166 ++++++++--------- .../ui/components/date_range_picker.py | 170 +++++++++--------- .../ui/src/deephaven/ui/components/dialog.py | 97 +++++----- .../deephaven/ui/components/dialog_trigger.py | 29 +-- .../ui/src/deephaven/ui/components/flex.py | 95 +++++----- .../ui/src/deephaven/ui/components/form.py | 129 ++++++------- .../src/deephaven/ui/components/fragment.py | 3 +- .../ui/src/deephaven/ui/components/grid.py | 101 +++++------ .../ui/src/deephaven/ui/components/heading.py | 83 ++++----- .../ui/src/deephaven/ui/components/icon.py | 95 +++++----- .../ui/components/illustrated_message.py | 81 ++++----- .../ui/src/deephaven/ui/components/image.py | 87 ++++----- .../ui/src/deephaven/ui/components/item.py | 10 +- .../ui/components/item_table_source.py | 28 +-- .../ui/components/list_action_group.py | 124 ++++++------- .../ui/components/list_action_menu.py | 116 ++++++------ .../src/deephaven/ui/components/list_view.py | 118 ++++++------ .../deephaven/ui/components/make_component.py | 5 +- .../deephaven/ui/components/number_field.py | 147 +++++++-------- .../ui/src/deephaven/ui/components/panel.py | 37 ++-- .../ui/src/deephaven/ui/components/picker.py | 150 ++++++++-------- .../deephaven/ui/components/progress_bar.py | 109 +++++------ .../ui/components/progress_circle.py | 103 +++++------ .../ui/src/deephaven/ui/components/radio.py | 105 +++++------ .../deephaven/ui/components/radio_group.py | 131 +++++++------- .../deephaven/ui/components/range_calendar.py | 122 ++++++------- .../deephaven/ui/components/range_slider.py | 111 ++++++------ plugins/ui/src/deephaven/ui/components/row.py | 7 +- .../ui/src/deephaven/ui/components/section.py | 5 +- .../ui/src/deephaven/ui/components/slider.py | 113 ++++++------ .../ui/src/deephaven/ui/components/stack.py | 9 +- .../ui/src/deephaven/ui/components/switch.py | 123 ++++++------- plugins/ui/src/deephaven/ui/components/tab.py | 12 +- .../src/deephaven/ui/components/tab_list.py | 81 ++++----- .../src/deephaven/ui/components/tab_panels.py | 81 ++++----- .../ui/src/deephaven/ui/components/table.py | 112 ++++++------ .../ui/src/deephaven/ui/components/tabs.py | 114 ++++++------ .../ui/src/deephaven/ui/components/text.py | 83 ++++----- .../src/deephaven/ui/components/text_area.py | 151 ++++++++-------- .../src/deephaven/ui/components/text_field.py | 155 ++++++++-------- .../src/deephaven/ui/components/time_field.py | 152 ++++++++-------- .../deephaven/ui/components/toggle_button.py | 135 +++++++------- .../ui/src/deephaven/ui/components/view.py | 140 +++++++-------- .../src/deephaven/ui/elements/BaseElement.py | 10 +- .../ui/src/deephaven/ui/elements/Element.py | 5 +- .../deephaven/ui/elements/FunctionElement.py | 8 +- .../ui/src/deephaven/ui/renderer/Renderer.py | 5 +- plugins/ui/src/deephaven/ui/types/types.py | 12 ++ plugins/ui/test/deephaven/ui/test_utils.py | 10 ++ 63 files changed, 2857 insertions(+), 2754 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/_internal/utils.py b/plugins/ui/src/deephaven/ui/_internal/utils.py index 22a3ec1c5..505c765a3 100644 --- a/plugins/ui/src/deephaven/ui/_internal/utils.py +++ b/plugins/ui/src/deephaven/ui/_internal/utils.py @@ -15,6 +15,8 @@ JavaTime, LocalDateConvertible, LocalDate, + Undefined, + UNDEFINED, ) T = TypeVar("T") @@ -36,6 +38,17 @@ } +def is_nullish(value: Any) -> bool: + """ + Check if a value is None or Undefined. + Args: + value: The value to check. + Returns: + Whether the value is nullish. + """ + return value is None or value is UNDEFINED + + def get_component_name(component: Any) -> str: """ Get the name of the component @@ -163,7 +176,7 @@ def remove_empty_keys(dict: dict[str, Any]) -> dict[str, Any]: Returns: The dict with keys removed. """ - return {k: v for k, v in dict.items() if v is not None} + return {k: v for k, v in dict.items() if v is not UNDEFINED} def _wrapped_callable( @@ -481,7 +494,7 @@ def _get_first_set_key(props: dict[str, Any], sequence: Sequence[str]) -> str | The first non-None prop, or None if all props are None. """ for key in sequence: - if props.get(key) is not None: + if not is_nullish(props.get(key)): return key return None @@ -666,11 +679,11 @@ def convert_date_props( The converted props. """ for key in simple_date_props: - if props.get(key) is not None: + if not is_nullish(props.get(key)): props[key] = _convert_to_java_date(props[key]) for key in date_range_props: - if props.get(key) is not None: + if not is_nullish(props.get(key)): props[key] = convert_date_range(props[key], _convert_to_java_date) # the simple props must be converted before this to simplify the callable conversion @@ -680,25 +693,25 @@ def convert_date_props( # Local Dates will default to DAY but we need to default to SECOND for the other types if ( granularity_key is not None - and props.get(granularity_key) is None + and is_nullish(props.get(granularity_key)) and converter != to_j_local_date ): props[granularity_key] = "SECOND" # now that the converter is set, we can convert simple props to strings for key in simple_date_props: - if props.get(key) is not None: + if not is_nullish(props.get(key)): props[key] = str(props[key]) # and convert the date range props to strings for key in date_range_props: - if props.get(key) is not None: + if not is_nullish(props.get(key)): props[key] = convert_date_range(props[key], str) # wrap the date callable with the convert # if there are date range props, we need to convert as a date range for key in callable_date_props: - if props.get(key) is not None: + if not is_nullish(props.get(key)): if not callable(props[key]): raise TypeError(f"{key} must be a callable") if len(date_range_props) > 0: @@ -730,7 +743,7 @@ def convert_time_props( The converted props. """ for key in simple_time_props: - if props.get(key) is not None: + if not is_nullish(props.get(key)): props[key] = _convert_to_java_time(props[key]) # the simple props must be converted before this to simplify the callable conversion @@ -738,12 +751,12 @@ def convert_time_props( # now that the converter is set, we can convert simple props to strings for key in simple_time_props: - if props.get(key) is not None: + if not is_nullish(props.get(key)): props[key] = str(props[key]) # wrap the date callable with the convert for key in callable_time_props: - if props.get(key) is not None: + if not is_nullish(props.get(key)): if not callable(props[key]): raise TypeError(f"{key} must be a callable") props[key] = _wrap_time_callable(props[key], converter) diff --git a/plugins/ui/src/deephaven/ui/components/action_button.py b/plugins/ui/src/deephaven/ui/components/action_button.py index e87669ebe..f089802fc 100644 --- a/plugins/ui/src/deephaven/ui/components/action_button.py +++ b/plugins/ui/src/deephaven/ui/components/action_button.py @@ -22,6 +22,7 @@ from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED ActionButtonElement = Element @@ -29,69 +30,69 @@ def action_button( *children: Any, type: ButtonType = "button", - on_press: PressEventCallable | None = None, - on_press_start: PressEventCallable | None = None, - on_press_end: PressEventCallable | None = None, - on_press_up: PressEventCallable | None = None, - on_press_change: Callable[[bool], None] | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - auto_focus: bool | None = None, - is_disabled: bool | None = None, - is_quiet: bool | None = None, - static_color: StaticColor | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - exclude_from_tab_order: bool | None = None, - aria_expanded: AriaExpanded | None = None, - aria_haspopup: AriaHasPopup | None = None, - aria_controls: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_pressed: AriaPressed | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + on_press: PressEventCallable | Undefined = UNDEFINED, + on_press_start: PressEventCallable | Undefined = UNDEFINED, + on_press_end: PressEventCallable | Undefined = UNDEFINED, + on_press_up: PressEventCallable | Undefined = UNDEFINED, + on_press_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + static_color: StaticColor | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + exclude_from_tab_order: bool | Undefined = UNDEFINED, + aria_expanded: AriaExpanded | Undefined = UNDEFINED, + aria_haspopup: AriaHasPopup | Undefined = UNDEFINED, + aria_controls: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_pressed: AriaPressed | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> ActionButtonElement: """ ActionButtons allow users to perform an action. They're used for similar, task-based options within a workflow, and are ideal for interfaces where buttons aren't meant to draw a lot of attention. diff --git a/plugins/ui/src/deephaven/ui/components/action_group.py b/plugins/ui/src/deephaven/ui/components/action_group.py index 715d57eca..ef0c4386e 100644 --- a/plugins/ui/src/deephaven/ui/components/action_group.py +++ b/plugins/ui/src/deephaven/ui/components/action_group.py @@ -18,73 +18,81 @@ ) from .basic import component_element from ..elements import Element -from ..types import ActionGroupDensity, SelectedKeys, SelectionMode, Key, Selection +from ..types import ( + ActionGroupDensity, + SelectedKeys, + SelectionMode, + Key, + Selection, + Undefined, + UNDEFINED, +) def action_group( *children: Any, - is_emphasized: bool | None = None, - density: ActionGroupDensity | None = "regular", - is_justified: bool | None = None, - is_quiet: bool | None = None, - static_color: StaticColor | None = None, - overflow_mode: OverflowMode | None = "wrap", - button_label_behavior: ButtonLabelBehavior | None = "show", - summary_icon: Element | None = None, - orientation: Orientation | None = "horizontal", - disabled_keys: Iterable[str] | None = None, - is_disabled: bool | None = None, - selection_mode: SelectionMode | None = None, - disallow_empty_selection: bool | None = None, - selected_keys: SelectedKeys | Iterable[str] | None = None, - default_selected_keys: SelectedKeys | Iterable[str] | None = None, - on_action: Callable[[str], None] | None = None, - on_change: Callable[[Key], None] | None = None, - on_selection_change: Callable[[Selection], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + is_emphasized: bool | Undefined = UNDEFINED, + density: ActionGroupDensity | Undefined = "regular", + is_justified: bool | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + static_color: StaticColor | Undefined = UNDEFINED, + overflow_mode: OverflowMode | Undefined = "wrap", + button_label_behavior: ButtonLabelBehavior | Undefined = "show", + summary_icon: Element | Undefined = UNDEFINED, + orientation: Orientation | Undefined = "horizontal", + disabled_keys: Iterable[str] | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + selection_mode: SelectionMode | Undefined = UNDEFINED, + disallow_empty_selection: bool | Undefined = UNDEFINED, + selected_keys: SelectedKeys | Iterable[str] | Undefined = UNDEFINED, + default_selected_keys: SelectedKeys | Iterable[str] | Undefined = UNDEFINED, + on_action: Callable[[str], None] | Undefined = UNDEFINED, + on_change: Callable[[Key], None] | Undefined = UNDEFINED, + on_selection_change: Callable[[Selection], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ An action grouping of action items that are related to each other. diff --git a/plugins/ui/src/deephaven/ui/components/action_menu.py b/plugins/ui/src/deephaven/ui/components/action_menu.py index 557e1f532..bbea7d590 100644 --- a/plugins/ui/src/deephaven/ui/components/action_menu.py +++ b/plugins/ui/src/deephaven/ui/components/action_menu.py @@ -7,11 +7,7 @@ from .basic import component_element from ..elements import Element -from ..types import ( - Key, - ActionKey, - ActionMenuDirection, -) +from ..types import Key, ActionKey, ActionMenuDirection, Undefined, UNDEFINED from .types import ( # Events @@ -29,63 +25,63 @@ def action_menu( *children: Item | SectionElement, - is_disabled: bool | None = None, - is_quiet: bool | None = None, - auto_focus: bool | None = None, - disabled_keys: Iterable[Key] | None = None, - align: Alignment | None = "start", - direction: ActionMenuDirection | None = "bottom", - should_flip: bool | None = True, - close_on_select: bool | None = True, - trigger: TriggerType | None = "press", - is_open: bool | None = None, - default_open: bool | None = None, - on_action: Callable[[ActionKey], None] | None = None, - on_open_change: Callable[[bool], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + is_disabled: bool | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + disabled_keys: Iterable[Key] | Undefined = UNDEFINED, + align: Alignment | Undefined = "start", + direction: ActionMenuDirection | Undefined = "bottom", + should_flip: bool | Undefined = True, + close_on_select: bool | Undefined = True, + trigger: TriggerType | Undefined = "press", + is_open: bool | Undefined = UNDEFINED, + default_open: bool | Undefined = UNDEFINED, + on_action: Callable[[ActionKey], None] | Undefined = UNDEFINED, + on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ ActionMenu combines an ActionButton with a Menu for simple "more actions" use cases. diff --git a/plugins/ui/src/deephaven/ui/components/button.py b/plugins/ui/src/deephaven/ui/components/button.py index 003ebb659..95b101e61 100644 --- a/plugins/ui/src/deephaven/ui/components/button.py +++ b/plugins/ui/src/deephaven/ui/components/button.py @@ -23,79 +23,80 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def button( *children: Any, - variant: ButtonVariant | None = "accent", - style: ButtonStyle | None = "fill", - static_color: StaticColor | None = None, - is_pending: bool | None = None, + variant: ButtonVariant | Undefined = "accent", + style: ButtonStyle | Undefined = "fill", + static_color: StaticColor | Undefined = UNDEFINED, + is_pending: bool | Undefined = UNDEFINED, type: ButtonType = "button", - is_disabled: bool | None = None, - auto_focus: bool | None = None, - href: str | None = None, - target: str | None = None, - rel: str | None = None, - on_press: PressEventCallable | None = None, - on_press_start: PressEventCallable | None = None, - on_press_end: PressEventCallable | None = None, - on_press_up: PressEventCallable | None = None, - on_press_change: Callable[[bool], None] | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_column: str | None = None, - grid_row: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - min_width: DimensionValue | None = None, - max_width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - exclude_from_tab_order: bool | None = None, - aria_expanded: AriaExpanded | None = None, - aria_has_popup: AriaHasPopup | None = None, - aria_controls: str | None = None, - aria_pressed: AriaPressed | None = None, - aria_label: str | None = None, - aria_labelled_by: str | None = None, - aria_described_by: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + is_disabled: bool | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + href: str | Undefined = UNDEFINED, + target: str | Undefined = UNDEFINED, + rel: str | Undefined = UNDEFINED, + on_press: PressEventCallable | Undefined = UNDEFINED, + on_press_start: PressEventCallable | Undefined = UNDEFINED, + on_press_end: PressEventCallable | Undefined = UNDEFINED, + on_press_up: PressEventCallable | Undefined = UNDEFINED, + on_press_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + exclude_from_tab_order: bool | Undefined = UNDEFINED, + aria_expanded: AriaExpanded | Undefined = UNDEFINED, + aria_has_popup: AriaHasPopup | Undefined = UNDEFINED, + aria_controls: str | Undefined = UNDEFINED, + aria_pressed: AriaPressed | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelled_by: str | Undefined = UNDEFINED, + aria_described_by: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Buttons allow users to perform an action or to navigate to another page. They have multiple styles for various needs, and are ideal for calling attention to where a user needs to do something in order to move forward in a flow. @@ -191,7 +192,7 @@ def button( rel=rel, # intentionally not exposing element_type to the user # for href links we can handle on their behalf - element_type=None if href is None else "a", + element_type=UNDEFINED if href is UNDEFINED else "a", on_press=on_press, on_press_start=on_press_start, on_press_end=on_press_end, diff --git a/plugins/ui/src/deephaven/ui/components/button_group.py b/plugins/ui/src/deephaven/ui/components/button_group.py index e57b2b84a..6a41d2086 100644 --- a/plugins/ui/src/deephaven/ui/components/button_group.py +++ b/plugins/ui/src/deephaven/ui/components/button_group.py @@ -14,53 +14,54 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def button_group( *children: Any, - is_disabled: bool | None = None, + is_disabled: bool | Undefined = UNDEFINED, orientation: Orientation = "horizontal", align: ButtonGroupAlignment = "start", - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_column: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ A button group is a grouping of button whose actions are related to each other. diff --git a/plugins/ui/src/deephaven/ui/components/calendar.py b/plugins/ui/src/deephaven/ui/components/calendar.py index 4e3e1d76f..79834d1ab 100644 --- a/plugins/ui/src/deephaven/ui/components/calendar.py +++ b/plugins/ui/src/deephaven/ui/components/calendar.py @@ -15,7 +15,7 @@ from ..elements import Element from .._internal.utils import create_props, convert_date_props, wrap_local_date_callable -from ..types import Date, LocalDateConvertible +from ..types import Date, LocalDateConvertible, Undefined, UNDEFINED from .basic import component_element from .make_component import make_component from deephaven.time import dh_now @@ -75,66 +75,66 @@ def _convert_calendar_props( @make_component def calendar( - value: Date | None = None, - default_value: Date | None = None, - focused_value: Date | None = None, - default_focused_value: Date | None = None, - min_value: Date | None = None, - max_value: Date | None = None, - page_behavior: PageBehavior | None = None, - is_invalid: bool | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - auto_focus: bool | None = None, - error_message: Element | None = None, - visible_months: int | None = None, - on_focus_change: Callable[[LocalDateConvertible], None] | None = None, - on_change: Callable[[Date], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_pressed: AriaPressed | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + value: Date | Undefined = UNDEFINED, + default_value: Date | Undefined = UNDEFINED, + focused_value: Date | Undefined = UNDEFINED, + default_focused_value: Date | Undefined = UNDEFINED, + min_value: Date | Undefined = UNDEFINED, + max_value: Date | Undefined = UNDEFINED, + page_behavior: PageBehavior | Undefined = UNDEFINED, + is_invalid: bool | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + error_message: Element | Undefined = UNDEFINED, + visible_months: int | Undefined = UNDEFINED, + on_focus_change: Callable[[LocalDateConvertible], None] | Undefined = UNDEFINED, + on_change: Callable[[Date], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_pressed: AriaPressed | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> CalendarElement: """ A calendar allows the user to select a date. diff --git a/plugins/ui/src/deephaven/ui/components/checkbox.py b/plugins/ui/src/deephaven/ui/components/checkbox.py index 9450ffb87..5d99abf52 100644 --- a/plugins/ui/src/deephaven/ui/components/checkbox.py +++ b/plugins/ui/src/deephaven/ui/components/checkbox.py @@ -15,76 +15,77 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def checkbox( *children: Any, - is_emphasized: bool | None = None, - is_indeterminate: bool | None = None, - default_selected: bool | None = None, - is_selected: bool | None = None, - value: str | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - is_required: bool | None = None, - is_invalid: bool | None = None, + is_emphasized: bool | Undefined = UNDEFINED, + is_indeterminate: bool | Undefined = UNDEFINED, + default_selected: bool | Undefined = UNDEFINED, + is_selected: bool | Undefined = UNDEFINED, + value: str | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, + is_invalid: bool | Undefined = UNDEFINED, # validation_behaviour, # omitted because validate is not implemented # validate, # omitted because it needs to return a ValidationError synchronously - auto_focus: bool | None = None, - name: str | None = None, - on_change: Callable[[bool], None] | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - exclude_from_tab_order: bool | None = None, - aria_controls: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - aria_errormessage: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + auto_focus: bool | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + on_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + exclude_from_tab_order: bool | Undefined = UNDEFINED, + aria_controls: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + aria_errormessage: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Checkboxes allow users to select multiple items from a list of individual items, or to mark one individual item as selected. diff --git a/plugins/ui/src/deephaven/ui/components/checkbox_group.py b/plugins/ui/src/deephaven/ui/components/checkbox_group.py index 073328090..2c7920a30 100644 --- a/plugins/ui/src/deephaven/ui/components/checkbox_group.py +++ b/plugins/ui/src/deephaven/ui/components/checkbox_group.py @@ -15,77 +15,77 @@ ) from .basic import component_element from ..elements import Element -from ..types import Key, Selection +from ..types import Key, Selection, Undefined, UNDEFINED def checkbox_group( *children: Any, orientation: Orientation = "vertical", - is_emphasized: bool | None = None, - value: Selection | None = None, - default_value: Selection | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - name: str | None = None, - label: Any | None = None, - description: Any | None = None, - error_message: Any | None = None, - is_required: bool | None = None, - is_invalid: bool | None = None, - validation_behavior: ValidationBehavior | None = "aria", - label_position: str | None = None, - label_align: str | None = None, - necessity_indicator: str | None = None, - contextual_help: Any | None = None, - show_error_icon: bool | None = None, - on_change: Callable[[Key], None] | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - aria_errormessage: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, + is_emphasized: bool | Undefined = UNDEFINED, + value: Selection | Undefined = UNDEFINED, + default_value: Selection | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + label: Any | Undefined = UNDEFINED, + description: Any | Undefined = UNDEFINED, + error_message: Any | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, + is_invalid: bool | Undefined = UNDEFINED, + validation_behavior: ValidationBehavior | Undefined = "aria", + label_position: str | Undefined = UNDEFINED, + label_align: str | Undefined = UNDEFINED, + necessity_indicator: str | Undefined = UNDEFINED, + contextual_help: Any | Undefined = UNDEFINED, + show_error_icon: bool | Undefined = UNDEFINED, + on_change: Callable[[Key], None] | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + aria_errormessage: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, ) -> Element: """ A grouping of checkbox's that are related to each other. diff --git a/plugins/ui/src/deephaven/ui/components/column.py b/plugins/ui/src/deephaven/ui/components/column.py index 4dbeea67b..79d40fc48 100644 --- a/plugins/ui/src/deephaven/ui/components/column.py +++ b/plugins/ui/src/deephaven/ui/components/column.py @@ -3,10 +3,13 @@ from typing import Any from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def column( - *children: Any, width: float | None = None, key: str | None = None + *children: Any, + width: float | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ A column is a container that can be used to group elements. diff --git a/plugins/ui/src/deephaven/ui/components/combo_box.py b/plugins/ui/src/deephaven/ui/components/combo_box.py index 80defb967..38e5c9b28 100644 --- a/plugins/ui/src/deephaven/ui/components/combo_box.py +++ b/plugins/ui/src/deephaven/ui/components/combo_box.py @@ -29,7 +29,7 @@ from .item_table_source import ItemTableSource from ..elements import BaseElement, Element from .._internal.utils import create_props, unpack_item_table_source -from ..types import Key +from ..types import Key, Undefined, UNDEFINED from .basic import component_element ComboBoxElement = BaseElement @@ -45,88 +45,88 @@ def combo_box( *children: Item | SectionElement | Table | PartitionedTable | ItemTableSource, - menu_trigger: MenuTriggerAction | None = "input", - is_quiet: bool | None = None, - align: Align | None = "end", - direction: MenuDirection | None = "bottom", - loading_state: LoadingState | None = None, + menu_trigger: MenuTriggerAction | Undefined = "input", + is_quiet: bool | Undefined = UNDEFINED, + align: Align | Undefined = "end", + direction: MenuDirection | Undefined = "bottom", + loading_state: LoadingState | Undefined = UNDEFINED, should_flip: bool = True, - menu_width: DimensionValue | None = None, - form_value: FormValue | None = "text", - should_focus_wrap: bool | None = None, - input_value: str | None = None, - default_input_value: str | None = None, - allows_custom_value: bool | None = None, - disabled_keys: list[Key] | None = None, - selected_key: Key | None = None, - default_selected_key: Key | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - is_required: bool | None = None, + menu_width: DimensionValue | Undefined = UNDEFINED, + form_value: FormValue | Undefined = "text", + should_focus_wrap: bool | Undefined = UNDEFINED, + input_value: str | Undefined = UNDEFINED, + default_input_value: str | Undefined = UNDEFINED, + allows_custom_value: bool | Undefined = UNDEFINED, + disabled_keys: list[Key] | Undefined = UNDEFINED, + selected_key: Key | Undefined = UNDEFINED, + default_selected_key: Key | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, validation_behavior: ValidationBehavior = "aria", - auto_focus: bool | None = None, - label: Element | None = None, - description: Element | None = None, - error_message: Element | None = None, - name: str | None = None, - validation_state: ValidationState | None = None, + auto_focus: bool | Undefined = UNDEFINED, + label: Element | Undefined = UNDEFINED, + description: Element | Undefined = UNDEFINED, + error_message: Element | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + validation_state: ValidationState | Undefined = UNDEFINED, label_position: LabelPosition = "top", - label_align: Alignment | None = None, - necessity_indicator: NecessityIndicator | None = None, - contextual_help: Element | None = None, - on_open_change: Callable[[bool, MenuTriggerAction], None] | None = None, - on_selection_change: Callable[[Key], None] | None = None, - on_change: Callable[[Key], None] | None = None, - on_input_change: Callable[[str], None] | None = None, - on_focus: Callable[[FocusEventCallable], None] | None = None, - on_blur: Callable[[FocusEventCallable], None] | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: Callable[[KeyboardEventCallable], None] | None = None, - on_key_up: Callable[[KeyboardEventCallable], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + label_align: Alignment | Undefined = UNDEFINED, + necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, + contextual_help: Element | Undefined = UNDEFINED, + on_open_change: Callable[[bool, MenuTriggerAction], None] | Undefined = UNDEFINED, + on_selection_change: Callable[[Key], None] | Undefined = UNDEFINED, + on_change: Callable[[Key], None] | Undefined = UNDEFINED, + on_input_change: Callable[[str], None] | Undefined = UNDEFINED, + on_focus: Callable[[FocusEventCallable], None] | Undefined = UNDEFINED, + on_blur: Callable[[FocusEventCallable], None] | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: Callable[[KeyboardEventCallable], None] | Undefined = UNDEFINED, + on_key_up: Callable[[KeyboardEventCallable], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> ComboBoxElement: """ A combo box that can be used to search or select from a list. Children should be one of five types: diff --git a/plugins/ui/src/deephaven/ui/components/content.py b/plugins/ui/src/deephaven/ui/components/content.py index b3d4bc0c5..1985dbe05 100644 --- a/plugins/ui/src/deephaven/ui/components/content.py +++ b/plugins/ui/src/deephaven/ui/components/content.py @@ -11,50 +11,51 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def content( *children: Any, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Content represents the primary content within a Spectrum container. diff --git a/plugins/ui/src/deephaven/ui/components/contextual_help.py b/plugins/ui/src/deephaven/ui/components/contextual_help.py index d9669d7b6..939ea080d 100644 --- a/plugins/ui/src/deephaven/ui/components/contextual_help.py +++ b/plugins/ui/src/deephaven/ui/components/contextual_help.py @@ -14,66 +14,67 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def contextual_help( heading: Any, content: Any, - footer: Any = None, + footer: Any = UNDEFINED, *, - variant: ContextualHelperVariant | None = "help", - placement: Placement | None = "bottom start", - is_open: bool | None = None, - default_open: bool | None = None, - container_padding: float | None = None, - offset: float | None = None, - cross_offset: float | None = None, - should_flip: bool | None = None, - on_open_change: Callable[[bool], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + variant: ContextualHelperVariant | Undefined = "help", + placement: Placement | Undefined = "bottom start", + is_open: bool | Undefined = UNDEFINED, + default_open: bool | Undefined = UNDEFINED, + container_padding: float | Undefined = UNDEFINED, + offset: float | Undefined = UNDEFINED, + cross_offset: float | Undefined = UNDEFINED, + should_flip: bool | Undefined = UNDEFINED, + on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ A contextual help is a quiet action button that triggers an informational popover. diff --git a/plugins/ui/src/deephaven/ui/components/date_field.py b/plugins/ui/src/deephaven/ui/components/date_field.py index b24451fdb..d33b6cee1 100644 --- a/plugins/ui/src/deephaven/ui/components/date_field.py +++ b/plugins/ui/src/deephaven/ui/components/date_field.py @@ -25,7 +25,7 @@ create_props, convert_date_props, ) -from ..types import Date, Granularity +from ..types import Date, Granularity, Undefined, UNDEFINED from .basic import component_element from .make_component import make_component from deephaven.time import dh_now @@ -75,87 +75,87 @@ def _convert_date_field_props( @make_component def date_field( - placeholder_value: Date | None = dh_now(), - value: Date | None = None, - default_value: Date | None = None, - min_value: Date | None = None, - max_value: Date | None = None, + placeholder_value: Date | Undefined = dh_now(), + value: Date | Undefined = UNDEFINED, + default_value: Date | Undefined = UNDEFINED, + min_value: Date | Undefined = UNDEFINED, + max_value: Date | Undefined = UNDEFINED, # TODO (issue # 698) we need to implement unavailable_values - # unavailable_values: Sequence[Date] | None = None, - granularity: Granularity | None = None, - hour_cycle: HourCycle | None = None, + # unavailable_values: Sequence[Date] | Undefined = UNDEFINED, + granularity: Granularity | Undefined = UNDEFINED, + hour_cycle: HourCycle | Undefined = UNDEFINED, hide_time_zone: bool = False, - should_force_leading_zeros: bool | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - is_required: bool | None = None, - validation_behavior: ValidationBehavior | None = None, - auto_focus: bool | None = None, - label: Element | None = None, - description: Element | None = None, - error_message: Element | None = None, - is_open: bool | None = None, - default_open: bool | None = None, - name: str | None = None, - is_quiet: bool | None = None, - show_format_help_text: bool | None = None, - label_position: LabelPosition | None = None, - label_align: Alignment | None = None, - necessity_indicator: NecessityIndicator | None = None, - contextual_help: Element | None = None, - validation_state: ValidationState | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - on_open_change: Callable[[bool], None] | None = None, - on_change: Callable[[Date], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_pressed: AriaPressed | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + should_force_leading_zeros: bool | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, + validation_behavior: ValidationBehavior | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + label: Element | Undefined = UNDEFINED, + description: Element | Undefined = UNDEFINED, + error_message: Element | Undefined = UNDEFINED, + is_open: bool | Undefined = UNDEFINED, + default_open: bool | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + show_format_help_text: bool | Undefined = UNDEFINED, + label_position: LabelPosition | Undefined = UNDEFINED, + label_align: Alignment | Undefined = UNDEFINED, + necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, + contextual_help: Element | Undefined = UNDEFINED, + validation_state: ValidationState | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_change: Callable[[Date], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_pressed: AriaPressed | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> DateFieldElement: """ A date field allows the user to select a date. diff --git a/plugins/ui/src/deephaven/ui/components/date_picker.py b/plugins/ui/src/deephaven/ui/components/date_picker.py index 1763f8c8b..5e31675df 100644 --- a/plugins/ui/src/deephaven/ui/components/date_picker.py +++ b/plugins/ui/src/deephaven/ui/components/date_picker.py @@ -28,7 +28,7 @@ convert_date_props, convert_list_prop, ) -from ..types import Date, Granularity +from ..types import Date, Granularity, Undefined, UNDEFINED from .basic import component_element from .make_component import make_component from deephaven.time import dh_now @@ -79,90 +79,90 @@ def _convert_date_picker_props( @make_component def date_picker( - placeholder_value: Date | None = dh_now(), - value: Date | None = None, - default_value: Date | None = None, - min_value: Date | None = None, - max_value: Date | None = None, + placeholder_value: Date | Undefined = dh_now(), + value: Date | Undefined = UNDEFINED, + default_value: Date | Undefined = UNDEFINED, + min_value: Date | Undefined = UNDEFINED, + max_value: Date | Undefined = UNDEFINED, # TODO (issue # 698) we need to implement unavailable_values - # unavailable_values: Sequence[Date] | None = None, - granularity: Granularity | None = None, - page_behavior: PageBehavior | None = None, - hour_cycle: HourCycle | None = None, + # unavailable_values: Sequence[Date] | Undefined = UNDEFINED, + granularity: Granularity | Undefined = UNDEFINED, + page_behavior: PageBehavior | Undefined = UNDEFINED, + hour_cycle: HourCycle | Undefined = UNDEFINED, hide_time_zone: bool = False, - should_force_leading_zeros: bool | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - is_required: bool | None = None, - validation_behavior: ValidationBehavior | None = None, - auto_focus: bool | None = None, - label: Element | None = None, - description: Element | None = None, - error_message: Element | None = None, - is_open: bool | None = None, - default_open: bool | None = None, - name: str | None = None, - max_visible_months: int | None = None, - should_flip: bool | None = None, - is_quiet: bool | None = None, - show_format_help_text: bool | None = None, - label_position: LabelPosition | None = None, - label_align: Alignment | None = None, - necessity_indicator: NecessityIndicator | None = None, - contextual_help: Element | None = None, - validation_state: ValidationState | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - on_open_change: Callable[[bool], None] | None = None, - on_change: Callable[[Date], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_pressed: AriaPressed | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + should_force_leading_zeros: bool | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, + validation_behavior: ValidationBehavior | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + label: Element | Undefined = UNDEFINED, + description: Element | Undefined = UNDEFINED, + error_message: Element | Undefined = UNDEFINED, + is_open: bool | Undefined = UNDEFINED, + default_open: bool | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + max_visible_months: int | Undefined = UNDEFINED, + should_flip: bool | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + show_format_help_text: bool | Undefined = UNDEFINED, + label_position: LabelPosition | Undefined = UNDEFINED, + label_align: Alignment | Undefined = UNDEFINED, + necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, + contextual_help: Element | Undefined = UNDEFINED, + validation_state: ValidationState | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_change: Callable[[Date], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_pressed: AriaPressed | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> DatePickerElement: """ A date picker allows the user to select a date. diff --git a/plugins/ui/src/deephaven/ui/components/date_range_picker.py b/plugins/ui/src/deephaven/ui/components/date_range_picker.py index 86768abbc..567949c9d 100644 --- a/plugins/ui/src/deephaven/ui/components/date_range_picker.py +++ b/plugins/ui/src/deephaven/ui/components/date_range_picker.py @@ -28,7 +28,7 @@ convert_date_props, convert_list_prop, ) -from ..types import Date, Granularity, DateRange +from ..types import Date, Granularity, DateRange, Undefined, UNDEFINED from .basic import component_element from .make_component import make_component from deephaven.time import dh_now @@ -77,92 +77,92 @@ def _convert_date_range_picker_props( @make_component def date_range_picker( - placeholder_value: Date | None = dh_now(), - value: DateRange | None = None, - default_value: DateRange | None = None, - min_value: Date | None = None, - max_value: Date | None = None, + placeholder_value: Date | Undefined = dh_now(), + value: DateRange | Undefined = UNDEFINED, + default_value: DateRange | Undefined = UNDEFINED, + min_value: Date | Undefined = UNDEFINED, + max_value: Date | Undefined = UNDEFINED, # TODO (issue # 698) we need to implement unavailable_values - # unavailable_values: Sequence[Date] | None = None, - granularity: Granularity | None = None, - page_behavior: PageBehavior | None = None, - hour_cycle: HourCycle | None = None, + # unavailable_values: Sequence[Date] | Undefined = UNDEFINED, + granularity: Granularity | Undefined = UNDEFINED, + page_behavior: PageBehavior | Undefined = UNDEFINED, + hour_cycle: HourCycle | Undefined = UNDEFINED, hide_time_zone: bool = False, - should_force_leading_zeros: bool | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - is_required: bool | None = None, - validation_behavior: ValidationBehavior | None = None, - auto_focus: bool | None = None, - label: Element | None = None, - description: Element | None = None, - error_message: Element | None = None, - is_open: bool | None = None, - default_open: bool | None = None, - allows_non_contiguous_ranges: bool | None = None, - start_name: str | None = None, - end_name: str | None = None, - max_visible_months: int | None = None, - should_flip: bool | None = None, - is_quiet: bool | None = None, - show_format_help_text: bool | None = None, - label_position: LabelPosition | None = None, - label_align: Alignment | None = None, - necessity_indicator: NecessityIndicator | None = None, - contextual_help: Element | None = None, - validation_state: ValidationState | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - on_open_change: Callable[[bool], None] | None = None, - on_change: Callable[[DateRange], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_pressed: AriaPressed | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + should_force_leading_zeros: bool | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, + validation_behavior: ValidationBehavior | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + label: Element | Undefined = UNDEFINED, + description: Element | Undefined = UNDEFINED, + error_message: Element | Undefined = UNDEFINED, + is_open: bool | Undefined = UNDEFINED, + default_open: bool | Undefined = UNDEFINED, + allows_non_contiguous_ranges: bool | Undefined = UNDEFINED, + start_name: str | Undefined = UNDEFINED, + end_name: str | Undefined = UNDEFINED, + max_visible_months: int | Undefined = UNDEFINED, + should_flip: bool | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + show_format_help_text: bool | Undefined = UNDEFINED, + label_position: LabelPosition | Undefined = UNDEFINED, + label_align: Alignment | Undefined = UNDEFINED, + necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, + contextual_help: Element | Undefined = UNDEFINED, + validation_state: ValidationState | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_change: Callable[[DateRange], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_pressed: AriaPressed | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> DatePickerElement: """ A date range picker allows the user to select a range of dates. diff --git a/plugins/ui/src/deephaven/ui/components/dialog.py b/plugins/ui/src/deephaven/ui/components/dialog.py index d118c88c6..5bd54723a 100644 --- a/plugins/ui/src/deephaven/ui/components/dialog.py +++ b/plugins/ui/src/deephaven/ui/components/dialog.py @@ -15,6 +15,7 @@ from ..elements import Element from .._internal.utils import create_props +from ..types import Undefined, UNDEFINED from .basic import component_element DialogElement = Element @@ -22,54 +23,54 @@ def dialog( *children: Any, - size: DialogSize | None = None, - is_dismissable: bool | None = None, - on_dismiss: Callable[[], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_pressed: AriaPressed | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + size: DialogSize | Undefined = UNDEFINED, + is_dismissable: bool | Undefined = UNDEFINED, + on_dismiss: Callable[[], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_pressed: AriaPressed | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> DialogElement: """ A dialog is a window containing contextual information, tasks, or workflows that appear over the user interface. diff --git a/plugins/ui/src/deephaven/ui/components/dialog_trigger.py b/plugins/ui/src/deephaven/ui/components/dialog_trigger.py index 9544e22d8..c98fde9ff 100644 --- a/plugins/ui/src/deephaven/ui/components/dialog_trigger.py +++ b/plugins/ui/src/deephaven/ui/components/dialog_trigger.py @@ -7,25 +7,26 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED from .._internal.utils import create_props def dialog_trigger( *children: Element, - type: DialogTriggerType | None = "modal", - mobile_type: DialogTriggerMobileType | None = None, - placement: Placement | None = "bottom", - is_open: bool | None = None, - default_open: bool | None = None, - container_padding: float | None = None, - offset: float | None = None, - cross_offset: float | None = None, - should_flip: bool | None = None, - hide_arrow: bool | None = None, - is_dismissable: bool | None = None, - is_keyboard_dismiss_disabled: bool | None = None, - on_open_change: Callable[[bool], None] | None = None, - key: str | None = None, + type: DialogTriggerType | Undefined = "modal", + mobile_type: DialogTriggerMobileType | Undefined = UNDEFINED, + placement: Placement | Undefined = "bottom", + is_open: bool | Undefined = UNDEFINED, + default_open: bool | Undefined = UNDEFINED, + container_padding: float | Undefined = UNDEFINED, + offset: float | Undefined = UNDEFINED, + cross_offset: float | Undefined = UNDEFINED, + should_flip: bool | Undefined = UNDEFINED, + hide_arrow: bool | Undefined = UNDEFINED, + is_dismissable: bool | Undefined = UNDEFINED, + is_keyboard_dismiss_disabled: bool | Undefined = UNDEFINED, + on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ A dialog_trigger serves as a wrapper around a dialog and its associated trigger. diff --git a/plugins/ui/src/deephaven/ui/components/flex.py b/plugins/ui/src/deephaven/ui/components/flex.py index 635085fb2..49fbc12b6 100644 --- a/plugins/ui/src/deephaven/ui/components/flex.py +++ b/plugins/ui/src/deephaven/ui/components/flex.py @@ -2,6 +2,7 @@ from typing import Any from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED from .types import ( LayoutFlex, Direction, @@ -19,54 +20,54 @@ def flex( *children: Any, - direction: Direction | None = None, - wrap: Wrap | None = None, - justify_content: JustifyContent | None = None, - align_content: AlignContent | None = None, - align_items: AlignItems | None = None, - gap: DimensionValue | None = "size-100", - column_gap: DimensionValue | None = None, - row_gap: DimensionValue | None = None, + direction: Direction | Undefined = UNDEFINED, + wrap: Wrap | Undefined = UNDEFINED, + justify_content: JustifyContent | Undefined = UNDEFINED, + align_content: AlignContent | Undefined = UNDEFINED, + align_items: AlignItems | Undefined = UNDEFINED, + gap: DimensionValue | Undefined = "size-100", + column_gap: DimensionValue | Undefined = UNDEFINED, + row_gap: DimensionValue | Undefined = UNDEFINED, flex: LayoutFlex = "auto", - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Base Flex component for laying out children in a flexbox. diff --git a/plugins/ui/src/deephaven/ui/components/form.py b/plugins/ui/src/deephaven/ui/components/form.py index 57c79facd..63b685609 100644 --- a/plugins/ui/src/deephaven/ui/components/form.py +++ b/plugins/ui/src/deephaven/ui/components/form.py @@ -20,75 +20,76 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def form( *children: Any, - is_quiet: bool | None = None, - is_emphasized: bool | None = None, - is_disabled: bool | None = None, - is_required: bool | None = None, - is_read_only: bool | None = None, - validation_state: ValidationState | None = None, - validation_behavior: ValidationBehavior | None = "aria", - validation_errors: Dict[str, str | List[str]] | None = None, - action: str | None = None, - enc_type: EncodingType | None = None, - method: HTTPMethods | None = None, - target: Target | None = None, - auto_complete: AutoCompleteModes | None = None, - auto_capitalize: AutoCapitalizeModes | None = None, + is_quiet: bool | Undefined = UNDEFINED, + is_emphasized: bool | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + validation_state: ValidationState | Undefined = UNDEFINED, + validation_behavior: ValidationBehavior | Undefined = "aria", + validation_errors: Dict[str, str | List[str]] | Undefined = UNDEFINED, + action: str | Undefined = UNDEFINED, + enc_type: EncodingType | Undefined = UNDEFINED, + method: HTTPMethods | Undefined = UNDEFINED, + target: Target | Undefined = UNDEFINED, + auto_complete: AutoCompleteModes | Undefined = UNDEFINED, + auto_capitalize: AutoCapitalizeModes | Undefined = UNDEFINED, label_position: LabelPosition = "top", - label_align: Alignment | None = None, - necessity_indicator: NecessityIndicator | None = None, - on_submit: Callable[[dict[str, str]], None] | None = None, - on_reset: Callable[[dict[str, str]], None] | None = None, - on_invalid: Callable[[dict[str, str]], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - overflow: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + label_align: Alignment | Undefined = UNDEFINED, + necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, + on_submit: Callable[[dict[str, str]], None] | Undefined = UNDEFINED, + on_reset: Callable[[dict[str, str]], None] | Undefined = UNDEFINED, + on_invalid: Callable[[dict[str, str]], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + overflow: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Forms allow users to enter data that can be submitted while providing alignment and styling for form fields diff --git a/plugins/ui/src/deephaven/ui/components/fragment.py b/plugins/ui/src/deephaven/ui/components/fragment.py index 1086407a0..f76e4f0dd 100644 --- a/plugins/ui/src/deephaven/ui/components/fragment.py +++ b/plugins/ui/src/deephaven/ui/components/fragment.py @@ -2,9 +2,10 @@ from typing import Any from .basic import component_element +from ..types import Undefined, UNDEFINED -def fragment(*children: Any, key: str | None = None): +def fragment(*children: Any, key: str | Undefined = UNDEFINED): """ A React.Fragment: https://react.dev/reference/react/Fragment. Used to group elements together without a wrapper node. diff --git a/plugins/ui/src/deephaven/ui/components/grid.py b/plugins/ui/src/deephaven/ui/components/grid.py index c4eb63cfb..99a8c1c25 100644 --- a/plugins/ui/src/deephaven/ui/components/grid.py +++ b/plugins/ui/src/deephaven/ui/components/grid.py @@ -16,63 +16,64 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def grid( *children: Any, - areas: list[str] | None = None, - rows: str | list[DimensionValue] | None = None, - columns: str | list[DimensionValue] | None = None, - auto_columns: DimensionValue | None = None, - auto_rows: DimensionValue | None = None, - auto_flow: GridFlow | None = None, - justify_items: JustifyItems | None = None, + areas: list[str] | Undefined = UNDEFINED, + rows: str | list[DimensionValue] | Undefined = UNDEFINED, + columns: str | list[DimensionValue] | Undefined = UNDEFINED, + auto_columns: DimensionValue | Undefined = UNDEFINED, + auto_rows: DimensionValue | Undefined = UNDEFINED, + auto_flow: GridFlow | Undefined = UNDEFINED, + justify_items: JustifyItems | Undefined = UNDEFINED, justify_content: JustifyContent = "stretch", align_content: AlignContent = "start", align_items: AlignItems = "stretch", - gap: DimensionValue | None = "size-100", - column_gap: DimensionValue | None = None, - row_gap: DimensionValue | None = None, - flex: LayoutFlex | None = "auto", - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + gap: DimensionValue | Undefined = "size-100", + column_gap: DimensionValue | Undefined = UNDEFINED, + row_gap: DimensionValue | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = "auto", + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ A layout container using CSS grid. Supports Spectrum dimensions as values to ensure consistent and adaptive sizing and spacing. diff --git a/plugins/ui/src/deephaven/ui/components/heading.py b/plugins/ui/src/deephaven/ui/components/heading.py index 947efe6f2..f7a51bf7e 100644 --- a/plugins/ui/src/deephaven/ui/components/heading.py +++ b/plugins/ui/src/deephaven/ui/components/heading.py @@ -13,52 +13,53 @@ from ..types import Color from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def heading( *children: Any, level: HeadingLevel = 3, - color: Color | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + color: Color | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ A layout container using CSS grid. Supports Spectrum dimensions as values to ensure consistent and adaptive sizing and spacing. diff --git a/plugins/ui/src/deephaven/ui/components/icon.py b/plugins/ui/src/deephaven/ui/components/icon.py index a05e8c882..43a9f2416 100644 --- a/plugins/ui/src/deephaven/ui/components/icon.py +++ b/plugins/ui/src/deephaven/ui/components/icon.py @@ -1,5 +1,6 @@ from __future__ import annotations from ..elements import BaseElement, Element +from ..types import Undefined, UNDEFINED from typing import Any from .types import ( AlignSelf, @@ -18,54 +19,54 @@ def icon( name: IconTypes, - size: IconSize | None = None, - color: IconColor | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, + size: IconSize | Undefined = UNDEFINED, + color: IconColor | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, slot: str = "icon", - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_hidden: bool | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_hidden: bool | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Get a Deephaven icon by name. diff --git a/plugins/ui/src/deephaven/ui/components/illustrated_message.py b/plugins/ui/src/deephaven/ui/components/illustrated_message.py index 4e284c6d7..e5d47f494 100644 --- a/plugins/ui/src/deephaven/ui/components/illustrated_message.py +++ b/plugins/ui/src/deephaven/ui/components/illustrated_message.py @@ -10,50 +10,51 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def illustrated_message( *children: Any, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ An IllustratedMessage displays an illustration and a message, usually for an empty state or an error page. diff --git a/plugins/ui/src/deephaven/ui/components/image.py b/plugins/ui/src/deephaven/ui/components/image.py index 99a75d81e..d3b676c55 100644 --- a/plugins/ui/src/deephaven/ui/components/image.py +++ b/plugins/ui/src/deephaven/ui/components/image.py @@ -2,6 +2,7 @@ from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED from typing import Callable from .types import ( AlignSelf, @@ -16,50 +17,50 @@ def image( src: str, - alt: str | None = None, + alt: str | Undefined = UNDEFINED, object_fit: ObjectFit = "fill", - on_error: Callable[[], None] | None = None, - on_load: Callable[[], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + on_error: Callable[[], None] | Undefined = UNDEFINED, + on_load: Callable[[], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Image is used to insert and display an image within a component. diff --git a/plugins/ui/src/deephaven/ui/components/item.py b/plugins/ui/src/deephaven/ui/components/item.py index b12aa953a..8bef939a8 100644 --- a/plugins/ui/src/deephaven/ui/components/item.py +++ b/plugins/ui/src/deephaven/ui/components/item.py @@ -2,7 +2,7 @@ from typing import Any, Union, List from ..elements import BaseElement -from ..types import Stringable +from ..types import Stringable, Undefined, UNDEFINED from .._internal.utils import create_props from .basic import component_element @@ -13,10 +13,10 @@ def item( *children: Stringable, - title: str | None = None, - text_value: str | None = None, - aria_label: str | None = None, - key: str | None = None, + title: str | Undefined = UNDEFINED, + text_value: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, **props: Any, ) -> ItemElement: """ diff --git a/plugins/ui/src/deephaven/ui/components/item_table_source.py b/plugins/ui/src/deephaven/ui/components/item_table_source.py index c26947ed6..31e1e4101 100644 --- a/plugins/ui/src/deephaven/ui/components/item_table_source.py +++ b/plugins/ui/src/deephaven/ui/components/item_table_source.py @@ -8,7 +8,7 @@ from .list_action_group import ListActionGroupElement from .list_action_menu import ListActionMenuElement from ..elements import Element -from ..types import ColumnName, Stringable +from ..types import ColumnName, Stringable, Undefined, UNDEFINED ListViewItem = Union[Stringable, ItemElement] ListViewElement = Element @@ -16,23 +16,23 @@ class ItemTableSource(TypedDict): table: Table | PartitionedTable - key_column: ColumnName | None - label_column: ColumnName | None - description_column: ColumnName | None - icon_column: ColumnName | None - title_column: ColumnName | None - actions: ListActionGroupElement | ListActionMenuElement | None + key_column: ColumnName | Undefined + label_column: ColumnName | Undefined + description_column: ColumnName | Undefined + icon_column: ColumnName | Undefined + title_column: ColumnName | Undefined + actions: ListActionGroupElement | ListActionMenuElement | Undefined def item_table_source( table: Table | PartitionedTable, - key_column: ColumnName | None = None, - label_column: ColumnName | None = None, - description_column: ColumnName | None = None, - icon_column: ColumnName | None = None, - title_column: ColumnName | None = None, - actions: ListActionGroupElement | ListActionMenuElement | None = None, - key: str | None = None, + key_column: ColumnName | Undefined = UNDEFINED, + label_column: ColumnName | Undefined = UNDEFINED, + description_column: ColumnName | Undefined = UNDEFINED, + icon_column: ColumnName | Undefined = UNDEFINED, + title_column: ColumnName | Undefined = UNDEFINED, + actions: ListActionGroupElement | ListActionMenuElement | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> ItemTableSource: """ An item table source wraps a Table or PartitionedTable to provide additional information for diff --git a/plugins/ui/src/deephaven/ui/components/list_action_group.py b/plugins/ui/src/deephaven/ui/components/list_action_group.py index 6293c9a67..b82fc68df 100644 --- a/plugins/ui/src/deephaven/ui/components/list_action_group.py +++ b/plugins/ui/src/deephaven/ui/components/list_action_group.py @@ -12,6 +12,8 @@ SelectedKeys, SelectionMode, Selection, + Undefined, + UNDEFINED, ) from .types import ( # Events @@ -33,67 +35,67 @@ def list_action_group( *children: Item, - on_action: Callable[[ActionKey, Key], None] | None = None, - on_change: Callable[[Selection, Key], None] | None = None, - is_emphasized: bool | None = None, - density: ActionGroupDensity | None = "regular", - is_justified: bool | None = None, - is_quiet: bool | None = None, - static_color: StaticColor | None = None, - overflow_mode: OverflowMode | None = "wrap", - button_label_behavior: ButtonLabelBehavior | None = "show", - summary_icon: Element | None = None, - orientation: Orientation | None = "horizontal", - disabled_keys: Iterable[str] | None = None, - is_disabled: bool | None = None, - selection_mode: SelectionMode | None = None, - disallow_empty_selection: bool | None = None, - selected_keys: SelectedKeys | Iterable[str] | None = None, - default_selected_keys: SelectedKeys | Iterable[str] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + on_action: Callable[[ActionKey, Key], None] | Undefined = UNDEFINED, + on_change: Callable[[Selection, Key], None] | Undefined = UNDEFINED, + is_emphasized: bool | Undefined = UNDEFINED, + density: ActionGroupDensity | Undefined = "regular", + is_justified: bool | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + static_color: StaticColor | Undefined = UNDEFINED, + overflow_mode: OverflowMode | Undefined = "wrap", + button_label_behavior: ButtonLabelBehavior | Undefined = "show", + summary_icon: Element | Undefined = UNDEFINED, + orientation: Orientation | Undefined = "horizontal", + disabled_keys: Iterable[str] | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + selection_mode: SelectionMode | Undefined = UNDEFINED, + disallow_empty_selection: bool | Undefined = UNDEFINED, + selected_keys: SelectedKeys | Iterable[str] | Undefined = UNDEFINED, + default_selected_keys: SelectedKeys | Iterable[str] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> ListActionGroupElement: """ A group of action buttons that can be used to create a list of actions. diff --git a/plugins/ui/src/deephaven/ui/components/list_action_menu.py b/plugins/ui/src/deephaven/ui/components/list_action_menu.py index 899bedc49..e9f69ebf5 100644 --- a/plugins/ui/src/deephaven/ui/components/list_action_menu.py +++ b/plugins/ui/src/deephaven/ui/components/list_action_menu.py @@ -6,7 +6,7 @@ from .basic import component_element from .item import Item from ..elements import Element -from ..types import Key, ActionKey, ActionMenuDirection +from ..types import Key, ActionKey, ActionMenuDirection, Undefined, UNDEFINED from .types import ( # Events TriggerType, @@ -25,63 +25,63 @@ def list_action_menu( *children: Item, - on_action: Callable[[ActionKey, Key], None] | None = None, - on_open_change: Callable[[bool, Key], None] | None = None, - is_disabled: bool | None = None, - is_quiet: bool | None = None, - auto_focus: bool | None = None, - disabled_keys: Iterable[Key] | None = None, - align: Alignment | None = "start", - direction: ActionMenuDirection | None = "bottom", - should_flip: bool | None = True, - close_on_select: bool | None = True, - trigger: TriggerType | None = "press", - is_open: bool | None = None, - default_open: bool | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + on_action: Callable[[ActionKey, Key], None] | Undefined = UNDEFINED, + on_open_change: Callable[[bool, Key], None] | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + disabled_keys: Iterable[Key] | Undefined = UNDEFINED, + align: Alignment | Undefined = "start", + direction: ActionMenuDirection | Undefined = "bottom", + should_flip: bool | Undefined = True, + close_on_select: bool | Undefined = True, + trigger: TriggerType | Undefined = "press", + is_open: bool | Undefined = UNDEFINED, + default_open: bool | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> ListActionMenuElement: """ A menu of action buttons that can be used to create a list of actions. diff --git a/plugins/ui/src/deephaven/ui/components/list_view.py b/plugins/ui/src/deephaven/ui/components/list_view.py index a7956ed00..8a53299ac 100644 --- a/plugins/ui/src/deephaven/ui/components/list_view.py +++ b/plugins/ui/src/deephaven/ui/components/list_view.py @@ -16,6 +16,8 @@ SelectionMode, SelectionStyle, Key, + Undefined, + UNDEFINED, ) from .types import ( LoadingState, @@ -41,65 +43,65 @@ def list_view( *children: Item | Table | ItemTableSource, - density: ListViewDensity | None = "COMPACT", - is_quiet: bool | None = None, - loading_state: LoadingState | None = None, + density: ListViewDensity | Undefined = "COMPACT", + is_quiet: bool | Undefined = UNDEFINED, + loading_state: LoadingState | Undefined = UNDEFINED, overflow_mode: ListViewOverflowMode = "truncate", - render_empty_state: Element | None = None, - disabled_behavior: DisabledBehavior | None = None, - disabled_keys: Selection | None = None, - selection_mode: SelectionMode | None = "MULTIPLE", - disallow_empty_selection: bool | None = None, - selected_keys: Selection | None = None, - default_selected_keys: Selection | None = None, - selection_style: SelectionStyle | None = None, - on_action: Callable[[Key, str], None] | None = None, - on_selection_change: Callable[[Selection], None] | None = None, - on_change: Callable[[Selection], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_column: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + render_empty_state: Element | Undefined = UNDEFINED, + disabled_behavior: DisabledBehavior | Undefined = UNDEFINED, + disabled_keys: Selection | Undefined = UNDEFINED, + selection_mode: SelectionMode | Undefined = "MULTIPLE", + disallow_empty_selection: bool | Undefined = UNDEFINED, + selected_keys: Selection | Undefined = UNDEFINED, + default_selected_keys: Selection | Undefined = UNDEFINED, + selection_style: SelectionStyle | Undefined = UNDEFINED, + on_action: Callable[[Key, str], None] | Undefined = UNDEFINED, + on_selection_change: Callable[[Selection], None] | Undefined = UNDEFINED, + on_change: Callable[[Selection], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> ListViewElement: """ A list view that can be used to create a list of items. Children should be one of three types: diff --git a/plugins/ui/src/deephaven/ui/components/make_component.py b/plugins/ui/src/deephaven/ui/components/make_component.py index 4d045b349..dce902659 100644 --- a/plugins/ui/src/deephaven/ui/components/make_component.py +++ b/plugins/ui/src/deephaven/ui/components/make_component.py @@ -4,6 +4,7 @@ from typing import Any, Callable from .._internal import get_component_qualname from ..elements import FunctionElement +from ..types import Undefined, UNDEFINED logger = logging.getLogger(__name__) @@ -18,7 +19,9 @@ def make_component(func: Callable[..., Any]): """ @functools.wraps(func) - def make_component_node(*args: Any, key: str | None = None, **kwargs: Any): + def make_component_node( + *args: Any, key: str | Undefined = UNDEFINED, **kwargs: Any + ): component_type = get_component_qualname(func) return FunctionElement(component_type, lambda: func(*args, **kwargs), key=key) diff --git a/plugins/ui/src/deephaven/ui/components/number_field.py b/plugins/ui/src/deephaven/ui/components/number_field.py index 92f4adaf1..48560a51f 100644 --- a/plugins/ui/src/deephaven/ui/components/number_field.py +++ b/plugins/ui/src/deephaven/ui/components/number_field.py @@ -17,85 +17,86 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def number_field( - is_quiet: bool | None = None, - hide_stepper: bool | None = None, - decrement_aria_label: str | None = None, - increment_aria_label: str | None = None, - is_wheel_disabled: bool | None = None, - format_options: NumberFieldFormatOptions | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - is_required: bool | None = None, + is_quiet: bool | Undefined = UNDEFINED, + hide_stepper: bool | Undefined = UNDEFINED, + decrement_aria_label: str | Undefined = UNDEFINED, + increment_aria_label: str | Undefined = UNDEFINED, + is_wheel_disabled: bool | Undefined = UNDEFINED, + format_options: NumberFieldFormatOptions | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, # validation_behaviour, # omitted because validate is not implemented # validate, # omitted because it needs to return a ValidationError synchronously - auto_focus: bool | None = None, - value: float | None = None, - default_value: float | None = None, - min_value: float | None = None, - max_value: float | None = None, - step: float | None = None, - label: Any | None = None, - description: Any | None = None, - error_message: Any | None = None, - validation_state: TextFieldValidationState | None = None, - name: str | None = None, + auto_focus: bool | Undefined = UNDEFINED, + value: float | Undefined = UNDEFINED, + default_value: float | Undefined = UNDEFINED, + min_value: float | Undefined = UNDEFINED, + max_value: float | Undefined = UNDEFINED, + step: float | Undefined = UNDEFINED, + label: Any | Undefined = UNDEFINED, + description: Any | Undefined = UNDEFINED, + error_message: Any | Undefined = UNDEFINED, + validation_state: TextFieldValidationState | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, label_position: LabelPosition = "top", - label_align: Alignment | None = None, - necessity_indicator: NecessityIndicator | None = None, - contextual_help: Any | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - on_change: Callable[[float], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + label_align: Alignment | Undefined = UNDEFINED, + necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, + contextual_help: Any | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + on_change: Callable[[float], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, # missing properties that are clipboard or composition events ) -> Element: """ diff --git a/plugins/ui/src/deephaven/ui/components/panel.py b/plugins/ui/src/deephaven/ui/components/panel.py index 9e9f12429..d37b9bded 100644 --- a/plugins/ui/src/deephaven/ui/components/panel.py +++ b/plugins/ui/src/deephaven/ui/components/panel.py @@ -13,28 +13,29 @@ Overflow, ) from ..elements import Element +from ..types import Undefined, UNDEFINED def panel( *children: Any, - title: str | None = None, - direction: Direction | None = "column", - wrap: Wrap | None = None, - justify_content: JustifyContent | None = None, - align_content: AlignContent | None = None, - align_items: AlignItems | None = "start", - gap: DimensionValue | None = "size-100", - column_gap: DimensionValue | None = None, - row_gap: DimensionValue | None = None, - overflow: Overflow | None = "auto", - padding: DimensionValue | None = "size-100", - padding_top: DimensionValue | None = None, - padding_bottom: DimensionValue | None = None, - padding_start: DimensionValue | None = None, - padding_end: DimensionValue | None = None, - padding_x: DimensionValue | None = None, - padding_y: DimensionValue | None = None, - key: str | None = None, + title: str | Undefined = UNDEFINED, + direction: Direction | Undefined = "column", + wrap: Wrap | Undefined = UNDEFINED, + justify_content: JustifyContent | Undefined = UNDEFINED, + align_content: AlignContent | Undefined = UNDEFINED, + align_items: AlignItems | Undefined = "start", + gap: DimensionValue | Undefined = "size-100", + column_gap: DimensionValue | Undefined = UNDEFINED, + row_gap: DimensionValue | Undefined = UNDEFINED, + overflow: Overflow | Undefined = "auto", + padding: DimensionValue | Undefined = "size-100", + padding_top: DimensionValue | Undefined = UNDEFINED, + padding_bottom: DimensionValue | Undefined = UNDEFINED, + padding_start: DimensionValue | Undefined = UNDEFINED, + padding_end: DimensionValue | Undefined = UNDEFINED, + padding_x: DimensionValue | Undefined = UNDEFINED, + padding_y: DimensionValue | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, **props: Any, ) -> Element: """ diff --git a/plugins/ui/src/deephaven/ui/components/picker.py b/plugins/ui/src/deephaven/ui/components/picker.py index 1f3fa4471..508098702 100644 --- a/plugins/ui/src/deephaven/ui/components/picker.py +++ b/plugins/ui/src/deephaven/ui/components/picker.py @@ -8,7 +8,7 @@ from .item_table_source import ItemTableSource from ..elements import BaseElement, Element from .._internal.utils import create_props, unpack_item_table_source -from ..types import Key +from ..types import Key, Undefined, UNDEFINED from .types import ( AlignSelf, CSSProperties, @@ -38,84 +38,84 @@ def picker( *children: Item | SectionElement | Table | PartitionedTable | ItemTableSource, - default_selected_key: Key | None = None, - selected_key: Key | None = None, - on_selection_change: Callable[[Key], None] | None = None, - on_change: Callable[[Key], None] | None = None, - is_quiet: bool | None = None, + default_selected_key: Key | Undefined = UNDEFINED, + selected_key: Key | Undefined = UNDEFINED, + on_selection_change: Callable[[Key], None] | Undefined = UNDEFINED, + on_change: Callable[[Key], None] | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, align: Alignment = "start", direction: MenuDirection = "bottom", should_flip: bool = True, - menu_width: DimensionValue | None = None, - auto_focus: bool | None = None, - auto_complete: str | None = None, - name: str | None = None, - is_open: bool | None = None, - default_open: bool | None = None, - is_disabled: bool | None = None, - is_required: bool | None = None, - is_invalid: bool | None = None, - validation_behavior: ValidationBehavior | None = None, - description: Element | None = None, - error_message: Element | None = None, - label: Element | None = None, - placeholder: str | None = None, - is_loading: bool | None = None, + menu_width: DimensionValue | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + auto_complete: str | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + is_open: bool | Undefined = UNDEFINED, + default_open: bool | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, + is_invalid: bool | Undefined = UNDEFINED, + validation_behavior: ValidationBehavior | Undefined = UNDEFINED, + description: Element | Undefined = UNDEFINED, + error_message: Element | Undefined = UNDEFINED, + label: Element | Undefined = UNDEFINED, + placeholder: str | Undefined = UNDEFINED, + is_loading: bool | Undefined = UNDEFINED, label_position: LabelPosition = "top", - label_align: Alignment | None = None, - necessity_indicator: NecessityIndicator | None = None, - contextual_help: Element | None = None, - on_open_change: Callable[[bool], None] | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - exclude_from_tab_order: bool | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + label_align: Alignment | Undefined = UNDEFINED, + necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, + contextual_help: Element | Undefined = UNDEFINED, + on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + exclude_from_tab_order: bool | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> PickerElement: """ A picker that can be used to select from a list. Children should be one of five types: diff --git a/plugins/ui/src/deephaven/ui/components/progress_bar.py b/plugins/ui/src/deephaven/ui/components/progress_bar.py index ee2a7ef28..0dfe345db 100644 --- a/plugins/ui/src/deephaven/ui/components/progress_bar.py +++ b/plugins/ui/src/deephaven/ui/components/progress_bar.py @@ -17,71 +17,72 @@ from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED ProgressBarElement = Element def progress_bar( size: ProgressBarSize = "L", - static_color: StaticColor | None = None, + static_color: StaticColor | Undefined = UNDEFINED, label_position: LabelPosition = "top", - show_value_label: bool | None = None, - label: Element | None = None, + show_value_label: bool | Undefined = UNDEFINED, + label: Element | Undefined = UNDEFINED, # format_options, # omitted because need to connect it to Deephaven formatting options as well - value_label: Element | None = None, + value_label: Element | Undefined = UNDEFINED, value: float = 0, min_value: float = 0, max_value: float = 100, - is_indeterminate: bool | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - exclude_from_tab_order: bool | None = None, - aria_expanded: AriaExpanded | None = None, - aria_haspopup: AriaHasPopup | None = None, - aria_controls: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_pressed: AriaPressed | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + is_indeterminate: bool | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + exclude_from_tab_order: bool | Undefined = UNDEFINED, + aria_expanded: AriaExpanded | Undefined = UNDEFINED, + aria_haspopup: AriaHasPopup | Undefined = UNDEFINED, + aria_controls: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_pressed: AriaPressed | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> ProgressBarElement: """ ProgressBars show the progression of a system operation: downloading, uploading, processing, etc., in a visual way. They can represent either determinate or indeterminate progress. diff --git a/plugins/ui/src/deephaven/ui/components/progress_circle.py b/plugins/ui/src/deephaven/ui/components/progress_circle.py index c65fd159e..680dd51b4 100644 --- a/plugins/ui/src/deephaven/ui/components/progress_circle.py +++ b/plugins/ui/src/deephaven/ui/components/progress_circle.py @@ -19,66 +19,67 @@ from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED ProgressCircleElement = Element def progress_circle( size: ProgressCircleSize = "M", - static_color: StaticColor | None = None, - is_indeterminate: bool | None = None, + static_color: StaticColor | Undefined = UNDEFINED, + is_indeterminate: bool | Undefined = UNDEFINED, value: float = 0, min_value: float = 0, max_value: float = 100, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - exclude_from_tab_order: bool | None = None, - aria_expanded: AriaExpanded | None = None, - aria_haspopup: AriaHasPopup | None = None, - aria_controls: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_pressed: AriaPressed | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + exclude_from_tab_order: bool | Undefined = UNDEFINED, + aria_expanded: AriaExpanded | Undefined = UNDEFINED, + aria_haspopup: AriaHasPopup | Undefined = UNDEFINED, + aria_controls: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_pressed: AriaPressed | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> ProgressCircleElement: """ ProgressCircles show the progression of a system operation such as downloading, uploading, or processing, in a visual way. They can represent determinate or indeterminate progress. diff --git a/plugins/ui/src/deephaven/ui/components/radio.py b/plugins/ui/src/deephaven/ui/components/radio.py index 0c8b095f2..a71e5f55c 100644 --- a/plugins/ui/src/deephaven/ui/components/radio.py +++ b/plugins/ui/src/deephaven/ui/components/radio.py @@ -12,63 +12,64 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED from .._internal.utils import create_props def radio( *children, - value: str | None = None, - is_disabled: bool | None = None, - auto_focus: bool | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_column: str | None = None, - grid_row: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - min_width: DimensionValue | None = None, - max_width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelled_by: str | None = None, - aria_described_by: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + value: str | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelled_by: str | Undefined = UNDEFINED, + aria_described_by: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Radio buttons allow users to select a single option from a list of mutually diff --git a/plugins/ui/src/deephaven/ui/components/radio_group.py b/plugins/ui/src/deephaven/ui/components/radio_group.py index 2567fe9ce..9e395baa2 100644 --- a/plugins/ui/src/deephaven/ui/components/radio_group.py +++ b/plugins/ui/src/deephaven/ui/components/radio_group.py @@ -19,79 +19,80 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED from .._internal.utils import create_props def radio_group( *children: Any, - is_emphasized: bool | None = None, + is_emphasized: bool | Undefined = UNDEFINED, orientation: Orientation = "vertical", - value: str | None = None, - default_value: str | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - name: str | None = None, - is_required: bool | None = None, - is_invalid: bool | None = None, - validation_behavior: ValidationBehavior | None = None, + value: str | Undefined = UNDEFINED, + default_value: str | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, + is_invalid: bool | Undefined = UNDEFINED, + validation_behavior: ValidationBehavior | Undefined = UNDEFINED, # validate, # omitted because of synchronouse return - label: Any | None = None, - description: Any | None = None, - error_message: Any | None = None, + label: Any | Undefined = UNDEFINED, + description: Any | Undefined = UNDEFINED, + error_message: Any | Undefined = UNDEFINED, label_position: LabelPosition = "top", - label_align: Alignment | None = None, - necessity_indicator: NecessityIndicator | None = None, - contextual_help: Any | None = None, - show_error_icon: bool | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_change: Callable[[str], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - aria_errormessage: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + label_align: Alignment | Undefined = UNDEFINED, + necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, + contextual_help: Any | Undefined = UNDEFINED, + show_error_icon: bool | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_change: Callable[[str], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + aria_errormessage: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Radio buttons allow users to select a single option from a list of mutually diff --git a/plugins/ui/src/deephaven/ui/components/range_calendar.py b/plugins/ui/src/deephaven/ui/components/range_calendar.py index a3082fa83..ddb45e41a 100644 --- a/plugins/ui/src/deephaven/ui/components/range_calendar.py +++ b/plugins/ui/src/deephaven/ui/components/range_calendar.py @@ -15,7 +15,7 @@ from ..elements import Element from .._internal.utils import create_props, convert_date_props, wrap_local_date_callable -from ..types import Date, LocalDateConvertible, DateRange +from ..types import Date, LocalDateConvertible, DateRange, Undefined, UNDEFINED from .basic import component_element from .make_component import make_component from deephaven.time import dh_now @@ -73,66 +73,66 @@ def _convert_range_calendar_props( @make_component def range_calendar( - value: DateRange | None = None, - default_value: DateRange | None = None, - focused_value: Date | None = None, - default_focused_value: Date | None = None, - min_value: Date | None = None, - max_value: Date | None = None, - page_behavior: PageBehavior | None = None, - is_invalid: bool | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - auto_focus: bool | None = None, - error_message: Element | None = None, - visible_months: int | None = None, - on_focus_change: Callable[[LocalDateConvertible], None] | None = None, - on_change: Callable[[DateRange], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_pressed: AriaPressed | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + value: DateRange | Undefined = UNDEFINED, + default_value: DateRange | Undefined = UNDEFINED, + focused_value: Date | Undefined = UNDEFINED, + default_focused_value: Date | Undefined = UNDEFINED, + min_value: Date | Undefined = UNDEFINED, + max_value: Date | Undefined = UNDEFINED, + page_behavior: PageBehavior | Undefined = UNDEFINED, + is_invalid: bool | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + error_message: Element | Undefined = UNDEFINED, + visible_months: int | Undefined = UNDEFINED, + on_focus_change: Callable[[LocalDateConvertible], None] | Undefined = UNDEFINED, + on_change: Callable[[DateRange], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_pressed: AriaPressed | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> RangeCalendarElement: """ A range_calendar allows the user to select a range of dates. diff --git a/plugins/ui/src/deephaven/ui/components/range_slider.py b/plugins/ui/src/deephaven/ui/components/range_slider.py index 6e69e071f..423de81d5 100644 --- a/plugins/ui/src/deephaven/ui/components/range_slider.py +++ b/plugins/ui/src/deephaven/ui/components/range_slider.py @@ -16,71 +16,72 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def range_slider( - start_name: str | None = None, - end_name: str | None = None, + start_name: str | Undefined = UNDEFINED, + end_name: str | Undefined = UNDEFINED, # format_options, # omitted because need to connect it to Deephaven formatting options as well label_position: LabelPosition = "top", - show_value_label: bool | None = None, + show_value_label: bool | Undefined = UNDEFINED, # get_value_label, # omitted because it needs to return a string synchronously - contextual_help: Any | None = None, + contextual_help: Any | Undefined = UNDEFINED, orientation: Orientation = "horizontal", - is_disabled: bool | None = None, + is_disabled: bool | Undefined = UNDEFINED, min_value: float = 0, max_value: float = 100, step: float = 1, - value: SliderChange | None = None, - default_value: SliderChange | None = None, - label: Any | None = None, - name: str | None = None, - on_change_end: SliderChangeCallable | None = None, - on_change: SliderChangeCallable | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + value: SliderChange | Undefined = UNDEFINED, + default_value: SliderChange | Undefined = UNDEFINED, + label: Any | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + on_change_end: SliderChangeCallable | Undefined = UNDEFINED, + on_change: SliderChangeCallable | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Sliders allow users to quickly select a value within a range. They should be used when the upper and lower bounds to the range are invariable. diff --git a/plugins/ui/src/deephaven/ui/components/row.py b/plugins/ui/src/deephaven/ui/components/row.py index d059beae1..e264d46de 100644 --- a/plugins/ui/src/deephaven/ui/components/row.py +++ b/plugins/ui/src/deephaven/ui/components/row.py @@ -3,9 +3,14 @@ from typing import Any from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED -def row(*children: Any, height: float | None = None, key: str | None = None) -> Element: +def row( + *children: Any, + height: float | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, +) -> Element: """ A row is a container that can be used to group elements. Each element will be placed to the right of its prior sibling. diff --git a/plugins/ui/src/deephaven/ui/components/section.py b/plugins/ui/src/deephaven/ui/components/section.py index 058ec76a8..842e8ec40 100644 --- a/plugins/ui/src/deephaven/ui/components/section.py +++ b/plugins/ui/src/deephaven/ui/components/section.py @@ -4,6 +4,7 @@ from .._internal.utils import create_props from ..elements import Element +from ..types import Undefined, UNDEFINED from .basic import component_element from .item import Item @@ -11,7 +12,9 @@ def section( - *children: Item, title: str | None = None, key: str | None = None + *children: Item, + title: str | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> SectionElement: """ A section that can be added to a menu, such as a picker. Children are the dropdown options. diff --git a/plugins/ui/src/deephaven/ui/components/slider.py b/plugins/ui/src/deephaven/ui/components/slider.py index 71a679286..91ee6dbe4 100644 --- a/plugins/ui/src/deephaven/ui/components/slider.py +++ b/plugins/ui/src/deephaven/ui/components/slider.py @@ -14,72 +14,73 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def slider( - is_filled: bool | None = None, - fill_offset: float | None = None, - track_gradient: list[str] | None = None, + is_filled: bool | Undefined = UNDEFINED, + fill_offset: float | Undefined = UNDEFINED, + track_gradient: list[str] | Undefined = UNDEFINED, # format_options, # omitted because need to connect it to Deephaven formatting options as well label_position: LabelPosition = "top", - show_value_label: bool | None = None, + show_value_label: bool | Undefined = UNDEFINED, # get_value_label, # omitted because it needs to return a string synchronously - contextual_help: Any | None = None, + contextual_help: Any | Undefined = UNDEFINED, orientation: Orientation = "horizontal", - is_disabled: bool | None = None, + is_disabled: bool | Undefined = UNDEFINED, min_value: float = 0, max_value: float = 100, step: float = 1, - value: float | None = None, - default_value: float | None = None, - label: Any | None = None, - name: str | None = None, - on_change_end: Callable[[float], None] | None = None, - on_change: Callable[[float], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + value: float | Undefined = UNDEFINED, + default_value: float | Undefined = UNDEFINED, + label: Any | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + on_change_end: Callable[[float], None] | Undefined = UNDEFINED, + on_change: Callable[[float], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Sliders allow users to quickly select a value within a range. They should be used when the upper and lower bounds to the range are invariable. diff --git a/plugins/ui/src/deephaven/ui/components/stack.py b/plugins/ui/src/deephaven/ui/components/stack.py index 52470f035..e07633817 100644 --- a/plugins/ui/src/deephaven/ui/components/stack.py +++ b/plugins/ui/src/deephaven/ui/components/stack.py @@ -3,14 +3,15 @@ from typing import Any from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def stack( *children: Any, - height: float | None = None, - width: float | None = None, - active_item_index: int | None = None, - key: str | None = None, + height: float | Undefined = UNDEFINED, + width: float | Undefined = UNDEFINED, + active_item_index: int | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ A stack is a container that can be used to group elements which creates a set of tabs. diff --git a/plugins/ui/src/deephaven/ui/components/switch.py b/plugins/ui/src/deephaven/ui/components/switch.py index ff5642a50..91d9fb0ec 100644 --- a/plugins/ui/src/deephaven/ui/components/switch.py +++ b/plugins/ui/src/deephaven/ui/components/switch.py @@ -12,71 +12,72 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def switch( *children: Any, - is_emphasized: bool | None = None, - default_selected: bool | None = None, - is_selected: bool | None = None, - value: str | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - auto_focus: bool | None = None, - is_quiet: bool | None = None, - name: str | None = None, - on_change: Callable[[bool], None] | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_column: str | None = None, - grid_row: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - exclude_from_tab_order: bool | None = None, - aria_controls: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + is_emphasized: bool | Undefined = UNDEFINED, + default_selected: bool | Undefined = UNDEFINED, + is_selected: bool | Undefined = UNDEFINED, + value: str | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + on_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + exclude_from_tab_order: bool | Undefined = UNDEFINED, + aria_controls: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Switches allow users to turn an individual option on or off. They are usually used to activate or deactivate a specific setting. diff --git a/plugins/ui/src/deephaven/ui/components/tab.py b/plugins/ui/src/deephaven/ui/components/tab.py index abaf467b1..3cecd7dca 100644 --- a/plugins/ui/src/deephaven/ui/components/tab.py +++ b/plugins/ui/src/deephaven/ui/components/tab.py @@ -2,18 +2,16 @@ from typing import Any from .basic import component_element - from ..elements import Element - -from ..types import Key +from ..types import Key, Undefined, UNDEFINED def tab( *children: Any, - title: Any | None = None, - key: Key | None = None, - icon: Element | None = None, - text_value: str | None = None, + title: Any | Undefined = UNDEFINED, + key: Key | Undefined = UNDEFINED, + icon: Element | Undefined = UNDEFINED, + text_value: str | Undefined = UNDEFINED, ): """ Tab item implementation for tabs component. diff --git a/plugins/ui/src/deephaven/ui/components/tab_list.py b/plugins/ui/src/deephaven/ui/components/tab_list.py index 941611a33..679e5742f 100644 --- a/plugins/ui/src/deephaven/ui/components/tab_list.py +++ b/plugins/ui/src/deephaven/ui/components/tab_list.py @@ -11,50 +11,51 @@ LayoutFlex, Position, ) +from ..types import Undefined, UNDEFINED def tab_list( *children: Any, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_column: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = "size-100", - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = "size-100", + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ): """ Python implementation for the Adobe React Spectrum TabList component. diff --git a/plugins/ui/src/deephaven/ui/components/tab_panels.py b/plugins/ui/src/deephaven/ui/components/tab_panels.py index e6b80a1e5..e3225dbe3 100644 --- a/plugins/ui/src/deephaven/ui/components/tab_panels.py +++ b/plugins/ui/src/deephaven/ui/components/tab_panels.py @@ -11,50 +11,51 @@ LayoutFlex, Position, ) +from ..types import Undefined, UNDEFINED def tab_panels( *children: Any, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_column: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ): """ Python implementation for the Adobe React Spectrum TabPanels component. diff --git a/plugins/ui/src/deephaven/ui/components/table.py b/plugins/ui/src/deephaven/ui/components/table.py index 9f9558614..e2fad30d1 100644 --- a/plugins/ui/src/deephaven/ui/components/table.py +++ b/plugins/ui/src/deephaven/ui/components/table.py @@ -13,73 +13,75 @@ QuickFilterExpression, RowPressCallback, ResolvableContextMenuItem, + Undefined, + UNDEFINED, ) def table( table: Table, *, - on_row_press: RowPressCallback | None = None, - on_row_double_press: RowPressCallback | None = None, - on_cell_press: CellPressCallback | None = None, - on_cell_double_press: CellPressCallback | None = None, - on_column_press: ColumnPressCallback | None = None, - on_column_double_press: ColumnPressCallback | None = None, - always_fetch_columns: ColumnName | list[ColumnName] | bool | None = None, - quick_filters: dict[ColumnName, QuickFilterExpression] | None = None, + on_row_press: RowPressCallback | Undefined = UNDEFINED, + on_row_double_press: RowPressCallback | Undefined = UNDEFINED, + on_cell_press: CellPressCallback | Undefined = UNDEFINED, + on_cell_double_press: CellPressCallback | Undefined = UNDEFINED, + on_column_press: ColumnPressCallback | Undefined = UNDEFINED, + on_column_double_press: ColumnPressCallback | Undefined = UNDEFINED, + always_fetch_columns: ColumnName | list[ColumnName] | bool | Undefined = UNDEFINED, + quick_filters: dict[ColumnName, QuickFilterExpression] | Undefined = UNDEFINED, show_quick_filters: bool = False, show_grouping_column: bool = True, show_search: bool = False, reverse: bool = False, - front_columns: list[ColumnName] | None = None, - back_columns: list[ColumnName] | None = None, - frozen_columns: list[ColumnName] | None = None, - hidden_columns: list[ColumnName] | None = None, - column_groups: list[ColumnGroup] | None = None, - density: Literal["compact", "regular", "spacious"] | None = None, + front_columns: list[ColumnName] | Undefined = UNDEFINED, + back_columns: list[ColumnName] | Undefined = UNDEFINED, + frozen_columns: list[ColumnName] | Undefined = UNDEFINED, + hidden_columns: list[ColumnName] | Undefined = UNDEFINED, + column_groups: list[ColumnGroup] | Undefined = UNDEFINED, + density: Literal["compact", "regular", "spacious"] | Undefined = UNDEFINED, context_menu: ( - ResolvableContextMenuItem | list[ResolvableContextMenuItem] | None - ) = None, + ResolvableContextMenuItem | list[ResolvableContextMenuItem] | Undefined + ) = UNDEFINED, context_header_menu: ( - ResolvableContextMenuItem | list[ResolvableContextMenuItem] | None - ) = None, - databars: list[DatabarConfig] | None = None, - key: str | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, + ResolvableContextMenuItem | list[ResolvableContextMenuItem] | Undefined + ) = UNDEFINED, + databars: list[DatabarConfig] | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, ) -> UITable: """ Customization to how a table is displayed, how it behaves, and listen to UI events. diff --git a/plugins/ui/src/deephaven/ui/components/tabs.py b/plugins/ui/src/deephaven/ui/components/tabs.py index 29832f75e..643a9602f 100644 --- a/plugins/ui/src/deephaven/ui/components/tabs.py +++ b/plugins/ui/src/deephaven/ui/components/tabs.py @@ -14,67 +14,67 @@ Position, ) -from ..types import Key, TabDensity +from ..types import Key, TabDensity, Undefined, UNDEFINED def tabs( *children: Any, - disabled_keys: Iterable[Key] | None = None, - is_disabled: bool | None = None, - is_quiet: bool | None = None, - is_emphasized: bool | None = None, - density: TabDensity | None = "compact", - keyboard_activation: KeyboardActivationType | None = "automatic", - orientation: Orientation | None = "horizontal", - disallow_empty_selection: bool | None = None, - selected_key: Key | None = None, - default_selected_key: Key | None = None, - on_selection_change: Callable[[Key], None] | None = None, - on_change: Callable[[Key], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = 1, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_column: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelled_by: str | None = None, - aria_described_by: str | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + disabled_keys: Iterable[Key] | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + is_emphasized: bool | Undefined = UNDEFINED, + density: TabDensity | Undefined = "compact", + keyboard_activation: KeyboardActivationType | Undefined = "automatic", + orientation: Orientation | Undefined = "horizontal", + disallow_empty_selection: bool | Undefined = UNDEFINED, + selected_key: Key | Undefined = UNDEFINED, + default_selected_key: Key | Undefined = UNDEFINED, + on_selection_change: Callable[[Key], None] | Undefined = UNDEFINED, + on_change: Callable[[Key], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = 1, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelled_by: str | Undefined = UNDEFINED, + aria_described_by: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ): """ Python implementation for the Adobe React Spectrum Tabs component. diff --git a/plugins/ui/src/deephaven/ui/components/text.py b/plugins/ui/src/deephaven/ui/components/text.py index 43bce3b0a..afd63bc4c 100644 --- a/plugins/ui/src/deephaven/ui/components/text.py +++ b/plugins/ui/src/deephaven/ui/components/text.py @@ -11,52 +11,53 @@ from ..types import Color from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def text( *children: Any, - color: Color | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, + color: Color | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, slot: str = "text", - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ Text represents text with no specific semantic meaning. diff --git a/plugins/ui/src/deephaven/ui/components/text_area.py b/plugins/ui/src/deephaven/ui/components/text_area.py index 67b394947..4a7bf1024 100644 --- a/plugins/ui/src/deephaven/ui/components/text_area.py +++ b/plugins/ui/src/deephaven/ui/components/text_area.py @@ -25,87 +25,88 @@ from .types import IconTypes from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED from .icon import icon as icon_component def text_area( - icon: Element | IconTypes | None = None, - is_quiet: bool | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - is_required: bool | None = None, - description: Any | None = None, - error_message: Any | None = None, - auto_focus: bool | None = None, - value: str | None = None, - default_value: str | None = None, - label: Any | None = None, - auto_complete: str | None = None, - max_length: int | None = None, - min_length: int | None = None, - input_mode: TextFieldInputMode | None = None, - name: str | None = None, - validation_state: TextFieldValidationState | None = None, + icon: Element | IconTypes | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, + description: Any | Undefined = UNDEFINED, + error_message: Any | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + value: str | Undefined = UNDEFINED, + default_value: str | Undefined = UNDEFINED, + label: Any | Undefined = UNDEFINED, + auto_complete: str | Undefined = UNDEFINED, + max_length: int | Undefined = UNDEFINED, + min_length: int | Undefined = UNDEFINED, + input_mode: TextFieldInputMode | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + validation_state: TextFieldValidationState | Undefined = UNDEFINED, label_position: LabelPosition = "top", - label_align: Alignment | None = None, - necessity_indicator: NecessityIndicator | None = None, - contextual_help: Any | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - on_change: Callable[[str], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - exclude_from_tab_order: bool | None = None, - aria_active_descendant: str | None = None, - aria_auto_complete: AriaAutoComplete | None = None, - aria_haspopup: AriaHasPopup | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - aria_errormessage: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + label_align: Alignment | Undefined = UNDEFINED, + necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, + contextual_help: Any | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + on_change: Callable[[str], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + exclude_from_tab_order: bool | Undefined = UNDEFINED, + aria_active_descendant: str | Undefined = UNDEFINED, + aria_auto_complete: AriaAutoComplete | Undefined = UNDEFINED, + aria_haspopup: AriaHasPopup | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + aria_errormessage: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, # missing properties that are clipboard or composition events ) -> Element: """ diff --git a/plugins/ui/src/deephaven/ui/components/text_field.py b/plugins/ui/src/deephaven/ui/components/text_field.py index 52debc960..79433dc00 100644 --- a/plugins/ui/src/deephaven/ui/components/text_field.py +++ b/plugins/ui/src/deephaven/ui/components/text_field.py @@ -24,87 +24,88 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def text_field( - icon: Element | None = None, - is_quiet: bool | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - is_required: bool | None = None, - description: Any | None = None, - error_message: Any | None = None, - auto_focus: bool | None = None, - value: str | None = None, - default_value: str | None = None, - label: Any | None = None, - auto_complete: str | None = None, - max_length: int | None = None, - min_length: int | None = None, - pattern: str | None = None, - type: TextFieldType | None = None, - input_mode: TextFieldInputMode | None = None, - name: str | None = None, - validation_state: TextFieldValidationState | None = None, + icon: Element | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, + description: Any | Undefined = UNDEFINED, + error_message: Any | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + value: str | Undefined = UNDEFINED, + default_value: str | Undefined = UNDEFINED, + label: Any | Undefined = UNDEFINED, + auto_complete: str | Undefined = UNDEFINED, + max_length: int | Undefined = UNDEFINED, + min_length: int | Undefined = UNDEFINED, + pattern: str | Undefined = UNDEFINED, + type: TextFieldType | Undefined = UNDEFINED, + input_mode: TextFieldInputMode | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + validation_state: TextFieldValidationState | Undefined = UNDEFINED, label_position: LabelPosition = "top", - label_align: Alignment | None = None, - necessity_indicator: NecessityIndicator | None = None, - contextual_help: Any | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - on_change: Callable[[str], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - exclude_from_tab_order: bool | None = None, - aria_active_descendant: str | None = None, - aria_auto_complete: AriaAutoComplete | None = None, - aria_haspopup: AriaHasPopup | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_details: str | None = None, - aria_errormessage: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + label_align: Alignment | Undefined = UNDEFINED, + necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, + contextual_help: Any | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + on_change: Callable[[str], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + exclude_from_tab_order: bool | Undefined = UNDEFINED, + aria_active_descendant: str | Undefined = UNDEFINED, + aria_auto_complete: AriaAutoComplete | Undefined = UNDEFINED, + aria_haspopup: AriaHasPopup | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + aria_errormessage: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, # missing properties that are clipboard or composition events ) -> Element: """ diff --git a/plugins/ui/src/deephaven/ui/components/time_field.py b/plugins/ui/src/deephaven/ui/components/time_field.py index db5d5a98d..f7e7af0e1 100644 --- a/plugins/ui/src/deephaven/ui/components/time_field.py +++ b/plugins/ui/src/deephaven/ui/components/time_field.py @@ -25,7 +25,7 @@ create_props, convert_time_props, ) -from ..types import Time, TimeGranularity +from ..types import Time, TimeGranularity, Undefined, UNDEFINED from .basic import component_element from .make_component import make_component @@ -70,82 +70,82 @@ def _convert_time_field_props( @make_component def time_field( - placeholder_value: Time | None = None, - value: Time | None = None, - default_value: Time | None = None, - min_value: Time | None = None, - max_value: Time | None = None, - granularity: TimeGranularity | None = "SECOND", - hour_cycle: HourCycle | None = None, + placeholder_value: Time | Undefined = UNDEFINED, + value: Time | Undefined = UNDEFINED, + default_value: Time | Undefined = UNDEFINED, + min_value: Time | Undefined = UNDEFINED, + max_value: Time | Undefined = UNDEFINED, + granularity: TimeGranularity | Undefined = "SECOND", + hour_cycle: HourCycle | Undefined = UNDEFINED, hide_time_zone: bool = False, - should_force_leading_zeros: bool | None = None, - is_disabled: bool | None = None, - is_read_only: bool | None = None, - is_required: bool | None = None, - validation_behavior: ValidationBehavior | None = None, - auto_focus: bool | None = None, - label: Element | None = None, - description: Element | None = None, - error_message: Element | None = None, - name: str | None = None, - is_quiet: bool | None = None, - label_position: LabelPosition | None = None, - label_align: Alignment | None = None, - necessity_indicator: NecessityIndicator | None = None, - contextual_help: Element | None = None, - validation_state: ValidationState | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - on_open_change: Callable[[bool], None] | None = None, - on_change: Callable[[Time], None] | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_pressed: AriaPressed | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + should_force_leading_zeros: bool | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + is_read_only: bool | Undefined = UNDEFINED, + is_required: bool | Undefined = UNDEFINED, + validation_behavior: ValidationBehavior | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + label: Element | Undefined = UNDEFINED, + description: Element | Undefined = UNDEFINED, + error_message: Element | Undefined = UNDEFINED, + name: str | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + label_position: LabelPosition | Undefined = UNDEFINED, + label_align: Alignment | Undefined = UNDEFINED, + necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, + contextual_help: Element | Undefined = UNDEFINED, + validation_state: ValidationState | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_change: Callable[[Time], None] | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_pressed: AriaPressed | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> TimeFieldElement: """ A time field allows the user to select a time. diff --git a/plugins/ui/src/deephaven/ui/components/toggle_button.py b/plugins/ui/src/deephaven/ui/components/toggle_button.py index d9f1cafc2..cde1b0f16 100644 --- a/plugins/ui/src/deephaven/ui/components/toggle_button.py +++ b/plugins/ui/src/deephaven/ui/components/toggle_button.py @@ -21,78 +21,79 @@ ) from .basic import component_element from ..elements import Element +from ..types import Undefined, UNDEFINED def toggle_button( *children: Any, - is_emphasized: bool | None = None, - is_selected: bool | None = None, - default_selected: bool | None = None, - is_disabled: bool | None = None, - auto_focus: bool | None = None, - is_quiet: bool | None = None, - static_color: StaticColor | None = None, + is_emphasized: bool | Undefined = UNDEFINED, + is_selected: bool | Undefined = UNDEFINED, + default_selected: bool | Undefined = UNDEFINED, + is_disabled: bool | Undefined = UNDEFINED, + auto_focus: bool | Undefined = UNDEFINED, + is_quiet: bool | Undefined = UNDEFINED, + static_color: StaticColor | Undefined = UNDEFINED, type: ButtonType = "button", - on_change: Callable[[bool], None] | None = None, - on_press: PressEventCallable | None = None, - on_press_start: PressEventCallable | None = None, - on_press_end: PressEventCallable | None = None, - on_press_change: Callable[[bool], None] | None = None, - on_press_up: PressEventCallable | None = None, - on_focus: FocusEventCallable | None = None, - on_blur: FocusEventCallable | None = None, - on_focus_change: Callable[[bool], None] | None = None, - on_key_down: KeyboardEventCallable | None = None, - on_key_up: KeyboardEventCallable | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_column: str | None = None, - grid_row: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - exclude_from_tab_order: bool | None = None, - aria_expanded: AriaExpanded | None = None, - aria_haspopup: AriaHasPopup | None = None, - aria_controls: str | None = None, - aria_label: str | None = None, - aria_labelledby: str | None = None, - aria_describedby: str | None = None, - aria_pressed: AriaPressed | None = None, - aria_details: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + on_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_press: PressEventCallable | Undefined = UNDEFINED, + on_press_start: PressEventCallable | Undefined = UNDEFINED, + on_press_end: PressEventCallable | Undefined = UNDEFINED, + on_press_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_press_up: PressEventCallable | Undefined = UNDEFINED, + on_focus: FocusEventCallable | Undefined = UNDEFINED, + on_blur: FocusEventCallable | Undefined = UNDEFINED, + on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, + on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, + on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + exclude_from_tab_order: bool | Undefined = UNDEFINED, + aria_expanded: AriaExpanded | Undefined = UNDEFINED, + aria_haspopup: AriaHasPopup | Undefined = UNDEFINED, + aria_controls: str | Undefined = UNDEFINED, + aria_label: str | Undefined = UNDEFINED, + aria_labelledby: str | Undefined = UNDEFINED, + aria_describedby: str | Undefined = UNDEFINED, + aria_pressed: AriaPressed | Undefined = UNDEFINED, + aria_details: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ ToggleButtons allow users to toggle a selection on or off, for example switching between two states or modes. diff --git a/plugins/ui/src/deephaven/ui/components/view.py b/plugins/ui/src/deephaven/ui/components/view.py index 0511048d5..7343ab88f 100644 --- a/plugins/ui/src/deephaven/ui/components/view.py +++ b/plugins/ui/src/deephaven/ui/components/view.py @@ -13,80 +13,80 @@ ) from .basic import component_element from ..elements import Element -from ..types import Color +from ..types import Color, Undefined, UNDEFINED def view( *children: Any, - element_type: ElementTypes | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - overflow: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - padding: DimensionValue | None = None, - padding_top: DimensionValue | None = None, - padding_bottom: DimensionValue | None = None, - padding_start: DimensionValue | None = None, - padding_end: DimensionValue | None = None, - padding_x: DimensionValue | None = None, - padding_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - background_color: Color | None = None, - border_width: BorderSize | None = None, - border_start_width: BorderSize | None = None, - border_end_width: BorderSize | None = None, - border_top_width: BorderSize | None = None, - border_bottom_width: BorderSize | None = None, - border_x_width: BorderSize | None = None, - border_y_width: BorderSize | None = None, - border_color: Color | None = None, - border_start_color: Color | None = None, - border_end_color: Color | None = None, - border_top_color: Color | None = None, - border_bottom_color: Color | None = None, - border_x_color: Color | None = None, - border_y_color: Color | None = None, - border_radius: BorderRadius | None = None, - border_top_start_radius: BorderRadius | None = None, - border_top_end_radius: BorderRadius | None = None, - border_bottom_start_radius: BorderRadius | None = None, - border_bottom_end_radius: BorderRadius | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, - is_hidden: bool | None = None, - id: str | None = None, - UNSAFE_class_name: str | None = None, - UNSAFE_style: CSSProperties | None = None, - key: str | None = None, + element_type: ElementTypes | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + overflow: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + padding: DimensionValue | Undefined = UNDEFINED, + padding_top: DimensionValue | Undefined = UNDEFINED, + padding_bottom: DimensionValue | Undefined = UNDEFINED, + padding_start: DimensionValue | Undefined = UNDEFINED, + padding_end: DimensionValue | Undefined = UNDEFINED, + padding_x: DimensionValue | Undefined = UNDEFINED, + padding_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + background_color: Color | Undefined = UNDEFINED, + border_width: BorderSize | Undefined = UNDEFINED, + border_start_width: BorderSize | Undefined = UNDEFINED, + border_end_width: BorderSize | Undefined = UNDEFINED, + border_top_width: BorderSize | Undefined = UNDEFINED, + border_bottom_width: BorderSize | Undefined = UNDEFINED, + border_x_width: BorderSize | Undefined = UNDEFINED, + border_y_width: BorderSize | Undefined = UNDEFINED, + border_color: Color | Undefined = UNDEFINED, + border_start_color: Color | Undefined = UNDEFINED, + border_end_color: Color | Undefined = UNDEFINED, + border_top_color: Color | Undefined = UNDEFINED, + border_bottom_color: Color | Undefined = UNDEFINED, + border_x_color: Color | Undefined = UNDEFINED, + border_y_color: Color | Undefined = UNDEFINED, + border_radius: BorderRadius | Undefined = UNDEFINED, + border_top_start_radius: BorderRadius | Undefined = UNDEFINED, + border_top_end_radius: BorderRadius | Undefined = UNDEFINED, + border_bottom_start_radius: BorderRadius | Undefined = UNDEFINED, + border_bottom_end_radius: BorderRadius | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, + is_hidden: bool | Undefined = UNDEFINED, + id: str | Undefined = UNDEFINED, + UNSAFE_class_name: str | Undefined = UNDEFINED, + UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, ) -> Element: """ View is a general purpose container with no specific semantics that can be used for custom styling purposes. It supports Spectrum style props to ensure consistency with other Spectrum components. diff --git a/plugins/ui/src/deephaven/ui/elements/BaseElement.py b/plugins/ui/src/deephaven/ui/elements/BaseElement.py index c6a425c0f..b4946a5f8 100644 --- a/plugins/ui/src/deephaven/ui/elements/BaseElement.py +++ b/plugins/ui/src/deephaven/ui/elements/BaseElement.py @@ -2,6 +2,7 @@ from typing import Any from .Element import Element +from ..types import Undefined, UNDEFINED from .._internal import dict_to_react_props, RenderContext @@ -12,7 +13,12 @@ class BaseElement(Element): """ def __init__( - self, name: str, /, *children: Any, key: str | None = None, **props: Any + self, + name: str, + /, + *children: Any, + key: str | Undefined = UNDEFINED, + **props: Any, ): self._name = name self._key = key @@ -34,7 +40,7 @@ def name(self) -> str: return self._name @property - def key(self) -> str | None: + def key(self) -> str | Undefined: return self._key def render(self, context: RenderContext) -> dict[str, Any]: diff --git a/plugins/ui/src/deephaven/ui/elements/Element.py b/plugins/ui/src/deephaven/ui/elements/Element.py index fe6a168f9..09e8ab756 100644 --- a/plugins/ui/src/deephaven/ui/elements/Element.py +++ b/plugins/ui/src/deephaven/ui/elements/Element.py @@ -2,6 +2,7 @@ from abc import ABC, abstractmethod from typing import Any, Dict +from ..types import Undefined, UNDEFINED from .._internal import RenderContext PropsType = Dict[str, Any] @@ -23,14 +24,14 @@ def name(self) -> str: return "deephaven.ui.Element" @property - def key(self) -> str | None: + def key(self) -> str | Undefined: """ Get the key prop of this element. Useful to check if a key prop was provided. Returns: The unique key prop of this element. """ - return None + return UNDEFINED @abstractmethod def render(self, context: RenderContext) -> PropsType: diff --git a/plugins/ui/src/deephaven/ui/elements/FunctionElement.py b/plugins/ui/src/deephaven/ui/elements/FunctionElement.py index 6b1ea35f9..474b2200c 100644 --- a/plugins/ui/src/deephaven/ui/elements/FunctionElement.py +++ b/plugins/ui/src/deephaven/ui/elements/FunctionElement.py @@ -2,6 +2,7 @@ import logging from typing import Callable from .Element import Element, PropsType +from ..types import Undefined, UNDEFINED from .._internal import RenderContext logger = logging.getLogger(__name__) @@ -9,7 +10,10 @@ class FunctionElement(Element): def __init__( - self, name: str, render: Callable[[], list[Element]], key: str | None = None + self, + name: str, + render: Callable[[], list[Element]], + key: str | Undefined = UNDEFINED, ): """ Create an element that takes a function to render. @@ -27,7 +31,7 @@ def name(self): return self._name @property - def key(self) -> str | None: + def key(self) -> str | Undefined: return self._key def render(self, context: RenderContext) -> PropsType: diff --git a/plugins/ui/src/deephaven/ui/renderer/Renderer.py b/plugins/ui/src/deephaven/ui/renderer/Renderer.py index ab834aa9b..332d66a2b 100644 --- a/plugins/ui/src/deephaven/ui/renderer/Renderer.py +++ b/plugins/ui/src/deephaven/ui/renderer/Renderer.py @@ -4,6 +4,7 @@ from typing import Any, Union from .._internal import RenderContext from ..elements import Element, PropsType +from ..types import UNDEFINED from .RenderedNode import RenderedNode logger = logging.getLogger(__name__) @@ -41,7 +42,9 @@ def _render_child_item(item: Any, parent_context: RenderContext, index_key: str) type(item), item, ) - key = item.key or f"{index_key}-{item.name}" + key: str = ( # type: ignore + f"{index_key}-{item.name}" if item.key is UNDEFINED else item.key + ) return _render_element(item, parent_context.get_child_context(key)) logger.debug("render_item returning child (%s): %s", type(item), item) diff --git a/plugins/ui/src/deephaven/ui/types/types.py b/plugins/ui/src/deephaven/ui/types/types.py index 6e1f2ccb1..0e26e349d 100644 --- a/plugins/ui/src/deephaven/ui/types/types.py +++ b/plugins/ui/src/deephaven/ui/types/types.py @@ -613,3 +613,15 @@ class DatabarConfig(TypedDict): """ Opacity of the databar fill. """ + + +class Undefined: + """ + A class representing the type of an undefined value. To use the value itself, use `UNDEFINED` instead. + """ + + def __str__(self): + return "Undefined" + + +UNDEFINED = Undefined() diff --git a/plugins/ui/test/deephaven/ui/test_utils.py b/plugins/ui/test/deephaven/ui/test_utils.py index 21872969e..598aea4e3 100644 --- a/plugins/ui/test/deephaven/ui/test_utils.py +++ b/plugins/ui/test/deephaven/ui/test_utils.py @@ -88,6 +88,7 @@ def test_dict_to_camel_case(self): def test_dict_to_react_props(self): from deephaven.ui._internal.utils import dict_to_react_props + from deephaven.ui.types import UNDEFINED self.assertDictEqual( dict_to_react_props({"test_string": "foo", "test_string_2": "bar_biz"}), @@ -99,6 +100,10 @@ def test_dict_to_react_props(self): ) self.assertDictEqual( dict_to_react_props({"foo": None, "bar": "biz"}), + {"foo": None, "bar": "biz"}, + ) + self.assertDictEqual( + dict_to_react_props({"foo": UNDEFINED, "bar": "biz"}), {"bar": "biz"}, ) self.assertDictEqual( @@ -117,9 +122,14 @@ def test_dict_to_react_props(self): def test_remove_empty_keys(self): from deephaven.ui._internal.utils import remove_empty_keys + from deephaven.ui.types import UNDEFINED self.assertDictEqual( remove_empty_keys({"foo": "bar", "biz": None, "baz": 0}), + {"foo": "bar", "biz": None, "baz": 0}, + ) + self.assertDictEqual( + remove_empty_keys({"foo": "bar", "biz": UNDEFINED, "baz": 0}), {"foo": "bar", "baz": 0}, ) From 6b7cf89b77c4dae4732ffa5295934521f82f65f3 Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Mon, 11 Nov 2024 11:01:20 -0500 Subject: [PATCH 02/13] fix ci --- .../ui/src/deephaven/ui/components/table.py | 1 + plugins/ui/src/deephaven/ui/types/types.py | 63 ------------------- 2 files changed, 1 insertion(+), 63 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/components/table.py b/plugins/ui/src/deephaven/ui/components/table.py index 5cd2ebaf0..5a77853a4 100644 --- a/plugins/ui/src/deephaven/ui/components/table.py +++ b/plugins/ui/src/deephaven/ui/components/table.py @@ -49,6 +49,7 @@ class TableFormat: value: str | Undefined = UNDEFINED mode: TableDatabar | Undefined = UNDEFINED + @dataclass class TableDatabar: """ diff --git a/plugins/ui/src/deephaven/ui/types/types.py b/plugins/ui/src/deephaven/ui/types/types.py index c36beea75..61a2136a3 100644 --- a/plugins/ui/src/deephaven/ui/types/types.py +++ b/plugins/ui/src/deephaven/ui/types/types.py @@ -565,69 +565,6 @@ class DateRange(TypedDict): DataBarValuePlacement = Literal["BESIDE", "OVERLAP", "HIDE"] -class DatabarConfig(TypedDict): - """ - Configuration for displaying a databar. - """ - - column: ColumnName - """ - Name of the column to display as a databar. - """ - - value_column: NotRequired[ColumnName] - """ - Name of the column to use as the value for the databar. - If not provided, the databar will use the column value. - - This can be useful if you want to display a databar with - a log scale, but display the actual value in the cell. - In this case, the value_column would be the log of the actual value. - """ - - min: NotRequired[Union[ColumnName, float]] - """ - Minimum value for the databar. Defaults to the minimum value in the column. - - If a column name is provided, the minimum value will be the value in that column. - If a constant is providded, the minimum value will be that constant. - """ - - max: NotRequired[Union[ColumnName, float]] - """ - Maximum value for the databar. Defaults to the maximum value in the column. - - If a column name is provided, the maximum value will be the value in that column. - If a constant is providded, the maximum value will be that constant. - """ - - axis: NotRequired[DataBarAxis] - """ - Whether the databar 0 value should be proportional to the min and max values, - in the middle of the cell, or on one side of the databar based on direction. - """ - - direction: NotRequired[DataBarDirection] - """ - Direction of the databar. - """ - - value_placement: NotRequired[DataBarValuePlacement] - """ - Placement of the value relative to the databar. - """ - - color: NotRequired[Color] - """ - Color of the databar. - """ - - opacity: NotRequired[float] - """ - Opacity of the databar fill. - """ - - class Undefined: """ A class representing the type of an undefined value. To use the value itself, use `UNDEFINED` instead. From b150c3aff20f649b225cc939b9c414534c1f2018 Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Mon, 11 Nov 2024 11:31:42 -0500 Subject: [PATCH 03/13] fix --- .../ui/src/deephaven/ui/components/table.py | 119 +++++++++--------- 1 file changed, 61 insertions(+), 58 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/components/table.py b/plugins/ui/src/deephaven/ui/components/table.py index 5a77853a4..7adcb1bd0 100644 --- a/plugins/ui/src/deephaven/ui/components/table.py +++ b/plugins/ui/src/deephaven/ui/components/table.py @@ -186,80 +186,83 @@ def __init__( self, table: Table, *, - format_: TableFormat | list[TableFormat] | None = None, - on_row_press: RowPressCallback | None = None, - on_row_double_press: RowPressCallback | None = None, - on_cell_press: CellPressCallback | None = None, - on_cell_double_press: CellPressCallback | None = None, - on_column_press: ColumnPressCallback | None = None, - on_column_double_press: ColumnPressCallback | None = None, - always_fetch_columns: ColumnName | list[ColumnName] | bool | None = None, - quick_filters: dict[ColumnName, QuickFilterExpression] | None = None, + format_: TableFormat | list[TableFormat] | Undefined = UNDEFINED, + on_row_press: RowPressCallback | Undefined = UNDEFINED, + on_row_double_press: RowPressCallback | Undefined = UNDEFINED, + on_cell_press: CellPressCallback | Undefined = UNDEFINED, + on_cell_double_press: CellPressCallback | Undefined = UNDEFINED, + on_column_press: ColumnPressCallback | Undefined = UNDEFINED, + on_column_double_press: ColumnPressCallback | Undefined = UNDEFINED, + always_fetch_columns: ColumnName + | list[ColumnName] + | bool + | Undefined = UNDEFINED, + quick_filters: dict[ColumnName, QuickFilterExpression] | Undefined = UNDEFINED, show_quick_filters: bool = False, show_grouping_column: bool = True, show_search: bool = False, reverse: bool = False, - front_columns: list[ColumnName] | None = None, - back_columns: list[ColumnName] | None = None, - frozen_columns: list[ColumnName] | None = None, - hidden_columns: list[ColumnName] | None = None, - column_groups: list[ColumnGroup] | None = None, - density: Literal["compact", "regular", "spacious"] | None = None, + front_columns: list[ColumnName] | Undefined = UNDEFINED, + back_columns: list[ColumnName] | Undefined = UNDEFINED, + frozen_columns: list[ColumnName] | Undefined = UNDEFINED, + hidden_columns: list[ColumnName] | Undefined = UNDEFINED, + column_groups: list[ColumnGroup] | Undefined = UNDEFINED, + density: Literal["compact", "regular", "spacious"] | Undefined = UNDEFINED, context_menu: ( - ResolvableContextMenuItem | list[ResolvableContextMenuItem] | None - ) = None, + ResolvableContextMenuItem | list[ResolvableContextMenuItem] | Undefined + ) = UNDEFINED, context_header_menu: ( - ResolvableContextMenuItem | list[ResolvableContextMenuItem] | None - ) = None, - databars: list[TableDatabar] | None = None, - key: str | None = None, - flex: LayoutFlex | None = None, - flex_grow: float | None = None, - flex_shrink: float | None = None, - flex_basis: DimensionValue | None = None, - align_self: AlignSelf | None = None, - justify_self: JustifySelf | None = None, - order: int | None = None, - grid_area: str | None = None, - grid_row: str | None = None, - grid_row_start: str | None = None, - grid_row_end: str | None = None, - grid_column: str | None = None, - grid_column_start: str | None = None, - grid_column_end: str | None = None, - margin: DimensionValue | None = None, - margin_top: DimensionValue | None = None, - margin_bottom: DimensionValue | None = None, - margin_start: DimensionValue | None = None, - margin_end: DimensionValue | None = None, - margin_x: DimensionValue | None = None, - margin_y: DimensionValue | None = None, - width: DimensionValue | None = None, - height: DimensionValue | None = None, - min_width: DimensionValue | None = None, - min_height: DimensionValue | None = None, - max_width: DimensionValue | None = None, - max_height: DimensionValue | None = None, - position: Position | None = None, - top: DimensionValue | None = None, - bottom: DimensionValue | None = None, - start: DimensionValue | None = None, - end: DimensionValue | None = None, - left: DimensionValue | None = None, - right: DimensionValue | None = None, - z_index: int | None = None, + ResolvableContextMenuItem | list[ResolvableContextMenuItem] | Undefined + ) = UNDEFINED, + databars: list[TableDatabar] | Undefined = UNDEFINED, + key: str | Undefined = UNDEFINED, + flex: LayoutFlex | Undefined = UNDEFINED, + flex_grow: float | Undefined = UNDEFINED, + flex_shrink: float | Undefined = UNDEFINED, + flex_basis: DimensionValue | Undefined = UNDEFINED, + align_self: AlignSelf | Undefined = UNDEFINED, + justify_self: JustifySelf | Undefined = UNDEFINED, + order: int | Undefined = UNDEFINED, + grid_area: str | Undefined = UNDEFINED, + grid_row: str | Undefined = UNDEFINED, + grid_row_start: str | Undefined = UNDEFINED, + grid_row_end: str | Undefined = UNDEFINED, + grid_column: str | Undefined = UNDEFINED, + grid_column_start: str | Undefined = UNDEFINED, + grid_column_end: str | Undefined = UNDEFINED, + margin: DimensionValue | Undefined = UNDEFINED, + margin_top: DimensionValue | Undefined = UNDEFINED, + margin_bottom: DimensionValue | Undefined = UNDEFINED, + margin_start: DimensionValue | Undefined = UNDEFINED, + margin_end: DimensionValue | Undefined = UNDEFINED, + margin_x: DimensionValue | Undefined = UNDEFINED, + margin_y: DimensionValue | Undefined = UNDEFINED, + width: DimensionValue | Undefined = UNDEFINED, + height: DimensionValue | Undefined = UNDEFINED, + min_width: DimensionValue | Undefined = UNDEFINED, + min_height: DimensionValue | Undefined = UNDEFINED, + max_width: DimensionValue | Undefined = UNDEFINED, + max_height: DimensionValue | Undefined = UNDEFINED, + position: Position | Undefined = UNDEFINED, + top: DimensionValue | Undefined = UNDEFINED, + bottom: DimensionValue | Undefined = UNDEFINED, + start: DimensionValue | Undefined = UNDEFINED, + end: DimensionValue | Undefined = UNDEFINED, + left: DimensionValue | Undefined = UNDEFINED, + right: DimensionValue | Undefined = UNDEFINED, + z_index: int | Undefined = UNDEFINED, ) -> None: props = locals() del props["self"] self._props = props - self._key = props.get("key") + self._key: str | Undefined = props.get("key") # type: ignore @property def name(self): return "deephaven.ui.elements.UITable" @property - def key(self) -> str | None: + def key(self) -> str | Undefined: return self._key def render(self, context: RenderContext) -> dict[str, Any]: From ee210e5497cd3d91e5593397ca8b999b0d67b1c4 Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Tue, 12 Nov 2024 09:39:03 -0500 Subject: [PATCH 04/13] fix --- .../ui/src/deephaven/ui/components/table.py | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/components/table.py b/plugins/ui/src/deephaven/ui/components/table.py index 7adcb1bd0..1a60591e8 100644 --- a/plugins/ui/src/deephaven/ui/components/table.py +++ b/plugins/ui/src/deephaven/ui/components/table.py @@ -41,13 +41,13 @@ class TableFormat: The TableFormat. """ - cols: ColumnName | list[ColumnName] | Undefined = UNDEFINED - if_: str | Undefined = UNDEFINED - color: Color | Undefined = UNDEFINED - background_color: Color | Undefined = UNDEFINED - alignment: Literal["left", "center", "right"] | Undefined = UNDEFINED - value: str | Undefined = UNDEFINED - mode: TableDatabar | Undefined = UNDEFINED + cols: ColumnName | list[ColumnName] | None = None + if_: str | None = None + color: Color | None = None + background_color: Color | None = None + alignment: Literal["left", "center", "right"] | None = None + value: str | None = None + mode: TableDatabar | None = None @dataclass @@ -80,14 +80,14 @@ class TableDatabar: """ column: ColumnName - value_column: ColumnName | Undefined = UNDEFINED - min: ColumnName | float | Undefined = UNDEFINED - max: ColumnName | float | Undefined = UNDEFINED - axis: Literal["proportional", "middle", "directional"] | Undefined = UNDEFINED - direction: Literal["LTR", "RTL"] | Undefined = UNDEFINED - value_placement: Literal["beside", "overlap", "hide"] | Undefined = UNDEFINED - color: Color | Undefined = UNDEFINED - opacity: float | Undefined = UNDEFINED + value_column: ColumnName | None = None + min: ColumnName | float | None = None + max: ColumnName | float | None = None + axis: Literal["proportional", "middle", "directional"] | None = None + direction: Literal["LTR", "RTL"] | None = None + value_placement: Literal["beside", "overlap", "hide"] | None = None + color: Color | None = None + opacity: float | None = None class table(Element): From 0a334786947808ce032584c4de0180af9ad3ef27 Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Tue, 12 Nov 2024 10:39:48 -0500 Subject: [PATCH 05/13] add review change --- .../ui/src/deephaven/ui/_internal/utils.py | 35 ++-- .../deephaven/ui/components/action_button.py | 128 ++++++------- .../deephaven/ui/components/action_group.py | 126 ++++++------- .../deephaven/ui/components/action_menu.py | 116 ++++++------ .../ui/src/deephaven/ui/components/button.py | 140 +++++++-------- .../deephaven/ui/components/button_group.py | 84 ++++----- .../src/deephaven/ui/components/calendar.py | 122 ++++++------- .../src/deephaven/ui/components/checkbox.py | 130 +++++++------- .../deephaven/ui/components/checkbox_group.py | 132 +++++++------- .../ui/src/deephaven/ui/components/column.py | 6 +- .../src/deephaven/ui/components/combo_box.py | 161 ++++++++--------- .../ui/src/deephaven/ui/components/content.py | 82 ++++----- .../ui/components/contextual_help.py | 110 ++++++------ .../src/deephaven/ui/components/date_field.py | 158 ++++++++-------- .../deephaven/ui/components/date_picker.py | 164 ++++++++--------- .../ui/components/date_range_picker.py | 168 +++++++++--------- .../ui/src/deephaven/ui/components/dialog.py | 98 +++++----- .../deephaven/ui/components/dialog_trigger.py | 30 ++-- .../ui/src/deephaven/ui/components/flex.py | 96 +++++----- .../ui/src/deephaven/ui/components/form.py | 130 +++++++------- .../src/deephaven/ui/components/fragment.py | 4 +- .../ui/src/deephaven/ui/components/grid.py | 102 +++++------ .../ui/src/deephaven/ui/components/heading.py | 84 ++++----- .../ui/src/deephaven/ui/components/icon.py | 96 +++++----- .../ui/components/illustrated_message.py | 82 ++++----- .../ui/src/deephaven/ui/components/image.py | 88 ++++----- .../ui/src/deephaven/ui/components/item.py | 10 +- .../ui/components/item_table_source.py | 28 +-- .../ui/components/list_action_group.py | 124 ++++++------- .../ui/components/list_action_menu.py | 116 ++++++------ .../src/deephaven/ui/components/list_view.py | 118 ++++++------ .../deephaven/ui/components/make_component.py | 4 +- .../deephaven/ui/components/number_field.py | 148 +++++++-------- .../ui/src/deephaven/ui/components/panel.py | 44 ++--- .../ui/src/deephaven/ui/components/picker.py | 150 ++++++++-------- .../deephaven/ui/components/progress_bar.py | 110 ++++++------ .../ui/components/progress_circle.py | 104 +++++------ .../ui/src/deephaven/ui/components/radio.py | 106 +++++------ .../deephaven/ui/components/radio_group.py | 132 +++++++------- .../deephaven/ui/components/range_calendar.py | 122 ++++++------- .../deephaven/ui/components/range_slider.py | 112 ++++++------ plugins/ui/src/deephaven/ui/components/row.py | 6 +- .../ui/src/deephaven/ui/components/section.py | 6 +- .../ui/src/deephaven/ui/components/slider.py | 114 ++++++------ .../ui/src/deephaven/ui/components/stack.py | 10 +- .../ui/src/deephaven/ui/components/switch.py | 124 ++++++------- plugins/ui/src/deephaven/ui/components/tab.py | 10 +- .../src/deephaven/ui/components/tab_list.py | 82 ++++----- .../src/deephaven/ui/components/tab_panels.py | 82 ++++----- .../ui/src/deephaven/ui/components/table.py | 119 +++++++------ .../ui/src/deephaven/ui/components/tabs.py | 114 ++++++------ .../ui/src/deephaven/ui/components/text.py | 84 ++++----- .../src/deephaven/ui/components/text_area.py | 152 ++++++++-------- .../src/deephaven/ui/components/text_field.py | 156 ++++++++-------- .../src/deephaven/ui/components/time_field.py | 152 ++++++++-------- .../deephaven/ui/components/toggle_button.py | 136 +++++++------- .../ui/src/deephaven/ui/components/view.py | 140 +++++++-------- .../src/deephaven/ui/elements/BaseElement.py | 6 +- .../ui/src/deephaven/ui/elements/Element.py | 6 +- .../deephaven/ui/elements/FunctionElement.py | 6 +- .../ui/src/deephaven/ui/renderer/Renderer.py | 4 +- plugins/ui/src/deephaven/ui/types/types.py | 18 +- 62 files changed, 2811 insertions(+), 2816 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/_internal/utils.py b/plugins/ui/src/deephaven/ui/_internal/utils.py index 505c765a3..e16de09bd 100644 --- a/plugins/ui/src/deephaven/ui/_internal/utils.py +++ b/plugins/ui/src/deephaven/ui/_internal/utils.py @@ -15,8 +15,8 @@ JavaTime, LocalDateConvertible, LocalDate, + UndefinedType, Undefined, - UNDEFINED, ) T = TypeVar("T") @@ -38,17 +38,6 @@ } -def is_nullish(value: Any) -> bool: - """ - Check if a value is None or Undefined. - Args: - value: The value to check. - Returns: - Whether the value is nullish. - """ - return value is None or value is UNDEFINED - - def get_component_name(component: Any) -> str: """ Get the name of the component @@ -176,7 +165,7 @@ def remove_empty_keys(dict: dict[str, Any]) -> dict[str, Any]: Returns: The dict with keys removed. """ - return {k: v for k, v in dict.items() if v is not UNDEFINED} + return {k: v for k, v in dict.items() if v is not Undefined} def _wrapped_callable( @@ -494,7 +483,7 @@ def _get_first_set_key(props: dict[str, Any], sequence: Sequence[str]) -> str | The first non-None prop, or None if all props are None. """ for key in sequence: - if not is_nullish(props.get(key)): + if props.get(key) != Undefined: return key return None @@ -679,11 +668,11 @@ def convert_date_props( The converted props. """ for key in simple_date_props: - if not is_nullish(props.get(key)): + if props.get(key) != Undefined: props[key] = _convert_to_java_date(props[key]) for key in date_range_props: - if not is_nullish(props.get(key)): + if props.get(key) != Undefined: props[key] = convert_date_range(props[key], _convert_to_java_date) # the simple props must be converted before this to simplify the callable conversion @@ -693,25 +682,25 @@ def convert_date_props( # Local Dates will default to DAY but we need to default to SECOND for the other types if ( granularity_key is not None - and is_nullish(props.get(granularity_key)) + and props.get(granularity_key) == Undefined and converter != to_j_local_date ): props[granularity_key] = "SECOND" # now that the converter is set, we can convert simple props to strings for key in simple_date_props: - if not is_nullish(props.get(key)): + if props.get(key) != Undefined: props[key] = str(props[key]) # and convert the date range props to strings for key in date_range_props: - if not is_nullish(props.get(key)): + if props.get(key) != Undefined: props[key] = convert_date_range(props[key], str) # wrap the date callable with the convert # if there are date range props, we need to convert as a date range for key in callable_date_props: - if not is_nullish(props.get(key)): + if props.get(key) != Undefined: if not callable(props[key]): raise TypeError(f"{key} must be a callable") if len(date_range_props) > 0: @@ -743,7 +732,7 @@ def convert_time_props( The converted props. """ for key in simple_time_props: - if not is_nullish(props.get(key)): + if props.get(key) != Undefined: props[key] = _convert_to_java_time(props[key]) # the simple props must be converted before this to simplify the callable conversion @@ -751,12 +740,12 @@ def convert_time_props( # now that the converter is set, we can convert simple props to strings for key in simple_time_props: - if not is_nullish(props.get(key)): + if props.get(key) != Undefined: props[key] = str(props[key]) # wrap the date callable with the convert for key in callable_time_props: - if not is_nullish(props.get(key)): + if props.get(key) != Undefined: if not callable(props[key]): raise TypeError(f"{key} must be a callable") props[key] = _wrap_time_callable(props[key], converter) diff --git a/plugins/ui/src/deephaven/ui/components/action_button.py b/plugins/ui/src/deephaven/ui/components/action_button.py index f089802fc..293417700 100644 --- a/plugins/ui/src/deephaven/ui/components/action_button.py +++ b/plugins/ui/src/deephaven/ui/components/action_button.py @@ -22,7 +22,7 @@ from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined ActionButtonElement = Element @@ -30,69 +30,69 @@ def action_button( *children: Any, type: ButtonType = "button", - on_press: PressEventCallable | Undefined = UNDEFINED, - on_press_start: PressEventCallable | Undefined = UNDEFINED, - on_press_end: PressEventCallable | Undefined = UNDEFINED, - on_press_up: PressEventCallable | Undefined = UNDEFINED, - on_press_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - static_color: StaticColor | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - exclude_from_tab_order: bool | Undefined = UNDEFINED, - aria_expanded: AriaExpanded | Undefined = UNDEFINED, - aria_haspopup: AriaHasPopup | Undefined = UNDEFINED, - aria_controls: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_pressed: AriaPressed | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + on_press: PressEventCallable | UndefinedType = Undefined, + on_press_start: PressEventCallable | UndefinedType = Undefined, + on_press_end: PressEventCallable | UndefinedType = Undefined, + on_press_up: PressEventCallable | UndefinedType = Undefined, + on_press_change: Callable[[bool], None] | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + static_color: StaticColor | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + exclude_from_tab_order: bool | UndefinedType = Undefined, + aria_expanded: AriaExpanded | UndefinedType = Undefined, + aria_haspopup: AriaHasPopup | UndefinedType = Undefined, + aria_controls: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_pressed: AriaPressed | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> ActionButtonElement: """ ActionButtons allow users to perform an action. They're used for similar, task-based options within a workflow, and are ideal for interfaces where buttons aren't meant to draw a lot of attention. diff --git a/plugins/ui/src/deephaven/ui/components/action_group.py b/plugins/ui/src/deephaven/ui/components/action_group.py index ef0c4386e..c7b860e1c 100644 --- a/plugins/ui/src/deephaven/ui/components/action_group.py +++ b/plugins/ui/src/deephaven/ui/components/action_group.py @@ -24,75 +24,75 @@ SelectionMode, Key, Selection, + UndefinedType, Undefined, - UNDEFINED, ) def action_group( *children: Any, - is_emphasized: bool | Undefined = UNDEFINED, - density: ActionGroupDensity | Undefined = "regular", - is_justified: bool | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - static_color: StaticColor | Undefined = UNDEFINED, - overflow_mode: OverflowMode | Undefined = "wrap", - button_label_behavior: ButtonLabelBehavior | Undefined = "show", - summary_icon: Element | Undefined = UNDEFINED, - orientation: Orientation | Undefined = "horizontal", - disabled_keys: Iterable[str] | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - selection_mode: SelectionMode | Undefined = UNDEFINED, - disallow_empty_selection: bool | Undefined = UNDEFINED, - selected_keys: SelectedKeys | Iterable[str] | Undefined = UNDEFINED, - default_selected_keys: SelectedKeys | Iterable[str] | Undefined = UNDEFINED, - on_action: Callable[[str], None] | Undefined = UNDEFINED, - on_change: Callable[[Key], None] | Undefined = UNDEFINED, - on_selection_change: Callable[[Selection], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + is_emphasized: bool | UndefinedType = Undefined, + density: ActionGroupDensity | UndefinedType = "regular", + is_justified: bool | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + static_color: StaticColor | UndefinedType = Undefined, + overflow_mode: OverflowMode | UndefinedType = "wrap", + button_label_behavior: ButtonLabelBehavior | UndefinedType = "show", + summary_icon: Element | UndefinedType = Undefined, + orientation: Orientation | UndefinedType = "horizontal", + disabled_keys: Iterable[str] | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + selection_mode: SelectionMode | UndefinedType = Undefined, + disallow_empty_selection: bool | UndefinedType = Undefined, + selected_keys: SelectedKeys | Iterable[str] | UndefinedType = Undefined, + default_selected_keys: SelectedKeys | Iterable[str] | UndefinedType = Undefined, + on_action: Callable[[str], None] | UndefinedType = Undefined, + on_change: Callable[[Key], None] | UndefinedType = Undefined, + on_selection_change: Callable[[Selection], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ An action grouping of action items that are related to each other. diff --git a/plugins/ui/src/deephaven/ui/components/action_menu.py b/plugins/ui/src/deephaven/ui/components/action_menu.py index 117b55c51..3e8d574dc 100644 --- a/plugins/ui/src/deephaven/ui/components/action_menu.py +++ b/plugins/ui/src/deephaven/ui/components/action_menu.py @@ -7,7 +7,7 @@ from .basic import component_element from ..elements import Element -from ..types import Key, ActionKey, ActionMenuDirection, Undefined, UNDEFINED +from ..types import Key, ActionKey, ActionMenuDirection, UndefinedType, Undefined from .types import ( # Events @@ -25,63 +25,63 @@ def action_menu( *children: Item | SectionElement, - is_disabled: bool | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - disabled_keys: Iterable[Key] | Undefined = UNDEFINED, - align: Alignment | Undefined = "start", - direction: ActionMenuDirection | Undefined = "bottom", - should_flip: bool | Undefined = True, - close_on_select: bool | Undefined = True, - trigger: TriggerType | Undefined = "press", - is_open: bool | Undefined = UNDEFINED, - default_open: bool | Undefined = UNDEFINED, - on_action: Callable[[ActionKey], None] | Undefined = UNDEFINED, - on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + is_disabled: bool | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + disabled_keys: Iterable[Key] | UndefinedType = Undefined, + align: Alignment | UndefinedType = "start", + direction: ActionMenuDirection | UndefinedType = "bottom", + should_flip: bool | UndefinedType = True, + close_on_select: bool | UndefinedType = True, + trigger: TriggerType | UndefinedType = "press", + is_open: bool | UndefinedType = Undefined, + default_open: bool | UndefinedType = Undefined, + on_action: Callable[[ActionKey], None] | UndefinedType = Undefined, + on_open_change: Callable[[bool], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ ActionMenu combines an ActionButton with a Menu for simple "more actions" use cases. diff --git a/plugins/ui/src/deephaven/ui/components/button.py b/plugins/ui/src/deephaven/ui/components/button.py index 95b101e61..72b40126e 100644 --- a/plugins/ui/src/deephaven/ui/components/button.py +++ b/plugins/ui/src/deephaven/ui/components/button.py @@ -23,80 +23,80 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def button( *children: Any, - variant: ButtonVariant | Undefined = "accent", - style: ButtonStyle | Undefined = "fill", - static_color: StaticColor | Undefined = UNDEFINED, - is_pending: bool | Undefined = UNDEFINED, + variant: ButtonVariant | UndefinedType = "accent", + style: ButtonStyle | UndefinedType = "fill", + static_color: StaticColor | UndefinedType = Undefined, + is_pending: bool | UndefinedType = Undefined, type: ButtonType = "button", - is_disabled: bool | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - href: str | Undefined = UNDEFINED, - target: str | Undefined = UNDEFINED, - rel: str | Undefined = UNDEFINED, - on_press: PressEventCallable | Undefined = UNDEFINED, - on_press_start: PressEventCallable | Undefined = UNDEFINED, - on_press_end: PressEventCallable | Undefined = UNDEFINED, - on_press_up: PressEventCallable | Undefined = UNDEFINED, - on_press_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - exclude_from_tab_order: bool | Undefined = UNDEFINED, - aria_expanded: AriaExpanded | Undefined = UNDEFINED, - aria_has_popup: AriaHasPopup | Undefined = UNDEFINED, - aria_controls: str | Undefined = UNDEFINED, - aria_pressed: AriaPressed | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelled_by: str | Undefined = UNDEFINED, - aria_described_by: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + is_disabled: bool | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + href: str | UndefinedType = Undefined, + target: str | UndefinedType = Undefined, + rel: str | UndefinedType = Undefined, + on_press: PressEventCallable | UndefinedType = Undefined, + on_press_start: PressEventCallable | UndefinedType = Undefined, + on_press_end: PressEventCallable | UndefinedType = Undefined, + on_press_up: PressEventCallable | UndefinedType = Undefined, + on_press_change: Callable[[bool], None] | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + exclude_from_tab_order: bool | UndefinedType = Undefined, + aria_expanded: AriaExpanded | UndefinedType = Undefined, + aria_has_popup: AriaHasPopup | UndefinedType = Undefined, + aria_controls: str | UndefinedType = Undefined, + aria_pressed: AriaPressed | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelled_by: str | UndefinedType = Undefined, + aria_described_by: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Buttons allow users to perform an action or to navigate to another page. They have multiple styles for various needs, and are ideal for calling attention to where a user needs to do something in order to move forward in a flow. @@ -192,7 +192,7 @@ def button( rel=rel, # intentionally not exposing element_type to the user # for href links we can handle on their behalf - element_type=UNDEFINED if href is UNDEFINED else "a", + element_type=Undefined if href is Undefined else "a", on_press=on_press, on_press_start=on_press_start, on_press_end=on_press_end, diff --git a/plugins/ui/src/deephaven/ui/components/button_group.py b/plugins/ui/src/deephaven/ui/components/button_group.py index 6a41d2086..4d797f17d 100644 --- a/plugins/ui/src/deephaven/ui/components/button_group.py +++ b/plugins/ui/src/deephaven/ui/components/button_group.py @@ -14,54 +14,54 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def button_group( *children: Any, - is_disabled: bool | Undefined = UNDEFINED, + is_disabled: bool | UndefinedType = Undefined, orientation: Orientation = "horizontal", align: ButtonGroupAlignment = "start", - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ A button group is a grouping of button whose actions are related to each other. diff --git a/plugins/ui/src/deephaven/ui/components/calendar.py b/plugins/ui/src/deephaven/ui/components/calendar.py index 79834d1ab..4be909d4f 100644 --- a/plugins/ui/src/deephaven/ui/components/calendar.py +++ b/plugins/ui/src/deephaven/ui/components/calendar.py @@ -15,7 +15,7 @@ from ..elements import Element from .._internal.utils import create_props, convert_date_props, wrap_local_date_callable -from ..types import Date, LocalDateConvertible, Undefined, UNDEFINED +from ..types import Date, LocalDateConvertible, UndefinedType, Undefined from .basic import component_element from .make_component import make_component from deephaven.time import dh_now @@ -75,66 +75,66 @@ def _convert_calendar_props( @make_component def calendar( - value: Date | Undefined = UNDEFINED, - default_value: Date | Undefined = UNDEFINED, - focused_value: Date | Undefined = UNDEFINED, - default_focused_value: Date | Undefined = UNDEFINED, - min_value: Date | Undefined = UNDEFINED, - max_value: Date | Undefined = UNDEFINED, - page_behavior: PageBehavior | Undefined = UNDEFINED, - is_invalid: bool | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - error_message: Element | Undefined = UNDEFINED, - visible_months: int | Undefined = UNDEFINED, - on_focus_change: Callable[[LocalDateConvertible], None] | Undefined = UNDEFINED, - on_change: Callable[[Date], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_pressed: AriaPressed | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + value: Date | UndefinedType = Undefined, + default_value: Date | UndefinedType = Undefined, + focused_value: Date | UndefinedType = Undefined, + default_focused_value: Date | UndefinedType = Undefined, + min_value: Date | UndefinedType = Undefined, + max_value: Date | UndefinedType = Undefined, + page_behavior: PageBehavior | UndefinedType = Undefined, + is_invalid: bool | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + error_message: Element | UndefinedType = Undefined, + visible_months: int | UndefinedType = Undefined, + on_focus_change: Callable[[LocalDateConvertible], None] | UndefinedType = Undefined, + on_change: Callable[[Date], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_pressed: AriaPressed | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> CalendarElement: """ A calendar allows the user to select a date. diff --git a/plugins/ui/src/deephaven/ui/components/checkbox.py b/plugins/ui/src/deephaven/ui/components/checkbox.py index 5d99abf52..596f865a2 100644 --- a/plugins/ui/src/deephaven/ui/components/checkbox.py +++ b/plugins/ui/src/deephaven/ui/components/checkbox.py @@ -15,77 +15,77 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def checkbox( *children: Any, - is_emphasized: bool | Undefined = UNDEFINED, - is_indeterminate: bool | Undefined = UNDEFINED, - default_selected: bool | Undefined = UNDEFINED, - is_selected: bool | Undefined = UNDEFINED, - value: str | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, - is_invalid: bool | Undefined = UNDEFINED, + is_emphasized: bool | UndefinedType = Undefined, + is_indeterminate: bool | UndefinedType = Undefined, + default_selected: bool | UndefinedType = Undefined, + is_selected: bool | UndefinedType = Undefined, + value: str | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, + is_invalid: bool | UndefinedType = Undefined, # validation_behaviour, # omitted because validate is not implemented # validate, # omitted because it needs to return a ValidationError synchronously - auto_focus: bool | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - on_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - exclude_from_tab_order: bool | Undefined = UNDEFINED, - aria_controls: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - aria_errormessage: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + auto_focus: bool | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + on_change: Callable[[bool], None] | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + exclude_from_tab_order: bool | UndefinedType = Undefined, + aria_controls: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + aria_errormessage: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Checkboxes allow users to select multiple items from a list of individual items, or to mark one individual item as selected. diff --git a/plugins/ui/src/deephaven/ui/components/checkbox_group.py b/plugins/ui/src/deephaven/ui/components/checkbox_group.py index 2c7920a30..7ae21c47b 100644 --- a/plugins/ui/src/deephaven/ui/components/checkbox_group.py +++ b/plugins/ui/src/deephaven/ui/components/checkbox_group.py @@ -15,77 +15,77 @@ ) from .basic import component_element from ..elements import Element -from ..types import Key, Selection, Undefined, UNDEFINED +from ..types import Key, Selection, UndefinedType, Undefined def checkbox_group( *children: Any, orientation: Orientation = "vertical", - is_emphasized: bool | Undefined = UNDEFINED, - value: Selection | Undefined = UNDEFINED, - default_value: Selection | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - label: Any | Undefined = UNDEFINED, - description: Any | Undefined = UNDEFINED, - error_message: Any | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, - is_invalid: bool | Undefined = UNDEFINED, - validation_behavior: ValidationBehavior | Undefined = "aria", - label_position: str | Undefined = UNDEFINED, - label_align: str | Undefined = UNDEFINED, - necessity_indicator: str | Undefined = UNDEFINED, - contextual_help: Any | Undefined = UNDEFINED, - show_error_icon: bool | Undefined = UNDEFINED, - on_change: Callable[[Key], None] | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - aria_errormessage: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, + is_emphasized: bool | UndefinedType = Undefined, + value: Selection | UndefinedType = Undefined, + default_value: Selection | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + label: Any | UndefinedType = Undefined, + description: Any | UndefinedType = Undefined, + error_message: Any | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, + is_invalid: bool | UndefinedType = Undefined, + validation_behavior: ValidationBehavior | UndefinedType = "aria", + label_position: str | UndefinedType = Undefined, + label_align: str | UndefinedType = Undefined, + necessity_indicator: str | UndefinedType = Undefined, + contextual_help: Any | UndefinedType = Undefined, + show_error_icon: bool | UndefinedType = Undefined, + on_change: Callable[[Key], None] | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + aria_errormessage: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, ) -> Element: """ A grouping of checkbox's that are related to each other. diff --git a/plugins/ui/src/deephaven/ui/components/column.py b/plugins/ui/src/deephaven/ui/components/column.py index 79d40fc48..ba62b88fe 100644 --- a/plugins/ui/src/deephaven/ui/components/column.py +++ b/plugins/ui/src/deephaven/ui/components/column.py @@ -3,13 +3,13 @@ from typing import Any from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def column( *children: Any, - width: float | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + width: float | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ A column is a container that can be used to group elements. diff --git a/plugins/ui/src/deephaven/ui/components/combo_box.py b/plugins/ui/src/deephaven/ui/components/combo_box.py index 38e5c9b28..ef1165c03 100644 --- a/plugins/ui/src/deephaven/ui/components/combo_box.py +++ b/plugins/ui/src/deephaven/ui/components/combo_box.py @@ -29,7 +29,7 @@ from .item_table_source import ItemTableSource from ..elements import BaseElement, Element from .._internal.utils import create_props, unpack_item_table_source -from ..types import Key, Undefined, UNDEFINED +from ..types import Key, UndefinedType, Undefined from .basic import component_element ComboBoxElement = BaseElement @@ -45,88 +45,89 @@ def combo_box( *children: Item | SectionElement | Table | PartitionedTable | ItemTableSource, - menu_trigger: MenuTriggerAction | Undefined = "input", - is_quiet: bool | Undefined = UNDEFINED, - align: Align | Undefined = "end", - direction: MenuDirection | Undefined = "bottom", - loading_state: LoadingState | Undefined = UNDEFINED, + menu_trigger: MenuTriggerAction | UndefinedType = "input", + is_quiet: bool | UndefinedType = Undefined, + align: Align | UndefinedType = "end", + direction: MenuDirection | UndefinedType = "bottom", + loading_state: LoadingState | UndefinedType = Undefined, should_flip: bool = True, - menu_width: DimensionValue | Undefined = UNDEFINED, - form_value: FormValue | Undefined = "text", - should_focus_wrap: bool | Undefined = UNDEFINED, - input_value: str | Undefined = UNDEFINED, - default_input_value: str | Undefined = UNDEFINED, - allows_custom_value: bool | Undefined = UNDEFINED, - disabled_keys: list[Key] | Undefined = UNDEFINED, - selected_key: Key | Undefined = UNDEFINED, - default_selected_key: Key | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, + menu_width: DimensionValue | UndefinedType = Undefined, + form_value: FormValue | UndefinedType = "text", + should_focus_wrap: bool | UndefinedType = Undefined, + input_value: str | UndefinedType = Undefined, + default_input_value: str | UndefinedType = Undefined, + allows_custom_value: bool | UndefinedType = Undefined, + disabled_keys: list[Key] | UndefinedType = Undefined, + selected_key: Key | UndefinedType = Undefined, + default_selected_key: Key | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, validation_behavior: ValidationBehavior = "aria", - auto_focus: bool | Undefined = UNDEFINED, - label: Element | Undefined = UNDEFINED, - description: Element | Undefined = UNDEFINED, - error_message: Element | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - validation_state: ValidationState | Undefined = UNDEFINED, + auto_focus: bool | UndefinedType = Undefined, + label: Element | UndefinedType = Undefined, + description: Element | UndefinedType = Undefined, + error_message: Element | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + validation_state: ValidationState | UndefinedType = Undefined, label_position: LabelPosition = "top", - label_align: Alignment | Undefined = UNDEFINED, - necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, - contextual_help: Element | Undefined = UNDEFINED, - on_open_change: Callable[[bool, MenuTriggerAction], None] | Undefined = UNDEFINED, - on_selection_change: Callable[[Key], None] | Undefined = UNDEFINED, - on_change: Callable[[Key], None] | Undefined = UNDEFINED, - on_input_change: Callable[[str], None] | Undefined = UNDEFINED, - on_focus: Callable[[FocusEventCallable], None] | Undefined = UNDEFINED, - on_blur: Callable[[FocusEventCallable], None] | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: Callable[[KeyboardEventCallable], None] | Undefined = UNDEFINED, - on_key_up: Callable[[KeyboardEventCallable], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + label_align: Alignment | UndefinedType = Undefined, + necessity_indicator: NecessityIndicator | UndefinedType = Undefined, + contextual_help: Element | UndefinedType = Undefined, + on_open_change: Callable[[bool, MenuTriggerAction], None] + | UndefinedType = Undefined, + on_selection_change: Callable[[Key], None] | UndefinedType = Undefined, + on_change: Callable[[Key], None] | UndefinedType = Undefined, + on_input_change: Callable[[str], None] | UndefinedType = Undefined, + on_focus: Callable[[FocusEventCallable], None] | UndefinedType = Undefined, + on_blur: Callable[[FocusEventCallable], None] | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: Callable[[KeyboardEventCallable], None] | UndefinedType = Undefined, + on_key_up: Callable[[KeyboardEventCallable], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> ComboBoxElement: """ A combo box that can be used to search or select from a list. Children should be one of five types: diff --git a/plugins/ui/src/deephaven/ui/components/content.py b/plugins/ui/src/deephaven/ui/components/content.py index 1985dbe05..affbfe260 100644 --- a/plugins/ui/src/deephaven/ui/components/content.py +++ b/plugins/ui/src/deephaven/ui/components/content.py @@ -11,51 +11,51 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def content( *children: Any, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Content represents the primary content within a Spectrum container. diff --git a/plugins/ui/src/deephaven/ui/components/contextual_help.py b/plugins/ui/src/deephaven/ui/components/contextual_help.py index 7b869eacb..c4fcadd31 100644 --- a/plugins/ui/src/deephaven/ui/components/contextual_help.py +++ b/plugins/ui/src/deephaven/ui/components/contextual_help.py @@ -14,67 +14,67 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def contextual_help( heading: Any, content: Any, - footer: Any = UNDEFINED, + footer: Any = Undefined, *, - variant: ContextualHelperVariant | Undefined = "help", - placement: Placement | Undefined = "bottom start", - is_open: bool | Undefined = UNDEFINED, - default_open: bool | Undefined = UNDEFINED, - container_padding: float | Undefined = UNDEFINED, - offset: float | Undefined = UNDEFINED, - cross_offset: float | Undefined = UNDEFINED, - should_flip: bool | Undefined = UNDEFINED, - on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + variant: ContextualHelperVariant | UndefinedType = "help", + placement: Placement | UndefinedType = "bottom start", + is_open: bool | UndefinedType = Undefined, + default_open: bool | UndefinedType = Undefined, + container_padding: float | UndefinedType = Undefined, + offset: float | UndefinedType = Undefined, + cross_offset: float | UndefinedType = Undefined, + should_flip: bool | UndefinedType = Undefined, + on_open_change: Callable[[bool], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ A contextual help is a quiet action button that triggers an informational popover. diff --git a/plugins/ui/src/deephaven/ui/components/date_field.py b/plugins/ui/src/deephaven/ui/components/date_field.py index d33b6cee1..b91e3cb35 100644 --- a/plugins/ui/src/deephaven/ui/components/date_field.py +++ b/plugins/ui/src/deephaven/ui/components/date_field.py @@ -25,7 +25,7 @@ create_props, convert_date_props, ) -from ..types import Date, Granularity, Undefined, UNDEFINED +from ..types import Date, Granularity, UndefinedType, Undefined from .basic import component_element from .make_component import make_component from deephaven.time import dh_now @@ -75,87 +75,87 @@ def _convert_date_field_props( @make_component def date_field( - placeholder_value: Date | Undefined = dh_now(), - value: Date | Undefined = UNDEFINED, - default_value: Date | Undefined = UNDEFINED, - min_value: Date | Undefined = UNDEFINED, - max_value: Date | Undefined = UNDEFINED, + placeholder_value: Date | UndefinedType = dh_now(), + value: Date | UndefinedType = Undefined, + default_value: Date | UndefinedType = Undefined, + min_value: Date | UndefinedType = Undefined, + max_value: Date | UndefinedType = Undefined, # TODO (issue # 698) we need to implement unavailable_values # unavailable_values: Sequence[Date] | Undefined = UNDEFINED, - granularity: Granularity | Undefined = UNDEFINED, - hour_cycle: HourCycle | Undefined = UNDEFINED, + granularity: Granularity | UndefinedType = Undefined, + hour_cycle: HourCycle | UndefinedType = Undefined, hide_time_zone: bool = False, - should_force_leading_zeros: bool | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, - validation_behavior: ValidationBehavior | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - label: Element | Undefined = UNDEFINED, - description: Element | Undefined = UNDEFINED, - error_message: Element | Undefined = UNDEFINED, - is_open: bool | Undefined = UNDEFINED, - default_open: bool | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - show_format_help_text: bool | Undefined = UNDEFINED, - label_position: LabelPosition | Undefined = UNDEFINED, - label_align: Alignment | Undefined = UNDEFINED, - necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, - contextual_help: Element | Undefined = UNDEFINED, - validation_state: ValidationState | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_change: Callable[[Date], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_pressed: AriaPressed | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + should_force_leading_zeros: bool | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, + validation_behavior: ValidationBehavior | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + label: Element | UndefinedType = Undefined, + description: Element | UndefinedType = Undefined, + error_message: Element | UndefinedType = Undefined, + is_open: bool | UndefinedType = Undefined, + default_open: bool | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + show_format_help_text: bool | UndefinedType = Undefined, + label_position: LabelPosition | UndefinedType = Undefined, + label_align: Alignment | UndefinedType = Undefined, + necessity_indicator: NecessityIndicator | UndefinedType = Undefined, + contextual_help: Element | UndefinedType = Undefined, + validation_state: ValidationState | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + on_open_change: Callable[[bool], None] | UndefinedType = Undefined, + on_change: Callable[[Date], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_pressed: AriaPressed | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> DateFieldElement: """ A date field allows the user to select a date. diff --git a/plugins/ui/src/deephaven/ui/components/date_picker.py b/plugins/ui/src/deephaven/ui/components/date_picker.py index 5e31675df..eb641b211 100644 --- a/plugins/ui/src/deephaven/ui/components/date_picker.py +++ b/plugins/ui/src/deephaven/ui/components/date_picker.py @@ -28,7 +28,7 @@ convert_date_props, convert_list_prop, ) -from ..types import Date, Granularity, Undefined, UNDEFINED +from ..types import Date, Granularity, UndefinedType, Undefined from .basic import component_element from .make_component import make_component from deephaven.time import dh_now @@ -79,90 +79,90 @@ def _convert_date_picker_props( @make_component def date_picker( - placeholder_value: Date | Undefined = dh_now(), - value: Date | Undefined = UNDEFINED, - default_value: Date | Undefined = UNDEFINED, - min_value: Date | Undefined = UNDEFINED, - max_value: Date | Undefined = UNDEFINED, + placeholder_value: Date | UndefinedType = dh_now(), + value: Date | UndefinedType = Undefined, + default_value: Date | UndefinedType = Undefined, + min_value: Date | UndefinedType = Undefined, + max_value: Date | UndefinedType = Undefined, # TODO (issue # 698) we need to implement unavailable_values # unavailable_values: Sequence[Date] | Undefined = UNDEFINED, - granularity: Granularity | Undefined = UNDEFINED, - page_behavior: PageBehavior | Undefined = UNDEFINED, - hour_cycle: HourCycle | Undefined = UNDEFINED, + granularity: Granularity | UndefinedType = Undefined, + page_behavior: PageBehavior | UndefinedType = Undefined, + hour_cycle: HourCycle | UndefinedType = Undefined, hide_time_zone: bool = False, - should_force_leading_zeros: bool | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, - validation_behavior: ValidationBehavior | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - label: Element | Undefined = UNDEFINED, - description: Element | Undefined = UNDEFINED, - error_message: Element | Undefined = UNDEFINED, - is_open: bool | Undefined = UNDEFINED, - default_open: bool | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - max_visible_months: int | Undefined = UNDEFINED, - should_flip: bool | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - show_format_help_text: bool | Undefined = UNDEFINED, - label_position: LabelPosition | Undefined = UNDEFINED, - label_align: Alignment | Undefined = UNDEFINED, - necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, - contextual_help: Element | Undefined = UNDEFINED, - validation_state: ValidationState | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_change: Callable[[Date], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_pressed: AriaPressed | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + should_force_leading_zeros: bool | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, + validation_behavior: ValidationBehavior | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + label: Element | UndefinedType = Undefined, + description: Element | UndefinedType = Undefined, + error_message: Element | UndefinedType = Undefined, + is_open: bool | UndefinedType = Undefined, + default_open: bool | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + max_visible_months: int | UndefinedType = Undefined, + should_flip: bool | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + show_format_help_text: bool | UndefinedType = Undefined, + label_position: LabelPosition | UndefinedType = Undefined, + label_align: Alignment | UndefinedType = Undefined, + necessity_indicator: NecessityIndicator | UndefinedType = Undefined, + contextual_help: Element | UndefinedType = Undefined, + validation_state: ValidationState | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + on_open_change: Callable[[bool], None] | UndefinedType = Undefined, + on_change: Callable[[Date], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_pressed: AriaPressed | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> DatePickerElement: """ A date picker allows the user to select a date. diff --git a/plugins/ui/src/deephaven/ui/components/date_range_picker.py b/plugins/ui/src/deephaven/ui/components/date_range_picker.py index 567949c9d..acd6d1c0a 100644 --- a/plugins/ui/src/deephaven/ui/components/date_range_picker.py +++ b/plugins/ui/src/deephaven/ui/components/date_range_picker.py @@ -28,7 +28,7 @@ convert_date_props, convert_list_prop, ) -from ..types import Date, Granularity, DateRange, Undefined, UNDEFINED +from ..types import Date, Granularity, DateRange, UndefinedType, Undefined from .basic import component_element from .make_component import make_component from deephaven.time import dh_now @@ -77,92 +77,92 @@ def _convert_date_range_picker_props( @make_component def date_range_picker( - placeholder_value: Date | Undefined = dh_now(), - value: DateRange | Undefined = UNDEFINED, - default_value: DateRange | Undefined = UNDEFINED, - min_value: Date | Undefined = UNDEFINED, - max_value: Date | Undefined = UNDEFINED, + placeholder_value: Date | UndefinedType = dh_now(), + value: DateRange | UndefinedType = Undefined, + default_value: DateRange | UndefinedType = Undefined, + min_value: Date | UndefinedType = Undefined, + max_value: Date | UndefinedType = Undefined, # TODO (issue # 698) we need to implement unavailable_values # unavailable_values: Sequence[Date] | Undefined = UNDEFINED, - granularity: Granularity | Undefined = UNDEFINED, - page_behavior: PageBehavior | Undefined = UNDEFINED, - hour_cycle: HourCycle | Undefined = UNDEFINED, + granularity: Granularity | UndefinedType = Undefined, + page_behavior: PageBehavior | UndefinedType = Undefined, + hour_cycle: HourCycle | UndefinedType = Undefined, hide_time_zone: bool = False, - should_force_leading_zeros: bool | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, - validation_behavior: ValidationBehavior | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - label: Element | Undefined = UNDEFINED, - description: Element | Undefined = UNDEFINED, - error_message: Element | Undefined = UNDEFINED, - is_open: bool | Undefined = UNDEFINED, - default_open: bool | Undefined = UNDEFINED, - allows_non_contiguous_ranges: bool | Undefined = UNDEFINED, - start_name: str | Undefined = UNDEFINED, - end_name: str | Undefined = UNDEFINED, - max_visible_months: int | Undefined = UNDEFINED, - should_flip: bool | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - show_format_help_text: bool | Undefined = UNDEFINED, - label_position: LabelPosition | Undefined = UNDEFINED, - label_align: Alignment | Undefined = UNDEFINED, - necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, - contextual_help: Element | Undefined = UNDEFINED, - validation_state: ValidationState | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_change: Callable[[DateRange], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_pressed: AriaPressed | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + should_force_leading_zeros: bool | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, + validation_behavior: ValidationBehavior | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + label: Element | UndefinedType = Undefined, + description: Element | UndefinedType = Undefined, + error_message: Element | UndefinedType = Undefined, + is_open: bool | UndefinedType = Undefined, + default_open: bool | UndefinedType = Undefined, + allows_non_contiguous_ranges: bool | UndefinedType = Undefined, + start_name: str | UndefinedType = Undefined, + end_name: str | UndefinedType = Undefined, + max_visible_months: int | UndefinedType = Undefined, + should_flip: bool | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + show_format_help_text: bool | UndefinedType = Undefined, + label_position: LabelPosition | UndefinedType = Undefined, + label_align: Alignment | UndefinedType = Undefined, + necessity_indicator: NecessityIndicator | UndefinedType = Undefined, + contextual_help: Element | UndefinedType = Undefined, + validation_state: ValidationState | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + on_open_change: Callable[[bool], None] | UndefinedType = Undefined, + on_change: Callable[[DateRange], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_pressed: AriaPressed | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> DatePickerElement: """ A date range picker allows the user to select a range of dates. diff --git a/plugins/ui/src/deephaven/ui/components/dialog.py b/plugins/ui/src/deephaven/ui/components/dialog.py index 5bd54723a..4c3b4108d 100644 --- a/plugins/ui/src/deephaven/ui/components/dialog.py +++ b/plugins/ui/src/deephaven/ui/components/dialog.py @@ -15,7 +15,7 @@ from ..elements import Element from .._internal.utils import create_props -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined from .basic import component_element DialogElement = Element @@ -23,54 +23,54 @@ def dialog( *children: Any, - size: DialogSize | Undefined = UNDEFINED, - is_dismissable: bool | Undefined = UNDEFINED, - on_dismiss: Callable[[], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_pressed: AriaPressed | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + size: DialogSize | UndefinedType = Undefined, + is_dismissable: bool | UndefinedType = Undefined, + on_dismiss: Callable[[], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_pressed: AriaPressed | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> DialogElement: """ A dialog is a window containing contextual information, tasks, or workflows that appear over the user interface. diff --git a/plugins/ui/src/deephaven/ui/components/dialog_trigger.py b/plugins/ui/src/deephaven/ui/components/dialog_trigger.py index c98fde9ff..14ccf9774 100644 --- a/plugins/ui/src/deephaven/ui/components/dialog_trigger.py +++ b/plugins/ui/src/deephaven/ui/components/dialog_trigger.py @@ -7,26 +7,26 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined from .._internal.utils import create_props def dialog_trigger( *children: Element, - type: DialogTriggerType | Undefined = "modal", - mobile_type: DialogTriggerMobileType | Undefined = UNDEFINED, - placement: Placement | Undefined = "bottom", - is_open: bool | Undefined = UNDEFINED, - default_open: bool | Undefined = UNDEFINED, - container_padding: float | Undefined = UNDEFINED, - offset: float | Undefined = UNDEFINED, - cross_offset: float | Undefined = UNDEFINED, - should_flip: bool | Undefined = UNDEFINED, - hide_arrow: bool | Undefined = UNDEFINED, - is_dismissable: bool | Undefined = UNDEFINED, - is_keyboard_dismiss_disabled: bool | Undefined = UNDEFINED, - on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + type: DialogTriggerType | UndefinedType = "modal", + mobile_type: DialogTriggerMobileType | UndefinedType = Undefined, + placement: Placement | UndefinedType = "bottom", + is_open: bool | UndefinedType = Undefined, + default_open: bool | UndefinedType = Undefined, + container_padding: float | UndefinedType = Undefined, + offset: float | UndefinedType = Undefined, + cross_offset: float | UndefinedType = Undefined, + should_flip: bool | UndefinedType = Undefined, + hide_arrow: bool | UndefinedType = Undefined, + is_dismissable: bool | UndefinedType = Undefined, + is_keyboard_dismiss_disabled: bool | UndefinedType = Undefined, + on_open_change: Callable[[bool], None] | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ A dialog_trigger serves as a wrapper around a dialog and its associated trigger. diff --git a/plugins/ui/src/deephaven/ui/components/flex.py b/plugins/ui/src/deephaven/ui/components/flex.py index 49fbc12b6..21172f72b 100644 --- a/plugins/ui/src/deephaven/ui/components/flex.py +++ b/plugins/ui/src/deephaven/ui/components/flex.py @@ -2,7 +2,7 @@ from typing import Any from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined from .types import ( LayoutFlex, Direction, @@ -20,54 +20,54 @@ def flex( *children: Any, - direction: Direction | Undefined = UNDEFINED, - wrap: Wrap | Undefined = UNDEFINED, - justify_content: JustifyContent | Undefined = UNDEFINED, - align_content: AlignContent | Undefined = UNDEFINED, - align_items: AlignItems | Undefined = UNDEFINED, - gap: DimensionValue | Undefined = "size-100", - column_gap: DimensionValue | Undefined = UNDEFINED, - row_gap: DimensionValue | Undefined = UNDEFINED, + direction: Direction | UndefinedType = Undefined, + wrap: Wrap | UndefinedType = Undefined, + justify_content: JustifyContent | UndefinedType = Undefined, + align_content: AlignContent | UndefinedType = Undefined, + align_items: AlignItems | UndefinedType = Undefined, + gap: DimensionValue | UndefinedType = "size-100", + column_gap: DimensionValue | UndefinedType = Undefined, + row_gap: DimensionValue | UndefinedType = Undefined, flex: LayoutFlex = "auto", - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Base Flex component for laying out children in a flexbox. diff --git a/plugins/ui/src/deephaven/ui/components/form.py b/plugins/ui/src/deephaven/ui/components/form.py index e2b9554a9..17280d643 100644 --- a/plugins/ui/src/deephaven/ui/components/form.py +++ b/plugins/ui/src/deephaven/ui/components/form.py @@ -20,76 +20,76 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def form( *children: Any, - is_quiet: bool | Undefined = UNDEFINED, - is_emphasized: bool | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - validation_state: ValidationState | Undefined = UNDEFINED, - validation_behavior: ValidationBehavior | Undefined = "aria", - validation_errors: Dict[str, str | List[str]] | Undefined = UNDEFINED, - action: str | Undefined = UNDEFINED, - enc_type: EncodingType | Undefined = UNDEFINED, - method: HTTPMethods | Undefined = UNDEFINED, - target: Target | Undefined = UNDEFINED, - auto_complete: AutoCompleteModes | Undefined = UNDEFINED, - auto_capitalize: AutoCapitalizeModes | Undefined = UNDEFINED, + is_quiet: bool | UndefinedType = Undefined, + is_emphasized: bool | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + validation_state: ValidationState | UndefinedType = Undefined, + validation_behavior: ValidationBehavior | UndefinedType = "aria", + validation_errors: Dict[str, str | List[str]] | UndefinedType = Undefined, + action: str | UndefinedType = Undefined, + enc_type: EncodingType | UndefinedType = Undefined, + method: HTTPMethods | UndefinedType = Undefined, + target: Target | UndefinedType = Undefined, + auto_complete: AutoCompleteModes | UndefinedType = Undefined, + auto_capitalize: AutoCapitalizeModes | UndefinedType = Undefined, label_position: LabelPosition = "top", - label_align: Alignment | Undefined = UNDEFINED, - necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, - on_submit: Callable[[dict[str, str]], None] | Undefined = UNDEFINED, - on_reset: Callable[[dict[str, str]], None] | Undefined = UNDEFINED, - on_invalid: Callable[[dict[str, str]], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - overflow: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + label_align: Alignment | UndefinedType = Undefined, + necessity_indicator: NecessityIndicator | UndefinedType = Undefined, + on_submit: Callable[[dict[str, str]], None] | UndefinedType = Undefined, + on_reset: Callable[[dict[str, str]], None] | UndefinedType = Undefined, + on_invalid: Callable[[dict[str, str]], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + overflow: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Forms allow users to enter data that can be submitted while providing alignment and styling for form fields diff --git a/plugins/ui/src/deephaven/ui/components/fragment.py b/plugins/ui/src/deephaven/ui/components/fragment.py index a8295008d..cbda2879e 100644 --- a/plugins/ui/src/deephaven/ui/components/fragment.py +++ b/plugins/ui/src/deephaven/ui/components/fragment.py @@ -3,10 +3,10 @@ from typing import Any from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined -def fragment(*children: Any, key: str | Undefined = UNDEFINED) -> Element: +def fragment(*children: Any, key: str | UndefinedType = Undefined) -> Element: """ A React.Fragment: https://react.dev/reference/react/Fragment. Used to group elements together without a wrapper node. diff --git a/plugins/ui/src/deephaven/ui/components/grid.py b/plugins/ui/src/deephaven/ui/components/grid.py index 99a8c1c25..5d9483647 100644 --- a/plugins/ui/src/deephaven/ui/components/grid.py +++ b/plugins/ui/src/deephaven/ui/components/grid.py @@ -16,64 +16,64 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def grid( *children: Any, - areas: list[str] | Undefined = UNDEFINED, - rows: str | list[DimensionValue] | Undefined = UNDEFINED, - columns: str | list[DimensionValue] | Undefined = UNDEFINED, - auto_columns: DimensionValue | Undefined = UNDEFINED, - auto_rows: DimensionValue | Undefined = UNDEFINED, - auto_flow: GridFlow | Undefined = UNDEFINED, - justify_items: JustifyItems | Undefined = UNDEFINED, + areas: list[str] | UndefinedType = Undefined, + rows: str | list[DimensionValue] | UndefinedType = Undefined, + columns: str | list[DimensionValue] | UndefinedType = Undefined, + auto_columns: DimensionValue | UndefinedType = Undefined, + auto_rows: DimensionValue | UndefinedType = Undefined, + auto_flow: GridFlow | UndefinedType = Undefined, + justify_items: JustifyItems | UndefinedType = Undefined, justify_content: JustifyContent = "stretch", align_content: AlignContent = "start", align_items: AlignItems = "stretch", - gap: DimensionValue | Undefined = "size-100", - column_gap: DimensionValue | Undefined = UNDEFINED, - row_gap: DimensionValue | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = "auto", - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + gap: DimensionValue | UndefinedType = "size-100", + column_gap: DimensionValue | UndefinedType = Undefined, + row_gap: DimensionValue | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = "auto", + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ A layout container using CSS grid. Supports Spectrum dimensions as values to ensure consistent and adaptive sizing and spacing. diff --git a/plugins/ui/src/deephaven/ui/components/heading.py b/plugins/ui/src/deephaven/ui/components/heading.py index f7a51bf7e..c823efeb3 100644 --- a/plugins/ui/src/deephaven/ui/components/heading.py +++ b/plugins/ui/src/deephaven/ui/components/heading.py @@ -13,53 +13,53 @@ from ..types import Color from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def heading( *children: Any, level: HeadingLevel = 3, - color: Color | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + color: Color | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ A layout container using CSS grid. Supports Spectrum dimensions as values to ensure consistent and adaptive sizing and spacing. diff --git a/plugins/ui/src/deephaven/ui/components/icon.py b/plugins/ui/src/deephaven/ui/components/icon.py index 43a9f2416..cef894562 100644 --- a/plugins/ui/src/deephaven/ui/components/icon.py +++ b/plugins/ui/src/deephaven/ui/components/icon.py @@ -1,6 +1,6 @@ from __future__ import annotations from ..elements import BaseElement, Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined from typing import Any from .types import ( AlignSelf, @@ -19,54 +19,54 @@ def icon( name: IconTypes, - size: IconSize | Undefined = UNDEFINED, - color: IconColor | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, + size: IconSize | UndefinedType = Undefined, + color: IconColor | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, slot: str = "icon", - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_hidden: bool | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_hidden: bool | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Get a Deephaven icon by name. diff --git a/plugins/ui/src/deephaven/ui/components/illustrated_message.py b/plugins/ui/src/deephaven/ui/components/illustrated_message.py index e5d47f494..20d9352f1 100644 --- a/plugins/ui/src/deephaven/ui/components/illustrated_message.py +++ b/plugins/ui/src/deephaven/ui/components/illustrated_message.py @@ -10,51 +10,51 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def illustrated_message( *children: Any, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ An IllustratedMessage displays an illustration and a message, usually for an empty state or an error page. diff --git a/plugins/ui/src/deephaven/ui/components/image.py b/plugins/ui/src/deephaven/ui/components/image.py index d3b676c55..74c5471b8 100644 --- a/plugins/ui/src/deephaven/ui/components/image.py +++ b/plugins/ui/src/deephaven/ui/components/image.py @@ -2,7 +2,7 @@ from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined from typing import Callable from .types import ( AlignSelf, @@ -17,50 +17,50 @@ def image( src: str, - alt: str | Undefined = UNDEFINED, + alt: str | UndefinedType = Undefined, object_fit: ObjectFit = "fill", - on_error: Callable[[], None] | Undefined = UNDEFINED, - on_load: Callable[[], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + on_error: Callable[[], None] | UndefinedType = Undefined, + on_load: Callable[[], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Image is used to insert and display an image within a component. diff --git a/plugins/ui/src/deephaven/ui/components/item.py b/plugins/ui/src/deephaven/ui/components/item.py index 8bef939a8..094fd64c4 100644 --- a/plugins/ui/src/deephaven/ui/components/item.py +++ b/plugins/ui/src/deephaven/ui/components/item.py @@ -2,7 +2,7 @@ from typing import Any, Union, List from ..elements import BaseElement -from ..types import Stringable, Undefined, UNDEFINED +from ..types import Stringable, UndefinedType, Undefined from .._internal.utils import create_props from .basic import component_element @@ -13,10 +13,10 @@ def item( *children: Stringable, - title: str | Undefined = UNDEFINED, - text_value: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + title: str | UndefinedType = Undefined, + text_value: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, **props: Any, ) -> ItemElement: """ diff --git a/plugins/ui/src/deephaven/ui/components/item_table_source.py b/plugins/ui/src/deephaven/ui/components/item_table_source.py index 31e1e4101..81b776555 100644 --- a/plugins/ui/src/deephaven/ui/components/item_table_source.py +++ b/plugins/ui/src/deephaven/ui/components/item_table_source.py @@ -8,7 +8,7 @@ from .list_action_group import ListActionGroupElement from .list_action_menu import ListActionMenuElement from ..elements import Element -from ..types import ColumnName, Stringable, Undefined, UNDEFINED +from ..types import ColumnName, Stringable, UndefinedType, Undefined ListViewItem = Union[Stringable, ItemElement] ListViewElement = Element @@ -16,23 +16,23 @@ class ItemTableSource(TypedDict): table: Table | PartitionedTable - key_column: ColumnName | Undefined - label_column: ColumnName | Undefined - description_column: ColumnName | Undefined - icon_column: ColumnName | Undefined - title_column: ColumnName | Undefined - actions: ListActionGroupElement | ListActionMenuElement | Undefined + key_column: ColumnName | UndefinedType + label_column: ColumnName | UndefinedType + description_column: ColumnName | UndefinedType + icon_column: ColumnName | UndefinedType + title_column: ColumnName | UndefinedType + actions: ListActionGroupElement | ListActionMenuElement | UndefinedType def item_table_source( table: Table | PartitionedTable, - key_column: ColumnName | Undefined = UNDEFINED, - label_column: ColumnName | Undefined = UNDEFINED, - description_column: ColumnName | Undefined = UNDEFINED, - icon_column: ColumnName | Undefined = UNDEFINED, - title_column: ColumnName | Undefined = UNDEFINED, - actions: ListActionGroupElement | ListActionMenuElement | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + key_column: ColumnName | UndefinedType = Undefined, + label_column: ColumnName | UndefinedType = Undefined, + description_column: ColumnName | UndefinedType = Undefined, + icon_column: ColumnName | UndefinedType = Undefined, + title_column: ColumnName | UndefinedType = Undefined, + actions: ListActionGroupElement | ListActionMenuElement | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> ItemTableSource: """ An item table source wraps a Table or PartitionedTable to provide additional information for diff --git a/plugins/ui/src/deephaven/ui/components/list_action_group.py b/plugins/ui/src/deephaven/ui/components/list_action_group.py index b82fc68df..9e2e82e3b 100644 --- a/plugins/ui/src/deephaven/ui/components/list_action_group.py +++ b/plugins/ui/src/deephaven/ui/components/list_action_group.py @@ -12,8 +12,8 @@ SelectedKeys, SelectionMode, Selection, + UndefinedType, Undefined, - UNDEFINED, ) from .types import ( # Events @@ -35,67 +35,67 @@ def list_action_group( *children: Item, - on_action: Callable[[ActionKey, Key], None] | Undefined = UNDEFINED, - on_change: Callable[[Selection, Key], None] | Undefined = UNDEFINED, - is_emphasized: bool | Undefined = UNDEFINED, - density: ActionGroupDensity | Undefined = "regular", - is_justified: bool | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - static_color: StaticColor | Undefined = UNDEFINED, - overflow_mode: OverflowMode | Undefined = "wrap", - button_label_behavior: ButtonLabelBehavior | Undefined = "show", - summary_icon: Element | Undefined = UNDEFINED, - orientation: Orientation | Undefined = "horizontal", - disabled_keys: Iterable[str] | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - selection_mode: SelectionMode | Undefined = UNDEFINED, - disallow_empty_selection: bool | Undefined = UNDEFINED, - selected_keys: SelectedKeys | Iterable[str] | Undefined = UNDEFINED, - default_selected_keys: SelectedKeys | Iterable[str] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + on_action: Callable[[ActionKey, Key], None] | UndefinedType = Undefined, + on_change: Callable[[Selection, Key], None] | UndefinedType = Undefined, + is_emphasized: bool | UndefinedType = Undefined, + density: ActionGroupDensity | UndefinedType = "regular", + is_justified: bool | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + static_color: StaticColor | UndefinedType = Undefined, + overflow_mode: OverflowMode | UndefinedType = "wrap", + button_label_behavior: ButtonLabelBehavior | UndefinedType = "show", + summary_icon: Element | UndefinedType = Undefined, + orientation: Orientation | UndefinedType = "horizontal", + disabled_keys: Iterable[str] | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + selection_mode: SelectionMode | UndefinedType = Undefined, + disallow_empty_selection: bool | UndefinedType = Undefined, + selected_keys: SelectedKeys | Iterable[str] | UndefinedType = Undefined, + default_selected_keys: SelectedKeys | Iterable[str] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> ListActionGroupElement: """ A group of action buttons that can be used to create a list of actions. diff --git a/plugins/ui/src/deephaven/ui/components/list_action_menu.py b/plugins/ui/src/deephaven/ui/components/list_action_menu.py index e9f69ebf5..47a2c425a 100644 --- a/plugins/ui/src/deephaven/ui/components/list_action_menu.py +++ b/plugins/ui/src/deephaven/ui/components/list_action_menu.py @@ -6,7 +6,7 @@ from .basic import component_element from .item import Item from ..elements import Element -from ..types import Key, ActionKey, ActionMenuDirection, Undefined, UNDEFINED +from ..types import Key, ActionKey, ActionMenuDirection, UndefinedType, Undefined from .types import ( # Events TriggerType, @@ -25,63 +25,63 @@ def list_action_menu( *children: Item, - on_action: Callable[[ActionKey, Key], None] | Undefined = UNDEFINED, - on_open_change: Callable[[bool, Key], None] | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - disabled_keys: Iterable[Key] | Undefined = UNDEFINED, - align: Alignment | Undefined = "start", - direction: ActionMenuDirection | Undefined = "bottom", - should_flip: bool | Undefined = True, - close_on_select: bool | Undefined = True, - trigger: TriggerType | Undefined = "press", - is_open: bool | Undefined = UNDEFINED, - default_open: bool | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + on_action: Callable[[ActionKey, Key], None] | UndefinedType = Undefined, + on_open_change: Callable[[bool, Key], None] | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + disabled_keys: Iterable[Key] | UndefinedType = Undefined, + align: Alignment | UndefinedType = "start", + direction: ActionMenuDirection | UndefinedType = "bottom", + should_flip: bool | UndefinedType = True, + close_on_select: bool | UndefinedType = True, + trigger: TriggerType | UndefinedType = "press", + is_open: bool | UndefinedType = Undefined, + default_open: bool | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> ListActionMenuElement: """ A menu of action buttons that can be used to create a list of actions. diff --git a/plugins/ui/src/deephaven/ui/components/list_view.py b/plugins/ui/src/deephaven/ui/components/list_view.py index 8a53299ac..6e850652f 100644 --- a/plugins/ui/src/deephaven/ui/components/list_view.py +++ b/plugins/ui/src/deephaven/ui/components/list_view.py @@ -16,8 +16,8 @@ SelectionMode, SelectionStyle, Key, + UndefinedType, Undefined, - UNDEFINED, ) from .types import ( LoadingState, @@ -43,65 +43,65 @@ def list_view( *children: Item | Table | ItemTableSource, - density: ListViewDensity | Undefined = "COMPACT", - is_quiet: bool | Undefined = UNDEFINED, - loading_state: LoadingState | Undefined = UNDEFINED, + density: ListViewDensity | UndefinedType = "COMPACT", + is_quiet: bool | UndefinedType = Undefined, + loading_state: LoadingState | UndefinedType = Undefined, overflow_mode: ListViewOverflowMode = "truncate", - render_empty_state: Element | Undefined = UNDEFINED, - disabled_behavior: DisabledBehavior | Undefined = UNDEFINED, - disabled_keys: Selection | Undefined = UNDEFINED, - selection_mode: SelectionMode | Undefined = "MULTIPLE", - disallow_empty_selection: bool | Undefined = UNDEFINED, - selected_keys: Selection | Undefined = UNDEFINED, - default_selected_keys: Selection | Undefined = UNDEFINED, - selection_style: SelectionStyle | Undefined = UNDEFINED, - on_action: Callable[[Key, str], None] | Undefined = UNDEFINED, - on_selection_change: Callable[[Selection], None] | Undefined = UNDEFINED, - on_change: Callable[[Selection], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + render_empty_state: Element | UndefinedType = Undefined, + disabled_behavior: DisabledBehavior | UndefinedType = Undefined, + disabled_keys: Selection | UndefinedType = Undefined, + selection_mode: SelectionMode | UndefinedType = "MULTIPLE", + disallow_empty_selection: bool | UndefinedType = Undefined, + selected_keys: Selection | UndefinedType = Undefined, + default_selected_keys: Selection | UndefinedType = Undefined, + selection_style: SelectionStyle | UndefinedType = Undefined, + on_action: Callable[[Key, str], None] | UndefinedType = Undefined, + on_selection_change: Callable[[Selection], None] | UndefinedType = Undefined, + on_change: Callable[[Selection], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> ListViewElement: """ A list view that can be used to create a list of items. Children should be one of three types: diff --git a/plugins/ui/src/deephaven/ui/components/make_component.py b/plugins/ui/src/deephaven/ui/components/make_component.py index dce902659..429a56f34 100644 --- a/plugins/ui/src/deephaven/ui/components/make_component.py +++ b/plugins/ui/src/deephaven/ui/components/make_component.py @@ -4,7 +4,7 @@ from typing import Any, Callable from .._internal import get_component_qualname from ..elements import FunctionElement -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined logger = logging.getLogger(__name__) @@ -20,7 +20,7 @@ def make_component(func: Callable[..., Any]): @functools.wraps(func) def make_component_node( - *args: Any, key: str | Undefined = UNDEFINED, **kwargs: Any + *args: Any, key: str | UndefinedType = Undefined, **kwargs: Any ): component_type = get_component_qualname(func) return FunctionElement(component_type, lambda: func(*args, **kwargs), key=key) diff --git a/plugins/ui/src/deephaven/ui/components/number_field.py b/plugins/ui/src/deephaven/ui/components/number_field.py index 48560a51f..85bbd1bc9 100644 --- a/plugins/ui/src/deephaven/ui/components/number_field.py +++ b/plugins/ui/src/deephaven/ui/components/number_field.py @@ -17,86 +17,86 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def number_field( - is_quiet: bool | Undefined = UNDEFINED, - hide_stepper: bool | Undefined = UNDEFINED, - decrement_aria_label: str | Undefined = UNDEFINED, - increment_aria_label: str | Undefined = UNDEFINED, - is_wheel_disabled: bool | Undefined = UNDEFINED, - format_options: NumberFieldFormatOptions | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, + is_quiet: bool | UndefinedType = Undefined, + hide_stepper: bool | UndefinedType = Undefined, + decrement_aria_label: str | UndefinedType = Undefined, + increment_aria_label: str | UndefinedType = Undefined, + is_wheel_disabled: bool | UndefinedType = Undefined, + format_options: NumberFieldFormatOptions | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, # validation_behaviour, # omitted because validate is not implemented # validate, # omitted because it needs to return a ValidationError synchronously - auto_focus: bool | Undefined = UNDEFINED, - value: float | Undefined = UNDEFINED, - default_value: float | Undefined = UNDEFINED, - min_value: float | Undefined = UNDEFINED, - max_value: float | Undefined = UNDEFINED, - step: float | Undefined = UNDEFINED, - label: Any | Undefined = UNDEFINED, - description: Any | Undefined = UNDEFINED, - error_message: Any | Undefined = UNDEFINED, - validation_state: TextFieldValidationState | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, + auto_focus: bool | UndefinedType = Undefined, + value: float | UndefinedType = Undefined, + default_value: float | UndefinedType = Undefined, + min_value: float | UndefinedType = Undefined, + max_value: float | UndefinedType = Undefined, + step: float | UndefinedType = Undefined, + label: Any | UndefinedType = Undefined, + description: Any | UndefinedType = Undefined, + error_message: Any | UndefinedType = Undefined, + validation_state: TextFieldValidationState | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, label_position: LabelPosition = "top", - label_align: Alignment | Undefined = UNDEFINED, - necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, - contextual_help: Any | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - on_change: Callable[[float], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + label_align: Alignment | UndefinedType = Undefined, + necessity_indicator: NecessityIndicator | UndefinedType = Undefined, + contextual_help: Any | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + on_change: Callable[[float], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, # missing properties that are clipboard or composition events ) -> Element: """ diff --git a/plugins/ui/src/deephaven/ui/components/panel.py b/plugins/ui/src/deephaven/ui/components/panel.py index f433fbc05..a9a2cc1a4 100644 --- a/plugins/ui/src/deephaven/ui/components/panel.py +++ b/plugins/ui/src/deephaven/ui/components/panel.py @@ -14,32 +14,32 @@ CSSProperties, ) from ..elements import Element -from ..types import Color, Undefined, UNDEFINED +from ..types import Color, UndefinedType, Undefined def panel( *children: Any, - title: str | Undefined = UNDEFINED, - direction: Direction | Undefined = "column", - wrap: Wrap | Undefined = UNDEFINED, - justify_content: JustifyContent | Undefined = UNDEFINED, - align_content: AlignContent | Undefined = UNDEFINED, - align_items: AlignItems | Undefined = "start", - gap: DimensionValue | Undefined = "size-100", - column_gap: DimensionValue | Undefined = UNDEFINED, - row_gap: DimensionValue | Undefined = UNDEFINED, - overflow: Overflow | Undefined = "auto", - padding: DimensionValue | Undefined = "size-100", - padding_top: DimensionValue | Undefined = UNDEFINED, - padding_bottom: DimensionValue | Undefined = UNDEFINED, - padding_start: DimensionValue | Undefined = UNDEFINED, - padding_end: DimensionValue | Undefined = UNDEFINED, - padding_x: DimensionValue | Undefined = UNDEFINED, - padding_y: DimensionValue | Undefined = UNDEFINED, - background_color: Color | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + title: str | UndefinedType = Undefined, + direction: Direction | UndefinedType = "column", + wrap: Wrap | UndefinedType = Undefined, + justify_content: JustifyContent | UndefinedType = Undefined, + align_content: AlignContent | UndefinedType = Undefined, + align_items: AlignItems | UndefinedType = "start", + gap: DimensionValue | UndefinedType = "size-100", + column_gap: DimensionValue | UndefinedType = Undefined, + row_gap: DimensionValue | UndefinedType = Undefined, + overflow: Overflow | UndefinedType = "auto", + padding: DimensionValue | UndefinedType = "size-100", + padding_top: DimensionValue | UndefinedType = Undefined, + padding_bottom: DimensionValue | UndefinedType = Undefined, + padding_start: DimensionValue | UndefinedType = Undefined, + padding_end: DimensionValue | UndefinedType = Undefined, + padding_x: DimensionValue | UndefinedType = Undefined, + padding_y: DimensionValue | UndefinedType = Undefined, + background_color: Color | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, **props: Any, ) -> Element: """ diff --git a/plugins/ui/src/deephaven/ui/components/picker.py b/plugins/ui/src/deephaven/ui/components/picker.py index 508098702..9b358fabb 100644 --- a/plugins/ui/src/deephaven/ui/components/picker.py +++ b/plugins/ui/src/deephaven/ui/components/picker.py @@ -8,7 +8,7 @@ from .item_table_source import ItemTableSource from ..elements import BaseElement, Element from .._internal.utils import create_props, unpack_item_table_source -from ..types import Key, Undefined, UNDEFINED +from ..types import Key, UndefinedType, Undefined from .types import ( AlignSelf, CSSProperties, @@ -38,84 +38,84 @@ def picker( *children: Item | SectionElement | Table | PartitionedTable | ItemTableSource, - default_selected_key: Key | Undefined = UNDEFINED, - selected_key: Key | Undefined = UNDEFINED, - on_selection_change: Callable[[Key], None] | Undefined = UNDEFINED, - on_change: Callable[[Key], None] | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, + default_selected_key: Key | UndefinedType = Undefined, + selected_key: Key | UndefinedType = Undefined, + on_selection_change: Callable[[Key], None] | UndefinedType = Undefined, + on_change: Callable[[Key], None] | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, align: Alignment = "start", direction: MenuDirection = "bottom", should_flip: bool = True, - menu_width: DimensionValue | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - auto_complete: str | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - is_open: bool | Undefined = UNDEFINED, - default_open: bool | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, - is_invalid: bool | Undefined = UNDEFINED, - validation_behavior: ValidationBehavior | Undefined = UNDEFINED, - description: Element | Undefined = UNDEFINED, - error_message: Element | Undefined = UNDEFINED, - label: Element | Undefined = UNDEFINED, - placeholder: str | Undefined = UNDEFINED, - is_loading: bool | Undefined = UNDEFINED, + menu_width: DimensionValue | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + auto_complete: str | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + is_open: bool | UndefinedType = Undefined, + default_open: bool | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, + is_invalid: bool | UndefinedType = Undefined, + validation_behavior: ValidationBehavior | UndefinedType = Undefined, + description: Element | UndefinedType = Undefined, + error_message: Element | UndefinedType = Undefined, + label: Element | UndefinedType = Undefined, + placeholder: str | UndefinedType = Undefined, + is_loading: bool | UndefinedType = Undefined, label_position: LabelPosition = "top", - label_align: Alignment | Undefined = UNDEFINED, - necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, - contextual_help: Element | Undefined = UNDEFINED, - on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - exclude_from_tab_order: bool | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + label_align: Alignment | UndefinedType = Undefined, + necessity_indicator: NecessityIndicator | UndefinedType = Undefined, + contextual_help: Element | UndefinedType = Undefined, + on_open_change: Callable[[bool], None] | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + exclude_from_tab_order: bool | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> PickerElement: """ A picker that can be used to select from a list. Children should be one of five types: diff --git a/plugins/ui/src/deephaven/ui/components/progress_bar.py b/plugins/ui/src/deephaven/ui/components/progress_bar.py index 0dfe345db..2b1b1ffb1 100644 --- a/plugins/ui/src/deephaven/ui/components/progress_bar.py +++ b/plugins/ui/src/deephaven/ui/components/progress_bar.py @@ -17,72 +17,72 @@ from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined ProgressBarElement = Element def progress_bar( size: ProgressBarSize = "L", - static_color: StaticColor | Undefined = UNDEFINED, + static_color: StaticColor | UndefinedType = Undefined, label_position: LabelPosition = "top", - show_value_label: bool | Undefined = UNDEFINED, - label: Element | Undefined = UNDEFINED, + show_value_label: bool | UndefinedType = Undefined, + label: Element | UndefinedType = Undefined, # format_options, # omitted because need to connect it to Deephaven formatting options as well - value_label: Element | Undefined = UNDEFINED, + value_label: Element | UndefinedType = Undefined, value: float = 0, min_value: float = 0, max_value: float = 100, - is_indeterminate: bool | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - exclude_from_tab_order: bool | Undefined = UNDEFINED, - aria_expanded: AriaExpanded | Undefined = UNDEFINED, - aria_haspopup: AriaHasPopup | Undefined = UNDEFINED, - aria_controls: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_pressed: AriaPressed | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + is_indeterminate: bool | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + exclude_from_tab_order: bool | UndefinedType = Undefined, + aria_expanded: AriaExpanded | UndefinedType = Undefined, + aria_haspopup: AriaHasPopup | UndefinedType = Undefined, + aria_controls: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_pressed: AriaPressed | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> ProgressBarElement: """ ProgressBars show the progression of a system operation: downloading, uploading, processing, etc., in a visual way. They can represent either determinate or indeterminate progress. diff --git a/plugins/ui/src/deephaven/ui/components/progress_circle.py b/plugins/ui/src/deephaven/ui/components/progress_circle.py index 680dd51b4..35df69413 100644 --- a/plugins/ui/src/deephaven/ui/components/progress_circle.py +++ b/plugins/ui/src/deephaven/ui/components/progress_circle.py @@ -19,67 +19,67 @@ from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined ProgressCircleElement = Element def progress_circle( size: ProgressCircleSize = "M", - static_color: StaticColor | Undefined = UNDEFINED, - is_indeterminate: bool | Undefined = UNDEFINED, + static_color: StaticColor | UndefinedType = Undefined, + is_indeterminate: bool | UndefinedType = Undefined, value: float = 0, min_value: float = 0, max_value: float = 100, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - exclude_from_tab_order: bool | Undefined = UNDEFINED, - aria_expanded: AriaExpanded | Undefined = UNDEFINED, - aria_haspopup: AriaHasPopup | Undefined = UNDEFINED, - aria_controls: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_pressed: AriaPressed | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + exclude_from_tab_order: bool | UndefinedType = Undefined, + aria_expanded: AriaExpanded | UndefinedType = Undefined, + aria_haspopup: AriaHasPopup | UndefinedType = Undefined, + aria_controls: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_pressed: AriaPressed | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> ProgressCircleElement: """ ProgressCircles show the progression of a system operation such as downloading, uploading, or processing, in a visual way. They can represent determinate or indeterminate progress. diff --git a/plugins/ui/src/deephaven/ui/components/radio.py b/plugins/ui/src/deephaven/ui/components/radio.py index a71e5f55c..e1cd05764 100644 --- a/plugins/ui/src/deephaven/ui/components/radio.py +++ b/plugins/ui/src/deephaven/ui/components/radio.py @@ -12,64 +12,64 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined from .._internal.utils import create_props def radio( *children, - value: str | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelled_by: str | Undefined = UNDEFINED, - aria_described_by: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + value: str | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelled_by: str | UndefinedType = Undefined, + aria_described_by: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Radio buttons allow users to select a single option from a list of mutually diff --git a/plugins/ui/src/deephaven/ui/components/radio_group.py b/plugins/ui/src/deephaven/ui/components/radio_group.py index 9e395baa2..74cb83891 100644 --- a/plugins/ui/src/deephaven/ui/components/radio_group.py +++ b/plugins/ui/src/deephaven/ui/components/radio_group.py @@ -19,80 +19,80 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined from .._internal.utils import create_props def radio_group( *children: Any, - is_emphasized: bool | Undefined = UNDEFINED, + is_emphasized: bool | UndefinedType = Undefined, orientation: Orientation = "vertical", - value: str | Undefined = UNDEFINED, - default_value: str | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, - is_invalid: bool | Undefined = UNDEFINED, - validation_behavior: ValidationBehavior | Undefined = UNDEFINED, + value: str | UndefinedType = Undefined, + default_value: str | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, + is_invalid: bool | UndefinedType = Undefined, + validation_behavior: ValidationBehavior | UndefinedType = Undefined, # validate, # omitted because of synchronouse return - label: Any | Undefined = UNDEFINED, - description: Any | Undefined = UNDEFINED, - error_message: Any | Undefined = UNDEFINED, + label: Any | UndefinedType = Undefined, + description: Any | UndefinedType = Undefined, + error_message: Any | UndefinedType = Undefined, label_position: LabelPosition = "top", - label_align: Alignment | Undefined = UNDEFINED, - necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, - contextual_help: Any | Undefined = UNDEFINED, - show_error_icon: bool | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_change: Callable[[str], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - aria_errormessage: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + label_align: Alignment | UndefinedType = Undefined, + necessity_indicator: NecessityIndicator | UndefinedType = Undefined, + contextual_help: Any | UndefinedType = Undefined, + show_error_icon: bool | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_change: Callable[[str], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + aria_errormessage: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Radio buttons allow users to select a single option from a list of mutually diff --git a/plugins/ui/src/deephaven/ui/components/range_calendar.py b/plugins/ui/src/deephaven/ui/components/range_calendar.py index ddb45e41a..7d48aa839 100644 --- a/plugins/ui/src/deephaven/ui/components/range_calendar.py +++ b/plugins/ui/src/deephaven/ui/components/range_calendar.py @@ -15,7 +15,7 @@ from ..elements import Element from .._internal.utils import create_props, convert_date_props, wrap_local_date_callable -from ..types import Date, LocalDateConvertible, DateRange, Undefined, UNDEFINED +from ..types import Date, LocalDateConvertible, DateRange, UndefinedType, Undefined from .basic import component_element from .make_component import make_component from deephaven.time import dh_now @@ -73,66 +73,66 @@ def _convert_range_calendar_props( @make_component def range_calendar( - value: DateRange | Undefined = UNDEFINED, - default_value: DateRange | Undefined = UNDEFINED, - focused_value: Date | Undefined = UNDEFINED, - default_focused_value: Date | Undefined = UNDEFINED, - min_value: Date | Undefined = UNDEFINED, - max_value: Date | Undefined = UNDEFINED, - page_behavior: PageBehavior | Undefined = UNDEFINED, - is_invalid: bool | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - error_message: Element | Undefined = UNDEFINED, - visible_months: int | Undefined = UNDEFINED, - on_focus_change: Callable[[LocalDateConvertible], None] | Undefined = UNDEFINED, - on_change: Callable[[DateRange], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_pressed: AriaPressed | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + value: DateRange | UndefinedType = Undefined, + default_value: DateRange | UndefinedType = Undefined, + focused_value: Date | UndefinedType = Undefined, + default_focused_value: Date | UndefinedType = Undefined, + min_value: Date | UndefinedType = Undefined, + max_value: Date | UndefinedType = Undefined, + page_behavior: PageBehavior | UndefinedType = Undefined, + is_invalid: bool | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + error_message: Element | UndefinedType = Undefined, + visible_months: int | UndefinedType = Undefined, + on_focus_change: Callable[[LocalDateConvertible], None] | UndefinedType = Undefined, + on_change: Callable[[DateRange], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_pressed: AriaPressed | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> RangeCalendarElement: """ A range_calendar allows the user to select a range of dates. diff --git a/plugins/ui/src/deephaven/ui/components/range_slider.py b/plugins/ui/src/deephaven/ui/components/range_slider.py index 423de81d5..a7901d585 100644 --- a/plugins/ui/src/deephaven/ui/components/range_slider.py +++ b/plugins/ui/src/deephaven/ui/components/range_slider.py @@ -16,72 +16,72 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def range_slider( - start_name: str | Undefined = UNDEFINED, - end_name: str | Undefined = UNDEFINED, + start_name: str | UndefinedType = Undefined, + end_name: str | UndefinedType = Undefined, # format_options, # omitted because need to connect it to Deephaven formatting options as well label_position: LabelPosition = "top", - show_value_label: bool | Undefined = UNDEFINED, + show_value_label: bool | UndefinedType = Undefined, # get_value_label, # omitted because it needs to return a string synchronously - contextual_help: Any | Undefined = UNDEFINED, + contextual_help: Any | UndefinedType = Undefined, orientation: Orientation = "horizontal", - is_disabled: bool | Undefined = UNDEFINED, + is_disabled: bool | UndefinedType = Undefined, min_value: float = 0, max_value: float = 100, step: float = 1, - value: SliderChange | Undefined = UNDEFINED, - default_value: SliderChange | Undefined = UNDEFINED, - label: Any | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - on_change_end: SliderChangeCallable | Undefined = UNDEFINED, - on_change: SliderChangeCallable | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + value: SliderChange | UndefinedType = Undefined, + default_value: SliderChange | UndefinedType = Undefined, + label: Any | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + on_change_end: SliderChangeCallable | UndefinedType = Undefined, + on_change: SliderChangeCallable | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Sliders allow users to quickly select a value within a range. They should be used when the upper and lower bounds to the range are invariable. diff --git a/plugins/ui/src/deephaven/ui/components/row.py b/plugins/ui/src/deephaven/ui/components/row.py index e264d46de..3a870ba31 100644 --- a/plugins/ui/src/deephaven/ui/components/row.py +++ b/plugins/ui/src/deephaven/ui/components/row.py @@ -3,13 +3,13 @@ from typing import Any from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def row( *children: Any, - height: float | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + height: float | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ A row is a container that can be used to group elements. diff --git a/plugins/ui/src/deephaven/ui/components/section.py b/plugins/ui/src/deephaven/ui/components/section.py index 842e8ec40..aab8464ef 100644 --- a/plugins/ui/src/deephaven/ui/components/section.py +++ b/plugins/ui/src/deephaven/ui/components/section.py @@ -4,7 +4,7 @@ from .._internal.utils import create_props from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined from .basic import component_element from .item import Item @@ -13,8 +13,8 @@ def section( *children: Item, - title: str | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + title: str | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> SectionElement: """ A section that can be added to a menu, such as a picker. Children are the dropdown options. diff --git a/plugins/ui/src/deephaven/ui/components/slider.py b/plugins/ui/src/deephaven/ui/components/slider.py index 91ee6dbe4..8df386b59 100644 --- a/plugins/ui/src/deephaven/ui/components/slider.py +++ b/plugins/ui/src/deephaven/ui/components/slider.py @@ -14,73 +14,73 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def slider( - is_filled: bool | Undefined = UNDEFINED, - fill_offset: float | Undefined = UNDEFINED, - track_gradient: list[str] | Undefined = UNDEFINED, + is_filled: bool | UndefinedType = Undefined, + fill_offset: float | UndefinedType = Undefined, + track_gradient: list[str] | UndefinedType = Undefined, # format_options, # omitted because need to connect it to Deephaven formatting options as well label_position: LabelPosition = "top", - show_value_label: bool | Undefined = UNDEFINED, + show_value_label: bool | UndefinedType = Undefined, # get_value_label, # omitted because it needs to return a string synchronously - contextual_help: Any | Undefined = UNDEFINED, + contextual_help: Any | UndefinedType = Undefined, orientation: Orientation = "horizontal", - is_disabled: bool | Undefined = UNDEFINED, + is_disabled: bool | UndefinedType = Undefined, min_value: float = 0, max_value: float = 100, step: float = 1, - value: float | Undefined = UNDEFINED, - default_value: float | Undefined = UNDEFINED, - label: Any | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - on_change_end: Callable[[float], None] | Undefined = UNDEFINED, - on_change: Callable[[float], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + value: float | UndefinedType = Undefined, + default_value: float | UndefinedType = Undefined, + label: Any | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + on_change_end: Callable[[float], None] | UndefinedType = Undefined, + on_change: Callable[[float], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Sliders allow users to quickly select a value within a range. They should be used when the upper and lower bounds to the range are invariable. diff --git a/plugins/ui/src/deephaven/ui/components/stack.py b/plugins/ui/src/deephaven/ui/components/stack.py index e07633817..e1620ea55 100644 --- a/plugins/ui/src/deephaven/ui/components/stack.py +++ b/plugins/ui/src/deephaven/ui/components/stack.py @@ -3,15 +3,15 @@ from typing import Any from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def stack( *children: Any, - height: float | Undefined = UNDEFINED, - width: float | Undefined = UNDEFINED, - active_item_index: int | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + height: float | UndefinedType = Undefined, + width: float | UndefinedType = Undefined, + active_item_index: int | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ A stack is a container that can be used to group elements which creates a set of tabs. diff --git a/plugins/ui/src/deephaven/ui/components/switch.py b/plugins/ui/src/deephaven/ui/components/switch.py index 91d9fb0ec..469d3864b 100644 --- a/plugins/ui/src/deephaven/ui/components/switch.py +++ b/plugins/ui/src/deephaven/ui/components/switch.py @@ -12,72 +12,72 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def switch( *children: Any, - is_emphasized: bool | Undefined = UNDEFINED, - default_selected: bool | Undefined = UNDEFINED, - is_selected: bool | Undefined = UNDEFINED, - value: str | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - on_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - exclude_from_tab_order: bool | Undefined = UNDEFINED, - aria_controls: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + is_emphasized: bool | UndefinedType = Undefined, + default_selected: bool | UndefinedType = Undefined, + is_selected: bool | UndefinedType = Undefined, + value: str | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + on_change: Callable[[bool], None] | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + exclude_from_tab_order: bool | UndefinedType = Undefined, + aria_controls: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Switches allow users to turn an individual option on or off. They are usually used to activate or deactivate a specific setting. diff --git a/plugins/ui/src/deephaven/ui/components/tab.py b/plugins/ui/src/deephaven/ui/components/tab.py index 3cecd7dca..76c4da52a 100644 --- a/plugins/ui/src/deephaven/ui/components/tab.py +++ b/plugins/ui/src/deephaven/ui/components/tab.py @@ -3,15 +3,15 @@ from .basic import component_element from ..elements import Element -from ..types import Key, Undefined, UNDEFINED +from ..types import Key, UndefinedType, Undefined def tab( *children: Any, - title: Any | Undefined = UNDEFINED, - key: Key | Undefined = UNDEFINED, - icon: Element | Undefined = UNDEFINED, - text_value: str | Undefined = UNDEFINED, + title: Any | UndefinedType = Undefined, + key: Key | UndefinedType = Undefined, + icon: Element | UndefinedType = Undefined, + text_value: str | UndefinedType = Undefined, ): """ Tab item implementation for tabs component. diff --git a/plugins/ui/src/deephaven/ui/components/tab_list.py b/plugins/ui/src/deephaven/ui/components/tab_list.py index 679e5742f..7e190ea5a 100644 --- a/plugins/ui/src/deephaven/ui/components/tab_list.py +++ b/plugins/ui/src/deephaven/ui/components/tab_list.py @@ -11,51 +11,51 @@ LayoutFlex, Position, ) -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def tab_list( *children: Any, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = "size-100", - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = "size-100", + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ): """ Python implementation for the Adobe React Spectrum TabList component. diff --git a/plugins/ui/src/deephaven/ui/components/tab_panels.py b/plugins/ui/src/deephaven/ui/components/tab_panels.py index e3225dbe3..bee43c02f 100644 --- a/plugins/ui/src/deephaven/ui/components/tab_panels.py +++ b/plugins/ui/src/deephaven/ui/components/tab_panels.py @@ -11,51 +11,51 @@ LayoutFlex, Position, ) -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def tab_panels( *children: Any, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ): """ Python implementation for the Adobe React Spectrum TabPanels component. diff --git a/plugins/ui/src/deephaven/ui/components/table.py b/plugins/ui/src/deephaven/ui/components/table.py index 1a60591e8..4d29a7ab7 100644 --- a/plugins/ui/src/deephaven/ui/components/table.py +++ b/plugins/ui/src/deephaven/ui/components/table.py @@ -14,8 +14,8 @@ QuickFilterExpression, RowPressCallback, ResolvableContextMenuItem, + UndefinedType, Undefined, - UNDEFINED, ) from .._internal import dict_to_react_props, RenderContext @@ -186,83 +186,84 @@ def __init__( self, table: Table, *, - format_: TableFormat | list[TableFormat] | Undefined = UNDEFINED, - on_row_press: RowPressCallback | Undefined = UNDEFINED, - on_row_double_press: RowPressCallback | Undefined = UNDEFINED, - on_cell_press: CellPressCallback | Undefined = UNDEFINED, - on_cell_double_press: CellPressCallback | Undefined = UNDEFINED, - on_column_press: ColumnPressCallback | Undefined = UNDEFINED, - on_column_double_press: ColumnPressCallback | Undefined = UNDEFINED, + format_: TableFormat | list[TableFormat] | UndefinedType = Undefined, + on_row_press: RowPressCallback | UndefinedType = Undefined, + on_row_double_press: RowPressCallback | UndefinedType = Undefined, + on_cell_press: CellPressCallback | UndefinedType = Undefined, + on_cell_double_press: CellPressCallback | UndefinedType = Undefined, + on_column_press: ColumnPressCallback | UndefinedType = Undefined, + on_column_double_press: ColumnPressCallback | UndefinedType = Undefined, always_fetch_columns: ColumnName | list[ColumnName] | bool - | Undefined = UNDEFINED, - quick_filters: dict[ColumnName, QuickFilterExpression] | Undefined = UNDEFINED, + | UndefinedType = Undefined, + quick_filters: dict[ColumnName, QuickFilterExpression] + | UndefinedType = Undefined, show_quick_filters: bool = False, show_grouping_column: bool = True, show_search: bool = False, reverse: bool = False, - front_columns: list[ColumnName] | Undefined = UNDEFINED, - back_columns: list[ColumnName] | Undefined = UNDEFINED, - frozen_columns: list[ColumnName] | Undefined = UNDEFINED, - hidden_columns: list[ColumnName] | Undefined = UNDEFINED, - column_groups: list[ColumnGroup] | Undefined = UNDEFINED, - density: Literal["compact", "regular", "spacious"] | Undefined = UNDEFINED, + front_columns: list[ColumnName] | UndefinedType = Undefined, + back_columns: list[ColumnName] | UndefinedType = Undefined, + frozen_columns: list[ColumnName] | UndefinedType = Undefined, + hidden_columns: list[ColumnName] | UndefinedType = Undefined, + column_groups: list[ColumnGroup] | UndefinedType = Undefined, + density: Literal["compact", "regular", "spacious"] | UndefinedType = Undefined, context_menu: ( - ResolvableContextMenuItem | list[ResolvableContextMenuItem] | Undefined - ) = UNDEFINED, + ResolvableContextMenuItem | list[ResolvableContextMenuItem] | UndefinedType + ) = Undefined, context_header_menu: ( - ResolvableContextMenuItem | list[ResolvableContextMenuItem] | Undefined - ) = UNDEFINED, - databars: list[TableDatabar] | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, + ResolvableContextMenuItem | list[ResolvableContextMenuItem] | UndefinedType + ) = Undefined, + databars: list[TableDatabar] | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, ) -> None: props = locals() del props["self"] self._props = props - self._key: str | Undefined = props.get("key") # type: ignore + self._key: str | UndefinedType = props.get("key") # type: ignore @property def name(self): return "deephaven.ui.elements.UITable" @property - def key(self) -> str | Undefined: + def key(self) -> str | UndefinedType: return self._key def render(self, context: RenderContext) -> dict[str, Any]: diff --git a/plugins/ui/src/deephaven/ui/components/tabs.py b/plugins/ui/src/deephaven/ui/components/tabs.py index a0086407f..e7261ff5f 100644 --- a/plugins/ui/src/deephaven/ui/components/tabs.py +++ b/plugins/ui/src/deephaven/ui/components/tabs.py @@ -14,7 +14,7 @@ Position, ) -from ..types import Key, TabDensity, Undefined, UNDEFINED +from ..types import Key, TabDensity, UndefinedType, Undefined from ..elements import BaseElement TabElement = BaseElement @@ -22,62 +22,62 @@ def tabs( *children: Any, - disabled_keys: Iterable[Key] | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - is_emphasized: bool | Undefined = UNDEFINED, - density: TabDensity | Undefined = "compact", - keyboard_activation: KeyboardActivationType | Undefined = "automatic", - orientation: Orientation | Undefined = "horizontal", - disallow_empty_selection: bool | Undefined = UNDEFINED, - selected_key: Key | Undefined = UNDEFINED, - default_selected_key: Key | Undefined = UNDEFINED, - on_selection_change: Callable[[Key], None] | Undefined = UNDEFINED, - on_change: Callable[[Key], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = 1, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelled_by: str | Undefined = UNDEFINED, - aria_described_by: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + disabled_keys: Iterable[Key] | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + is_emphasized: bool | UndefinedType = Undefined, + density: TabDensity | UndefinedType = "compact", + keyboard_activation: KeyboardActivationType | UndefinedType = "automatic", + orientation: Orientation | UndefinedType = "horizontal", + disallow_empty_selection: bool | UndefinedType = Undefined, + selected_key: Key | UndefinedType = Undefined, + default_selected_key: Key | UndefinedType = Undefined, + on_selection_change: Callable[[Key], None] | UndefinedType = Undefined, + on_change: Callable[[Key], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = 1, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelled_by: str | UndefinedType = Undefined, + aria_described_by: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> TabElement: """ Python implementation for the Adobe React Spectrum Tabs component. diff --git a/plugins/ui/src/deephaven/ui/components/text.py b/plugins/ui/src/deephaven/ui/components/text.py index afd63bc4c..fbca8919f 100644 --- a/plugins/ui/src/deephaven/ui/components/text.py +++ b/plugins/ui/src/deephaven/ui/components/text.py @@ -11,53 +11,53 @@ from ..types import Color from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def text( *children: Any, - color: Color | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, + color: Color | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, slot: str = "text", - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ Text represents text with no specific semantic meaning. diff --git a/plugins/ui/src/deephaven/ui/components/text_area.py b/plugins/ui/src/deephaven/ui/components/text_area.py index 4a7bf1024..047180165 100644 --- a/plugins/ui/src/deephaven/ui/components/text_area.py +++ b/plugins/ui/src/deephaven/ui/components/text_area.py @@ -25,88 +25,88 @@ from .types import IconTypes from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined from .icon import icon as icon_component def text_area( - icon: Element | IconTypes | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, - description: Any | Undefined = UNDEFINED, - error_message: Any | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - value: str | Undefined = UNDEFINED, - default_value: str | Undefined = UNDEFINED, - label: Any | Undefined = UNDEFINED, - auto_complete: str | Undefined = UNDEFINED, - max_length: int | Undefined = UNDEFINED, - min_length: int | Undefined = UNDEFINED, - input_mode: TextFieldInputMode | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - validation_state: TextFieldValidationState | Undefined = UNDEFINED, + icon: Element | IconTypes | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, + description: Any | UndefinedType = Undefined, + error_message: Any | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + value: str | UndefinedType = Undefined, + default_value: str | UndefinedType = Undefined, + label: Any | UndefinedType = Undefined, + auto_complete: str | UndefinedType = Undefined, + max_length: int | UndefinedType = Undefined, + min_length: int | UndefinedType = Undefined, + input_mode: TextFieldInputMode | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + validation_state: TextFieldValidationState | UndefinedType = Undefined, label_position: LabelPosition = "top", - label_align: Alignment | Undefined = UNDEFINED, - necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, - contextual_help: Any | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - on_change: Callable[[str], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - exclude_from_tab_order: bool | Undefined = UNDEFINED, - aria_active_descendant: str | Undefined = UNDEFINED, - aria_auto_complete: AriaAutoComplete | Undefined = UNDEFINED, - aria_haspopup: AriaHasPopup | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - aria_errormessage: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + label_align: Alignment | UndefinedType = Undefined, + necessity_indicator: NecessityIndicator | UndefinedType = Undefined, + contextual_help: Any | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + on_change: Callable[[str], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + exclude_from_tab_order: bool | UndefinedType = Undefined, + aria_active_descendant: str | UndefinedType = Undefined, + aria_auto_complete: AriaAutoComplete | UndefinedType = Undefined, + aria_haspopup: AriaHasPopup | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + aria_errormessage: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, # missing properties that are clipboard or composition events ) -> Element: """ diff --git a/plugins/ui/src/deephaven/ui/components/text_field.py b/plugins/ui/src/deephaven/ui/components/text_field.py index 79433dc00..0bc99e1ca 100644 --- a/plugins/ui/src/deephaven/ui/components/text_field.py +++ b/plugins/ui/src/deephaven/ui/components/text_field.py @@ -24,88 +24,88 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def text_field( - icon: Element | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, - description: Any | Undefined = UNDEFINED, - error_message: Any | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - value: str | Undefined = UNDEFINED, - default_value: str | Undefined = UNDEFINED, - label: Any | Undefined = UNDEFINED, - auto_complete: str | Undefined = UNDEFINED, - max_length: int | Undefined = UNDEFINED, - min_length: int | Undefined = UNDEFINED, - pattern: str | Undefined = UNDEFINED, - type: TextFieldType | Undefined = UNDEFINED, - input_mode: TextFieldInputMode | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - validation_state: TextFieldValidationState | Undefined = UNDEFINED, + icon: Element | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, + description: Any | UndefinedType = Undefined, + error_message: Any | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + value: str | UndefinedType = Undefined, + default_value: str | UndefinedType = Undefined, + label: Any | UndefinedType = Undefined, + auto_complete: str | UndefinedType = Undefined, + max_length: int | UndefinedType = Undefined, + min_length: int | UndefinedType = Undefined, + pattern: str | UndefinedType = Undefined, + type: TextFieldType | UndefinedType = Undefined, + input_mode: TextFieldInputMode | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + validation_state: TextFieldValidationState | UndefinedType = Undefined, label_position: LabelPosition = "top", - label_align: Alignment | Undefined = UNDEFINED, - necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, - contextual_help: Any | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - on_change: Callable[[str], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - exclude_from_tab_order: bool | Undefined = UNDEFINED, - aria_active_descendant: str | Undefined = UNDEFINED, - aria_auto_complete: AriaAutoComplete | Undefined = UNDEFINED, - aria_haspopup: AriaHasPopup | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - aria_errormessage: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + label_align: Alignment | UndefinedType = Undefined, + necessity_indicator: NecessityIndicator | UndefinedType = Undefined, + contextual_help: Any | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + on_change: Callable[[str], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + exclude_from_tab_order: bool | UndefinedType = Undefined, + aria_active_descendant: str | UndefinedType = Undefined, + aria_auto_complete: AriaAutoComplete | UndefinedType = Undefined, + aria_haspopup: AriaHasPopup | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + aria_errormessage: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, # missing properties that are clipboard or composition events ) -> Element: """ diff --git a/plugins/ui/src/deephaven/ui/components/time_field.py b/plugins/ui/src/deephaven/ui/components/time_field.py index f7e7af0e1..4a2c5bbfa 100644 --- a/plugins/ui/src/deephaven/ui/components/time_field.py +++ b/plugins/ui/src/deephaven/ui/components/time_field.py @@ -25,7 +25,7 @@ create_props, convert_time_props, ) -from ..types import Time, TimeGranularity, Undefined, UNDEFINED +from ..types import Time, TimeGranularity, UndefinedType, Undefined from .basic import component_element from .make_component import make_component @@ -70,82 +70,82 @@ def _convert_time_field_props( @make_component def time_field( - placeholder_value: Time | Undefined = UNDEFINED, - value: Time | Undefined = UNDEFINED, - default_value: Time | Undefined = UNDEFINED, - min_value: Time | Undefined = UNDEFINED, - max_value: Time | Undefined = UNDEFINED, - granularity: TimeGranularity | Undefined = "SECOND", - hour_cycle: HourCycle | Undefined = UNDEFINED, + placeholder_value: Time | UndefinedType = Undefined, + value: Time | UndefinedType = Undefined, + default_value: Time | UndefinedType = Undefined, + min_value: Time | UndefinedType = Undefined, + max_value: Time | UndefinedType = Undefined, + granularity: TimeGranularity | UndefinedType = "SECOND", + hour_cycle: HourCycle | UndefinedType = Undefined, hide_time_zone: bool = False, - should_force_leading_zeros: bool | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - is_read_only: bool | Undefined = UNDEFINED, - is_required: bool | Undefined = UNDEFINED, - validation_behavior: ValidationBehavior | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - label: Element | Undefined = UNDEFINED, - description: Element | Undefined = UNDEFINED, - error_message: Element | Undefined = UNDEFINED, - name: str | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - label_position: LabelPosition | Undefined = UNDEFINED, - label_align: Alignment | Undefined = UNDEFINED, - necessity_indicator: NecessityIndicator | Undefined = UNDEFINED, - contextual_help: Element | Undefined = UNDEFINED, - validation_state: ValidationState | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - on_open_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_change: Callable[[Time], None] | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_pressed: AriaPressed | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + should_force_leading_zeros: bool | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + is_read_only: bool | UndefinedType = Undefined, + is_required: bool | UndefinedType = Undefined, + validation_behavior: ValidationBehavior | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + label: Element | UndefinedType = Undefined, + description: Element | UndefinedType = Undefined, + error_message: Element | UndefinedType = Undefined, + name: str | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + label_position: LabelPosition | UndefinedType = Undefined, + label_align: Alignment | UndefinedType = Undefined, + necessity_indicator: NecessityIndicator | UndefinedType = Undefined, + contextual_help: Element | UndefinedType = Undefined, + validation_state: ValidationState | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + on_open_change: Callable[[bool], None] | UndefinedType = Undefined, + on_change: Callable[[Time], None] | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_pressed: AriaPressed | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> TimeFieldElement: """ A time field allows the user to select a time. diff --git a/plugins/ui/src/deephaven/ui/components/toggle_button.py b/plugins/ui/src/deephaven/ui/components/toggle_button.py index cde1b0f16..af0d0b9d0 100644 --- a/plugins/ui/src/deephaven/ui/components/toggle_button.py +++ b/plugins/ui/src/deephaven/ui/components/toggle_button.py @@ -21,79 +21,79 @@ ) from .basic import component_element from ..elements import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined def toggle_button( *children: Any, - is_emphasized: bool | Undefined = UNDEFINED, - is_selected: bool | Undefined = UNDEFINED, - default_selected: bool | Undefined = UNDEFINED, - is_disabled: bool | Undefined = UNDEFINED, - auto_focus: bool | Undefined = UNDEFINED, - is_quiet: bool | Undefined = UNDEFINED, - static_color: StaticColor | Undefined = UNDEFINED, + is_emphasized: bool | UndefinedType = Undefined, + is_selected: bool | UndefinedType = Undefined, + default_selected: bool | UndefinedType = Undefined, + is_disabled: bool | UndefinedType = Undefined, + auto_focus: bool | UndefinedType = Undefined, + is_quiet: bool | UndefinedType = Undefined, + static_color: StaticColor | UndefinedType = Undefined, type: ButtonType = "button", - on_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_press: PressEventCallable | Undefined = UNDEFINED, - on_press_start: PressEventCallable | Undefined = UNDEFINED, - on_press_end: PressEventCallable | Undefined = UNDEFINED, - on_press_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_press_up: PressEventCallable | Undefined = UNDEFINED, - on_focus: FocusEventCallable | Undefined = UNDEFINED, - on_blur: FocusEventCallable | Undefined = UNDEFINED, - on_focus_change: Callable[[bool], None] | Undefined = UNDEFINED, - on_key_down: KeyboardEventCallable | Undefined = UNDEFINED, - on_key_up: KeyboardEventCallable | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - exclude_from_tab_order: bool | Undefined = UNDEFINED, - aria_expanded: AriaExpanded | Undefined = UNDEFINED, - aria_haspopup: AriaHasPopup | Undefined = UNDEFINED, - aria_controls: str | Undefined = UNDEFINED, - aria_label: str | Undefined = UNDEFINED, - aria_labelledby: str | Undefined = UNDEFINED, - aria_describedby: str | Undefined = UNDEFINED, - aria_pressed: AriaPressed | Undefined = UNDEFINED, - aria_details: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + on_change: Callable[[bool], None] | UndefinedType = Undefined, + on_press: PressEventCallable | UndefinedType = Undefined, + on_press_start: PressEventCallable | UndefinedType = Undefined, + on_press_end: PressEventCallable | UndefinedType = Undefined, + on_press_change: Callable[[bool], None] | UndefinedType = Undefined, + on_press_up: PressEventCallable | UndefinedType = Undefined, + on_focus: FocusEventCallable | UndefinedType = Undefined, + on_blur: FocusEventCallable | UndefinedType = Undefined, + on_focus_change: Callable[[bool], None] | UndefinedType = Undefined, + on_key_down: KeyboardEventCallable | UndefinedType = Undefined, + on_key_up: KeyboardEventCallable | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + exclude_from_tab_order: bool | UndefinedType = Undefined, + aria_expanded: AriaExpanded | UndefinedType = Undefined, + aria_haspopup: AriaHasPopup | UndefinedType = Undefined, + aria_controls: str | UndefinedType = Undefined, + aria_label: str | UndefinedType = Undefined, + aria_labelledby: str | UndefinedType = Undefined, + aria_describedby: str | UndefinedType = Undefined, + aria_pressed: AriaPressed | UndefinedType = Undefined, + aria_details: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ ToggleButtons allow users to toggle a selection on or off, for example switching between two states or modes. diff --git a/plugins/ui/src/deephaven/ui/components/view.py b/plugins/ui/src/deephaven/ui/components/view.py index 7343ab88f..1dd76dab0 100644 --- a/plugins/ui/src/deephaven/ui/components/view.py +++ b/plugins/ui/src/deephaven/ui/components/view.py @@ -13,80 +13,80 @@ ) from .basic import component_element from ..elements import Element -from ..types import Color, Undefined, UNDEFINED +from ..types import Color, UndefinedType, Undefined def view( *children: Any, - element_type: ElementTypes | Undefined = UNDEFINED, - flex: LayoutFlex | Undefined = UNDEFINED, - flex_grow: float | Undefined = UNDEFINED, - flex_shrink: float | Undefined = UNDEFINED, - flex_basis: DimensionValue | Undefined = UNDEFINED, - align_self: AlignSelf | Undefined = UNDEFINED, - justify_self: JustifySelf | Undefined = UNDEFINED, - order: int | Undefined = UNDEFINED, - grid_area: str | Undefined = UNDEFINED, - grid_row: str | Undefined = UNDEFINED, - grid_row_start: str | Undefined = UNDEFINED, - grid_row_end: str | Undefined = UNDEFINED, - grid_column: str | Undefined = UNDEFINED, - grid_column_start: str | Undefined = UNDEFINED, - grid_column_end: str | Undefined = UNDEFINED, - overflow: str | Undefined = UNDEFINED, - margin: DimensionValue | Undefined = UNDEFINED, - margin_top: DimensionValue | Undefined = UNDEFINED, - margin_bottom: DimensionValue | Undefined = UNDEFINED, - margin_start: DimensionValue | Undefined = UNDEFINED, - margin_end: DimensionValue | Undefined = UNDEFINED, - margin_x: DimensionValue | Undefined = UNDEFINED, - margin_y: DimensionValue | Undefined = UNDEFINED, - padding: DimensionValue | Undefined = UNDEFINED, - padding_top: DimensionValue | Undefined = UNDEFINED, - padding_bottom: DimensionValue | Undefined = UNDEFINED, - padding_start: DimensionValue | Undefined = UNDEFINED, - padding_end: DimensionValue | Undefined = UNDEFINED, - padding_x: DimensionValue | Undefined = UNDEFINED, - padding_y: DimensionValue | Undefined = UNDEFINED, - width: DimensionValue | Undefined = UNDEFINED, - height: DimensionValue | Undefined = UNDEFINED, - min_width: DimensionValue | Undefined = UNDEFINED, - min_height: DimensionValue | Undefined = UNDEFINED, - max_width: DimensionValue | Undefined = UNDEFINED, - max_height: DimensionValue | Undefined = UNDEFINED, - background_color: Color | Undefined = UNDEFINED, - border_width: BorderSize | Undefined = UNDEFINED, - border_start_width: BorderSize | Undefined = UNDEFINED, - border_end_width: BorderSize | Undefined = UNDEFINED, - border_top_width: BorderSize | Undefined = UNDEFINED, - border_bottom_width: BorderSize | Undefined = UNDEFINED, - border_x_width: BorderSize | Undefined = UNDEFINED, - border_y_width: BorderSize | Undefined = UNDEFINED, - border_color: Color | Undefined = UNDEFINED, - border_start_color: Color | Undefined = UNDEFINED, - border_end_color: Color | Undefined = UNDEFINED, - border_top_color: Color | Undefined = UNDEFINED, - border_bottom_color: Color | Undefined = UNDEFINED, - border_x_color: Color | Undefined = UNDEFINED, - border_y_color: Color | Undefined = UNDEFINED, - border_radius: BorderRadius | Undefined = UNDEFINED, - border_top_start_radius: BorderRadius | Undefined = UNDEFINED, - border_top_end_radius: BorderRadius | Undefined = UNDEFINED, - border_bottom_start_radius: BorderRadius | Undefined = UNDEFINED, - border_bottom_end_radius: BorderRadius | Undefined = UNDEFINED, - position: Position | Undefined = UNDEFINED, - top: DimensionValue | Undefined = UNDEFINED, - bottom: DimensionValue | Undefined = UNDEFINED, - start: DimensionValue | Undefined = UNDEFINED, - end: DimensionValue | Undefined = UNDEFINED, - left: DimensionValue | Undefined = UNDEFINED, - right: DimensionValue | Undefined = UNDEFINED, - z_index: int | Undefined = UNDEFINED, - is_hidden: bool | Undefined = UNDEFINED, - id: str | Undefined = UNDEFINED, - UNSAFE_class_name: str | Undefined = UNDEFINED, - UNSAFE_style: CSSProperties | Undefined = UNDEFINED, - key: str | Undefined = UNDEFINED, + element_type: ElementTypes | UndefinedType = Undefined, + flex: LayoutFlex | UndefinedType = Undefined, + flex_grow: float | UndefinedType = Undefined, + flex_shrink: float | UndefinedType = Undefined, + flex_basis: DimensionValue | UndefinedType = Undefined, + align_self: AlignSelf | UndefinedType = Undefined, + justify_self: JustifySelf | UndefinedType = Undefined, + order: int | UndefinedType = Undefined, + grid_area: str | UndefinedType = Undefined, + grid_row: str | UndefinedType = Undefined, + grid_row_start: str | UndefinedType = Undefined, + grid_row_end: str | UndefinedType = Undefined, + grid_column: str | UndefinedType = Undefined, + grid_column_start: str | UndefinedType = Undefined, + grid_column_end: str | UndefinedType = Undefined, + overflow: str | UndefinedType = Undefined, + margin: DimensionValue | UndefinedType = Undefined, + margin_top: DimensionValue | UndefinedType = Undefined, + margin_bottom: DimensionValue | UndefinedType = Undefined, + margin_start: DimensionValue | UndefinedType = Undefined, + margin_end: DimensionValue | UndefinedType = Undefined, + margin_x: DimensionValue | UndefinedType = Undefined, + margin_y: DimensionValue | UndefinedType = Undefined, + padding: DimensionValue | UndefinedType = Undefined, + padding_top: DimensionValue | UndefinedType = Undefined, + padding_bottom: DimensionValue | UndefinedType = Undefined, + padding_start: DimensionValue | UndefinedType = Undefined, + padding_end: DimensionValue | UndefinedType = Undefined, + padding_x: DimensionValue | UndefinedType = Undefined, + padding_y: DimensionValue | UndefinedType = Undefined, + width: DimensionValue | UndefinedType = Undefined, + height: DimensionValue | UndefinedType = Undefined, + min_width: DimensionValue | UndefinedType = Undefined, + min_height: DimensionValue | UndefinedType = Undefined, + max_width: DimensionValue | UndefinedType = Undefined, + max_height: DimensionValue | UndefinedType = Undefined, + background_color: Color | UndefinedType = Undefined, + border_width: BorderSize | UndefinedType = Undefined, + border_start_width: BorderSize | UndefinedType = Undefined, + border_end_width: BorderSize | UndefinedType = Undefined, + border_top_width: BorderSize | UndefinedType = Undefined, + border_bottom_width: BorderSize | UndefinedType = Undefined, + border_x_width: BorderSize | UndefinedType = Undefined, + border_y_width: BorderSize | UndefinedType = Undefined, + border_color: Color | UndefinedType = Undefined, + border_start_color: Color | UndefinedType = Undefined, + border_end_color: Color | UndefinedType = Undefined, + border_top_color: Color | UndefinedType = Undefined, + border_bottom_color: Color | UndefinedType = Undefined, + border_x_color: Color | UndefinedType = Undefined, + border_y_color: Color | UndefinedType = Undefined, + border_radius: BorderRadius | UndefinedType = Undefined, + border_top_start_radius: BorderRadius | UndefinedType = Undefined, + border_top_end_radius: BorderRadius | UndefinedType = Undefined, + border_bottom_start_radius: BorderRadius | UndefinedType = Undefined, + border_bottom_end_radius: BorderRadius | UndefinedType = Undefined, + position: Position | UndefinedType = Undefined, + top: DimensionValue | UndefinedType = Undefined, + bottom: DimensionValue | UndefinedType = Undefined, + start: DimensionValue | UndefinedType = Undefined, + end: DimensionValue | UndefinedType = Undefined, + left: DimensionValue | UndefinedType = Undefined, + right: DimensionValue | UndefinedType = Undefined, + z_index: int | UndefinedType = Undefined, + is_hidden: bool | UndefinedType = Undefined, + id: str | UndefinedType = Undefined, + UNSAFE_class_name: str | UndefinedType = Undefined, + UNSAFE_style: CSSProperties | UndefinedType = Undefined, + key: str | UndefinedType = Undefined, ) -> Element: """ View is a general purpose container with no specific semantics that can be used for custom styling purposes. It supports Spectrum style props to ensure consistency with other Spectrum components. diff --git a/plugins/ui/src/deephaven/ui/elements/BaseElement.py b/plugins/ui/src/deephaven/ui/elements/BaseElement.py index b4946a5f8..67680b5dd 100644 --- a/plugins/ui/src/deephaven/ui/elements/BaseElement.py +++ b/plugins/ui/src/deephaven/ui/elements/BaseElement.py @@ -2,7 +2,7 @@ from typing import Any from .Element import Element -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined from .._internal import dict_to_react_props, RenderContext @@ -17,7 +17,7 @@ def __init__( name: str, /, *children: Any, - key: str | Undefined = UNDEFINED, + key: str | UndefinedType = Undefined, **props: Any, ): self._name = name @@ -40,7 +40,7 @@ def name(self) -> str: return self._name @property - def key(self) -> str | Undefined: + def key(self) -> str | UndefinedType: return self._key def render(self, context: RenderContext) -> dict[str, Any]: diff --git a/plugins/ui/src/deephaven/ui/elements/Element.py b/plugins/ui/src/deephaven/ui/elements/Element.py index 09e8ab756..fbeb0f984 100644 --- a/plugins/ui/src/deephaven/ui/elements/Element.py +++ b/plugins/ui/src/deephaven/ui/elements/Element.py @@ -2,7 +2,7 @@ from abc import ABC, abstractmethod from typing import Any, Dict -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined from .._internal import RenderContext PropsType = Dict[str, Any] @@ -24,14 +24,14 @@ def name(self) -> str: return "deephaven.ui.Element" @property - def key(self) -> str | Undefined: + def key(self) -> str | UndefinedType: """ Get the key prop of this element. Useful to check if a key prop was provided. Returns: The unique key prop of this element. """ - return UNDEFINED + return Undefined @abstractmethod def render(self, context: RenderContext) -> PropsType: diff --git a/plugins/ui/src/deephaven/ui/elements/FunctionElement.py b/plugins/ui/src/deephaven/ui/elements/FunctionElement.py index 474b2200c..3f5a06bb7 100644 --- a/plugins/ui/src/deephaven/ui/elements/FunctionElement.py +++ b/plugins/ui/src/deephaven/ui/elements/FunctionElement.py @@ -2,7 +2,7 @@ import logging from typing import Callable from .Element import Element, PropsType -from ..types import Undefined, UNDEFINED +from ..types import UndefinedType, Undefined from .._internal import RenderContext logger = logging.getLogger(__name__) @@ -13,7 +13,7 @@ def __init__( self, name: str, render: Callable[[], list[Element]], - key: str | Undefined = UNDEFINED, + key: str | UndefinedType = Undefined, ): """ Create an element that takes a function to render. @@ -31,7 +31,7 @@ def name(self): return self._name @property - def key(self) -> str | Undefined: + def key(self) -> str | UndefinedType: return self._key def render(self, context: RenderContext) -> PropsType: diff --git a/plugins/ui/src/deephaven/ui/renderer/Renderer.py b/plugins/ui/src/deephaven/ui/renderer/Renderer.py index 48a5bf096..317cd6948 100644 --- a/plugins/ui/src/deephaven/ui/renderer/Renderer.py +++ b/plugins/ui/src/deephaven/ui/renderer/Renderer.py @@ -5,7 +5,7 @@ from .._internal import RenderContext, remove_empty_keys from ..elements import Element, PropsType -from ..types import UNDEFINED +from ..types import Undefined from .RenderedNode import RenderedNode logger = logging.getLogger(__name__) @@ -45,7 +45,7 @@ def _render_child_item(item: Any, parent_context: RenderContext, index_key: str) item, ) key: str = ( # type: ignore - f"{index_key}-{item.name}" if item.key is UNDEFINED else item.key + f"{index_key}-{item.name}" if item.key is Undefined else item.key ) return _render_element(item, parent_context.get_child_context(key)) diff --git a/plugins/ui/src/deephaven/ui/types/types.py b/plugins/ui/src/deephaven/ui/types/types.py index 61a2136a3..733444e99 100644 --- a/plugins/ui/src/deephaven/ui/types/types.py +++ b/plugins/ui/src/deephaven/ui/types/types.py @@ -9,6 +9,7 @@ Tuple, Callable, Sequence, + TypeAlias, ) if sys.version_info < (3, 11): @@ -565,13 +566,16 @@ class DateRange(TypedDict): DataBarValuePlacement = Literal["BESIDE", "OVERLAP", "HIDE"] -class Undefined: - """ - A class representing the type of an undefined value. To use the value itself, use `UNDEFINED` instead. - """ - - def __str__(self): +class _Undefined: + def __str__(self) -> str: return "Undefined" + def __bool__(self) -> bool: + return False + + def __eq__(self, other: object) -> bool: + return isinstance(other, _Undefined) or other is None + -UNDEFINED = Undefined() +Undefined = _Undefined() +UndefinedType: TypeAlias = _Undefined From 219f6407f966699aff3782cd80e51e731e231f6b Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Tue, 12 Nov 2024 10:43:22 -0500 Subject: [PATCH 06/13] fix test --- plugins/ui/src/deephaven/ui/_internal/utils.py | 1 - plugins/ui/src/deephaven/ui/types/types.py | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/_internal/utils.py b/plugins/ui/src/deephaven/ui/_internal/utils.py index e16de09bd..4937a0ea5 100644 --- a/plugins/ui/src/deephaven/ui/_internal/utils.py +++ b/plugins/ui/src/deephaven/ui/_internal/utils.py @@ -15,7 +15,6 @@ JavaTime, LocalDateConvertible, LocalDate, - UndefinedType, Undefined, ) diff --git a/plugins/ui/src/deephaven/ui/types/types.py b/plugins/ui/src/deephaven/ui/types/types.py index 733444e99..6e944d8de 100644 --- a/plugins/ui/src/deephaven/ui/types/types.py +++ b/plugins/ui/src/deephaven/ui/types/types.py @@ -9,13 +9,12 @@ Tuple, Callable, Sequence, - TypeAlias, ) if sys.version_info < (3, 11): - from typing_extensions import TypedDict, NotRequired + from typing_extensions import TypedDict, NotRequired, TypeAlias else: - from typing import TypedDict, NotRequired + from typing import TypedDict, NotRequired, TypeAlias import datetime import pandas From f5744dd6b4ccf5cd51f3de8d4f718c290178ddd0 Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Tue, 12 Nov 2024 10:47:21 -0500 Subject: [PATCH 07/13] fix missing refactors --- plugins/ui/src/deephaven/ui/components/date_field.py | 2 +- plugins/ui/src/deephaven/ui/components/date_picker.py | 2 +- .../ui/src/deephaven/ui/components/date_range_picker.py | 2 +- plugins/ui/test/deephaven/ui/test_utils.py | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/components/date_field.py b/plugins/ui/src/deephaven/ui/components/date_field.py index b91e3cb35..738b9c7ed 100644 --- a/plugins/ui/src/deephaven/ui/components/date_field.py +++ b/plugins/ui/src/deephaven/ui/components/date_field.py @@ -81,7 +81,7 @@ def date_field( min_value: Date | UndefinedType = Undefined, max_value: Date | UndefinedType = Undefined, # TODO (issue # 698) we need to implement unavailable_values - # unavailable_values: Sequence[Date] | Undefined = UNDEFINED, + # unavailable_values: Sequence[Date] | Undefined = Undefined, granularity: Granularity | UndefinedType = Undefined, hour_cycle: HourCycle | UndefinedType = Undefined, hide_time_zone: bool = False, diff --git a/plugins/ui/src/deephaven/ui/components/date_picker.py b/plugins/ui/src/deephaven/ui/components/date_picker.py index eb641b211..037cc9bb8 100644 --- a/plugins/ui/src/deephaven/ui/components/date_picker.py +++ b/plugins/ui/src/deephaven/ui/components/date_picker.py @@ -85,7 +85,7 @@ def date_picker( min_value: Date | UndefinedType = Undefined, max_value: Date | UndefinedType = Undefined, # TODO (issue # 698) we need to implement unavailable_values - # unavailable_values: Sequence[Date] | Undefined = UNDEFINED, + # unavailable_values: Sequence[Date] | Undefined = Undefined, granularity: Granularity | UndefinedType = Undefined, page_behavior: PageBehavior | UndefinedType = Undefined, hour_cycle: HourCycle | UndefinedType = Undefined, diff --git a/plugins/ui/src/deephaven/ui/components/date_range_picker.py b/plugins/ui/src/deephaven/ui/components/date_range_picker.py index acd6d1c0a..f2acaf630 100644 --- a/plugins/ui/src/deephaven/ui/components/date_range_picker.py +++ b/plugins/ui/src/deephaven/ui/components/date_range_picker.py @@ -83,7 +83,7 @@ def date_range_picker( min_value: Date | UndefinedType = Undefined, max_value: Date | UndefinedType = Undefined, # TODO (issue # 698) we need to implement unavailable_values - # unavailable_values: Sequence[Date] | Undefined = UNDEFINED, + # unavailable_values: Sequence[Date] | Undefined = Undefined, granularity: Granularity | UndefinedType = Undefined, page_behavior: PageBehavior | UndefinedType = Undefined, hour_cycle: HourCycle | UndefinedType = Undefined, diff --git a/plugins/ui/test/deephaven/ui/test_utils.py b/plugins/ui/test/deephaven/ui/test_utils.py index 598aea4e3..689cc597a 100644 --- a/plugins/ui/test/deephaven/ui/test_utils.py +++ b/plugins/ui/test/deephaven/ui/test_utils.py @@ -88,7 +88,7 @@ def test_dict_to_camel_case(self): def test_dict_to_react_props(self): from deephaven.ui._internal.utils import dict_to_react_props - from deephaven.ui.types import UNDEFINED + from deephaven.ui.types import Undefined self.assertDictEqual( dict_to_react_props({"test_string": "foo", "test_string_2": "bar_biz"}), @@ -103,7 +103,7 @@ def test_dict_to_react_props(self): {"foo": None, "bar": "biz"}, ) self.assertDictEqual( - dict_to_react_props({"foo": UNDEFINED, "bar": "biz"}), + dict_to_react_props({"foo": Undefined, "bar": "biz"}), {"bar": "biz"}, ) self.assertDictEqual( @@ -122,14 +122,14 @@ def test_dict_to_react_props(self): def test_remove_empty_keys(self): from deephaven.ui._internal.utils import remove_empty_keys - from deephaven.ui.types import UNDEFINED + from deephaven.ui.types import Undefined self.assertDictEqual( remove_empty_keys({"foo": "bar", "biz": None, "baz": 0}), {"foo": "bar", "biz": None, "baz": 0}, ) self.assertDictEqual( - remove_empty_keys({"foo": "bar", "biz": UNDEFINED, "baz": 0}), + remove_empty_keys({"foo": "bar", "biz": Undefined, "baz": 0}), {"foo": "bar", "baz": 0}, ) From 87856723e42299c55f1bb45a421ec0f4ead718db Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Tue, 12 Nov 2024 15:28:53 -0500 Subject: [PATCH 08/13] copy magic methods --- plugins/ui/src/deephaven/ui/types/types.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/types/types.py b/plugins/ui/src/deephaven/ui/types/types.py index 6e944d8de..26606d0e0 100644 --- a/plugins/ui/src/deephaven/ui/types/types.py +++ b/plugins/ui/src/deephaven/ui/types/types.py @@ -566,15 +566,21 @@ class DateRange(TypedDict): class _Undefined: - def __str__(self) -> str: - return "Undefined" - def __bool__(self) -> bool: return False + def __copy__(self) -> "_Undefined": + return self + + def __deepcopy__(self, _: Any) -> "_Undefined": + return self + def __eq__(self, other: object) -> bool: return isinstance(other, _Undefined) or other is None + def __str__(self) -> str: + return "Undefined" + Undefined = _Undefined() UndefinedType: TypeAlias = _Undefined From 76235ab15cfb1c35de6919e7cefc8b7c9ceb2ab6 Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Wed, 13 Nov 2024 10:53:09 -0500 Subject: [PATCH 09/13] fix --- .../ui/src/deephaven/ui/_internal/utils.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/_internal/utils.py b/plugins/ui/src/deephaven/ui/_internal/utils.py index 4937a0ea5..105424a5b 100644 --- a/plugins/ui/src/deephaven/ui/_internal/utils.py +++ b/plugins/ui/src/deephaven/ui/_internal/utils.py @@ -482,7 +482,7 @@ def _get_first_set_key(props: dict[str, Any], sequence: Sequence[str]) -> str | The first non-None prop, or None if all props are None. """ for key in sequence: - if props.get(key) != Undefined: + if Undefined != props.get(key): return key return None @@ -667,11 +667,11 @@ def convert_date_props( The converted props. """ for key in simple_date_props: - if props.get(key) != Undefined: + if Undefined != props.get(key): props[key] = _convert_to_java_date(props[key]) for key in date_range_props: - if props.get(key) != Undefined: + if Undefined != props.get(key): props[key] = convert_date_range(props[key], _convert_to_java_date) # the simple props must be converted before this to simplify the callable conversion @@ -681,25 +681,25 @@ def convert_date_props( # Local Dates will default to DAY but we need to default to SECOND for the other types if ( granularity_key is not None - and props.get(granularity_key) == Undefined + and Undefined == props.get(granularity_key) and converter != to_j_local_date ): props[granularity_key] = "SECOND" # now that the converter is set, we can convert simple props to strings for key in simple_date_props: - if props.get(key) != Undefined: + if Undefined != props.get(key): props[key] = str(props[key]) # and convert the date range props to strings for key in date_range_props: - if props.get(key) != Undefined: + if Undefined != props.get(key): props[key] = convert_date_range(props[key], str) # wrap the date callable with the convert # if there are date range props, we need to convert as a date range for key in callable_date_props: - if props.get(key) != Undefined: + if Undefined != props.get(key): if not callable(props[key]): raise TypeError(f"{key} must be a callable") if len(date_range_props) > 0: @@ -731,7 +731,7 @@ def convert_time_props( The converted props. """ for key in simple_time_props: - if props.get(key) != Undefined: + if Undefined != props.get(key): props[key] = _convert_to_java_time(props[key]) # the simple props must be converted before this to simplify the callable conversion @@ -739,12 +739,12 @@ def convert_time_props( # now that the converter is set, we can convert simple props to strings for key in simple_time_props: - if props.get(key) != Undefined: + if Undefined != props.get(key): props[key] = str(props[key]) # wrap the date callable with the convert for key in callable_time_props: - if props.get(key) != Undefined: + if Undefined != props.get(key): if not callable(props[key]): raise TypeError(f"{key} must be a callable") props[key] = _wrap_time_callable(props[key], converter) From 3235785ed3923a5f1fa970b98b12f19faeda816b Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Wed, 13 Nov 2024 15:30:17 -0500 Subject: [PATCH 10/13] refactor --- .../ui/src/deephaven/ui/_internal/utils.py | 38 +++++++++++++------ sphinx_ext/deephaven_autodoc.py | 2 +- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/_internal/utils.py b/plugins/ui/src/deephaven/ui/_internal/utils.py index 105424a5b..f320eb41b 100644 --- a/plugins/ui/src/deephaven/ui/_internal/utils.py +++ b/plugins/ui/src/deephaven/ui/_internal/utils.py @@ -5,7 +5,6 @@ import sys from functools import partial from deephaven.time import to_j_instant, to_j_zdt, to_j_local_date, to_j_local_time -from deephaven.dtypes import ZonedDateTime, Instant from ..types import ( Date, @@ -37,6 +36,21 @@ } +def is_nullish(value: Any) -> bool: + """ + Check if the value is None or Undefined. Although the `__eq__` method for Undefined exists, Python uses the + `__eq__` method of the left hand side object. If that method is defined, such as afor Java wrapped types, the + behaviour is unexpected. + + Args: + value: The value to check. + + Returns: + If the value is nullish. + """ + return value is None or value is Undefined + + def get_component_name(component: Any) -> str: """ Get the name of the component @@ -482,7 +496,7 @@ def _get_first_set_key(props: dict[str, Any], sequence: Sequence[str]) -> str | The first non-None prop, or None if all props are None. """ for key in sequence: - if Undefined != props.get(key): + if not is_nullish(props.get(key)): return key return None @@ -667,11 +681,11 @@ def convert_date_props( The converted props. """ for key in simple_date_props: - if Undefined != props.get(key): + if not is_nullish(props.get(key)): props[key] = _convert_to_java_date(props[key]) for key in date_range_props: - if Undefined != props.get(key): + if not is_nullish(props.get(key)): props[key] = convert_date_range(props[key], _convert_to_java_date) # the simple props must be converted before this to simplify the callable conversion @@ -681,25 +695,25 @@ def convert_date_props( # Local Dates will default to DAY but we need to default to SECOND for the other types if ( granularity_key is not None - and Undefined == props.get(granularity_key) + and is_nullish(props.get(granularity_key)) and converter != to_j_local_date ): props[granularity_key] = "SECOND" - # now that the converter is set, we can convert simple props to strings + # no.w that the converter is set, we can convert simple props to strings for key in simple_date_props: - if Undefined != props.get(key): + if not is_nullish(props.get(key)): props[key] = str(props[key]) # and convert the date range props to strings for key in date_range_props: - if Undefined != props.get(key): + if not is_nullish(props.get(key)): props[key] = convert_date_range(props[key], str) # wrap the date callable with the convert # if there are date range props, we need to convert as a date range for key in callable_date_props: - if Undefined != props.get(key): + if not is_nullish(props.get(key)): if not callable(props[key]): raise TypeError(f"{key} must be a callable") if len(date_range_props) > 0: @@ -731,7 +745,7 @@ def convert_time_props( The converted props. """ for key in simple_time_props: - if Undefined != props.get(key): + if not is_nullish(props.get(key)): props[key] = _convert_to_java_time(props[key]) # the simple props must be converted before this to simplify the callable conversion @@ -739,12 +753,12 @@ def convert_time_props( # now that the converter is set, we can convert simple props to strings for key in simple_time_props: - if Undefined != props.get(key): + if not is_nullish(props.get(key)): props[key] = str(props[key]) # wrap the date callable with the convert for key in callable_time_props: - if Undefined != props.get(key): + if not is_nullish(props.get(key)): if not callable(props[key]): raise TypeError(f"{key} must be a callable") props[key] = _wrap_time_callable(props[key], converter) diff --git a/sphinx_ext/deephaven_autodoc.py b/sphinx_ext/deephaven_autodoc.py index 56e6e946b..279f7d93e 100644 --- a/sphinx_ext/deephaven_autodoc.py +++ b/sphinx_ext/deephaven_autodoc.py @@ -108,7 +108,7 @@ def extract_list_item(node: docutils.nodes.list_item) -> ParamData: match = re.match(r"(.+?) \((.*?)\) -- (.+)", field, re.DOTALL) if match is None: raise ValueError( - f"Could not match {field} to extract param data. " + f"Could not match {field} to extract param data. {node}" f"Verify this parameter is documented correctly within 'Args:' with type and description." ) matched = match.groups() From f338845f28985d7b91e3fb1d7d18e7ed5e929e8d Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Wed, 13 Nov 2024 16:19:52 -0500 Subject: [PATCH 11/13] fix --- plugins/ui/src/deephaven/ui/components/panel.py | 1 + sphinx_ext/deephaven_autodoc.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/ui/src/deephaven/ui/components/panel.py b/plugins/ui/src/deephaven/ui/components/panel.py index a9a2cc1a4..9c1c7f25e 100644 --- a/plugins/ui/src/deephaven/ui/components/panel.py +++ b/plugins/ui/src/deephaven/ui/components/panel.py @@ -68,6 +68,7 @@ def panel( UNSAFE_class_name: A CSS class to apply to the element. UNSAFE_style: A CSS style to apply to the element. key: A unique identifier used by React to render elements in a list. + **props: Any other Panel prop. Returns: The rendered panel element. diff --git a/sphinx_ext/deephaven_autodoc.py b/sphinx_ext/deephaven_autodoc.py index 279f7d93e..56e6e946b 100644 --- a/sphinx_ext/deephaven_autodoc.py +++ b/sphinx_ext/deephaven_autodoc.py @@ -108,7 +108,7 @@ def extract_list_item(node: docutils.nodes.list_item) -> ParamData: match = re.match(r"(.+?) \((.*?)\) -- (.+)", field, re.DOTALL) if match is None: raise ValueError( - f"Could not match {field} to extract param data. {node}" + f"Could not match {field} to extract param data. " f"Verify this parameter is documented correctly within 'Args:' with type and description." ) matched = match.groups() From d0bceddbf6a0dbc7b2f228928a92c733be8a6413 Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Wed, 13 Nov 2024 16:23:16 -0500 Subject: [PATCH 12/13] add none type --- plugins/ui/src/deephaven/ui/components/combo_box.py | 2 +- plugins/ui/src/deephaven/ui/components/picker.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/components/combo_box.py b/plugins/ui/src/deephaven/ui/components/combo_box.py index ef1165c03..7e3a33f5b 100644 --- a/plugins/ui/src/deephaven/ui/components/combo_box.py +++ b/plugins/ui/src/deephaven/ui/components/combo_box.py @@ -58,7 +58,7 @@ def combo_box( default_input_value: str | UndefinedType = Undefined, allows_custom_value: bool | UndefinedType = Undefined, disabled_keys: list[Key] | UndefinedType = Undefined, - selected_key: Key | UndefinedType = Undefined, + selected_key: Key | None | UndefinedType = Undefined, default_selected_key: Key | UndefinedType = Undefined, is_disabled: bool | UndefinedType = Undefined, is_read_only: bool | UndefinedType = Undefined, diff --git a/plugins/ui/src/deephaven/ui/components/picker.py b/plugins/ui/src/deephaven/ui/components/picker.py index 9b358fabb..b518a7224 100644 --- a/plugins/ui/src/deephaven/ui/components/picker.py +++ b/plugins/ui/src/deephaven/ui/components/picker.py @@ -39,7 +39,7 @@ def picker( *children: Item | SectionElement | Table | PartitionedTable | ItemTableSource, default_selected_key: Key | UndefinedType = Undefined, - selected_key: Key | UndefinedType = Undefined, + selected_key: Key | None | UndefinedType = Undefined, on_selection_change: Callable[[Key], None] | UndefinedType = Undefined, on_change: Callable[[Key], None] | UndefinedType = Undefined, is_quiet: bool | UndefinedType = Undefined, From cff17dfdd336bd0637ee797661d5ec8b453333cb Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Wed, 13 Nov 2024 18:58:44 -0500 Subject: [PATCH 13/13] add other none types --- plugins/ui/src/deephaven/ui/components/calendar.py | 4 ++-- plugins/ui/src/deephaven/ui/components/combo_box.py | 2 +- plugins/ui/src/deephaven/ui/components/date_field.py | 4 ++-- plugins/ui/src/deephaven/ui/components/date_picker.py | 4 ++-- plugins/ui/src/deephaven/ui/components/date_range_picker.py | 4 ++-- plugins/ui/src/deephaven/ui/components/radio_group.py | 4 ++-- plugins/ui/src/deephaven/ui/components/range_calendar.py | 4 ++-- plugins/ui/src/deephaven/ui/components/tabs.py | 2 +- plugins/ui/src/deephaven/ui/components/text_area.py | 2 +- plugins/ui/src/deephaven/ui/components/text_field.py | 2 +- plugins/ui/src/deephaven/ui/components/time_field.py | 4 ++-- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/components/calendar.py b/plugins/ui/src/deephaven/ui/components/calendar.py index 4be909d4f..20bb876af 100644 --- a/plugins/ui/src/deephaven/ui/components/calendar.py +++ b/plugins/ui/src/deephaven/ui/components/calendar.py @@ -75,8 +75,8 @@ def _convert_calendar_props( @make_component def calendar( - value: Date | UndefinedType = Undefined, - default_value: Date | UndefinedType = Undefined, + value: Date | None | UndefinedType = Undefined, + default_value: Date | None | UndefinedType = Undefined, focused_value: Date | UndefinedType = Undefined, default_focused_value: Date | UndefinedType = Undefined, min_value: Date | UndefinedType = Undefined, diff --git a/plugins/ui/src/deephaven/ui/components/combo_box.py b/plugins/ui/src/deephaven/ui/components/combo_box.py index 7e3a33f5b..0261b75b0 100644 --- a/plugins/ui/src/deephaven/ui/components/combo_box.py +++ b/plugins/ui/src/deephaven/ui/components/combo_box.py @@ -76,7 +76,7 @@ def combo_box( contextual_help: Element | UndefinedType = Undefined, on_open_change: Callable[[bool, MenuTriggerAction], None] | UndefinedType = Undefined, - on_selection_change: Callable[[Key], None] | UndefinedType = Undefined, + on_selection_change: Callable[[Key | None], None] | UndefinedType = Undefined, on_change: Callable[[Key], None] | UndefinedType = Undefined, on_input_change: Callable[[str], None] | UndefinedType = Undefined, on_focus: Callable[[FocusEventCallable], None] | UndefinedType = Undefined, diff --git a/plugins/ui/src/deephaven/ui/components/date_field.py b/plugins/ui/src/deephaven/ui/components/date_field.py index 738b9c7ed..bd7936cb7 100644 --- a/plugins/ui/src/deephaven/ui/components/date_field.py +++ b/plugins/ui/src/deephaven/ui/components/date_field.py @@ -76,8 +76,8 @@ def _convert_date_field_props( @make_component def date_field( placeholder_value: Date | UndefinedType = dh_now(), - value: Date | UndefinedType = Undefined, - default_value: Date | UndefinedType = Undefined, + value: Date | None | UndefinedType = Undefined, + default_value: Date | None | UndefinedType = Undefined, min_value: Date | UndefinedType = Undefined, max_value: Date | UndefinedType = Undefined, # TODO (issue # 698) we need to implement unavailable_values diff --git a/plugins/ui/src/deephaven/ui/components/date_picker.py b/plugins/ui/src/deephaven/ui/components/date_picker.py index 037cc9bb8..22f9e4320 100644 --- a/plugins/ui/src/deephaven/ui/components/date_picker.py +++ b/plugins/ui/src/deephaven/ui/components/date_picker.py @@ -80,8 +80,8 @@ def _convert_date_picker_props( @make_component def date_picker( placeholder_value: Date | UndefinedType = dh_now(), - value: Date | UndefinedType = Undefined, - default_value: Date | UndefinedType = Undefined, + value: Date | None | UndefinedType = Undefined, + default_value: Date | None | UndefinedType = Undefined, min_value: Date | UndefinedType = Undefined, max_value: Date | UndefinedType = Undefined, # TODO (issue # 698) we need to implement unavailable_values diff --git a/plugins/ui/src/deephaven/ui/components/date_range_picker.py b/plugins/ui/src/deephaven/ui/components/date_range_picker.py index f2acaf630..50ccad247 100644 --- a/plugins/ui/src/deephaven/ui/components/date_range_picker.py +++ b/plugins/ui/src/deephaven/ui/components/date_range_picker.py @@ -78,8 +78,8 @@ def _convert_date_range_picker_props( @make_component def date_range_picker( placeholder_value: Date | UndefinedType = dh_now(), - value: DateRange | UndefinedType = Undefined, - default_value: DateRange | UndefinedType = Undefined, + value: DateRange | None | UndefinedType = Undefined, + default_value: DateRange | None | UndefinedType = Undefined, min_value: Date | UndefinedType = Undefined, max_value: Date | UndefinedType = Undefined, # TODO (issue # 698) we need to implement unavailable_values diff --git a/plugins/ui/src/deephaven/ui/components/radio_group.py b/plugins/ui/src/deephaven/ui/components/radio_group.py index 74cb83891..b0f023506 100644 --- a/plugins/ui/src/deephaven/ui/components/radio_group.py +++ b/plugins/ui/src/deephaven/ui/components/radio_group.py @@ -27,8 +27,8 @@ def radio_group( *children: Any, is_emphasized: bool | UndefinedType = Undefined, orientation: Orientation = "vertical", - value: str | UndefinedType = Undefined, - default_value: str | UndefinedType = Undefined, + value: str | None | UndefinedType = Undefined, + default_value: str | None | UndefinedType = Undefined, is_disabled: bool | UndefinedType = Undefined, is_read_only: bool | UndefinedType = Undefined, name: str | UndefinedType = Undefined, diff --git a/plugins/ui/src/deephaven/ui/components/range_calendar.py b/plugins/ui/src/deephaven/ui/components/range_calendar.py index 7d48aa839..acdd27f37 100644 --- a/plugins/ui/src/deephaven/ui/components/range_calendar.py +++ b/plugins/ui/src/deephaven/ui/components/range_calendar.py @@ -73,8 +73,8 @@ def _convert_range_calendar_props( @make_component def range_calendar( - value: DateRange | UndefinedType = Undefined, - default_value: DateRange | UndefinedType = Undefined, + value: DateRange | None | UndefinedType = Undefined, + default_value: DateRange | None | UndefinedType = Undefined, focused_value: Date | UndefinedType = Undefined, default_focused_value: Date | UndefinedType = Undefined, min_value: Date | UndefinedType = Undefined, diff --git a/plugins/ui/src/deephaven/ui/components/tabs.py b/plugins/ui/src/deephaven/ui/components/tabs.py index e7261ff5f..13cd64f02 100644 --- a/plugins/ui/src/deephaven/ui/components/tabs.py +++ b/plugins/ui/src/deephaven/ui/components/tabs.py @@ -30,7 +30,7 @@ def tabs( keyboard_activation: KeyboardActivationType | UndefinedType = "automatic", orientation: Orientation | UndefinedType = "horizontal", disallow_empty_selection: bool | UndefinedType = Undefined, - selected_key: Key | UndefinedType = Undefined, + selected_key: Key | None | UndefinedType = Undefined, default_selected_key: Key | UndefinedType = Undefined, on_selection_change: Callable[[Key], None] | UndefinedType = Undefined, on_change: Callable[[Key], None] | UndefinedType = Undefined, diff --git a/plugins/ui/src/deephaven/ui/components/text_area.py b/plugins/ui/src/deephaven/ui/components/text_area.py index 047180165..74e10ee46 100644 --- a/plugins/ui/src/deephaven/ui/components/text_area.py +++ b/plugins/ui/src/deephaven/ui/components/text_area.py @@ -31,7 +31,7 @@ def text_area( - icon: Element | IconTypes | UndefinedType = Undefined, + icon: Element | IconTypes | None | UndefinedType = Undefined, is_quiet: bool | UndefinedType = Undefined, is_disabled: bool | UndefinedType = Undefined, is_read_only: bool | UndefinedType = Undefined, diff --git a/plugins/ui/src/deephaven/ui/components/text_field.py b/plugins/ui/src/deephaven/ui/components/text_field.py index 0bc99e1ca..ce2f3d4fb 100644 --- a/plugins/ui/src/deephaven/ui/components/text_field.py +++ b/plugins/ui/src/deephaven/ui/components/text_field.py @@ -28,7 +28,7 @@ def text_field( - icon: Element | UndefinedType = Undefined, + icon: Element | None | UndefinedType = Undefined, is_quiet: bool | UndefinedType = Undefined, is_disabled: bool | UndefinedType = Undefined, is_read_only: bool | UndefinedType = Undefined, diff --git a/plugins/ui/src/deephaven/ui/components/time_field.py b/plugins/ui/src/deephaven/ui/components/time_field.py index 4a2c5bbfa..3488e873f 100644 --- a/plugins/ui/src/deephaven/ui/components/time_field.py +++ b/plugins/ui/src/deephaven/ui/components/time_field.py @@ -71,8 +71,8 @@ def _convert_time_field_props( @make_component def time_field( placeholder_value: Time | UndefinedType = Undefined, - value: Time | UndefinedType = Undefined, - default_value: Time | UndefinedType = Undefined, + value: Time | None | UndefinedType = Undefined, + default_value: Time | None | UndefinedType = Undefined, min_value: Time | UndefinedType = Undefined, max_value: Time | UndefinedType = Undefined, granularity: TimeGranularity | UndefinedType = "SECOND",