diff --git a/bale/elements.py b/bale/elements.py index 0a05d32..33e5f48 100644 --- a/bale/elements.py +++ b/bale/elements.py @@ -162,16 +162,17 @@ class FInput(ui.input): class DSelect(ui.select): def __init__( self, - options: List | Dict, + options: Union[List, Dict], *, - label: str | None = None, + label: Optional[str] = None, value: Any = None, - on_change: Callable[..., Any] | None = None, + on_change: Optional[Callable[..., Any]] = None, with_input: bool = False, + new_value_mode: Optional[Literal["add", "add-unique", "toggle"]] = None, multiple: bool = False, clearable: bool = False, ) -> None: - super().__init__(options, label=label, value=value, on_change=on_change, with_input=with_input, multiple=multiple, clearable=clearable) + super().__init__(options, label=label, value=value, on_change=on_change, with_input=with_input, new_value_mode=new_value_mode, multiple=multiple, clearable=clearable) self.tailwind.width("full") if multiple is True: self.props("use-chips") @@ -180,16 +181,17 @@ class DSelect(ui.select): class FSelect(ui.select): def __init__( self, - options: List | Dict, + options: Union[List, Dict], *, - label: str | None = None, + label: Optional[str] = None, value: Any = None, - on_change: Callable[..., Any] | None = None, + on_change: Optional[Callable[..., Any]] = None, with_input: bool = False, + new_value_mode: Optional[Literal["add", "add-unique", "toggle"]] = None, multiple: bool = False, clearable: bool = False, ) -> None: - super().__init__(options, label=label, value=value, on_change=on_change, with_input=with_input, multiple=multiple, clearable=clearable) + super().__init__(options, label=label, value=value, on_change=on_change, with_input=with_input, new_value_mode=new_value_mode, multiple=multiple, clearable=clearable) self.tailwind.width("64") diff --git a/bale/tabs/automation.py b/bale/tabs/automation.py index 8080d21..41ca98c 100644 --- a/bale/tabs/automation.py +++ b/bale/tabs/automation.py @@ -491,10 +491,10 @@ class Automation(Tab): row.tailwind.width("[860px]").justify_content("center") with ui.column() as col: col.tailwind.height("full").width("[420px]") - self.hosts = el.DSelect(source_hosts, label="Source Host(s)", multiple=True, with_input=True) self.target_host = el.DSelect(target_host, label="Target Host", on_change=target_host_selected) self.target_paths = [""] - self.target_path = el.DSelect(self.target_paths, value="", label="Target Path", on_change=target_path_selected) + self.target_path = el.DSelect(self.target_paths, value="", label="Target Path", new_value_mode="add-unique", on_change=target_path_selected) + self.hosts = el.DSelect(source_hosts, label="Source Host(s)", multiple=True, with_input=True) all_fs_to_lists() with ui.scroll_area().classes("col"): self.parentchildren = el.DSelect(