@syncfusion/ej2-diagrams
Advanced tools
Comparing version 16.4.40-beta to 16.4.42
@@ -5,2 +5,4 @@ # Changelog | ||
## 16.4.40-beta (2018-12-10) | ||
### Diagram | ||
@@ -7,0 +9,0 @@ |
/*! | ||
* filename: index.d.ts | ||
* version : 16.4.40-beta | ||
* version : 16.4.42 | ||
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. | ||
@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license. |
{ | ||
"name": "@syncfusion/ej2-diagrams", | ||
"version": "16.4.40-beta", | ||
"version": "16.4.42", | ||
"description": "Feature-rich diagram control to create diagrams like flow charts, organizational charts, mind maps, and BPMN diagrams. Its rich feature set includes built-in shapes, editing, serializing, exporting, printing, overview, data binding, and automatic layouts.", | ||
@@ -11,9 +11,9 @@ "author": "Syncfusion Inc.", | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "~16.4.40-beta", | ||
"@syncfusion/ej2-data": "~16.4.40-beta", | ||
"@syncfusion/ej2-navigations": "~16.4.40-beta", | ||
"@syncfusion/ej2-inputs": "~16.4.40-beta", | ||
"@syncfusion/ej2-popups": "~16.4.40-beta", | ||
"@syncfusion/ej2-buttons": "~16.4.40-beta", | ||
"@syncfusion/ej2-lists": "~16.4.40-beta" | ||
"@syncfusion/ej2-base": "~16.4.42", | ||
"@syncfusion/ej2-data": "~16.4.42", | ||
"@syncfusion/ej2-navigations": "~16.4.42", | ||
"@syncfusion/ej2-inputs": "~16.4.42", | ||
"@syncfusion/ej2-popups": "~16.4.42", | ||
"@syncfusion/ej2-buttons": "~16.4.42", | ||
"@syncfusion/ej2-lists": "~16.4.42" | ||
}, | ||
@@ -20,0 +20,0 @@ "devDependencies": { |
@@ -199,3 +199,3 @@ import { Property, ChildProperty, Collection, ComplexFactory } from '@syncfusion/ej2-base';import { TextDecoration, WhiteSpace, TextWrap, TextAlign, GradientType, TextOverflow } from '../enum/enum'; | ||
* Sets the fill color of a shape/path | ||
* @default 'transparent' | ||
* @default 'white' | ||
*/ | ||
@@ -347,2 +347,8 @@ fill?: string; | ||
/** | ||
* Sets the fill color of a shape/path | ||
* @default 'transparent' | ||
*/ | ||
fill?: string; | ||
} |
@@ -261,3 +261,3 @@ import { ChildProperty } from '@syncfusion/ej2-base'; | ||
* Sets the fill color of a shape/path | ||
* @default 'transparent' | ||
* @default 'white' | ||
*/ | ||
@@ -408,2 +408,7 @@ fill: string; | ||
textOverflow: TextOverflow; | ||
/** | ||
* Sets the fill color of a shape/path | ||
* @default 'transparent' | ||
*/ | ||
fill: string; | ||
} |
@@ -267,3 +267,3 @@ var __extends = (this && this.__extends) || (function () { | ||
__decorate([ | ||
Property('transparent') | ||
Property('white') | ||
], ShapeStyle.prototype, "fill", void 0); | ||
@@ -360,4 +360,7 @@ __decorate([ | ||
], TextStyle.prototype, "textOverflow", void 0); | ||
__decorate([ | ||
Property('transparent') | ||
], TextStyle.prototype, "fill", void 0); | ||
return TextStyle; | ||
}(ShapeStyle)); | ||
export { TextStyle }; |
@@ -47,2 +47,3 @@ var __extends = (this && this.__extends) || (function () { | ||
if (child.canMeasure) { | ||
availableSize.width = availableSize.width || this.maxWidth || this.minWidth; | ||
child.measure(availableSize); | ||
@@ -49,0 +50,0 @@ } |
@@ -14,2 +14,3 @@ import { Container } from './container'; | ||
* Not applicable for canvas | ||
* to avoid the child size updation with respect to parent ser true | ||
* @private | ||
@@ -16,0 +17,0 @@ */ |
@@ -29,2 +29,3 @@ var __extends = (this && this.__extends) || (function () { | ||
* Not applicable for canvas | ||
* to avoid the child size updation with respect to parent ser true | ||
* @private | ||
@@ -65,3 +66,8 @@ */ | ||
//Measure children | ||
child.measure(child.desiredSize); | ||
if (this.measureChildren) { | ||
child.measure(child.desiredSize); | ||
} | ||
else { | ||
child.measure(availableSize); | ||
} | ||
var childSize = child.desiredSize.clone(); | ||
@@ -79,3 +85,5 @@ //Consider Child's margin | ||
else { | ||
updateSize(childSize, desired); | ||
if (!child.preventContainer) { | ||
updateSize(childSize, desired); | ||
} | ||
} | ||
@@ -82,0 +90,0 @@ } |
@@ -119,3 +119,3 @@ var __extends = (this && this.__extends) || (function () { | ||
if (this.isDirt && this.canMeasure) { | ||
size = measureText(this, this.style, this.content, this.width); | ||
size = measureText(this, this.style, this.content, this.width || availableSize.width); | ||
} | ||
@@ -122,0 +122,0 @@ else { |
@@ -1,2 +0,2 @@ | ||
import { Component, Property, Complex, Collection, EventHandler, L10n, Droppable, remove, Ajax } from '@syncfusion/ej2-base';import { Browser, ModuleDeclaration, Event, EmitType } from '@syncfusion/ej2-base';import { INotifyPropertyChanged } from '@syncfusion/ej2-base';import { CanvasRenderer } from './rendering/canvas-renderer';import { SvgRenderer } from './rendering/svg-renderer';import { DiagramRenderer } from './rendering/renderer';import { BaseAttributes } from './rendering/canvas-interface';import { PageSettings, ScrollSettings } from './diagram/page-settings';import { PageSettingsModel, ScrollSettingsModel } from './diagram/page-settings-model';import { DiagramElement } from './core/elements/diagram-element';import { ServiceLocator } from './objects/service';import { IElement, IDataLoadedEventArgs, ISelectionChangeEventArgs, IClickEventArgs, ScrollValues } from './objects/interface/IElement';import { ISizeChangeEventArgs, IConnectionChangeEventArgs, IEndChangeEventArgs, IDoubleClickEventArgs } from './objects/interface/IElement';import { ICollectionChangeEventArgs, IPropertyChangeEventArgs, IDraggingEventArgs, IRotationEventArgs } from './objects/interface/IElement';import { IDragEnterEventArgs, IDragLeaveEventArgs, IDragOverEventArgs, IDropEventArgs } from './objects/interface/IElement';import { ITextEditEventArgs, IHistoryChangeArgs, IScrollChangeEventArgs, IMouseEventArgs } from './objects/interface/IElement';import { StackEntryObject } from './objects/interface/IElement';import { ZoomOptions, IPrintOptions, IExportOptions, IFitOptions, ActiveLabel } from './objects/interface/interfaces';import { View, IDataSource, IFields } from './objects/interface/interfaces';import { Container } from './core/containers/container';import { Node, BpmnShape, BpmnAnnotation, SwimLane, Path } from './objects/node';import { Segment } from './interaction/scroller';import { Connector } from './objects/connector';import { ConnectorModel, BpmnFlowModel } from './objects/connector-model';import { SnapSettings } from './diagram/grid-lines';import { RulerSettings } from './diagram/ruler-settings';import { removeRulerElements, updateRuler, getRulerSize } from './ruler/ruler';import { renderRuler, renderOverlapElement } from './ruler/ruler';import { RulerSettingsModel } from './diagram/ruler-settings-model';import { SnapSettingsModel } from './diagram/grid-lines-model';import { NodeModel, TextModel, BpmnShapeModel, BpmnAnnotationModel } from './objects/node-model';import { UmlActivityShapeModel, SwimLaneModel, LaneModel } from './objects/node-model';import { Size } from './primitives/size';import { Point } from './primitives/point';import { Keys, KeyModifiers, DiagramTools, AlignmentMode, AnnotationConstraints, NodeConstraints } from './enum/enum';import { DiagramConstraints, BridgeDirection, AlignmentOptions, SelectorConstraints, PortVisibility, DiagramEvent } from './enum/enum';import { DistributeOptions, SizingOptions, RenderingMode, DiagramAction, ThumbsConstraints, NudgeDirection } from './enum/enum';import { RealAction } from './enum/enum';import { PathElement } from './core/elements/path-element';import { TextElement } from './core/elements/text-element';import { updateStyle, removeItem, updateConnector, updateShape, setUMLActivityDefaults, findNodeByName } from './utility/diagram-util';import { checkPortRestriction, serialize, deserialize, updateHyperlink, getObjectType } from './utility/diagram-util';import { Rect } from './primitives/rect';import { getPortShape } from './objects/dictionary/common';import { PointPortModel } from './objects/port-model';import { ShapeAnnotationModel, AnnotationModel, PathAnnotationModel } from './objects/annotation-model';import { ShapeAnnotation, PathAnnotation, Annotation } from './objects/annotation';import { PointModel } from './primitives/point-model';import { Canvas } from './core/containers/canvas';import { GridPanel } from './core/containers/grid';import { DataSourceModel } from './diagram/data-source-model';import { DataSource } from './diagram/data-source';import { LayoutModel } from './layout/layout-base-model';import { Layout, INode, ILayout } from './layout/layout-base';import { DataBinding } from './data-binding/data-binding';import { Selector } from './interaction/selector';import { SelectorModel } from './interaction/selector-model';import { DiagramEventHandler } from './interaction/event-handlers';import { CommandHandler } from './interaction/command-manager';import { DiagramScroller } from './interaction/scroller';import { Actions, isSelected } from './interaction/actions';import { ToolBase } from './interaction/tool';import { BpmnDiagrams } from './objects/bpmn';import { DiagramContextMenu } from './objects/context-menu';import { ConnectorBridging } from './objects/connector-bridging';import { SpatialSearch } from './interaction/spatial-search/spatial-search';import { HistoryEntry, History } from './diagram/history';import { UndoRedo } from './objects/undo-redo';import { ConnectorEditing } from './interaction/connector-editing';import { Ruler } from '../ruler/index';import { BeforeOpenCloseMenuEventArgs, MenuEventArgs, EJ2Instance } from '@syncfusion/ej2-navigations';import { setAttributeSvg, setAttributeHtml, measureHtmlText, removeElement, createMeasureElements } from './utility/dom-util';import { getDiagramElement, getScrollerWidth, getHTMLLayer } from './utility/dom-util';import { getBackgroundLayer, createHtmlElement, createSvgElement, getNativeLayerSvg } from './utility/dom-util';import { getPortLayerSvg, getDiagramLayerSvg } from './utility/dom-util';import { getAdornerLayerSvg, getSelectorElement, getGridLayerSvg, getBackgroundLayerSvg } from './utility/dom-util';import { CommandManager, ContextMenuSettings } from './diagram/keyboard-commands';import { CommandManagerModel, CommandModel, ContextMenuSettingsModel } from './diagram/keyboard-commands-model';import { canDelete, canInConnect, canOutConnect, canRotate, canVitualize } from './utility/constraints-util';import { canPortInConnect, canPortOutConnect } from './utility/constraints-util';import { canResize, canSingleSelect, canZoomPan, canZoomTextEdit } from './utility/constraints-util';import { canDragSourceEnd, canDragTargetEnd, canDragSegmentThumb, enableReadOnly, canMove } from './utility/constraints-util';import { findAnnotation, arrangeChild, getInOutConnectPorts } from './utility/diagram-util';import { randomId, cloneObject, extendObject, getFunction, getBounds } from './utility/base-util';import { Snapping } from './objects/snapping';import { DiagramTooltipModel } from './objects/tooltip-model';import { TextStyleModel } from './core/appearance-model';import { TransformFactor } from './interaction/scroller';import { RadialTree } from './layout/radial-tree';import { HierarchicalTree } from './layout/hierarchical-tree';import { ComplexHierarchicalTree } from './layout/complex-hierarchical-tree';import { MindMap } from './layout/mind-map';import { DiagramTooltip, initTooltip } from './objects/tooltip';import { Tooltip } from '@syncfusion/ej2-popups';import { PrintAndExport } from './print-settings';import { Port, PointPort } from './objects/port';import { SymmetricLayout, IGraphObject } from './layout/symmetrical-layout';import { LayoutAnimation } from './objects/layout-animation';import { canShadow } from './utility/constraints-util';import { Layer } from './diagram/layer';import { LayerModel } from './diagram/layer-model';import { DiagramNativeElement } from './core/elements/native-element';import { DiagramHtmlElement } from './core/elements/html-element';import { IconShapeModel } from './objects/icon-model';import { canAllowDrop } from './utility/constraints-util';import { checkParentAsContainer, addChildToContainer } from './interaction/container-interaction';import { DataManager } from '@syncfusion/ej2-data'; | ||
import { Component, Property, Complex, Collection, EventHandler, L10n, Droppable, remove, Ajax } from '@syncfusion/ej2-base';import { Browser, ModuleDeclaration, Event, EmitType } from '@syncfusion/ej2-base';import { INotifyPropertyChanged } from '@syncfusion/ej2-base';import { CanvasRenderer } from './rendering/canvas-renderer';import { SvgRenderer } from './rendering/svg-renderer';import { DiagramRenderer } from './rendering/renderer';import { BaseAttributes } from './rendering/canvas-interface';import { PageSettings, ScrollSettings } from './diagram/page-settings';import { PageSettingsModel, ScrollSettingsModel } from './diagram/page-settings-model';import { DiagramElement } from './core/elements/diagram-element';import { ServiceLocator } from './objects/service';import { IElement, IDataLoadedEventArgs, ISelectionChangeEventArgs, IClickEventArgs, ScrollValues } from './objects/interface/IElement';import { ISizeChangeEventArgs, IConnectionChangeEventArgs, IEndChangeEventArgs, IDoubleClickEventArgs } from './objects/interface/IElement';import { ICollectionChangeEventArgs, IPropertyChangeEventArgs, IDraggingEventArgs, IRotationEventArgs } from './objects/interface/IElement';import { IDragEnterEventArgs, IDragLeaveEventArgs, IDragOverEventArgs, IDropEventArgs } from './objects/interface/IElement';import { ITextEditEventArgs, IHistoryChangeArgs, IScrollChangeEventArgs, IMouseEventArgs } from './objects/interface/IElement';import { StackEntryObject } from './objects/interface/IElement';import { ZoomOptions, IPrintOptions, IExportOptions, IFitOptions, ActiveLabel } from './objects/interface/interfaces';import { View, IDataSource, IFields } from './objects/interface/interfaces';import { Container } from './core/containers/container';import { Node, BpmnShape, BpmnAnnotation, SwimLane, Path } from './objects/node';import { Segment } from './interaction/scroller';import { Connector } from './objects/connector';import { ConnectorModel, BpmnFlowModel } from './objects/connector-model';import { SnapSettings } from './diagram/grid-lines';import { RulerSettings } from './diagram/ruler-settings';import { removeRulerElements, updateRuler, getRulerSize } from './ruler/ruler';import { renderRuler, renderOverlapElement } from './ruler/ruler';import { RulerSettingsModel } from './diagram/ruler-settings-model';import { SnapSettingsModel } from './diagram/grid-lines-model';import { NodeModel, TextModel, BpmnShapeModel, BpmnAnnotationModel } from './objects/node-model';import { UmlActivityShapeModel, SwimLaneModel, LaneModel } from './objects/node-model';import { Size } from './primitives/size';import { Point } from './primitives/point';import { Keys, KeyModifiers, DiagramTools, AlignmentMode, AnnotationConstraints, NodeConstraints } from './enum/enum';import { DiagramConstraints, BridgeDirection, AlignmentOptions, SelectorConstraints, PortVisibility, DiagramEvent } from './enum/enum';import { DistributeOptions, SizingOptions, RenderingMode, DiagramAction, ThumbsConstraints, NudgeDirection } from './enum/enum';import { RealAction } from './enum/enum';import { PathElement } from './core/elements/path-element';import { TextElement } from './core/elements/text-element';import { updateStyle, removeItem, updateConnector, updateShape, setUMLActivityDefaults, findNodeByName } from './utility/diagram-util';import { checkPortRestriction, serialize, deserialize, updateHyperlink, getObjectType, removeGradient } from './utility/diagram-util';import { Rect } from './primitives/rect';import { getPortShape } from './objects/dictionary/common';import { PointPortModel } from './objects/port-model';import { ShapeAnnotationModel, AnnotationModel, PathAnnotationModel } from './objects/annotation-model';import { ShapeAnnotation, PathAnnotation, Annotation } from './objects/annotation';import { PointModel } from './primitives/point-model';import { Canvas } from './core/containers/canvas';import { GridPanel } from './core/containers/grid';import { DataSourceModel } from './diagram/data-source-model';import { DataSource } from './diagram/data-source';import { LayoutModel } from './layout/layout-base-model';import { Layout, INode, ILayout } from './layout/layout-base';import { DataBinding } from './data-binding/data-binding';import { Selector } from './interaction/selector';import { SelectorModel } from './interaction/selector-model';import { DiagramEventHandler } from './interaction/event-handlers';import { CommandHandler } from './interaction/command-manager';import { DiagramScroller } from './interaction/scroller';import { Actions, isSelected } from './interaction/actions';import { ToolBase } from './interaction/tool';import { BpmnDiagrams } from './objects/bpmn';import { DiagramContextMenu } from './objects/context-menu';import { ConnectorBridging } from './objects/connector-bridging';import { SpatialSearch } from './interaction/spatial-search/spatial-search';import { HistoryEntry, History } from './diagram/history';import { UndoRedo } from './objects/undo-redo';import { ConnectorEditing } from './interaction/connector-editing';import { Ruler } from '../ruler/index';import { BeforeOpenCloseMenuEventArgs, MenuEventArgs, EJ2Instance } from '@syncfusion/ej2-navigations';import { setAttributeSvg, setAttributeHtml, measureHtmlText, removeElement, createMeasureElements } from './utility/dom-util';import { getDiagramElement, getScrollerWidth, getHTMLLayer } from './utility/dom-util';import { getBackgroundLayer, createHtmlElement, createSvgElement, getNativeLayerSvg } from './utility/dom-util';import { getPortLayerSvg, getDiagramLayerSvg } from './utility/dom-util';import { getAdornerLayerSvg, getSelectorElement, getGridLayerSvg, getBackgroundLayerSvg } from './utility/dom-util';import { CommandManager, ContextMenuSettings } from './diagram/keyboard-commands';import { CommandManagerModel, CommandModel, ContextMenuSettingsModel } from './diagram/keyboard-commands-model';import { canDelete, canInConnect, canOutConnect, canRotate, canVitualize } from './utility/constraints-util';import { canPortInConnect, canPortOutConnect } from './utility/constraints-util';import { canResize, canSingleSelect, canZoomPan, canZoomTextEdit } from './utility/constraints-util';import { canDragSourceEnd, canDragTargetEnd, canDragSegmentThumb, enableReadOnly, canMove } from './utility/constraints-util';import { findAnnotation, arrangeChild, getInOutConnectPorts } from './utility/diagram-util';import { randomId, cloneObject, extendObject, getFunction, getBounds } from './utility/base-util';import { Snapping } from './objects/snapping';import { DiagramTooltipModel } from './objects/tooltip-model';import { TextStyleModel, ShadowModel } from './core/appearance-model';import { TransformFactor } from './interaction/scroller';import { RadialTree } from './layout/radial-tree';import { HierarchicalTree } from './layout/hierarchical-tree';import { ComplexHierarchicalTree } from './layout/complex-hierarchical-tree';import { MindMap } from './layout/mind-map';import { DiagramTooltip, initTooltip } from './objects/tooltip';import { Tooltip } from '@syncfusion/ej2-popups';import { PrintAndExport } from './print-settings';import { Port, PointPort } from './objects/port';import { SymmetricLayout, IGraphObject } from './layout/symmetrical-layout';import { LayoutAnimation } from './objects/layout-animation';import { canShadow } from './utility/constraints-util';import { Layer } from './diagram/layer';import { LayerModel } from './diagram/layer-model';import { DiagramNativeElement } from './core/elements/native-element';import { DiagramHtmlElement } from './core/elements/html-element';import { IconShapeModel } from './objects/icon-model';import { canAllowDrop } from './utility/constraints-util';import { checkParentAsContainer, addChildToContainer } from './interaction/container-interaction';import { DataManager } from '@syncfusion/ej2-data';import { ContextMenuItemModel } from './../diagram/objects/interface/interfaces'; | ||
import {ComponentModel} from '@syncfusion/ej2-base'; | ||
@@ -265,2 +265,8 @@ | ||
/** | ||
* Customizes the undo redo functionality | ||
* @default undefined | ||
*/ | ||
historyManager?: History; | ||
/** | ||
* Helps to return the default properties of node | ||
@@ -267,0 +273,0 @@ * ```html |
@@ -55,2 +55,3 @@ import { Component, L10n, Droppable } from '@syncfusion/ej2-base'; | ||
import { DiagramTooltipModel } from './objects/tooltip-model'; | ||
import { ShadowModel } from './core/appearance-model'; | ||
import { RadialTree } from './layout/radial-tree'; | ||
@@ -382,2 +383,7 @@ import { HierarchicalTree } from './layout/hierarchical-tree'; | ||
/** | ||
* Customizes the undo redo functionality | ||
* @default undefined | ||
*/ | ||
historyManager: History; | ||
/** | ||
* Helps to return the default properties of node | ||
@@ -884,4 +890,2 @@ * ```html | ||
/** @private */ | ||
historyList: History; | ||
/** @private */ | ||
diagramActions: DiagramAction; | ||
@@ -1449,3 +1453,3 @@ /** @private */ | ||
/** @private */ | ||
renderDiagramElements(canvas: HTMLCanvasElement | SVGElement, renderer: DiagramRenderer, htmlLayer: HTMLElement, transform?: boolean, fromExport?: boolean): void; | ||
renderDiagramElements(canvas: HTMLCanvasElement | SVGElement, renderer: DiagramRenderer, htmlLayer: HTMLElement, transform?: boolean, fromExport?: boolean, isOverView?: boolean): void; | ||
/** @private */ | ||
@@ -1576,2 +1580,4 @@ updateBridging(isLoad?: boolean): void; | ||
/** @private */ | ||
updateShadow(nodeShadow: ShadowModel, changedShadow: ShadowModel): void; | ||
/** @private */ | ||
updateMargin(node: Node, changes: Node): void; | ||
@@ -1578,0 +1584,0 @@ private initDroppables; |
@@ -775,3 +775,3 @@ var __extends = (this && this.__extends) || (function () { | ||
} | ||
textele.style = annotation.style; | ||
// textele.style = annotation.style; | ||
// tslint:disable-next-line:no-any | ||
@@ -955,3 +955,3 @@ var wrapperContent; | ||
if (connector.bridges.length > 0) { | ||
if (connector.type === 'Straight') { | ||
if (connector.type === 'Straight' && connector.segments.length < 2) { | ||
for (var n = 0; n < connector.bridges.length; n++) { | ||
@@ -966,3 +966,3 @@ var bridge = connector.bridges[n]; | ||
} | ||
else if (connector.type === 'Orthogonal') { | ||
else if (connector.type === 'Orthogonal' || (connector.type === 'Straight' && connector.segments.length > 1)) { | ||
for (var n = 0; n < connector.bridges.length; n++) { | ||
@@ -969,0 +969,0 @@ var bridge = connector.bridges[n]; |
@@ -239,6 +239,6 @@ import { remove } from '@syncfusion/ej2-base'; | ||
case 'undo': | ||
target = this.parent.historyList && this.parent.historyList.canUndo ? true : false; | ||
target = this.parent.historyManager && this.parent.historyManager.canUndo ? true : false; | ||
break; | ||
case 'redo': | ||
target = this.parent.historyList && this.parent.historyList.canRedo ? true : false; | ||
target = this.parent.historyManager && this.parent.historyManager.canRedo ? true : false; | ||
break; | ||
@@ -245,0 +245,0 @@ case 'paste': |
@@ -1165,3 +1165,3 @@ var __extends = (this && this.__extends) || (function () { | ||
__decorate([ | ||
Complex({}, TextStyle) | ||
Complex({ fill: 'white' }, TextStyle) | ||
], Node.prototype, "style", void 0); | ||
@@ -1168,0 +1168,0 @@ __decorate([ |
@@ -22,3 +22,3 @@ import { Node } from './node'; | ||
UndoRedo.prototype.initHistory = function (diagram) { | ||
diagram.historyList = { | ||
diagram.historyManager = { | ||
canRedo: false, canUndo: false, currentEntry: null, | ||
@@ -34,4 +34,4 @@ push: diagram.addHistoryEntry.bind(diagram), undo: Function, redo: Function, | ||
var nextEntry = null; | ||
if (diagram.historyList.canLog) { | ||
var hEntry = diagram.historyList.canLog(entry); | ||
if (diagram.historyManager.canLog) { | ||
var hEntry = diagram.historyManager.canLog(entry); | ||
if (hEntry.cancel === true) { | ||
@@ -41,4 +41,4 @@ return; | ||
} | ||
if (diagram.historyList && diagram.historyList.canUndo && diagram.historyList.currentEntry) { | ||
entryObject = diagram.historyList.currentEntry; | ||
if (diagram.historyManager && diagram.historyManager.canUndo && diagram.historyManager.currentEntry) { | ||
entryObject = diagram.historyManager.currentEntry; | ||
if (entryObject.next) { | ||
@@ -57,6 +57,6 @@ if (entryObject.previous) { | ||
} | ||
diagram.historyList.currentEntry = entry; | ||
diagram.historyManager.currentEntry = entry; | ||
this.getHistoryList(diagram); | ||
diagram.historyList.canUndo = true; | ||
diagram.historyList.canRedo = false; | ||
diagram.historyManager.canUndo = true; | ||
diagram.historyManager.canRedo = false; | ||
}; | ||
@@ -82,3 +82,3 @@ /** @private */ | ||
else { | ||
diagram.historyList.undo(entry); | ||
diagram.historyManager.undo(entry); | ||
} | ||
@@ -90,7 +90,7 @@ } | ||
var redoStack = []; | ||
var currEntry = diagram.historyList.currentEntry; | ||
var currEntry = diagram.historyManager.currentEntry; | ||
var undoObj; | ||
var redoObj; | ||
currEntry = diagram.historyList.currentEntry; | ||
if (diagram.historyList.canUndo || diagram.historyList.undoStack.length === 0) { | ||
currEntry = diagram.historyManager.currentEntry; | ||
if (diagram.historyManager.canUndo || diagram.historyManager.undoStack.length === 0) { | ||
this.getHistroyObject(undoStack, currEntry); | ||
@@ -106,3 +106,3 @@ } | ||
} | ||
currEntry = diagram.historyList.currentEntry; | ||
currEntry = diagram.historyManager.currentEntry; | ||
while (currEntry && currEntry.next) { | ||
@@ -113,4 +113,4 @@ redoObj = currEntry.next; | ||
} | ||
diagram.historyList.undoStack = undoStack; | ||
diagram.historyList.redoStack = redoStack; | ||
diagram.historyManager.undoStack = undoStack; | ||
diagram.historyManager.redoStack = redoStack; | ||
}; | ||
@@ -146,5 +146,5 @@ UndoRedo.prototype.getHistroyObject = function (list, obj) { | ||
if (entry.type !== 'StartGroup' && entry.type !== 'EndGroup') { | ||
if (diagram.historyList.undoStack.length > 0) { | ||
var addObject = diagram.historyList.undoStack.splice(0, 1); | ||
diagram.historyList.redoStack.splice(0, 0, addObject[0]); | ||
if (diagram.historyManager.undoStack.length > 0) { | ||
var addObject = diagram.historyManager.undoStack.splice(0, 1); | ||
diagram.historyManager.redoStack.splice(0, 0, addObject[0]); | ||
} | ||
@@ -319,2 +319,5 @@ } | ||
diagram.nodePropertyChange(currentObject, {}, undoChanges); | ||
if (currentObject.parentId) { | ||
diagram.updateConnectorEdges(diagram.nameTable[currentObject.parentId]); | ||
} | ||
}; | ||
@@ -635,3 +638,3 @@ UndoRedo.prototype.recordPropertyChanged = function (entry, diagram, isRedo) { | ||
else { | ||
diagram.historyList.redo(entry); | ||
diagram.historyManager.redo(entry); | ||
} | ||
@@ -660,5 +663,5 @@ } | ||
if (historyEntry.type !== 'StartGroup' && historyEntry.type !== 'EndGroup') { | ||
if (diagram.historyList.redoStack.length > 0) { | ||
var addObject = diagram.historyList.redoStack.splice(0, 1); | ||
diagram.historyList.undoStack.splice(0, 0, addObject[0]); | ||
if (diagram.historyManager.redoStack.length > 0) { | ||
var addObject = diagram.historyManager.redoStack.splice(0, 1); | ||
diagram.historyManager.undoStack.splice(0, 0, addObject[0]); | ||
} | ||
@@ -724,3 +727,3 @@ } | ||
var currentObject; | ||
var hList = diagram.historyList; | ||
var hList = diagram.historyManager; | ||
if (hList.canUndo) { | ||
@@ -745,3 +748,3 @@ undoEntry = hList.currentEntry; | ||
var entryCurrent; | ||
var hList = diagram.historyList; | ||
var hList = diagram.historyManager; | ||
if (hList.canRedo) { | ||
@@ -748,0 +751,0 @@ if (!hList.currentEntry.previous && !hList.canUndo) { |
@@ -22,2 +22,3 @@ import { Rect } from './primitives/rect'; | ||
private diagramAsSvg; | ||
private setTransform; | ||
private diagramAsCanvas; | ||
@@ -24,0 +25,0 @@ private isImageExportable; |
@@ -304,3 +304,2 @@ import { Browser } from '@syncfusion/ej2-base'; | ||
var attr = { | ||
'transform': 'translate(' + (-options.bounds.x + margin.left) + ', ' + (-options.bounds.y + margin.top) + ')', | ||
'x': String(left), | ||
@@ -310,3 +309,7 @@ 'y': String(top), 'width': String(width), 'height': String(height) | ||
setAttributeSvg(g, attr); | ||
var backRect = document.getElementById(this.diagram.element.id + '_backgroundLayerrect').cloneNode(true); | ||
this.setTransform(g, options.bounds, margin); | ||
var gradient = document.getElementById(this.diagram.element.id + 'gradient_pattern'); | ||
if (gradient) { | ||
svg.appendChild(gradient); | ||
} | ||
attr = { | ||
@@ -316,12 +319,19 @@ 'x': 0, | ||
}; | ||
var backimage = document.getElementById(this.diagram.element.id + '_backgroundImageLayer').cloneNode(true); | ||
setAttributeSvg(backimage, attr); | ||
svg.appendChild(backimage); | ||
this.setTransform(backimage, bounds, margin); | ||
var backRect = document.getElementById(this.diagram.element.id + '_backgroundLayerrect').cloneNode(true); | ||
setAttributeSvg(backRect, attr); | ||
svg.appendChild(backRect); | ||
this.setTransform(backRect, bounds, margin); | ||
if (this.diagram.mode === 'SVG') { | ||
var element = void 0; | ||
var i = void 0; | ||
var diagramLayerSVG = getDiagramLayerSvg(this.diagram.element.id); | ||
svg.appendChild(diagramLayerSVG.getElementById(this.diagram.diagramLayer.id).cloneNode(true)); | ||
for (var i = 0; i < svg.childNodes.length; i++) { | ||
var element = svg.childNodes[i]; | ||
if (element.id === 'diagram_diagramLayer') { | ||
element.setAttribute('transform', 'translate(' + (-bounds.x + margin.left) + ', ' + | ||
(-bounds.y + margin.top) + ')'); | ||
for (i = 0; i < svg.childNodes.length; i++) { | ||
element = svg.childNodes[i]; | ||
if (element.id === this.diagram.element.id + '_diagramLayer') { | ||
this.setTransform(element, bounds, margin); | ||
} | ||
@@ -333,5 +343,3 @@ } | ||
svg.appendChild(g); | ||
g.setAttribute('transform', 'translate(' + (-options.bounds.x + margin.left) + ', ' + | ||
(-options.bounds.y + margin.top) + ')'); | ||
var nodes = this.diagram.nodes; | ||
this.setTransform(g, options.bounds, margin); | ||
//renderLabels | ||
@@ -345,2 +353,6 @@ var renderer = new DiagramRenderer('', null, true); | ||
}; | ||
PrintAndExport.prototype.setTransform = function (element, bounds, margin) { | ||
element.setAttribute('transform', 'translate(' + (-bounds.x + margin.left) + ', ' + | ||
(-bounds.y + margin.top) + ')'); | ||
}; | ||
PrintAndExport.prototype.diagramAsCanvas = function (options, customBounds) { | ||
@@ -545,3 +557,8 @@ var scaleX = 'scaleX'; | ||
ctx.restore(); | ||
this.printImage(div, url, 0); | ||
if (isExport) { | ||
imageArray.push(url); | ||
} | ||
else { | ||
this.printImage(div, url, 0); | ||
} | ||
} | ||
@@ -548,0 +565,0 @@ if (isExport) { |
@@ -993,18 +993,20 @@ import { PathElement } from '../core/elements/path-element'; | ||
DiagramRenderer.renderSvgBackGroundImage = function (background, diagramElement, x, y, width, height) { | ||
var container = document.getElementById(diagramElement.id); | ||
var backgroundLayer = getBackgroundLayerSvg(diagramElement.id); | ||
var target = backgroundLayer.getElementById(diagramElement.id + '_image'); | ||
if (!target && background.source) { | ||
var bgimageLayer = getBackgroundImageLayer(diagramElement.id); | ||
target = document.createElementNS('http://www.w3.org/2000/svg', 'image'); | ||
target.setAttribute('id', diagramElement.id + '_image'); | ||
bgimageLayer.appendChild(target); | ||
} | ||
if (target) { | ||
target.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', background.source); | ||
if (background.source) { | ||
var backgroundLayer = getBackgroundLayerSvg(diagramElement.id); | ||
var target = backgroundLayer.getElementById(diagramElement.id + '_image'); | ||
if (!target) { | ||
var bgimageLayer = getBackgroundImageLayer(diagramElement.id); | ||
target = document.createElementNS('http://www.w3.org/2000/svg', 'image'); | ||
target.setAttribute('id', diagramElement.id + '_image'); | ||
bgimageLayer.appendChild(target); | ||
} | ||
var imageObj = new Image(); | ||
imageObj.src = background.source; | ||
target.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', imageObj.src.toString()); | ||
var scale = background.scale !== 'None' ? background.scale : ''; | ||
var imgAlign = background.align; | ||
var aspectRatio = imgAlign.charAt(0).toLowerCase() + imgAlign.slice(1) + ' ' | ||
+ scale.charAt(0).toLowerCase() + scale.slice(1); | ||
var container_1 = document.getElementById(diagramElement.id); | ||
var aspectRatio = imgAlign.charAt(0).toLowerCase() + imgAlign.slice(1); | ||
if (scale) { | ||
aspectRatio += ' ' + scale.charAt(0).toLowerCase() + scale.slice(1); | ||
} | ||
var attr = { | ||
@@ -1011,0 +1013,0 @@ 'id': diagramElement.id + '_image', 'x': x, 'y': y, |
@@ -8,2 +8,3 @@ import { Point } from './../primitives/point'; | ||
import { createSvgElement, createHtmlElement, getBackgroundLayerSvg } from '../utility/dom-util'; | ||
import { removeGradient } from '../utility/diagram-util'; | ||
/** | ||
@@ -312,3 +313,3 @@ * SVG Renderer | ||
var pivotY = options.y + options.height * options.pivotY; | ||
if (options.doWrap) { | ||
if (options.doWrap || options.textOverflow !== 'Wrap') { | ||
this.setSvgStyle(text, options, diagramId); | ||
@@ -485,2 +486,3 @@ this.setSvgFontStyle(text, options); | ||
var offset; | ||
removeGradient(svg.id); | ||
if (options.gradient.type !== 'None') { | ||
@@ -494,6 +496,2 @@ for (var i = 0; i < options.gradient.stops.length; i++) { | ||
linear.id = svg.id + '_linear'; | ||
grd = svgContainer.getElementById(svg.id + '_linear'); | ||
if (grd) { | ||
grd.parentNode.removeChild(grd); | ||
} | ||
grd = this.createLinearGradient(linear); | ||
@@ -505,7 +503,2 @@ defs.appendChild(grd); | ||
radial.id = svg.id + '_radial'; | ||
grd = svgContainer.getElementById(svg.id + '_radial'); | ||
grd = svgContainer.getElementById(svg.id + '_linear'); | ||
if (grd) { | ||
grd.parentNode.removeChild(grd); | ||
} | ||
grd = this.createRadialGradient(radial); | ||
@@ -512,0 +505,0 @@ defs.appendChild(grd); |
@@ -115,30 +115,32 @@ import { Rect } from '../primitives/rect'; | ||
var property = properties_1[_i]; | ||
if (property !== 'wrapper') { | ||
var constructorId = 'constructor'; | ||
var name_1 = 'name'; | ||
var isEventEmmitter = obj[property] && obj.hasOwnProperty('observers') ? true : false; | ||
if (!isEventEmmitter) { | ||
if (obj[property] instanceof Array) { | ||
newObject[property] = cloneArray((internalProp.indexOf(property) === -1 && obj[keys]) ? obj[keys][property] : obj[property], additionalProp, property); | ||
if (property !== 'historyManager') { | ||
if (property !== 'wrapper') { | ||
var constructorId = 'constructor'; | ||
var name_1 = 'name'; | ||
var isEventEmmitter = obj[property] && obj.hasOwnProperty('observers') ? true : false; | ||
if (!isEventEmmitter) { | ||
if (obj[property] instanceof Array) { | ||
newObject[property] = cloneArray((internalProp.indexOf(property) === -1 && obj[keys]) ? obj[keys][property] : obj[property], additionalProp, property); | ||
} | ||
else if (obj[property] instanceof Array === false && obj[property] instanceof HTMLElement) { | ||
newObject[property] = obj[property].cloneNode(true).innerHtml; | ||
} | ||
else if (obj[property] instanceof Array === false && obj[property] instanceof Object) { | ||
newObject[property] = cloneObject((internalProp.indexOf(property) === -1 && obj[keys]) ? obj[keys][property] : obj[property]); | ||
} | ||
else { | ||
newObject[property] = obj[property]; | ||
} | ||
} | ||
else if (obj[property] instanceof Array === false && obj[property] instanceof HTMLElement) { | ||
newObject[property] = obj[property].cloneNode(true).innerHtml; | ||
} | ||
else { | ||
if (obj[property]) { | ||
newObject[property] = { | ||
actualSize: { | ||
width: obj[property].actualSize.width, height: obj[property].actualSize.height | ||
}, offsetX: obj[property].offsetX, offsetY: obj[property].offsetY | ||
}; | ||
} | ||
else if (obj[property] instanceof Array === false && obj[property] instanceof Object) { | ||
newObject[property] = cloneObject((internalProp.indexOf(property) === -1 && obj[keys]) ? obj[keys][property] : obj[property]); | ||
} | ||
else { | ||
newObject[property] = obj[property]; | ||
} | ||
} | ||
} | ||
else { | ||
if (obj[property]) { | ||
newObject[property] = { | ||
actualSize: { | ||
width: obj[property].actualSize.width, height: obj[property].actualSize.height | ||
}, offsetX: obj[property].offsetX, offsetY: obj[property].offsetY | ||
}; | ||
} | ||
} | ||
} | ||
@@ -145,0 +147,0 @@ } |
@@ -82,2 +82,3 @@ import { PointModel } from './../primitives/point-model'; | ||
export declare function updateHyperlink(changedObject: HyperlinkModel, target: DiagramElement, actualAnnotation: AnnotationModel): void; | ||
/** @private */ | ||
export declare function updateShapeContent(content: DiagramElement, actualObject: Node, diagram: Diagram): void; | ||
@@ -94,2 +95,4 @@ /** @private */ | ||
export declare function getUMLActivityShapes(umlActivityShape: PathElement, content: DiagramElement, node: Node): DiagramElement; | ||
/** @private */ | ||
export declare function removeGradient(svgId: string): void; | ||
/** @private */ | ||
@@ -96,0 +99,0 @@ export declare function removeItem(array: String[], item: string): void; |
@@ -653,3 +653,3 @@ import { Size } from './../primitives/size'; | ||
case 'gradient': | ||
style.gradient = changedObject.gradient; | ||
updateGradient(changedObject.gradient, style.gradient); | ||
break; | ||
@@ -662,2 +662,42 @@ } | ||
} | ||
function updateGradient(changedGradient, targetGradient) { | ||
for (var _i = 0, _a = Object.keys(changedGradient); _i < _a.length; _i++) { | ||
var key = _a[_i]; | ||
switch (key) { | ||
case 'type': | ||
targetGradient.type = changedGradient.type; | ||
break; | ||
case 'x1': | ||
targetGradient.x1 = changedGradient.x1; | ||
break; | ||
case 'x2': | ||
targetGradient.x2 = changedGradient.x2; | ||
break; | ||
case 'y1': | ||
targetGradient.y1 = changedGradient.y1; | ||
break; | ||
case 'y2': | ||
targetGradient.y2 = changedGradient.y2; | ||
break; | ||
case 'cx': | ||
targetGradient.cx = changedGradient.cx; | ||
break; | ||
case 'cy': | ||
targetGradient.cy = changedGradient.cy; | ||
break; | ||
case 'fx': | ||
targetGradient.fx = changedGradient.fx; | ||
break; | ||
case 'fy': | ||
targetGradient.fy = changedGradient.fy; | ||
break; | ||
case 'r': | ||
targetGradient.r = changedGradient.r; | ||
break; | ||
case 'stops': | ||
targetGradient.stops = changedGradient.stops; | ||
break; | ||
} | ||
} | ||
} | ||
/** @private */ | ||
@@ -689,2 +729,3 @@ export function updateHyperlink(changedObject, target, actualAnnotation) { | ||
} | ||
/** @private */ | ||
export function updateShapeContent(content, actualObject, diagram) { | ||
@@ -722,3 +763,3 @@ content.width = actualObject.width; | ||
var nodeStyle; | ||
switch (node.shape.type) { | ||
switch (actualObject.shape.type) { | ||
case 'Path': | ||
@@ -922,2 +963,7 @@ var pathContent = new PathElement(); | ||
} | ||
/** @private */ | ||
export function removeGradient(svgId) { | ||
removeElement(svgId + '_linear'); | ||
removeElement(svgId + '_radial'); | ||
} | ||
/** @private */ | ||
@@ -924,0 +970,0 @@ export function removeItem(array, item) { |
@@ -277,2 +277,5 @@ import { Rect } from '../primitives/rect'; | ||
bounds.width = wrapBounds.width; | ||
if (text.wrapBounds.width >= maxWidth && options.textOverflow !== 'Wrap') { | ||
bounds.width = maxWidth; | ||
} | ||
bounds.height = childNodes.length * text.style.fontSize * 1.2; | ||
@@ -279,0 +282,0 @@ return bounds; |
@@ -96,3 +96,3 @@ import { NodeConstraints, AnnotationConstraints } from '../enum/enum'; | ||
constraints: (NodeConstraints.Default | NodeConstraints.HideThumbs) & ~(NodeConstraints.Rotate | NodeConstraints.Drag | NodeConstraints.Resize), | ||
maxHeight: 25, minHeight: 25 | ||
minHeight: 25 | ||
}, true); | ||
@@ -150,3 +150,3 @@ diagram.initObject(temp); | ||
constraints: (NodeConstraints.Default | NodeConstraints.HideThumbs) & ~(NodeConstraints.Rotate | NodeConstraints.Drag | NodeConstraints.Resize), | ||
maxHeight: 25, minHeight: 25 | ||
minHeight: 25 | ||
}, true); | ||
@@ -219,3 +219,3 @@ diagram.initObject(temp); | ||
], | ||
style: { fill: node.style.fill, strokeColor: '#ffffff00' }, maxHeight: 25, minHeight: 25, | ||
style: { fill: node.style.fill, strokeColor: '#ffffff00' }, minHeight: 25, | ||
constraints: (NodeConstraints.Default | NodeConstraints.HideThumbs) & ~(NodeConstraints.Rotate | NodeConstraints.Drag | NodeConstraints.Resize) | ||
@@ -222,0 +222,0 @@ }, true); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
21866686
161704
1