feat(frontend): add table actions navigation (#1298)

* feat(frontend): add table actions navigation

* feat(frontend): add table actions navigation

* feat(frontend): add table actions navigation
This commit is contained in:
Faton Ramadani
2023-03-16 12:36:33 +01:00
committed by GitHub
parent a0c5864a7d
commit 6fd1c704ea
4 changed files with 108 additions and 28 deletions
@@ -52,7 +52,15 @@
const currentIndex = sortedGridItems.findIndex((item) => item.id === $selectedComponent)
if (currentIndex !== -1 && currentIndex > 0) {
$selectedComponent = sortedGridItems[currentIndex - 1].id
const left = sortedGridItems[currentIndex - 1]
if (left.data.type === 'tablecomponent') {
if (left.data.actionButtons.length >= 1) {
$selectedComponent = left.data.actionButtons[left.data.actionButtons.length - 1].id
} else {
$selectedComponent = left.id
}
}
}
}
@@ -61,6 +69,12 @@
function right(event: KeyboardEvent) {
let r = $componentControl[$selectedComponent!]?.right?.()
if (typeof r === 'string') {
$selectedComponent = r
r = $componentControl[r]?.right?.(true)
}
if (!r) {
const sortedGridItems = getGridItems()
const currentIndex = sortedGridItems.findIndex((item) => item.id === $selectedComponent)