|
|
@ -6,6 +6,7 @@ import { |
|
|
|
DropZoneRef, |
|
|
|
DropZoneRef, |
|
|
|
computed, |
|
|
|
computed, |
|
|
|
onKeyStroke, |
|
|
|
onKeyStroke, |
|
|
|
|
|
|
|
onMounted, |
|
|
|
provide, |
|
|
|
provide, |
|
|
|
ref, |
|
|
|
ref, |
|
|
|
useEventListener, |
|
|
|
useEventListener, |
|
|
@ -85,6 +86,8 @@ function transition(direction: TransitionDirection) { |
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
isTransitioning.value = false |
|
|
|
isTransitioning.value = false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(focusInput, 100) |
|
|
|
}, 1000) |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -113,6 +116,19 @@ async function goPrevious() { |
|
|
|
goToPrevious() |
|
|
|
goToPrevious() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function focusInput() { |
|
|
|
|
|
|
|
if (document && typeof document !== 'undefined') { |
|
|
|
|
|
|
|
const inputEl = |
|
|
|
|
|
|
|
(document.querySelector('.nc-cell input') as HTMLInputElement) || |
|
|
|
|
|
|
|
(document.querySelector('.nc-cell textarea') as HTMLTextAreaElement) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (inputEl) { |
|
|
|
|
|
|
|
inputEl.select() |
|
|
|
|
|
|
|
inputEl.focus() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
useEventListener('wheel', (event) => { |
|
|
|
useEventListener('wheel', (event) => { |
|
|
|
if (Math.abs(event.deltaX) < Math.abs(event.deltaY)) { |
|
|
|
if (Math.abs(event.deltaX) < Math.abs(event.deltaY)) { |
|
|
|
// Scrolling more vertically than horizontally |
|
|
|
// Scrolling more vertically than horizontally |
|
|
@ -130,6 +146,8 @@ useEventListener('wheel', (event) => { |
|
|
|
|
|
|
|
|
|
|
|
onKeyStroke(['ArrowLeft', 'ArrowDown'], goPrevious) |
|
|
|
onKeyStroke(['ArrowLeft', 'ArrowDown'], goPrevious) |
|
|
|
onKeyStroke(['ArrowRight', 'ArrowUp', 'Enter', 'Space'], goNext) |
|
|
|
onKeyStroke(['ArrowRight', 'ArrowUp', 'Enter', 'Space'], goNext) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(focusInput) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|