|
|
@ -1,6 +1,15 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import { ActiveCellInj, ReadonlyInj, inject, ref, useProject, useSelectedCellKeyupListener, watch } from '#imports' |
|
|
|
import { |
|
|
|
|
|
|
|
ActiveCellInj, |
|
|
|
|
|
|
|
ReadonlyInj, |
|
|
|
|
|
|
|
inject, |
|
|
|
|
|
|
|
isDrawerOrModalExist, |
|
|
|
|
|
|
|
ref, |
|
|
|
|
|
|
|
useProject, |
|
|
|
|
|
|
|
useSelectedCellKeyupListener, |
|
|
|
|
|
|
|
watch, |
|
|
|
|
|
|
|
} from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
interface Props { |
|
|
|
modelValue?: string | null |
|
|
|
modelValue?: string | null |
|
|
@ -65,8 +74,8 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { |
|
|
|
switch (e.key) { |
|
|
|
switch (e.key) { |
|
|
|
case 'Enter': |
|
|
|
case 'Enter': |
|
|
|
e.stopPropagation() |
|
|
|
e.stopPropagation() |
|
|
|
// if expanded form is active skip resetting the active cell |
|
|
|
// skip if drawer / modal is active |
|
|
|
if (document.querySelector('.nc-drawer-expanded-form.active')) { |
|
|
|
if (isDrawerOrModalExist()) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (!open.value) { |
|
|
|
if (!open.value) { |
|
|
@ -78,8 +87,8 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { |
|
|
|
} |
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
|
case 'Escape': |
|
|
|
case 'Escape': |
|
|
|
// if expanded form is active skip resetting the active cell |
|
|
|
// skip if drawer / modal is active |
|
|
|
if (document.querySelector('.nc-drawer-expanded-form.active')) { |
|
|
|
if (isDrawerOrModalExist()) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (open.value) { |
|
|
|
if (open.value) { |
|
|
|