diff --git a/src/svelte-components/src/components/DimensionInput.svelte b/src/svelte-components/src/components/DimensionInput.svelte deleted file mode 100644 index bec8141..0000000 --- a/src/svelte-components/src/components/DimensionInput.svelte +++ /dev/null @@ -1,91 +0,0 @@ - - -
-
- menu.setOpen(true)} - /> - -
- - - {#each options as option} - onOptionSelected(option)}> - {option.label} - - {/each} - - -
- - \ No newline at end of file diff --git a/src/svelte-components/src/components/TextFieldWithOptions.svelte b/src/svelte-components/src/components/TextFieldWithOptions.svelte new file mode 100644 index 0000000..d1d487a --- /dev/null +++ b/src/svelte-components/src/components/TextFieldWithOptions.svelte @@ -0,0 +1,90 @@ + + +
+ showMenu(true)} + on:focusout={() => showMenu(false)} + use={[[virtualKeyboardChange, (newValue) => (value = newValue)]]} + {...$$restProps} + > +
+ {#if valid} + + {/if} +
+ {helperText} +
+ + +
+ {#each options as group} + + {#each group as option} + { + value = option; + showMenu(false); + + optionSelected = true; + }} + > + {option} + + {/each} + + {/each} +
+
+
+ + diff --git a/src/svelte-components/src/dialogs/ChangeHostnameDialog.svelte b/src/svelte-components/src/dialogs/ChangeHostnameDialog.svelte index c8463a3..c04a40c 100644 --- a/src/svelte-components/src/dialogs/ChangeHostnameDialog.svelte +++ b/src/svelte-components/src/dialogs/ChangeHostnameDialog.svelte @@ -4,7 +4,7 @@ import TextField from "@smui/textfield"; import MessageDialog from "$dialogs/MessageDialog.svelte"; import * as api from "$lib/api"; - import { virtualKeyboardChangeHelper } from "$lib/customActions"; + import { virtualKeyboardChange } from "$lib/CustomActions"; // https://man7.org/linux/man-pages/man7/hostname.7.html // @@ -73,7 +73,7 @@ (hostname = newValue)]]} + use={[[virtualKeyboardChange, (newValue) => (hostname = newValue)]]} label="New Hostname" spellcheck="false" variant="filled" diff --git a/src/svelte-components/src/dialogs/ManualHomeAxisDialog.svelte b/src/svelte-components/src/dialogs/ManualHomeAxisDialog.svelte index 14c4135..b008e83 100644 --- a/src/svelte-components/src/dialogs/ManualHomeAxisDialog.svelte +++ b/src/svelte-components/src/dialogs/ManualHomeAxisDialog.svelte @@ -3,7 +3,7 @@ import TextField from "@smui/textfield"; import Button, { Label } from "@smui/button"; import { ControllerMethods } from "$lib/RegisterControllerMethods"; - import { virtualKeyboardChangeHelper } from "$lib/customActions"; + import { virtualKeyboardChange } from "$lib/CustomActions"; export let open: boolean; export let axis = ""; @@ -31,7 +31,7 @@ label="Absolute" type="number" bind:value - use={[[virtualKeyboardChangeHelper, (newValue) => (value = newValue)]]} + use={[[virtualKeyboardChange, (newValue) => (value = newValue)]]} variant="filled" style="width: 100%;" /> diff --git a/src/svelte-components/src/dialogs/ProbeDialog.svelte b/src/svelte-components/src/dialogs/ProbeDialog.svelte index cc76844..6559b08 100644 --- a/src/svelte-components/src/dialogs/ProbeDialog.svelte +++ b/src/svelte-components/src/dialogs/ProbeDialog.svelte @@ -1,5 +1,4 @@