mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-31 16:24:33 +00:00
feat(grid): add Clone Row to row context menu (closes #227)
Copy the selected row as a new row with primary key columns set to null so auto-increment values are generated on save.
This commit is contained in:
@@ -35,6 +35,7 @@ import {
|
||||
FileDown,
|
||||
SquareDashed,
|
||||
Check,
|
||||
CopyPlus,
|
||||
} from "lucide-vue-next";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
@@ -882,6 +883,7 @@ const {
|
||||
applyCellValue,
|
||||
onEditKeydown,
|
||||
addRow,
|
||||
cloneRow,
|
||||
showDeleteRowConfirm,
|
||||
requestDeleteRow,
|
||||
confirmDeleteRow,
|
||||
@@ -2513,6 +2515,9 @@ defineExpose({
|
||||
</ContextMenuSub>
|
||||
<ContextMenuSeparator />
|
||||
<template v-if="editable && contextRowItem">
|
||||
<ContextMenuItem @click="cloneRow(contextRowItem.id)">
|
||||
<CopyPlus class="w-3.5 h-3.5 mr-2" /> {{ t("grid.cloneRow") }}
|
||||
</ContextMenuItem>
|
||||
<ContextMenuItem v-if="contextRowItem.isDeleted" @click="restoreRow(contextRowItem.id)">
|
||||
<Undo2 class="w-3.5 h-3.5 mr-2" /> {{ t("grid.restoreRow") }}
|
||||
</ContextMenuItem>
|
||||
|
||||
Reference in New Issue
Block a user