diff --git a/src/components/Table.jsx b/src/components/Table.jsx index 0f01e7d..4f53657 100644 --- a/src/components/Table.jsx +++ b/src/components/Table.jsx @@ -14,7 +14,6 @@ import { IconDeleteStroked, IconKeyStroked, IconCheckboxTick, - IconColorPalette, } from "@douyinfe/semi-icons"; import { Select, @@ -72,24 +71,27 @@ export default function Table(props) { onMouseLeave={() => setIsHovered(false)} >
{isHovered @@ -97,8 +99,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 && (
@@ -147,8 +149,9 @@ export default function Table(props) {
Indices : {" "} @@ -159,10 +162,11 @@ export default function Table(props) { {props.tableData.indices.map((index, k) => (
@@ -431,8 +435,9 @@ 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([]); @@ -458,8 +463,9 @@ 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([]); @@ -691,8 +697,9 @@ 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([]); @@ -732,8 +739,9 @@ 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([]); @@ -896,10 +904,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 ), }); @@ -936,8 +944,9 @@ 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([]); @@ -945,10 +954,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 ), }); @@ -1038,7 +1047,7 @@ export default function Table(props) { -
+
Theme
+
@@ -1231,10 +1243,11 @@ export default function Table(props) { function field(fieldData, index) { return (
{ setHoveredField(index); props.setOnRect({