Skip to content

Commit 40b119e

Browse files
Release v0.0.120
1 parent 2343113 commit 40b119e

File tree

7 files changed

+55
-38
lines changed

7 files changed

+55
-38
lines changed

dist/index.js

+15-10
Original file line numberDiff line numberDiff line change
@@ -48595,16 +48595,7 @@ var SchemaDesigner = class {
4859548595
this.config.icons.addTableIcon,
4859648596
"Add Table",
4859748597
() => {
48598-
this.mxModel.beginUpdate();
48599-
this.mxGraph.stopEditing(false);
48600-
const entity = this.createTable();
48601-
const cell2 = this.renderTable(entity, 100, 100);
48602-
this.mxGraph.scrollCellToVisible(cell2, true);
48603-
const state = this.mxGraph.view.getState(cell2);
48604-
if (state !== void 0) {
48605-
cell2.value.editTable(state);
48606-
}
48607-
this.mxModel.endUpdate();
48598+
this.addNewTable();
4860848599
},
4860948600
(_graph, evt, _cell) => {
4861048601
this.mxGraph.stopEditing(false);
@@ -48964,6 +48955,20 @@ var SchemaDesigner = class {
4896448955
incoming
4896548956
};
4896648957
}
48958+
addNewTable() {
48959+
this.mxModel.beginUpdate();
48960+
this.mxGraph.stopEditing(false);
48961+
const entity = this.createTable();
48962+
const cell2 = this.renderTable(entity, 100, 100);
48963+
this.autoLayout();
48964+
this.mxGraph.setSelectionCell(cell2);
48965+
this.mxGraph.scrollCellToVisible(cell2, true);
48966+
const state = this.mxGraph.view.getState(cell2);
48967+
if (state !== void 0) {
48968+
cell2.value.editTable(state);
48969+
}
48970+
this.mxModel.endUpdate();
48971+
}
4896748972
/**
4896848973
* Creates a new entity
4896948974
* @returns The new entity

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.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export declare class SchemaDesigner {
146146
outgoing: mxCell[];
147147
incoming: mxCell[];
148148
};
149+
addNewTable(): void;
149150
/**
150151
* Creates a new entity
151152
* @returns The new entity

dist/src/ts/schemaDesigner/schemaDesigner.js

+16-11
Original file line numberDiff line numberDiff line change
@@ -453,17 +453,7 @@ 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.mxGraph.scrollCellToVisible(cell, true);
461-
// Get cell state
462-
const state = this.mxGraph.view.getState(cell);
463-
if (state !== undefined) {
464-
cell.value.editTable(state);
465-
}
466-
this.mxModel.endUpdate();
456+
this.addNewTable();
467457
}, (_graph, evt, _cell) => {
468458
this.mxGraph.stopEditing(false);
469459
const pt = this.mxGraph.getPointForEvent(evt, true);
@@ -788,6 +778,21 @@ class SchemaDesigner {
788778
incoming
789779
};
790780
}
781+
addNewTable() {
782+
this.mxModel.beginUpdate();
783+
this.mxGraph.stopEditing(false);
784+
const entity = this.createTable();
785+
const cell = this.renderTable(entity, 100, 100);
786+
this.autoLayout();
787+
this.mxGraph.setSelectionCell(cell);
788+
this.mxGraph.scrollCellToVisible(cell, true);
789+
// Get cell state
790+
const state = this.mxGraph.view.getState(cell);
791+
if (state !== undefined) {
792+
cell.value.editTable(state);
793+
}
794+
this.mxModel.endUpdate();
795+
}
791796
/**
792797
* Creates a new entity
793798
* @returns The new entity

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.119",
4+
"version": "0.0.120",
55
"homepage": "https://github.com/microsoft/azdataGraph",
66
"author": "Microsoft",
77
"license": "Apache-2.0",

src/ts/schemaDesigner/schemaDesigner.ts

+19-13
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,8 @@ export class SchemaDesigner {
480480
private configureMxOutline() {
481481
this._outlineContainer = document.createElement("div");
482482
this._outlineContainer.classList.add("sd-outline");
483-
this.container.appendChild( this._outlineContainer);
484-
new mx.mxOutline(this.mxGraph, this._outlineContainer);
483+
this.container.appendChild(this._outlineContainer);
484+
new mx.mxOutline(this.mxGraph, this._outlineContainer);
485485
}
486486

487487
/**
@@ -497,17 +497,7 @@ export class SchemaDesigner {
497497
this.config.icons.addTableIcon,
498498
"Add Table",
499499
() => {
500-
this.mxModel.beginUpdate();
501-
this.mxGraph.stopEditing(false);
502-
const entity: ITable = this.createTable();
503-
const cell = this.renderTable(entity, 100, 100);
504-
this.mxGraph.scrollCellToVisible(cell, true);
505-
// Get cell state
506-
const state = this.mxGraph.view.getState(cell);
507-
if (state !== undefined) {
508-
(cell.value as SchemaDesignerTable).editTable(state);
509-
}
510-
this.mxModel.endUpdate();
500+
this.addNewTable();
511501
},
512502
(_graph, evt, _cell) => {
513503
this.mxGraph.stopEditing(false);
@@ -907,6 +897,22 @@ export class SchemaDesigner {
907897
};
908898
}
909899

900+
public addNewTable() {
901+
this.mxModel.beginUpdate();
902+
this.mxGraph.stopEditing(false);
903+
const entity: ITable = this.createTable();
904+
const cell = this.renderTable(entity, 100, 100);
905+
this.autoLayout();
906+
this.mxGraph.setSelectionCell(cell);
907+
this.mxGraph.scrollCellToVisible(cell, true);
908+
// Get cell state
909+
const state = this.mxGraph.view.getState(cell);
910+
if (state !== undefined) {
911+
(cell.value as SchemaDesignerTable).editTable(state);
912+
}
913+
this.mxModel.endUpdate();
914+
}
915+
910916
/**
911917
* Creates a new entity
912918
* @returns The new entity

0 commit comments

Comments
 (0)