David Benson преди 3 години
родител
ревизия
02391fe7bd

+ 8 - 0
ChangeLog

@@ -1,3 +1,11 @@
+05-JAN-2022: 16.2.2
+
+- Disables merging for merged cells
+- [conf cloud] Adds support for anchor importing from server + support for adding links to anchors in old editor
+- Adds precedence for alt on mouse down
+- Adds Shift+Click for table range selection
+- Fixes insertRow/Column for selected cell range
+
 04-JAN-2022: 16.2.1
 
 - Fixes cell divider event handling

+ 1 - 1
VERSION

@@ -1 +1 @@
-16.2.1
+16.2.2

Файловите разлики са ограничени, защото са твърде много
+ 662 - 659
src/main/webapp/js/app.min.js


+ 5 - 1
src/main/webapp/js/grapheditor/EditorUi.js

@@ -1340,7 +1340,11 @@ EditorUi.prototype.updateSelectionStateForTableCells = function(result)
 						table, row + rowspan), col) : null;
 			}
 			
-			if (next == model.getChildAt(parent, col + colspan))
+			var state = this.editor.graph.view.getState(next);
+
+			if (next == model.getChildAt(parent, col + colspan) && state != null &&
+				mxUtils.getValue(state.style, 'colspan', 1) == 1 &&
+				mxUtils.getValue(state.style, 'rowspan', 1) == 1)
 			{
 				colspan++;
 			}

+ 31 - 16
src/main/webapp/js/grapheditor/Format.js

@@ -1518,17 +1518,32 @@ ArrangePanel.prototype.addTable = function(div)
 	panel.style.width = '220px';
 	panel.className = 'geToolbarContainer';
 
+	var cell = ss.vertices[0];
+
+	if (graph.getSelectionCount() > 1)
+	{
+		if (graph.isTableCell(cell))
+		{
+			cell = graph.model.getParent(cell);
+		}
+
+		if (graph.isTableRow(cell))
+		{
+			cell = graph.model.getParent(cell);
+		}
+	}
+
 	var isTable = ss.table || ss.row || ss.cell;
-	var isStack = graph.isStack(ss.vertices[0]) ||
-		graph.isStackChild(ss.vertices[0]);
+	var isStack = graph.isStack(cell) ||
+		graph.isStackChild(cell);
 
 	var showCols = isTable;
 	var showRows = isTable;
 
 	if (isStack)
 	{
-		var style = (graph.isStack(ss.vertices[0])) ? ss.style :
-			graph.getCellStyle(graph.model.getParent(ss.vertices[0]));
+		var style = (graph.isStack(cell)) ? ss.style :
+			graph.getCellStyle(graph.model.getParent(cell));
 
 		showRows = style['horizontalStack'] == '0';
 		showCols = !showRows;
@@ -1546,11 +1561,11 @@ ArrangePanel.prototype.addTable = function(div)
 				{
 					if (isStack)
 					{
-						graph.insertLane(ss.vertices[0], true);
+						graph.insertLane(cell, true);
 					}
 					else
 					{
-						graph.insertTableColumn(ss.vertices[0], true);
+						graph.insertTableColumn(cell, true);
 					}
 				}
 				catch (e)
@@ -1565,11 +1580,11 @@ ArrangePanel.prototype.addTable = function(div)
 				{
 					if (isStack)
 					{
-						graph.insertLane(ss.vertices[0], false);
+						graph.insertLane(cell, false);
 					}
 					else
 					{
-						graph.insertTableColumn(ss.vertices[0], false);
+						graph.insertTableColumn(cell, false);
 					}
 				}
 				catch (e)
@@ -1584,11 +1599,11 @@ ArrangePanel.prototype.addTable = function(div)
 				{
 					if (isStack)
 					{
-						graph.deleteLane(ss.vertices[0]);
+						graph.deleteLane(cell);
 					}
 					else
 					{
-						graph.deleteTableColumn(ss.vertices[0]);
+						graph.deleteTableColumn(cell);
 					}
 				}
 				catch (e)
@@ -1607,11 +1622,11 @@ ArrangePanel.prototype.addTable = function(div)
 				{
 					if (isStack)
 					{
-						graph.insertLane(ss.vertices[0], true);
+						graph.insertLane(cell, true);
 					}
 					else
 					{
-						graph.insertTableRow(ss.vertices[0], true);
+						graph.insertTableRow(cell, true);
 					}
 				}
 				catch (e)
@@ -1626,11 +1641,11 @@ ArrangePanel.prototype.addTable = function(div)
 				{
 					if (isStack)
 					{
-						graph.insertLane(ss.vertices[0], false);
+						graph.insertLane(cell, false);
 					}
 					else
 					{
-						graph.insertTableRow(ss.vertices[0], false);
+						graph.insertTableRow(cell, false);
 					}
 				}
 				catch (e)
@@ -1645,11 +1660,11 @@ ArrangePanel.prototype.addTable = function(div)
 				{
 					if (isStack)
 					{
-						graph.deleteLane(ss.vertices[0]);
+						graph.deleteLane(cell);
 					}
 					else
 					{
-						graph.deleteTableRow(ss.vertices[0]);
+						graph.deleteTableRow(cell);
 					}
 				}
 				catch (e)

+ 72 - 2
src/main/webapp/js/grapheditor/Graph.js

@@ -969,8 +969,8 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
 	    var isForceRubberBandEvent = rubberband.isForceRubberbandEvent;
 	    rubberband.isForceRubberbandEvent = function(me)
 	    {
-	    	return (isForceRubberBandEvent.apply(this, arguments) && !mxEvent.isShiftDown(me.getEvent()) &&
-	    		!mxEvent.isControlDown(me.getEvent())) || (mxClient.IS_CHROMEOS && mxEvent.isShiftDown(me.getEvent())) ||
+	    	return isForceRubberBandEvent.apply(this, arguments) ||
+				(mxClient.IS_CHROMEOS && mxEvent.isShiftDown(me.getEvent())) ||
 	    		(mxUtils.hasScrollbars(this.graph.container) && mxClient.IS_FF &&
 	    		mxClient.IS_WIN && me.getState() == null && mxEvent.isTouchEvent(me.getEvent()));
 	    };
@@ -3952,6 +3952,76 @@ Graph.prototype.restoreSelection = function(cells)
 	}
 };
 
