Skip to content

Commit f100bf8

Browse files
Release v0.0.110
1 parent 439169d commit f100bf8

File tree

6 files changed

+43
-4
lines changed

6 files changed

+43
-4
lines changed

dist/index.js

+12
Original file line numberDiff line numberDiff line change
@@ -48593,6 +48593,17 @@ var SchemaDesigner = class {
4859348593
this.config.icons.addTableIcon,
4859448594
"Add Table",
4859548595
() => {
48596+
this.mxModel.beginUpdate();
48597+
this.mxGraph.stopEditing(false);
48598+
const entity = this.createTable();
48599+
const cell2 = this.renderTable(entity, 100, 100);
48600+
this.autoLayout();
48601+
this.mxGraph.scrollCellToVisible(cell2, true);
48602+
const state = this.mxGraph.view.getState(cell2);
48603+
if (state !== void 0) {
48604+
cell2.value.editTable(state);
48605+
}
48606+
this.mxModel.endUpdate();
4859648607
},
4859748608
(_graph, evt, _cell) => {
4859848609
this.mxGraph.stopEditing(false);
@@ -48988,6 +48999,7 @@ var SchemaDesigner = class {
4898848999
this.renderForeignKey(foreignKey, editedTable);
4898949000
});
4899049001
this.autoLayout();
49002+
this.mxGraph.scrollCellToVisible(state.cell, true);
4899149003
this.mxGraph.model.endUpdate();
4899249004
}
4899349005
// Gets the foreign keys for a table

dist/index.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/ts/schemaDesigner/schemaDesigner.js

+13
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,18 @@ class SchemaDesigner {
453453
this.toolbar = new schemaDesignerToolbar_1.SchemaDesignerToolbar(toolbarBelt, this.mxGraph, this.config);
454454
if (this.config.isEditable) {
455455
this.toolbar.addButton(this.config.icons.addTableIcon, "Add Table", () => {
456+
this.mxModel.beginUpdate();
457+
this.mxGraph.stopEditing(false);
458+
const entity = this.createTable();
459+
const cell = this.renderTable(entity, 100, 100);
460+
this.autoLayout();
461+
this.mxGraph.scrollCellToVisible(cell, true);
462+
// Get cell state
463+
const state = this.mxGraph.view.getState(cell);
464+
if (state !== undefined) {
465+
cell.value.editTable(state);
466+
}
467+
this.mxModel.endUpdate();
456468
}, (_graph, evt, _cell) => {
457469
this.mxGraph.stopEditing(false);
458470
const pt = this.mxGraph.getPointForEvent(evt, true);
@@ -815,6 +827,7 @@ class SchemaDesigner {
815827
});
816828
// Update the cell position
817829
this.autoLayout();
830+
this.mxGraph.scrollCellToVisible(state.cell, true);
818831
this.mxGraph.model.endUpdate();
819832
}
820833
// Gets the foreign keys for a table

dist/tsconfig.tsbuildinfo

+1-1
Large diffs are not rendered by default.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "azdataGraph",
33
"description": "azdataGraph is a derivative of mxGraph, which is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering.",
4-
"version": "0.0.109",
4+
"version": "0.0.110",
55
"homepage": "https://github.com/microsoft/azdataGraph",
66
"author": "Microsoft",
77
"license": "Apache-2.0",

src/ts/schemaDesigner/schemaDesigner.ts

+14
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,18 @@ export class SchemaDesigner {
495495
this.config.icons.addTableIcon,
496496
"Add Table",
497497
() => {
498+
this.mxModel.beginUpdate();
499+
this.mxGraph.stopEditing(false);
500+
const entity: ITable = this.createTable();
501+
const cell = this.renderTable(entity, 100, 100);
502+
this.autoLayout();
503+
this.mxGraph.scrollCellToVisible(cell, true);
504+
// Get cell state
505+
const state = this.mxGraph.view.getState(cell);
506+
if (state !== undefined) {
507+
(cell.value as SchemaDesignerTable).editTable(state);
508+
}
509+
this.mxModel.endUpdate();
498510
},
499511
(_graph, evt, _cell) => {
500512
this.mxGraph.stopEditing(false);
@@ -941,6 +953,8 @@ export class SchemaDesigner {
941953
// Update the cell position
942954
this.autoLayout();
943955

956+
this.mxGraph.scrollCellToVisible(state.cell, true);
957+
944958
this.mxGraph.model.endUpdate();
945959
}
946960

0 commit comments

Comments
 (0)