@progress/kendo-angular-diagrams 21.4.1 → 22.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/progress-kendo-angular-diagrams.mjs +16 -16
- package/package.json +14 -22
- package/esm2022/connection-tooltip-template.directive.mjs +0 -47
- package/esm2022/diagram.component.mjs +0 -948
- package/esm2022/diagram.module.mjs +0 -53
- package/esm2022/directives.mjs +0 -31
- package/esm2022/index.mjs +0 -11
- package/esm2022/models.mjs +0 -7
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/progress-kendo-angular-diagrams.mjs +0 -8
- package/esm2022/shape-tooltip-template.directive.mjs +0 -47
- package/esm2022/utils.mjs +0 -6
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { placeTooltip, events, convertToDiagramModel, loadTheme, Diagram } from '@progress/kendo-diagram-common';
|
|
6
6
|
export { ArrowMarker, Circle, CircleMarker, Collate, Connection, Connector, DataInputOutput, DataStorage, Database, Decision, Delay, DirectAccessStorage, Display, Document, Extract, FlowchartShapeType, Group, Image, InternalStorage, Layout, Line, LogicalOr, ManualInputOutput, ManualOperation, MarkerType, Merge, MultiLineTextBlock, MultipleDocuments, OffPageConnector, OnPageConnector, Path, Point, Polyline, PredefinedProcess, Preparation, Process, Rect, Rectangle, Shape, Sort, SummingJunction, Terminator, TextBlock, convertToDiagramModel } from '@progress/kendo-diagram-common';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { Directive, EventEmitter,
|
|
8
|
+
import { Directive, EventEmitter, ContentChild, ViewChild, Output, Input, HostBinding, Component, NgModule } from '@angular/core';
|
|
9
9
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
10
|
import { isPresent, getLicenseMessage, shouldShowValidationUI, hasObservers, isDocumentAvailable, WatermarkOverlayComponent } from '@progress/kendo-angular-common';
|
|
11
11
|
import * as i1 from '@progress/kendo-angular-popup';
|
|
@@ -20,8 +20,8 @@ const packageMetadata = {
|
|
|
20
20
|
productName: 'Kendo UI for Angular',
|
|
21
21
|
productCode: 'KENDOUIANGULAR',
|
|
22
22
|
productCodes: ['KENDOUIANGULAR'],
|
|
23
|
-
publishDate:
|
|
24
|
-
version: '
|
|
23
|
+
publishDate: 1768396058,
|
|
24
|
+
version: '22.0.0-develop.1',
|
|
25
25
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning',
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -59,10 +59,10 @@ class ShapeTooltipTemplateDirective {
|
|
|
59
59
|
constructor(templateRef) {
|
|
60
60
|
this.templateRef = templateRef;
|
|
61
61
|
}
|
|
62
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
63
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
62
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ShapeTooltipTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
63
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.18", type: ShapeTooltipTemplateDirective, isStandalone: true, selector: "[kendoDiagramShapeTooltipTemplate]", ngImport: i0 });
|
|
64
64
|
}
|
|
65
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ShapeTooltipTemplateDirective, decorators: [{
|
|
66
66
|
type: Directive,
|
|
67
67
|
args: [{
|
|
68
68
|
selector: '[kendoDiagramShapeTooltipTemplate]',
|
|
@@ -101,10 +101,10 @@ class ConnectionTooltipTemplateDirective {
|
|
|
101
101
|
constructor(templateRef) {
|
|
102
102
|
this.templateRef = templateRef;
|
|
103
103
|
}
|
|
104
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
105
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ConnectionTooltipTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
105
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.18", type: ConnectionTooltipTemplateDirective, isStandalone: true, selector: "[kendoDiagramConnectionTooltipTemplate]", ngImport: i0 });
|
|
106
106
|
}
|
|
107
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ConnectionTooltipTemplateDirective, decorators: [{
|
|
108
108
|
type: Directive,
|
|
109
109
|
args: [{
|
|
110
110
|
selector: '[kendoDiagramConnectionTooltipTemplate]',
|
|
@@ -930,8 +930,8 @@ class DiagramComponent {
|
|
|
930
930
|
largeStep: this._navigable.largeStep
|
|
931
931
|
};
|
|
932
932
|
}
|
|
933
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
934
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
933
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: DiagramComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i1.PopupService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
934
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.18", type: DiagramComponent, isStandalone: true, selector: "kendo-diagram", inputs: { connectionDefaults: "connectionDefaults", connections: "connections", connectionModelFields: "connectionModelFields", editable: "editable", layout: "layout", pannable: "pannable", selectable: "selectable", shapeDefaults: "shapeDefaults", shapes: "shapes", shapeModelFields: "shapeModelFields", zoom: "zoom", zoomMax: "zoomMax", zoomMin: "zoomMin", zoomRate: "zoomRate", navigable: "navigable" }, outputs: { change: "change", diagramClick: "diagramClick", drag: "drag", dragEnd: "dragEnd", dragStart: "dragStart", shapeBoundsChange: "shapeBoundsChange", mouseEnter: "mouseEnter", mouseLeave: "mouseLeave", onPan: "pan", onSelect: "select", zoomEnd: "zoomEnd", zoomStart: "zoomStart", tooltipShow: "tooltipShow", tooltipHide: "tooltipHide" }, host: { properties: { "class.k-diagram": "this.diagramClass" } }, providers: [PopupService], queries: [{ propertyName: "shapeTooltipTemplate", first: true, predicate: ShapeTooltipTemplateDirective, descendants: true }, { propertyName: "connectionTooltipTemplate", first: true, predicate: ConnectionTooltipTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "defaultTooltipTemplate", first: true, predicate: ["defaultTemplate"], descendants: true }, { propertyName: "customTooltipTemplate", first: true, predicate: ["customTooltipTemplate"], descendants: true }], exportAs: ["kendoDiagram"], usesOnChanges: true, ngImport: i0, template: `
|
|
935
935
|
@if (showLicenseWatermark) {
|
|
936
936
|
<div kendoWatermarkOverlay [licenseMessage]="licenseMessage"></div>
|
|
937
937
|
}
|
|
@@ -945,7 +945,7 @@ class DiagramComponent {
|
|
|
945
945
|
</ng-template>
|
|
946
946
|
`, isInline: true, dependencies: [{ kind: "component", type: WatermarkOverlayComponent, selector: "div[kendoWatermarkOverlay]", inputs: ["licenseMessage"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
947
947
|
}
|
|
948
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
948
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: DiagramComponent, decorators: [{
|
|
949
949
|
type: Component,
|
|
950
950
|
args: [{
|
|
951
951
|
standalone: true,
|
|
@@ -1101,11 +1101,11 @@ const KENDO_DIAGRAM = [
|
|
|
1101
1101
|
* ```
|
|
1102
1102
|
*/
|
|
1103
1103
|
class DiagramModule {
|
|
1104
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1105
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
1106
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
1104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: DiagramModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1105
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.18", ngImport: i0, type: DiagramModule, imports: [DiagramComponent, ShapeTooltipTemplateDirective, ConnectionTooltipTemplateDirective], exports: [DiagramComponent, ShapeTooltipTemplateDirective, ConnectionTooltipTemplateDirective] });
|
|
1106
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: DiagramModule, imports: [DiagramComponent] });
|
|
1107
1107
|
}
|
|
1108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: DiagramModule, decorators: [{
|
|
1109
1109
|
type: NgModule,
|
|
1110
1110
|
args: [{
|
|
1111
1111
|
imports: [...KENDO_DIAGRAM],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-diagrams",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0-develop.1",
|
|
4
4
|
"description": "Kendo UI Angular diagrams component",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Progress",
|
|
@@ -15,33 +15,27 @@
|
|
|
15
15
|
"Progress"
|
|
16
16
|
],
|
|
17
17
|
"@progress": {
|
|
18
|
-
"friendlyName": "Diagrams"
|
|
19
|
-
"package": {
|
|
20
|
-
"productName": "Kendo UI for Angular",
|
|
21
|
-
"productCode": "KENDOUIANGULAR",
|
|
22
|
-
"publishDate": 1768393344,
|
|
23
|
-
"licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"
|
|
24
|
-
}
|
|
18
|
+
"friendlyName": "Diagrams"
|
|
25
19
|
},
|
|
26
20
|
"peerDependencies": {
|
|
27
|
-
"@angular/animations": "
|
|
28
|
-
"@angular/common": "
|
|
29
|
-
"@angular/core": "
|
|
30
|
-
"@angular/platform-browser": "
|
|
21
|
+
"@angular/animations": "19 - 21",
|
|
22
|
+
"@angular/common": "19 - 21",
|
|
23
|
+
"@angular/core": "19 - 21",
|
|
24
|
+
"@angular/platform-browser": "19 - 21",
|
|
31
25
|
"@progress/kendo-licensing": "^1.7.0",
|
|
32
|
-
"@progress/kendo-angular-common": "
|
|
33
|
-
"@progress/kendo-angular-buttons": "
|
|
34
|
-
"@progress/kendo-angular-dialog": "
|
|
35
|
-
"@progress/kendo-angular-dropdowns": "
|
|
36
|
-
"@progress/kendo-angular-icons": "
|
|
37
|
-
"@progress/kendo-angular-inputs": "
|
|
38
|
-
"@progress/kendo-angular-popup": "
|
|
26
|
+
"@progress/kendo-angular-common": "22.0.0-develop.1",
|
|
27
|
+
"@progress/kendo-angular-buttons": "22.0.0-develop.1",
|
|
28
|
+
"@progress/kendo-angular-dialog": "22.0.0-develop.1",
|
|
29
|
+
"@progress/kendo-angular-dropdowns": "22.0.0-develop.1",
|
|
30
|
+
"@progress/kendo-angular-icons": "22.0.0-develop.1",
|
|
31
|
+
"@progress/kendo-angular-inputs": "22.0.0-develop.1",
|
|
32
|
+
"@progress/kendo-angular-popup": "22.0.0-develop.1",
|
|
39
33
|
"rxjs": "^6.5.3 || ^7.0.0"
|
|
40
34
|
},
|
|
41
35
|
"dependencies": {
|
|
42
36
|
"@progress/kendo-diagram-common": "^2.2.0",
|
|
43
37
|
"tslib": "^2.3.1",
|
|
44
|
-
"@progress/kendo-angular-schematics": "
|
|
38
|
+
"@progress/kendo-angular-schematics": "22.0.0-develop.1"
|
|
45
39
|
},
|
|
46
40
|
"schematics": "./schematics/collection.json",
|
|
47
41
|
"module": "fesm2022/progress-kendo-angular-diagrams.mjs",
|
|
@@ -52,8 +46,6 @@
|
|
|
52
46
|
},
|
|
53
47
|
".": {
|
|
54
48
|
"types": "./index.d.ts",
|
|
55
|
-
"esm2022": "./esm2022/progress-kendo-angular-diagrams.mjs",
|
|
56
|
-
"esm": "./esm2022/progress-kendo-angular-diagrams.mjs",
|
|
57
49
|
"default": "./fesm2022/progress-kendo-angular-diagrams.mjs"
|
|
58
50
|
}
|
|
59
51
|
},
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, TemplateRef } from '@angular/core';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Defines a custom template for connection tooltips within the `kendo-diagram` component.
|
|
9
|
-
* Use this directive to customize how tooltips appear when hovering over connections.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* import { Component } from '@angular/core';
|
|
14
|
-
*
|
|
15
|
-
* _@Component({
|
|
16
|
-
* selector: 'my-app',
|
|
17
|
-
* template: `
|
|
18
|
-
* <kendo-diagram>
|
|
19
|
-
* <ng-template kendoDiagramConnectionTooltipTemplate let-dataItem>
|
|
20
|
-
* {{dataItem.tooltipContent}}
|
|
21
|
-
* </ng-template>
|
|
22
|
-
* </kendo-diagram>
|
|
23
|
-
* `
|
|
24
|
-
* })
|
|
25
|
-
* class AppComponent {
|
|
26
|
-
* }
|
|
27
|
-
*
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export class ConnectionTooltipTemplateDirective {
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
templateRef;
|
|
35
|
-
constructor(templateRef) {
|
|
36
|
-
this.templateRef = templateRef;
|
|
37
|
-
}
|
|
38
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ConnectionTooltipTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
39
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ConnectionTooltipTemplateDirective, isStandalone: true, selector: "[kendoDiagramConnectionTooltipTemplate]", ngImport: i0 });
|
|
40
|
-
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ConnectionTooltipTemplateDirective, decorators: [{
|
|
42
|
-
type: Directive,
|
|
43
|
-
args: [{
|
|
44
|
-
selector: '[kendoDiagramConnectionTooltipTemplate]',
|
|
45
|
-
standalone: true,
|
|
46
|
-
}]
|
|
47
|
-
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
@@ -1,948 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, ContentChild, ElementRef, EventEmitter, HostBinding, Input, NgZone, Output, Renderer2, TemplateRef, ViewChild, ViewContainerRef, } from '@angular/core';
|
|
6
|
-
import { Diagram, convertToDiagramModel, placeTooltip } from '@progress/kendo-diagram-common';
|
|
7
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
8
|
-
import { packageMetadata } from './package-metadata';
|
|
9
|
-
import { hasObservers, shouldShowValidationUI, getLicenseMessage, WatermarkOverlayComponent, isDocumentAvailable, isPresent } from '@progress/kendo-angular-common';
|
|
10
|
-
import { PopupService } from '@progress/kendo-angular-popup';
|
|
11
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
12
|
-
import { events, loadTheme } from '@progress/kendo-diagram-common';
|
|
13
|
-
import { DEFAULT_NAVIGABLE_OPTIONS } from './utils';
|
|
14
|
-
import { ShapeTooltipTemplateDirective } from './shape-tooltip-template.directive';
|
|
15
|
-
import { ConnectionTooltipTemplateDirective } from './connection-tooltip-template.directive';
|
|
16
|
-
import * as i0 from "@angular/core";
|
|
17
|
-
import * as i1 from "@progress/kendo-angular-popup";
|
|
18
|
-
/**
|
|
19
|
-
* Represents the [Kendo UI Diagram component for Angular](slug:overview_diagram).
|
|
20
|
-
*
|
|
21
|
-
* The Diagram component is used to create organizational charts, and other types of diagrams.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```html
|
|
25
|
-
* <kendo-diagram [shapes]="shapesData"></kendo-diagram>
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export class DiagramComponent {
|
|
29
|
-
wrapperElement;
|
|
30
|
-
renderer;
|
|
31
|
-
zone;
|
|
32
|
-
popupService;
|
|
33
|
-
viewContainer;
|
|
34
|
-
diagramClass = true;
|
|
35
|
-
/**
|
|
36
|
-
* Defines the default configuration options applicable to all connections.
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
connectionDefaults;
|
|
40
|
-
/**
|
|
41
|
-
* Defines the connections that render between the shapes in the `Diagram` (see [Connections article](slug:diagram_connections)).
|
|
42
|
-
* Accepts either an array of `ConnectionOptions` or an array of any objects
|
|
43
|
-
* that will be mapped using the `connectionModelFields` configuration.
|
|
44
|
-
*
|
|
45
|
-
*/
|
|
46
|
-
connections = [];
|
|
47
|
-
/**
|
|
48
|
-
* Defines the field mapping configuration for connections data binding ([see example](slug:diagram_data_binding#field-mapping)).
|
|
49
|
-
* Maps source object properties to `Diagram` connection properties.
|
|
50
|
-
* Only used when `connections` is an array of custom objects instead of `ConnectionOptions`.
|
|
51
|
-
*/
|
|
52
|
-
connectionModelFields;
|
|
53
|
-
/**
|
|
54
|
-
* A set of settings to configure the `Diagram` behavior when the user attempts to drag, resize, or remove shapes.
|
|
55
|
-
* Changing the property value dynamically triggers a reinitialization of the `Diagram`.
|
|
56
|
-
*
|
|
57
|
-
* @default true
|
|
58
|
-
*/
|
|
59
|
-
editable = true;
|
|
60
|
-
/**
|
|
61
|
-
* Defines the layout configuration for arranging shapes and connections in the `Diagram` (see [Layout article](slug:diagram_layouts)).
|
|
62
|
-
*
|
|
63
|
-
*/
|
|
64
|
-
layout;
|
|
65
|
-
/**
|
|
66
|
-
* Defines the pannable options. Use this setting to disable `Diagram` pan or change the key that activates the pan behavior.
|
|
67
|
-
*
|
|
68
|
-
* @default true
|
|
69
|
-
*/
|
|
70
|
-
pannable = true;
|
|
71
|
-
/**
|
|
72
|
-
* Defines the `Diagram` selection options.
|
|
73
|
-
*
|
|
74
|
-
* By default, you can select shapes in the `Diagram` in one of two ways:
|
|
75
|
-
* - Clicking a single shape to select it and deselect any previously selected shapes.
|
|
76
|
-
* - Holding the `Ctrl/Cmd on MacOS` key while clicking multiple shapes to select them and any other shapes between them.
|
|
77
|
-
*
|
|
78
|
-
* Use the `selectable` configuration to allow single selection only, enable selection by drawing a rectangular area with the mouse around shapes in the canvas, or disable selection altogether.
|
|
79
|
-
*
|
|
80
|
-
* @default true
|
|
81
|
-
*/
|
|
82
|
-
selectable = true;
|
|
83
|
-
/**
|
|
84
|
-
* Defines the default configuration options applicable to all shapes.
|
|
85
|
-
*/
|
|
86
|
-
shapeDefaults;
|
|
87
|
-
/**
|
|
88
|
-
* Defines the shapes that render in the `Diagram` (see [Shapes article](slug:diagram_shapes)).
|
|
89
|
-
* Accepts either an array of `ShapeOptions` or an array of any objects
|
|
90
|
-
* that will be mapped using the `shapeModelFields` configuration.
|
|
91
|
-
*
|
|
92
|
-
*/
|
|
93
|
-
shapes = [];
|
|
94
|
-
/**
|
|
95
|
-
* Defines the field mapping configuration for shapes data binding ([see example](slug:diagram_data_binding#field-mapping)).
|
|
96
|
-
* Maps source object properties to `Diagram` shape properties.
|
|
97
|
-
* Only used when `shapes` is an array of custom objects instead of `ShapeOptions`.
|
|
98
|
-
*/
|
|
99
|
-
shapeModelFields;
|
|
100
|
-
/**
|
|
101
|
-
* Defines the zoom level of the `Diagram`.
|
|
102
|
-
*
|
|
103
|
-
* @default 1
|
|
104
|
-
*/
|
|
105
|
-
zoom = 1;
|
|
106
|
-
/**
|
|
107
|
-
* Defines the maximum zoom level of the `Diagram`.
|
|
108
|
-
*
|
|
109
|
-
* @default 2
|
|
110
|
-
*/
|
|
111
|
-
zoomMax = 2;
|
|
112
|
-
/**
|
|
113
|
-
* Defines the minimum zoom level of the `Diagram`.
|
|
114
|
-
*
|
|
115
|
-
* @default 0.1
|
|
116
|
-
*/
|
|
117
|
-
zoomMin = 0.1;
|
|
118
|
-
/**
|
|
119
|
-
* Defines the zoom rate of the `Diagram`.
|
|
120
|
-
*
|
|
121
|
-
* @default 0.1
|
|
122
|
-
*/
|
|
123
|
-
zoomRate = 0.1;
|
|
124
|
-
/**
|
|
125
|
-
* Enables keyboard navigation in the `Diagram`.
|
|
126
|
-
* When set to `true`, navigate between shapes using arrow keys.
|
|
127
|
-
* Alternatively, pass a `DiagramNavigationOptions` object to customize navigation behavior.
|
|
128
|
-
*
|
|
129
|
-
* @default true
|
|
130
|
-
*/
|
|
131
|
-
set navigable(_navigable) {
|
|
132
|
-
if (typeof _navigable === 'boolean') {
|
|
133
|
-
this._navigable = _navigable ? DEFAULT_NAVIGABLE_OPTIONS : { ...DEFAULT_NAVIGABLE_OPTIONS, enabled: false };
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
this._navigable = _navigable;
|
|
137
|
-
this._navigable.enabled = isPresent(this._navigable.enabled) ? this._navigable.enabled : true;
|
|
138
|
-
}
|
|
139
|
-
this.options = { ...this.options, navigation: this.getNormalizedNavigationOptions() };
|
|
140
|
-
this.diagramWidget?.setOptions(this.options);
|
|
141
|
-
}
|
|
142
|
-
get navigable() {
|
|
143
|
-
return this._navigable;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Fires when a shape or connection is created or removed.
|
|
147
|
-
*/
|
|
148
|
-
change = new EventEmitter();
|
|
149
|
-
/**
|
|
150
|
-
* Fires when the user clicks on a shape or a connection.
|
|
151
|
-
*/
|
|
152
|
-
diagramClick = new EventEmitter();
|
|
153
|
-
/**
|
|
154
|
-
* Fires when the user drags an item.
|
|
155
|
-
*/
|
|
156
|
-
drag = new EventEmitter();
|
|
157
|
-
/**
|
|
158
|
-
* Fires when the user stops dragging an item.
|
|
159
|
-
*/
|
|
160
|
-
dragEnd = new EventEmitter();
|
|
161
|
-
/**
|
|
162
|
-
* Fires when the user starts dragging an item.
|
|
163
|
-
*/
|
|
164
|
-
dragStart = new EventEmitter();
|
|
165
|
-
/**
|
|
166
|
-
* Fires when the location or size of an item are changed.
|
|
167
|
-
*/
|
|
168
|
-
shapeBoundsChange = new EventEmitter();
|
|
169
|
-
/**
|
|
170
|
-
* Fires when the mouse pointer enters a shape or connection.
|
|
171
|
-
*/
|
|
172
|
-
mouseEnter = new EventEmitter();
|
|
173
|
-
/**
|
|
174
|
-
* Fires when the mouse pointer leaves a shape or connection.
|
|
175
|
-
*/
|
|
176
|
-
mouseLeave = new EventEmitter();
|
|
177
|
-
/**
|
|
178
|
-
* Fires when the user pans the `Diagram`.
|
|
179
|
-
*/
|
|
180
|
-
onPan = new EventEmitter();
|
|
181
|
-
/**
|
|
182
|
-
* Fires when the user selects one or more items.
|
|
183
|
-
*/
|
|
184
|
-
onSelect = new EventEmitter();
|
|
185
|
-
/**
|
|
186
|
-
* Fires when the `Diagram` has finished zooming out.
|
|
187
|
-
*/
|
|
188
|
-
zoomEnd = new EventEmitter();
|
|
189
|
-
/**
|
|
190
|
-
* Fires when the `Diagram` starts zooming in or out.
|
|
191
|
-
*/
|
|
192
|
-
zoomStart = new EventEmitter();
|
|
193
|
-
/**
|
|
194
|
-
* Fires when a tooltip should shown for a shape or connection.
|
|
195
|
-
*/
|
|
196
|
-
tooltipShow = new EventEmitter();
|
|
197
|
-
/**
|
|
198
|
-
* Fires when a tooltip should be hidden.
|
|
199
|
-
*/
|
|
200
|
-
tooltipHide = new EventEmitter();
|
|
201
|
-
/**
|
|
202
|
-
* @hidden
|
|
203
|
-
* Represents the Diagram instance, holding the core functionality of the Diagram.
|
|
204
|
-
*/
|
|
205
|
-
diagramWidget;
|
|
206
|
-
/**
|
|
207
|
-
* The currently selected items in the `Diagram`.
|
|
208
|
-
*/
|
|
209
|
-
get selection() {
|
|
210
|
-
return this.diagramWidget?.select();
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* The actual shapes created by the `Diagram`.
|
|
214
|
-
*/
|
|
215
|
-
get diagramShapes() {
|
|
216
|
-
return this.diagramWidget?.shapes;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* The actual connections created by the `Diagram`.
|
|
220
|
-
*/
|
|
221
|
-
get diagramConnections() {
|
|
222
|
-
return this.diagramWidget?.connections;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* @hidden
|
|
226
|
-
*/
|
|
227
|
-
showLicenseWatermark = false;
|
|
228
|
-
/**
|
|
229
|
-
* @hidden
|
|
230
|
-
*/
|
|
231
|
-
licenseMessage;
|
|
232
|
-
/**
|
|
233
|
-
* @hidden
|
|
234
|
-
*/
|
|
235
|
-
customTemplate;
|
|
236
|
-
_navigable = DEFAULT_NAVIGABLE_OPTIONS;
|
|
237
|
-
options = {
|
|
238
|
-
shapes: this.shapes,
|
|
239
|
-
connections: this.connections,
|
|
240
|
-
selectable: this.selectable,
|
|
241
|
-
editable: this.editable,
|
|
242
|
-
zoom: this.zoom,
|
|
243
|
-
zoomMax: this.zoomMax,
|
|
244
|
-
zoomMin: this.zoomMin,
|
|
245
|
-
zoomRate: this.zoomRate,
|
|
246
|
-
shapeDefaults: this.shapeDefaults,
|
|
247
|
-
connectionDefaults: this.connectionDefaults,
|
|
248
|
-
navigation: this.getNormalizedNavigationOptions()
|
|
249
|
-
};
|
|
250
|
-
/**
|
|
251
|
-
* Stores the converted shapes from user data.
|
|
252
|
-
*/
|
|
253
|
-
convertedShapes = [];
|
|
254
|
-
/**
|
|
255
|
-
* Stores the converted connections from user data.
|
|
256
|
-
*/
|
|
257
|
-
convertedConnections = [];
|
|
258
|
-
/**
|
|
259
|
-
* Current popup instance for tooltip.
|
|
260
|
-
*/
|
|
261
|
-
tooltipPopup;
|
|
262
|
-
defaultTooltipTemplate;
|
|
263
|
-
customTooltipTemplate;
|
|
264
|
-
shapeTooltipTemplate;
|
|
265
|
-
connectionTooltipTemplate;
|
|
266
|
-
/**
|
|
267
|
-
* @hidden
|
|
268
|
-
* The original data item provided by the user. Passed in the tooltip template context.
|
|
269
|
-
*/
|
|
270
|
-
dataItem;
|
|
271
|
-
constructor(wrapperElement, renderer, zone, popupService, viewContainer) {
|
|
272
|
-
this.wrapperElement = wrapperElement;
|
|
273
|
-
this.renderer = renderer;
|
|
274
|
-
this.zone = zone;
|
|
275
|
-
this.popupService = popupService;
|
|
276
|
-
this.viewContainer = viewContainer;
|
|
277
|
-
const isValid = validatePackage(packageMetadata);
|
|
278
|
-
this.licenseMessage = getLicenseMessage(packageMetadata);
|
|
279
|
-
this.showLicenseWatermark = shouldShowValidationUI(isValid);
|
|
280
|
-
}
|
|
281
|
-
ngOnChanges(changes) {
|
|
282
|
-
if (changes['shapes'] || changes['connections'] || changes['shapeModelFields'] || changes['connectionModelFields']) {
|
|
283
|
-
this.convertUserData();
|
|
284
|
-
this.options = {
|
|
285
|
-
...this.options,
|
|
286
|
-
shapes: this.convertedShapes,
|
|
287
|
-
connections: this.convertedConnections
|
|
288
|
-
};
|
|
289
|
-
this.loadOptions(this.options);
|
|
290
|
-
}
|
|
291
|
-
if (changes['connectionDefaults']) {
|
|
292
|
-
this.options.connectionDefaults = { ...this.options.connectionDefaults, ...this.connectionDefaults };
|
|
293
|
-
this.loadOptions(this.options);
|
|
294
|
-
}
|
|
295
|
-
if (changes['shapeDefaults']) {
|
|
296
|
-
this.options.shapeDefaults = { ...this.options.shapeDefaults, ...this.shapeDefaults };
|
|
297
|
-
this.loadOptions(this.options);
|
|
298
|
-
}
|
|
299
|
-
if (changes['editable']) {
|
|
300
|
-
this.options = { ...this.options, editable: this.editable };
|
|
301
|
-
if (this.diagramWidget) {
|
|
302
|
-
this.diagramWidget.destroy();
|
|
303
|
-
this.init();
|
|
304
|
-
this.bindDiagramEvents();
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
if (changes['zoomMax']) {
|
|
308
|
-
this.updateOptions('zoomMax');
|
|
309
|
-
}
|
|
310
|
-
if (changes['zoomMin']) {
|
|
311
|
-
this.updateOptions('zoomMin');
|
|
312
|
-
}
|
|
313
|
-
if (changes['zoomRate']) {
|
|
314
|
-
this.updateOptions('zoomRate');
|
|
315
|
-
}
|
|
316
|
-
if (changes['selectable']) {
|
|
317
|
-
this.updateOptions('selectable');
|
|
318
|
-
}
|
|
319
|
-
if (changes['layout']) {
|
|
320
|
-
this.updateOptions('layout');
|
|
321
|
-
this.diagramWidget?.layout(this.options.layout);
|
|
322
|
-
}
|
|
323
|
-
if (changes['pannable']) {
|
|
324
|
-
this.updateOptions('pannable');
|
|
325
|
-
}
|
|
326
|
-
if (changes['zoom']) {
|
|
327
|
-
this.updateOptions('zoom');
|
|
328
|
-
this.diagramWidget?.zoom(this.diagramWidget.options.zoom);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
ngAfterViewInit() {
|
|
332
|
-
this.convertUserData();
|
|
333
|
-
this.options.shapes = this.convertedShapes;
|
|
334
|
-
this.options.connections = this.convertedConnections;
|
|
335
|
-
this.renderer.setStyle(this.wrapperElement.nativeElement, 'display', 'block');
|
|
336
|
-
this.init();
|
|
337
|
-
this.bindDiagramEvents();
|
|
338
|
-
}
|
|
339
|
-
ngOnDestroy() {
|
|
340
|
-
this.hideTooltip();
|
|
341
|
-
this.diagramWidget?.destroy();
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* Provides the current `Diagram`'s shapes and connections that can be used to create a new `Diagram` when needed.
|
|
345
|
-
* @returns {DiagramState} Object containing shapes and connections arrays.
|
|
346
|
-
*/
|
|
347
|
-
getState() {
|
|
348
|
-
return this.diagramWidget?.save();
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Focuses the `Diagram`.
|
|
352
|
-
* @returns {boolean} true if focus was set successfully.
|
|
353
|
-
*/
|
|
354
|
-
focus() {
|
|
355
|
-
return this.diagramWidget?.focus();
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* Clears the `Diagram`.
|
|
359
|
-
*/
|
|
360
|
-
clear() {
|
|
361
|
-
this.diagramWidget?.clear();
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* Determines whether two shapes are connected.
|
|
365
|
-
* @param {Shape} Shape.
|
|
366
|
-
* @param {Shape} Shape.
|
|
367
|
-
* @returns {boolean} true if the two shapes are connected.
|
|
368
|
-
*/
|
|
369
|
-
connected(source, target) {
|
|
370
|
-
return this.diagramWidget?.connected(source, target);
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Adds connection to the `Diagram`.
|
|
374
|
-
* @param {Connection} Connection.
|
|
375
|
-
* @param {boolean} Boolean.
|
|
376
|
-
* @returns {Connection} The newly created connection.
|
|
377
|
-
*/
|
|
378
|
-
addConnection(connection, undoable) {
|
|
379
|
-
const newConnection = this.diagramWidget?.addConnection(connection, undoable);
|
|
380
|
-
return newConnection;
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Adds shape to the `Diagram`.
|
|
384
|
-
* @param {ShapeOptions | Shape | Point} If you pass a `Point`, a new Shape with default options will be created and positioned at that point.
|
|
385
|
-
* @param {boolean} Boolean indicating if the action should be undoable.
|
|
386
|
-
* @returns {Shape} The newly created shape.
|
|
387
|
-
*/
|
|
388
|
-
addShape(item, undoable) {
|
|
389
|
-
const newShape = this.diagramWidget?.addShape(item, undoable);
|
|
390
|
-
return newShape;
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Removes shape(s) and/or connection(s) from the `Diagram`.
|
|
394
|
-
* @param {Shape | Connection | (Shape | Connection)[]} Shape, Connection or an Array of Shapes and/or Connections.
|
|
395
|
-
* @param {Boolean} Boolean indicating if the action should be undoable.
|
|
396
|
-
*/
|
|
397
|
-
remove(items, undoable) {
|
|
398
|
-
this.diagramWidget?.remove(items, undoable);
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* Connects two items in the `Diagram`.
|
|
402
|
-
* @param {Shape | Connector | Point} Shape, Shape's Connector or Point.
|
|
403
|
-
* @param {Shape | Connector | Point} Shape, Shape's Connector or Point.
|
|
404
|
-
* @param {ConnectionOptions} Connection options.
|
|
405
|
-
* @returns {Connection} The created connection.
|
|
406
|
-
*/
|
|
407
|
-
connect(source, target, options) {
|
|
408
|
-
return this.diagramWidget?.connect(source, target, options);
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* Executes the next undoable action on top of the undo stack if any.
|
|
412
|
-
*/
|
|
413
|
-
undo() {
|
|
414
|
-
this.diagramWidget?.undo();
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Executes the previous undoable action on top of the redo stack if any.
|
|
418
|
-
*/
|
|
419
|
-
redo() {
|
|
420
|
-
this.diagramWidget?.redo();
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* Selects items on the basis of the given input.
|
|
424
|
-
* @param {Shape | Connection | (Shape | Connection)[]} Shape, Connection or an Array of Shapes and/or Connections.
|
|
425
|
-
* @param Selection options.
|
|
426
|
-
* @returns {(Shape | Connection)[]} Array of selected items.
|
|
427
|
-
*/
|
|
428
|
-
select(items, options) {
|
|
429
|
-
return this.diagramWidget?.select(items, options);
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* Selects all items in the `Diagram`.
|
|
433
|
-
*/
|
|
434
|
-
selectAll() {
|
|
435
|
-
this.diagramWidget?.selectAll();
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Selects items in the specified area.
|
|
439
|
-
* @param {Rect} rect Rectangle area to select.
|
|
440
|
-
*/
|
|
441
|
-
selectArea(rect) {
|
|
442
|
-
this.diagramWidget?.selectArea(rect);
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* Deselects the specified items or all items if no item is specified.
|
|
446
|
-
* @param {Shape | Connection | (Shape | Connection)[]} Shape, Connection or an Array of Shapes and/or Connections.
|
|
447
|
-
*/
|
|
448
|
-
deselect(items) {
|
|
449
|
-
this.diagramWidget?.deselect(items);
|
|
450
|
-
}
|
|
451
|
-
/**
|
|
452
|
-
* Brings to front the passed items.
|
|
453
|
-
* @param {Shape | Connection | (Shape | Connection)[]} Shape, Connection or an Array of Shapes and/or Connections.
|
|
454
|
-
* @param {boolean} By default the action is undoable.
|
|
455
|
-
*/
|
|
456
|
-
bringToFront(items, undoable) {
|
|
457
|
-
this.diagramWidget?.toFront(items, undoable);
|
|
458
|
-
}
|
|
459
|
-
/**
|
|
460
|
-
* Sends to back the passed items.
|
|
461
|
-
* @param {Shape | Connection | (Shape | Connection)[]} Shape, Connection or an Array of Shapes and/or Connections.
|
|
462
|
-
* @param {boolean} By default the action is undoable.
|
|
463
|
-
*/
|
|
464
|
-
bringToBack(items, undoable) {
|
|
465
|
-
this.diagramWidget?.toBack(items, undoable);
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Bring into view the passed item(s) or rectangle.
|
|
469
|
-
* @param {Shape | Connection | (Shape | Connection)[]} Shape, Connection or an Array of Shapes and/or Connections.
|
|
470
|
-
* @param {DiagramAlignOptions} controls the position of the calculated rectangle relative to the viewport.
|
|
471
|
-
* "Center middle" will position the items in the center. animate - controls if the pan should be animated.
|
|
472
|
-
*/
|
|
473
|
-
bringIntoView(item, options) {
|
|
474
|
-
this.diagramWidget?.bringIntoView(item, options);
|
|
475
|
-
}
|
|
476
|
-
/**
|
|
477
|
-
* Aligns shapes in the specified direction.
|
|
478
|
-
* @param {Direction} Direction to align shapes.
|
|
479
|
-
*/
|
|
480
|
-
alignShapes(direction) {
|
|
481
|
-
this.diagramWidget?.alignShapes(direction);
|
|
482
|
-
}
|
|
483
|
-
/**
|
|
484
|
-
* @hidden
|
|
485
|
-
* Pans the Diagram.
|
|
486
|
-
* @param {Point} Pan coordinates.
|
|
487
|
-
* @param {boolean} Whether to animate the pan.
|
|
488
|
-
* @returns {Point} Current pan position.
|
|
489
|
-
*/
|
|
490
|
-
pan(pan, animate) {
|
|
491
|
-
return this.diagramWidget?.pan(pan, animate);
|
|
492
|
-
}
|
|
493
|
-
/**
|
|
494
|
-
* Gets the current `Diagram` viewport rectangle.
|
|
495
|
-
* @returns {Rect} Viewport rectangle.
|
|
496
|
-
*/
|
|
497
|
-
viewport() {
|
|
498
|
-
return this.diagramWidget?.viewport();
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* Copies selected items to clipboard.
|
|
502
|
-
*/
|
|
503
|
-
copy() {
|
|
504
|
-
this.diagramWidget?.copy();
|
|
505
|
-
}
|
|
506
|
-
/**
|
|
507
|
-
* @hidden
|
|
508
|
-
* Cuts selected items to clipboard.
|
|
509
|
-
*/
|
|
510
|
-
cut() {
|
|
511
|
-
this.diagramWidget?.cut();
|
|
512
|
-
}
|
|
513
|
-
/**
|
|
514
|
-
* Pastes items from clipboard.
|
|
515
|
-
*/
|
|
516
|
-
paste() {
|
|
517
|
-
this.diagramWidget?.paste();
|
|
518
|
-
}
|
|
519
|
-
/**
|
|
520
|
-
* Gets the bounding rectangle of the given items.
|
|
521
|
-
* @param {Shape | Connection | (Shape | Connection)[]} Shape, Connection or an Array of Shapes and/or Connections.
|
|
522
|
-
* @param {boolean} Pass 'true' if you need to get the bounding box of the shapes without their rotation offset.
|
|
523
|
-
* @returns {Rect} Bounding rectangle.
|
|
524
|
-
*/
|
|
525
|
-
boundingBox(items, origin) {
|
|
526
|
-
return this.diagramWidget?.boundingBox(items, origin);
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* Converts document coordinates to view coordinates.
|
|
530
|
-
* @param {Point} Point in document coordinates.
|
|
531
|
-
* @returns {Point} Point in view coordinates.
|
|
532
|
-
*/
|
|
533
|
-
documentToView(point) {
|
|
534
|
-
return this.diagramWidget?.documentToView(point);
|
|
535
|
-
}
|
|
536
|
-
/**
|
|
537
|
-
* Converts view coordinates to document coordinates.
|
|
538
|
-
* @param {Point} Point in view coordinates.
|
|
539
|
-
* @returns {Point} Point in document coordinates.
|
|
540
|
-
*/
|
|
541
|
-
viewToDocument(point) {
|
|
542
|
-
return this.diagramWidget?.viewToDocument(point);
|
|
543
|
-
}
|
|
544
|
-
/**
|
|
545
|
-
* Converts view coordinates to model coordinates.
|
|
546
|
-
* @param {Point} Point in view coordinates.
|
|
547
|
-
* @returns {Point} Point in model coordinates.
|
|
548
|
-
*/
|
|
549
|
-
viewToModel(point) {
|
|
550
|
-
return this.diagramWidget?.viewToModel(point);
|
|
551
|
-
}
|
|
552
|
-
/**
|
|
553
|
-
* Converts model coordinates to view coordinates.
|
|
554
|
-
* @param {Point} Point in model coordinates.
|
|
555
|
-
* @returns {Point} Point in view coordinates.
|
|
556
|
-
*/
|
|
557
|
-
modelToView(point) {
|
|
558
|
-
return this.diagramWidget?.modelToView(point);
|
|
559
|
-
}
|
|
560
|
-
/**
|
|
561
|
-
* Converts model coordinates to layer coordinates.
|
|
562
|
-
* @param {Point} Point in model coordinates.
|
|
563
|
-
* @returns {Point} Point in layer coordinates.
|
|
564
|
-
*/
|
|
565
|
-
modelToLayer(point) {
|
|
566
|
-
return this.diagramWidget?.modelToLayer(point);
|
|
567
|
-
}
|
|
568
|
-
/**
|
|
569
|
-
* Converts layer coordinates to model coordinates.
|
|
570
|
-
* @param {Point} Point in layer coordinates.
|
|
571
|
-
* @returns {Point} Point in model coordinates.
|
|
572
|
-
*/
|
|
573
|
-
layerToModel(point) {
|
|
574
|
-
return this.diagramWidget?.layerToModel(point);
|
|
575
|
-
}
|
|
576
|
-
/**
|
|
577
|
-
* Converts document coordinates to model coordinates.
|
|
578
|
-
* @param {Point} Point in document coordinates.
|
|
579
|
-
* @returns {Point} Point in model coordinates.
|
|
580
|
-
*/
|
|
581
|
-
documentToModel(point) {
|
|
582
|
-
return this.diagramWidget?.documentToModel(point);
|
|
583
|
-
}
|
|
584
|
-
/**
|
|
585
|
-
* Converts model coordinates to document coordinates.
|
|
586
|
-
* @param {Point} Point in model coordinates.
|
|
587
|
-
* @returns {Point} Point in document coordinates.
|
|
588
|
-
*/
|
|
589
|
-
modelToDocument(point) {
|
|
590
|
-
return this.diagramWidget?.modelToDocument(point);
|
|
591
|
-
}
|
|
592
|
-
/**
|
|
593
|
-
* Gets a shape on the basis of its identifier.
|
|
594
|
-
* @param {string} The identifier of a shape.
|
|
595
|
-
* @returns {Shape} The shape with the specified ID.
|
|
596
|
-
*/
|
|
597
|
-
getShapeById(id) {
|
|
598
|
-
return this.diagramWidget?.getShapeById(id);
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* Exports the diagram's DOM visual representation for rendering or export purposes.
|
|
602
|
-
* Creates a clipped group containing the canvas content with proper transformations.
|
|
603
|
-
* @returns {Group} A drawing Group element containing the exported DOM visual
|
|
604
|
-
*/
|
|
605
|
-
exportDOMVisual() {
|
|
606
|
-
return this.diagramWidget?.exportDOMVisual();
|
|
607
|
-
}
|
|
608
|
-
/**
|
|
609
|
-
* Exports the diagram's visual representation with proper scaling based on zoom level.
|
|
610
|
-
* Creates a scaled group containing the main layer content.
|
|
611
|
-
* @returns {Group} A drawing Group element containing the exported visual with inverse zoom scaling
|
|
612
|
-
*/
|
|
613
|
-
exportVisual() {
|
|
614
|
-
return this.diagramWidget?.exportVisual();
|
|
615
|
-
}
|
|
616
|
-
/**
|
|
617
|
-
* Handles the tooltipShow event from the diagram widget.
|
|
618
|
-
*/
|
|
619
|
-
handleTooltipShow(event) {
|
|
620
|
-
this.hideTooltip();
|
|
621
|
-
const dataItem = event.item.dataItem;
|
|
622
|
-
const isShape = event.item.name === "Shape";
|
|
623
|
-
const isConnection = event.item.name === "Connection";
|
|
624
|
-
this.setCustomTemplate(isShape, isConnection);
|
|
625
|
-
const defaultsEnabled = isShape
|
|
626
|
-
? this.options.shapeDefaults?.tooltip?.visible
|
|
627
|
-
: this.options.connectionDefaults?.tooltip?.visible;
|
|
628
|
-
const itemTooltipEnabled = dataItem.tooltip?.visible;
|
|
629
|
-
const optionsArray = isShape ? this.options.shapes : this.options.connections;
|
|
630
|
-
const optionsItem = optionsArray?.find((item) => item.id === event.item.id);
|
|
631
|
-
const hasTooltipText = !!dataItem.tooltipText || !!optionsItem?.tooltipText;
|
|
632
|
-
if (!dataItem.tooltipText && optionsItem?.tooltipText) {
|
|
633
|
-
dataItem.tooltipText = optionsItem.tooltipText;
|
|
634
|
-
}
|
|
635
|
-
const shouldShowTooltip = itemTooltipEnabled !== false && hasTooltipText && (defaultsEnabled || itemTooltipEnabled);
|
|
636
|
-
if (shouldShowTooltip) {
|
|
637
|
-
this.dataItem = dataItem;
|
|
638
|
-
let popupContent = this.defaultTooltipTemplate;
|
|
639
|
-
const showCustomTemplate = Boolean((isShape && this.shapeTooltipTemplate) || (isConnection && this.connectionTooltipTemplate));
|
|
640
|
-
if (showCustomTemplate) {
|
|
641
|
-
popupContent = this.customTooltipTemplate;
|
|
642
|
-
}
|
|
643
|
-
const popupClass = this.popupClass(isShape, dataItem);
|
|
644
|
-
this.showTooltip(event, popupContent, popupClass);
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
showTooltip(event, content, popupClass) {
|
|
648
|
-
this.tooltipPopup = this.popupService.open({
|
|
649
|
-
content: content,
|
|
650
|
-
appendTo: this.viewContainer,
|
|
651
|
-
popupClass,
|
|
652
|
-
animate: false
|
|
653
|
-
});
|
|
654
|
-
const contentElement = this.tooltipPopup.popupElement.querySelector('.k-popup');
|
|
655
|
-
if (content === this.defaultTooltipTemplate) {
|
|
656
|
-
this.renderer.addClass(contentElement, 'k-tooltip');
|
|
657
|
-
}
|
|
658
|
-
const popupElementRect = contentElement.getBoundingClientRect();
|
|
659
|
-
const zoom = event.item.diagram.zoom();
|
|
660
|
-
const pan = event.item.diagram.pan();
|
|
661
|
-
const diagramRect = this.diagramWidget.element.getBoundingClientRect();
|
|
662
|
-
const win = this.diagramWidget.element.ownerDocument.defaultView;
|
|
663
|
-
const lines = this.diagramWidget.connections.map(con => con.allPoints());
|
|
664
|
-
const shapes = this.diagramWidget.shapes.map(shp => shp.bounds());
|
|
665
|
-
const pos = placeTooltip({
|
|
666
|
-
hovered: event.item,
|
|
667
|
-
mouse: event.point,
|
|
668
|
-
shapes: shapes,
|
|
669
|
-
connections: lines,
|
|
670
|
-
diagramRect: diagramRect,
|
|
671
|
-
zoom: zoom,
|
|
672
|
-
pan: pan,
|
|
673
|
-
tooltipSize: { width: popupElementRect.width, height: popupElementRect.height },
|
|
674
|
-
viewportBounds: new DOMRect(0, 0, win.innerWidth, win.innerHeight)
|
|
675
|
-
});
|
|
676
|
-
this.tooltipPopup.popup.instance.offset = { left: pos.left + win.scrollX, top: pos.top + win.scrollY };
|
|
677
|
-
this.tooltipShow.emit({ ...this.dataItem });
|
|
678
|
-
}
|
|
679
|
-
popupClass(isShape, dataItem) {
|
|
680
|
-
const defaultCssClass = isShape
|
|
681
|
-
? this.options.shapeDefaults?.tooltip?.cssClass
|
|
682
|
-
: this.options.connectionDefaults?.tooltip?.cssClass;
|
|
683
|
-
const itemCssClass = dataItem.tooltip?.cssClass;
|
|
684
|
-
const popupClass = defaultCssClass || itemCssClass;
|
|
685
|
-
return popupClass;
|
|
686
|
-
}
|
|
687
|
-
setCustomTemplate(isShape, isConnection) {
|
|
688
|
-
this.customTemplate = null;
|
|
689
|
-
if (isShape && this.shapeTooltipTemplate) {
|
|
690
|
-
this.customTemplate = this.shapeTooltipTemplate.templateRef;
|
|
691
|
-
}
|
|
692
|
-
if (isConnection && this.connectionTooltipTemplate) {
|
|
693
|
-
this.customTemplate = this.connectionTooltipTemplate.templateRef;
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
/**
|
|
697
|
-
* Handles the tooltipHide event from the diagram widget.
|
|
698
|
-
*/
|
|
699
|
-
handleTooltipHide() {
|
|
700
|
-
this.hideTooltip();
|
|
701
|
-
this.tooltipHide.emit({ ...this.dataItem });
|
|
702
|
-
}
|
|
703
|
-
/**
|
|
704
|
-
* Hides the current tooltip and cleans up resources.
|
|
705
|
-
*/
|
|
706
|
-
hideTooltip() {
|
|
707
|
-
if (this.tooltipPopup) {
|
|
708
|
-
this.tooltipPopup.close();
|
|
709
|
-
this.tooltipPopup = undefined;
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
activeEmitter(name) {
|
|
713
|
-
const emitter = this[name];
|
|
714
|
-
if (emitter?.emit && hasObservers(emitter)) {
|
|
715
|
-
return emitter;
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
/**
|
|
719
|
-
* Binds event handlers to the diagram widget.
|
|
720
|
-
*/
|
|
721
|
-
bindDiagramEvents() {
|
|
722
|
-
events.forEach((eventName) => {
|
|
723
|
-
this.diagramWidget.bind(eventName, (e) => {
|
|
724
|
-
if (eventName === 'click') {
|
|
725
|
-
eventName = 'diagramClick';
|
|
726
|
-
}
|
|
727
|
-
if (eventName === 'select') {
|
|
728
|
-
eventName = 'onSelect';
|
|
729
|
-
}
|
|
730
|
-
if (eventName === 'pan') {
|
|
731
|
-
eventName = 'onPan';
|
|
732
|
-
}
|
|
733
|
-
if (eventName === 'itemBoundsChange') {
|
|
734
|
-
eventName = 'shapeBoundsChange';
|
|
735
|
-
}
|
|
736
|
-
if (eventName === 'tooltipShow') {
|
|
737
|
-
this.zone.run(() => {
|
|
738
|
-
this.handleTooltipShow(e);
|
|
739
|
-
});
|
|
740
|
-
return;
|
|
741
|
-
}
|
|
742
|
-
if (eventName === 'tooltipHide') {
|
|
743
|
-
this.zone.run(() => {
|
|
744
|
-
this.handleTooltipHide();
|
|
745
|
-
});
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
const emitter = this.activeEmitter(eventName);
|
|
749
|
-
if (emitter) {
|
|
750
|
-
this.zone.run(() => {
|
|
751
|
-
emitter.emit(e);
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
|
-
});
|
|
755
|
-
});
|
|
756
|
-
}
|
|
757
|
-
/**
|
|
758
|
-
* Converts user data to Diagram model format using field mappings.
|
|
759
|
-
*/
|
|
760
|
-
convertUserData() {
|
|
761
|
-
if (this.shapeModelFields || this.connectionModelFields) {
|
|
762
|
-
const mapping = {
|
|
763
|
-
shapes: {
|
|
764
|
-
source: () => this.shapes || [],
|
|
765
|
-
map: this.createFieldMapping(this.shapeModelFields)
|
|
766
|
-
},
|
|
767
|
-
connections: {
|
|
768
|
-
source: () => this.connections || [],
|
|
769
|
-
map: this.createFieldMapping(this.connectionModelFields)
|
|
770
|
-
}
|
|
771
|
-
};
|
|
772
|
-
const result = convertToDiagramModel({ shapes: this.shapes, connections: this.options.connections }, mapping);
|
|
773
|
-
this.convertedShapes = this.addDataItemProperty(result.shapes, this.shapes);
|
|
774
|
-
this.convertedConnections = this.addDataItemProperty(result.connections, this.connections);
|
|
775
|
-
}
|
|
776
|
-
else {
|
|
777
|
-
this.convertedShapes = this.addDataItemProperty(this.shapes, this.shapes);
|
|
778
|
-
this.convertedConnections = this.addDataItemProperty(this.connections, this.connections);
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
addDataItemProperty(array, sourceArray) {
|
|
782
|
-
if (!array || !Array.isArray(array) || array.length === 0) {
|
|
783
|
-
return [];
|
|
784
|
-
}
|
|
785
|
-
if (!sourceArray || !Array.isArray(sourceArray)) {
|
|
786
|
-
return array;
|
|
787
|
-
}
|
|
788
|
-
return array.map((item, index) => ({
|
|
789
|
-
...item,
|
|
790
|
-
dataItem: sourceArray[index]
|
|
791
|
-
}));
|
|
792
|
-
}
|
|
793
|
-
/**
|
|
794
|
-
* Creates field mapping configuration from model fields.
|
|
795
|
-
*/
|
|
796
|
-
createFieldMapping(modelFields) {
|
|
797
|
-
if (!modelFields) {
|
|
798
|
-
return {};
|
|
799
|
-
}
|
|
800
|
-
const mapping = {};
|
|
801
|
-
Object.keys(modelFields).forEach(key => {
|
|
802
|
-
const fieldName = modelFields[key];
|
|
803
|
-
if (fieldName) {
|
|
804
|
-
mapping[key] = fieldName;
|
|
805
|
-
}
|
|
806
|
-
});
|
|
807
|
-
return mapping;
|
|
808
|
-
}
|
|
809
|
-
init() {
|
|
810
|
-
if (!isDocumentAvailable()) {
|
|
811
|
-
return;
|
|
812
|
-
}
|
|
813
|
-
this.zone.runOutsideAngular(() => {
|
|
814
|
-
const theme = loadTheme(this.wrapperElement.nativeElement);
|
|
815
|
-
this.diagramWidget = new Diagram(this.wrapperElement.nativeElement, this.options, theme);
|
|
816
|
-
this.diagramWidget._createOptionElements();
|
|
817
|
-
this.diagramWidget.zoom(this.diagramWidget.options.zoom);
|
|
818
|
-
this.diagramWidget.canvas.draw();
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
updateOptions(prop) {
|
|
822
|
-
this.options[prop] = this[prop];
|
|
823
|
-
this.diagramWidget?.setOptions(this.options);
|
|
824
|
-
}
|
|
825
|
-
loadOptions(options) {
|
|
826
|
-
this.diagramWidget?.load(options);
|
|
827
|
-
this.diagramWidget?.layout(options);
|
|
828
|
-
}
|
|
829
|
-
getNormalizedNavigationOptions() {
|
|
830
|
-
return {
|
|
831
|
-
disabled: !this._navigable.enabled,
|
|
832
|
-
smallStep: this._navigable.smallStep,
|
|
833
|
-
largeStep: this._navigable.largeStep
|
|
834
|
-
};
|
|
835
|
-
}
|
|
836
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DiagramComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i1.PopupService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
837
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DiagramComponent, isStandalone: true, selector: "kendo-diagram", inputs: { connectionDefaults: "connectionDefaults", connections: "connections", connectionModelFields: "connectionModelFields", editable: "editable", layout: "layout", pannable: "pannable", selectable: "selectable", shapeDefaults: "shapeDefaults", shapes: "shapes", shapeModelFields: "shapeModelFields", zoom: "zoom", zoomMax: "zoomMax", zoomMin: "zoomMin", zoomRate: "zoomRate", navigable: "navigable" }, outputs: { change: "change", diagramClick: "diagramClick", drag: "drag", dragEnd: "dragEnd", dragStart: "dragStart", shapeBoundsChange: "shapeBoundsChange", mouseEnter: "mouseEnter", mouseLeave: "mouseLeave", onPan: "pan", onSelect: "select", zoomEnd: "zoomEnd", zoomStart: "zoomStart", tooltipShow: "tooltipShow", tooltipHide: "tooltipHide" }, host: { properties: { "class.k-diagram": "this.diagramClass" } }, providers: [PopupService], queries: [{ propertyName: "shapeTooltipTemplate", first: true, predicate: ShapeTooltipTemplateDirective, descendants: true }, { propertyName: "connectionTooltipTemplate", first: true, predicate: ConnectionTooltipTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "defaultTooltipTemplate", first: true, predicate: ["defaultTemplate"], descendants: true }, { propertyName: "customTooltipTemplate", first: true, predicate: ["customTooltipTemplate"], descendants: true }], exportAs: ["kendoDiagram"], usesOnChanges: true, ngImport: i0, template: `
|
|
838
|
-
@if (showLicenseWatermark) {
|
|
839
|
-
<div kendoWatermarkOverlay [licenseMessage]="licenseMessage"></div>
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
<ng-template #customTooltipTemplate>
|
|
843
|
-
<ng-container [ngTemplateOutlet]="customTemplate" [ngTemplateOutletContext]="{ $implicit: dataItem }"></ng-container>
|
|
844
|
-
</ng-template>
|
|
845
|
-
|
|
846
|
-
<ng-template #defaultTemplate>
|
|
847
|
-
{{dataItem?.tooltipText}}
|
|
848
|
-
</ng-template>
|
|
849
|
-
`, isInline: true, dependencies: [{ kind: "component", type: WatermarkOverlayComponent, selector: "div[kendoWatermarkOverlay]", inputs: ["licenseMessage"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
850
|
-
}
|
|
851
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DiagramComponent, decorators: [{
|
|
852
|
-
type: Component,
|
|
853
|
-
args: [{
|
|
854
|
-
standalone: true,
|
|
855
|
-
exportAs: 'kendoDiagram',
|
|
856
|
-
selector: 'kendo-diagram',
|
|
857
|
-
template: `
|
|
858
|
-
@if (showLicenseWatermark) {
|
|
859
|
-
<div kendoWatermarkOverlay [licenseMessage]="licenseMessage"></div>
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
<ng-template #customTooltipTemplate>
|
|
863
|
-
<ng-container [ngTemplateOutlet]="customTemplate" [ngTemplateOutletContext]="{ $implicit: dataItem }"></ng-container>
|
|
864
|
-
</ng-template>
|
|
865
|
-
|
|
866
|
-
<ng-template #defaultTemplate>
|
|
867
|
-
{{dataItem?.tooltipText}}
|
|
868
|
-
</ng-template>
|
|
869
|
-
`,
|
|
870
|
-
imports: [WatermarkOverlayComponent, NgTemplateOutlet],
|
|
871
|
-
providers: [PopupService]
|
|
872
|
-
}]
|
|
873
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i1.PopupService }, { type: i0.ViewContainerRef }], propDecorators: { diagramClass: [{
|
|
874
|
-
type: HostBinding,
|
|
875
|
-
args: ['class.k-diagram']
|
|
876
|
-
}], connectionDefaults: [{
|
|
877
|
-
type: Input
|
|
878
|
-
}], connections: [{
|
|
879
|
-
type: Input
|
|
880
|
-
}], connectionModelFields: [{
|
|
881
|
-
type: Input
|
|
882
|
-
}], editable: [{
|
|
883
|
-
type: Input
|
|
884
|
-
}], layout: [{
|
|
885
|
-
type: Input
|
|
886
|
-
}], pannable: [{
|
|
887
|
-
type: Input
|
|
888
|
-
}], selectable: [{
|
|
889
|
-
type: Input
|
|
890
|
-
}], shapeDefaults: [{
|
|
891
|
-
type: Input
|
|
892
|
-
}], shapes: [{
|
|
893
|
-
type: Input
|
|
894
|
-
}], shapeModelFields: [{
|
|
895
|
-
type: Input
|
|
896
|
-
}], zoom: [{
|
|
897
|
-
type: Input
|
|
898
|
-
}], zoomMax: [{
|
|
899
|
-
type: Input
|
|
900
|
-
}], zoomMin: [{
|
|
901
|
-
type: Input
|
|
902
|
-
}], zoomRate: [{
|
|
903
|
-
type: Input
|
|
904
|
-
}], navigable: [{
|
|
905
|
-
type: Input
|
|
906
|
-
}], change: [{
|
|
907
|
-
type: Output
|
|
908
|
-
}], diagramClick: [{
|
|
909
|
-
type: Output
|
|
910
|
-
}], drag: [{
|
|
911
|
-
type: Output
|
|
912
|
-
}], dragEnd: [{
|
|
913
|
-
type: Output
|
|
914
|
-
}], dragStart: [{
|
|
915
|
-
type: Output
|
|
916
|
-
}], shapeBoundsChange: [{
|
|
917
|
-
type: Output
|
|
918
|
-
}], mouseEnter: [{
|
|
919
|
-
type: Output
|
|
920
|
-
}], mouseLeave: [{
|
|
921
|
-
type: Output
|
|
922
|
-
}], onPan: [{
|
|
923
|
-
type: Output,
|
|
924
|
-
args: ['pan']
|
|
925
|
-
}], onSelect: [{
|
|
926
|
-
type: Output,
|
|
927
|
-
args: ['select']
|
|
928
|
-
}], zoomEnd: [{
|
|
929
|
-
type: Output
|
|
930
|
-
}], zoomStart: [{
|
|
931
|
-
type: Output
|
|
932
|
-
}], tooltipShow: [{
|
|
933
|
-
type: Output
|
|
934
|
-
}], tooltipHide: [{
|
|
935
|
-
type: Output
|
|
936
|
-
}], defaultTooltipTemplate: [{
|
|
937
|
-
type: ViewChild,
|
|
938
|
-
args: ['defaultTemplate']
|
|
939
|
-
}], customTooltipTemplate: [{
|
|
940
|
-
type: ViewChild,
|
|
941
|
-
args: ['customTooltipTemplate']
|
|
942
|
-
}], shapeTooltipTemplate: [{
|
|
943
|
-
type: ContentChild,
|
|
944
|
-
args: [ShapeTooltipTemplateDirective]
|
|
945
|
-
}], connectionTooltipTemplate: [{
|
|
946
|
-
type: ContentChild,
|
|
947
|
-
args: [ConnectionTooltipTemplateDirective]
|
|
948
|
-
}] } });
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { NgModule } from '@angular/core';
|
|
6
|
-
import { KENDO_DIAGRAM } from './directives';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
import * as i1 from "./diagram.component";
|
|
9
|
-
import * as i2 from "./shape-tooltip-template.directive";
|
|
10
|
-
import * as i3 from "./connection-tooltip-template.directive";
|
|
11
|
-
/**
|
|
12
|
-
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
|
|
13
|
-
* definition for the Diagram component.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
*
|
|
17
|
-
* ```ts-no-run
|
|
18
|
-
* // Import the Diagram module
|
|
19
|
-
* import { DiagramModule } from '@progress/kendo-angular-diagrams';
|
|
20
|
-
*
|
|
21
|
-
* // The browser platform with a compiler
|
|
22
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
23
|
-
*
|
|
24
|
-
* import { NgModule } from '@angular/core';
|
|
25
|
-
*
|
|
26
|
-
* // Import the app component
|
|
27
|
-
* import { AppComponent } from './app.component';
|
|
28
|
-
*
|
|
29
|
-
* // Define the app module
|
|
30
|
-
* _@NgModule({
|
|
31
|
-
* declarations: [AppComponent],
|
|
32
|
-
* imports: [BrowserModule, DiagramModule],
|
|
33
|
-
* bootstrap: [AppComponent]
|
|
34
|
-
* })
|
|
35
|
-
* export class AppModule {}
|
|
36
|
-
*
|
|
37
|
-
* // Compile and launch the module
|
|
38
|
-
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
39
|
-
*
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
export class DiagramModule {
|
|
43
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DiagramModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
44
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: DiagramModule, imports: [i1.DiagramComponent, i2.ShapeTooltipTemplateDirective, i3.ConnectionTooltipTemplateDirective], exports: [i1.DiagramComponent, i2.ShapeTooltipTemplateDirective, i3.ConnectionTooltipTemplateDirective] });
|
|
45
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DiagramModule, imports: [i1.DiagramComponent] });
|
|
46
|
-
}
|
|
47
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DiagramModule, decorators: [{
|
|
48
|
-
type: NgModule,
|
|
49
|
-
args: [{
|
|
50
|
-
imports: [...KENDO_DIAGRAM],
|
|
51
|
-
exports: [...KENDO_DIAGRAM]
|
|
52
|
-
}]
|
|
53
|
-
}] });
|
package/esm2022/directives.mjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { DiagramComponent } from "./diagram.component";
|
|
6
|
-
import { ConnectionTooltipTemplateDirective } from "./connection-tooltip-template.directive";
|
|
7
|
-
import { ShapeTooltipTemplateDirective } from "./shape-tooltip-template.directive";
|
|
8
|
-
/**
|
|
9
|
-
* Represents the utility array that that contains all `Diagram`-related components and directives.
|
|
10
|
-
*
|
|
11
|
-
* Use `KENDO_DIAGRAM` to import all Diagram components and directives at once.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* import { Component } from '@angular/core';
|
|
16
|
-
* import { KENDO_DIAGRAM } from '@progress/kendo-angular-diagrams';
|
|
17
|
-
*
|
|
18
|
-
* @Component({
|
|
19
|
-
* selector: 'my-diagram-app',
|
|
20
|
-
* standalone: true,
|
|
21
|
-
* imports: [KENDO_DIAGRAM],
|
|
22
|
-
* template: `...`
|
|
23
|
-
* })
|
|
24
|
-
* export class DiagramAppComponent {}
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export const KENDO_DIAGRAM = [
|
|
28
|
-
DiagramComponent,
|
|
29
|
-
ShapeTooltipTemplateDirective,
|
|
30
|
-
ConnectionTooltipTemplateDirective
|
|
31
|
-
];
|
package/esm2022/index.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
export { Shape, Connection, Connector, Point, Rect, Circle, Group, FlowchartShapeType, ArrowMarker, CircleMarker, Collate, DataInputOutput, DataStorage, Database, Decision, Delay, DirectAccessStorage, Display, Document, MultipleDocuments, Extract, Image, InternalStorage, Layout, Line, LogicalOr, ManualInputOutput, ManualOperation, Merge, MultiLineTextBlock, OffPageConnector, OnPageConnector, Path, Polyline, PredefinedProcess, Preparation, Process, Rectangle, Sort, SummingJunction, Terminator, TextBlock, MarkerType, convertToDiagramModel } from '@progress/kendo-diagram-common';
|
|
6
|
-
export { DiagramModule } from './diagram.module';
|
|
7
|
-
export { DiagramComponent } from './diagram.component';
|
|
8
|
-
export { ShapeTooltipTemplateDirective } from './shape-tooltip-template.directive';
|
|
9
|
-
export { ConnectionTooltipTemplateDirective } from './connection-tooltip-template.directive';
|
|
10
|
-
export * from './directives';
|
|
11
|
-
export * from './models';
|
package/esm2022/models.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
;
|
|
6
|
-
;
|
|
7
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
export const packageMetadata = {
|
|
9
|
-
name: '@progress/kendo-angular-diagrams',
|
|
10
|
-
productName: 'Kendo UI for Angular',
|
|
11
|
-
productCode: 'KENDOUIANGULAR',
|
|
12
|
-
productCodes: ['KENDOUIANGULAR'],
|
|
13
|
-
publishDate: 1768393344,
|
|
14
|
-
version: '21.4.1',
|
|
15
|
-
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning',
|
|
16
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/**
|
|
6
|
-
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
8
|
-
export * from './index';
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, TemplateRef } from '@angular/core';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Defines a custom template for shape tooltips within the `kendo-diagram` component.
|
|
9
|
-
* Use this directive to customize how tooltips appear when hovering over shapes.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* import { Component } from '@angular/core';
|
|
14
|
-
*
|
|
15
|
-
* _@Component({
|
|
16
|
-
* selector: 'my-app',
|
|
17
|
-
* template: `
|
|
18
|
-
* <kendo-diagram>
|
|
19
|
-
* <ng-template kendoDiagramShapeTooltipTemplate let-dataItem>
|
|
20
|
-
* {{dataItem.tooltipContent}}
|
|
21
|
-
* </ng-template>
|
|
22
|
-
* </kendo-diagram>
|
|
23
|
-
* `
|
|
24
|
-
* })
|
|
25
|
-
* class AppComponent {
|
|
26
|
-
* }
|
|
27
|
-
*
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export class ShapeTooltipTemplateDirective {
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
templateRef;
|
|
35
|
-
constructor(templateRef) {
|
|
36
|
-
this.templateRef = templateRef;
|
|
37
|
-
}
|
|
38
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ShapeTooltipTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
39
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ShapeTooltipTemplateDirective, isStandalone: true, selector: "[kendoDiagramShapeTooltipTemplate]", ngImport: i0 });
|
|
40
|
-
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ShapeTooltipTemplateDirective, decorators: [{
|
|
42
|
-
type: Directive,
|
|
43
|
-
args: [{
|
|
44
|
-
selector: '[kendoDiagramShapeTooltipTemplate]',
|
|
45
|
-
standalone: true,
|
|
46
|
-
}]
|
|
47
|
-
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
package/esm2022/utils.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @hidden */
|
|
6
|
-
export const DEFAULT_NAVIGABLE_OPTIONS = { enabled: true, smallStep: 1, largeStep: 5 };
|