Compare commits
No commits in common. "c6abf633f8ae5e9b562dda36f9f7ab4d6adcb4e1" and "a4eebb944f55da8e87cc899eebada0bd3fd37aa8" have entirely different histories.
c6abf633f8
...
a4eebb944f
4 changed files with 34 additions and 33 deletions
|
@ -31,3 +31,7 @@ export const handle = sequence(
|
|||
authorization,
|
||||
createTRPCHandle({ router, createContext }),
|
||||
);
|
||||
|
||||
// Allow server application to exit
|
||||
process.on("SIGINT", () => process.exit()); // Ctrl+C
|
||||
process.on("SIGTERM", () => process.exit()); // docker stop
|
||||
|
|
|
@ -166,14 +166,6 @@
|
|||
if (opened) {
|
||||
onClose(kb);
|
||||
}
|
||||
// select remaining item if autoselect is enabled
|
||||
if (!selection) {
|
||||
if (!noAutoselect1 && filteredItems.length === 1) {
|
||||
selectListItem(filteredItems[0], true);
|
||||
} else {
|
||||
setInputValue("");
|
||||
}
|
||||
}
|
||||
opened = false;
|
||||
}
|
||||
|
||||
|
@ -193,38 +185,43 @@
|
|||
}
|
||||
|
||||
function onKeyDown(e: KeyboardEvent): void {
|
||||
switch (e.key) {
|
||||
case "Tab":
|
||||
close();
|
||||
break;
|
||||
case "ArrowDown":
|
||||
let { key } = e;
|
||||
if (key === "Tab" && e.shiftKey) key = "ShiftTab";
|
||||
const fnmap: Record<string, () => void> = {
|
||||
Tab: () => close,
|
||||
ShiftTab: () => close,
|
||||
ArrowDown: () => {
|
||||
open();
|
||||
if (highlightIndex < filteredItems.length - 1) {
|
||||
highlightIndex++;
|
||||
highlight();
|
||||
}
|
||||
break;
|
||||
case "ArrowUp":
|
||||
},
|
||||
ArrowUp: () => {
|
||||
open();
|
||||
if (highlightIndex > 0) {
|
||||
highlightIndex--;
|
||||
highlight();
|
||||
}
|
||||
break;
|
||||
case "Escape":
|
||||
},
|
||||
Escape: () => {
|
||||
e.stopPropagation();
|
||||
if (opened) {
|
||||
if (inputElm) inputElm.focus();
|
||||
close();
|
||||
}
|
||||
break;
|
||||
case "Backspace":
|
||||
},
|
||||
Backspace: () => {
|
||||
if (inputValue().length === 0) {
|
||||
onBackspace();
|
||||
} else if (selection) {
|
||||
clearSelection();
|
||||
}
|
||||
break;
|
||||
},
|
||||
};
|
||||
const fn = fnmap[key];
|
||||
if (typeof fn === "function") {
|
||||
fn();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,6 +234,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
function onBlur(): void {
|
||||
if (!selection) {
|
||||
if (!noAutoselect1 && filteredItems.length === 1) {
|
||||
selectListItem(filteredItems[0], true);
|
||||
} else {
|
||||
setInputValue("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function highlight(): void {
|
||||
if (browser && opened) {
|
||||
window.setTimeout(() => {
|
||||
|
@ -296,11 +303,12 @@
|
|||
on:focus={open}
|
||||
on:keydown={onKeyDown}
|
||||
on:keypress={onKeyPress}
|
||||
on:blur={onBlur}
|
||||
use:floatingRef
|
||||
/>
|
||||
|
||||
{#if opened && filteredItems.length > 0}
|
||||
<div bind:this={listElm} class="autocomplete-list" tabindex="-1" use:floatingContent>
|
||||
<div bind:this={listElm} class="autocomplete-list" use:floatingContent>
|
||||
{#each filteredItems as item, i}
|
||||
<div
|
||||
class="autocomplete-list-item"
|
||||
|
@ -336,12 +344,7 @@
|
|||
|
||||
{#if clearBtn && selection}
|
||||
<div class="absolute bottom-0 right-0 h-full flex items-center">
|
||||
<IconButton
|
||||
cls=""
|
||||
path={mdiClose}
|
||||
tabindex={-1}
|
||||
title="Löschen"
|
||||
on:click={clearSelection} />
|
||||
<IconButton cls="" path={mdiClose} title="Löschen" on:click={clearSelection} />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<script lang="ts">
|
||||
import { goto } from "$app/navigation";
|
||||
|
||||
import type { RouterOutput } from "$lib/shared/trpc";
|
||||
import { formatDate } from "$lib/shared/util";
|
||||
|
||||
|
@ -41,7 +39,6 @@
|
|||
class="transition-colors hover:bg-neutral-content/10"
|
||||
class:done={entry.execution?.done}
|
||||
class:priority={entry.current_version.priority}
|
||||
on:dblclick={() => { void goto("/entry/" + entry.id); }}
|
||||
>
|
||||
<td
|
||||
><a
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<script lang="ts">
|
||||
import { goto } from "$app/navigation";
|
||||
|
||||
import { mdiFilter } from "@mdi/js";
|
||||
|
||||
import { URL_ENTRIES } from "$lib/shared/constants";
|
||||
|
@ -36,7 +34,6 @@
|
|||
<tr
|
||||
class="transition-colors hover:bg-neutral-content/10"
|
||||
class:p-hidden={patient.hidden}
|
||||
on:dblclick={() => { void goto("/patient/" + patient.id); }}
|
||||
>
|
||||
<td
|
||||
><a
|
||||
|
|
Loading…
Reference in a new issue