From b8f7ac2812d8c8f83a332e946b36451c4429c6e5 Mon Sep 17 00:00:00 2001 From: 1ilit Date: Mon, 22 Jan 2024 18:16:21 +0200 Subject: [PATCH] Remove popconfirm from canvas field delete --- src/components/Table.jsx | 105 ++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 61 deletions(-) diff --git a/src/components/Table.jsx b/src/components/Table.jsx index 8c8bd45..aa11c1e 100644 --- a/src/components/Table.jsx +++ b/src/components/Table.jsx @@ -17,7 +17,6 @@ import { IconColorPalette, } from "@douyinfe/semi-icons"; import { - Popconfirm, Select, Input, TextArea, @@ -73,27 +72,24 @@ export default function Table(props) { onMouseLeave={() => setIsHovered(false)} >
{isHovered @@ -101,8 +97,8 @@ export default function Table(props) { ? props.tableData.name : `${props.tableData.name.substring(0, 10)}...` : props.tableData.name.length < 16 - ? props.tableData.name - : `${props.tableData.name.substring(0, 16)}...`} + ? props.tableData.name + : `${props.tableData.name.substring(0, 16)}...`}
{isHovered && (
@@ -151,9 +147,8 @@ export default function Table(props) {
Indices : {" "} @@ -164,11 +159,10 @@ export default function Table(props) { {props.tableData.indices.map((index, k) => (
@@ -437,9 +431,8 @@ export default function Table(props) { fid: j, undo: { notNull: f.notNull }, redo: { notNull: !f.notNull }, - message: `Edit table field to${ - f.notNull ? "" : " not" - } null`, + message: `Edit table field to${f.notNull ? "" : " not" + } null`, }, ]); setRedoStack([]); @@ -465,9 +458,8 @@ export default function Table(props) { fid: j, undo: { primary: f.primary }, redo: { primary: !f.primary }, - message: `Edit table field to${ - f.primary ? " not" : "" - } primary`, + message: `Edit table field to${f.primary ? " not" : "" + } primary`, }, ]); setRedoStack([]); @@ -699,9 +691,8 @@ export default function Table(props) { [checkedValues.target.value]: checkedValues.target.checked, }, - message: `Edit table field to${ - f.unique ? " not" : "" - } unique`, + message: `Edit table field to${f.unique ? " not" : "" + } unique`, }, ]); setRedoStack([]); @@ -741,9 +732,8 @@ export default function Table(props) { [checkedValues.target.value]: checkedValues.target.checked, }, - message: `Edit table field to${ - f.primary ? " not" : "" - } auto increment`, + message: `Edit table field to${f.primary ? " not" : "" + } auto increment`, }, ]); setRedoStack([]); @@ -906,10 +896,10 @@ export default function Table(props) { indices: props.tableData.indices.map((index) => index.id === k ? { - ...index, - fields: [...value], - name: `${value.join("_")}_index`, - } + ...index, + fields: [...value], + name: `${value.join("_")}_index`, + } : index ), }); @@ -946,9 +936,8 @@ export default function Table(props) { [checkedValues.target.value]: checkedValues.target.checked, }, - message: `Edit table field to${ - idx.unique ? " not" : "" - } unique`, + message: `Edit table field to${idx.unique ? " not" : "" + } unique`, }, ]); setRedoStack([]); @@ -956,10 +945,10 @@ export default function Table(props) { indices: props.tableData.indices.map((index) => index.id === k ? { - ...index, - [checkedValues.target.value]: - checkedValues.target.checked, - } + ...index, + [checkedValues.target.value]: + checkedValues.target.checked, + } : index ), }); @@ -1242,11 +1231,10 @@ export default function Table(props) { function field(fieldData, index) { return (
{ setHoveredField(index); props.setOnRect({ @@ -1278,10 +1266,16 @@ export default function Table(props) {
{hoveredField === index ? ( - { + + - + > ) : ( fieldData.type )}