|
|
@ -76,6 +76,8 @@ provide(ReadonlyInj, readOnly) |
|
|
|
|
|
|
|
|
|
|
|
const isForm = inject(IsFormInj, ref(false)) |
|
|
|
const isForm = inject(IsFormInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isGrid = inject(IsGridInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
const isPublic = inject(IsPublicInj, ref(false)) |
|
|
|
const isPublic = inject(IsPublicInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
const isLocked = inject(IsLockedInj, ref(false)) |
|
|
|
const isLocked = inject(IsLockedInj, ref(false)) |
|
|
@ -124,14 +126,26 @@ const syncAndNavigate = (dir: NavigateDir, e: KeyboardEvent) => { |
|
|
|
|
|
|
|
|
|
|
|
if (!isForm.value) e.stopImmediatePropagation() |
|
|
|
if (!isForm.value) e.stopImmediatePropagation() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isNumericField = computed(() => { |
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
isInt(column.value, abstractType.value) || |
|
|
|
|
|
|
|
isFloat(column.value, abstractType.value) || |
|
|
|
|
|
|
|
isDecimal(column.value) || |
|
|
|
|
|
|
|
isCurrency(column.value) || |
|
|
|
|
|
|
|
isPercent(column.value) || |
|
|
|
|
|
|
|
isDuration(column.value) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div |
|
|
|
<div |
|
|
|
class="nc-cell w-full" |
|
|
|
class="nc-cell w-full h-full" |
|
|
|
:class="[ |
|
|
|
:class="[ |
|
|
|
`nc-cell-${(column?.uidt || 'default').toLowerCase()}`, |
|
|
|
`nc-cell-${(column?.uidt || 'default').toLowerCase()}`, |
|
|
|
{ 'text-blue-600': isPrimary(column) && !props.virtual && !isForm }, |
|
|
|
{ 'text-blue-600': isPrimary(column) && !props.virtual && !isForm }, |
|
|
|
|
|
|
|
{ 'nc-grid-numeric-cell': isGrid && isNumericField }, |
|
|
|
]" |
|
|
|
]" |
|
|
|
@keydown.enter.exact="syncAndNavigate(NavigateDir.NEXT, $event)" |
|
|
|
@keydown.enter.exact="syncAndNavigate(NavigateDir.NEXT, $event)" |
|
|
|
@keydown.shift.enter.exact="syncAndNavigate(NavigateDir.PREV, $event)" |
|
|
|
@keydown.shift.enter.exact="syncAndNavigate(NavigateDir.PREV, $event)" |
|
|
@ -168,3 +182,12 @@ const syncAndNavigate = (dir: NavigateDir, e: KeyboardEvent) => { |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
|
|
|
.nc-grid-numeric-cell { |
|
|
|
|
|
|
|
@apply text-right; |
|
|
|
|
|
|
|
:deep(input) { |
|
|
|
|
|
|
|
@apply text-right; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|