+/**
+ * Adds table range selection with Shift+Click.
+ */
+Graph.prototype.selectCellForEvent = function(cell, evt)
+{
+	if (!mxEvent.isShiftDown(evt) || this.isSelectionEmpty() ||
+		!this.selectTableRange(this.getSelectionCell(), cell))
+	{
+		mxGraph.prototype.selectCellForEvent.apply(this, arguments);
+	}
+};
+
+/**
+ * Returns true if 
+ */
+Graph.prototype.selectTableRange = function(startCell, endCell)
+{
+	var result = false;
+
+	if (this.isTableCell(startCell) && this.isTableCell(endCell))
+	{
+		var startRow = this.model.getParent(startCell);
+		var table = this.model.getParent(startRow);
+		var endRow = this.model.getParent(endCell);
+
+		if (table == this.model.getParent(endRow))
+		{
+			var startCellIndex = startRow.getIndex(startCell);
+			var startRowIndex = table.getIndex(startRow);
+			var endCellIndex = endRow.getIndex(endCell);
+			var endRowIndex = table.getIndex(endRow);
+
+			var fromRow = Math.min(startRowIndex, endRowIndex);
+			var toRow = Math.max(startRowIndex, endRowIndex);
+			var fromCell = Math.min(startCellIndex, endCellIndex);
+			var toCell = Math.max(startCellIndex, endCellIndex);
+			
+			var cells = [];
+
+			for (var row = fromRow; row <= toRow; row++)
+			{
+				var currentRow = this.model.getChildAt(table, row);
+				
+				for (var col = fromCell; col <= toCell; col++)
+				{
+					cells.push(this.model.getChildAt(currentRow, col));
+				}
+			}
+
+			if (cells.length > 0 && (cells.length > 1 ||
+				this.getSelectionCount() > 1 ||
+				!this.isCellSelected(cells[0])))
+			{
+				this.setSelectionCells(cells);
+				result = true;
+			}
+		}
+	}
+
+	return result;
+};
+
+/**
+ * Returns the cells for the given table range.
+ */
+Graph.prototype.getTableRange = function(start, end)
+{
+
+};
+
 /**
  * Selects cells for connect vertex return value.
  */

+ 13 - 0
src/main/webapp/js/grapheditor/Menus.js

@@ -648,6 +648,19 @@ Menus.prototype.addInsertTableCellItem = function(menu, parent)
 	var cell = graph.getSelectionCell();
 	var style = graph.getCurrentCellStyle(cell);
 
+	if (graph.getSelectionCount() > 1)
+	{
+		if (graph.isTableCell(cell))
+		{
+			cell = graph.model.getParent(cell);
+		}
+
+		if (graph.isTableRow(cell))
+		{
+			cell = graph.model.getParent(cell);
+		}
+	}
+
 	var isTable = graph.isTable(cell) ||
 		graph.isTableRow(cell) ||
 		graph.isTableCell(cell);

Файловите разлики са ограничени, защото са твърде много
+ 406 - 403
src/main/webapp/js/viewer-static.min.js


Файловите разлики са ограничени, защото са твърде много
+ 406 - 403
src/main/webapp/js/viewer.min.js


Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
src/main/webapp/mxgraph/mxClient.js


Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
src/main/webapp/service-worker.js


Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
src/main/webapp/service-worker.js.map