@progress/kendo-angular-diagrams 25.2.1-develop.1 → 25.3.0-develop.10

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.
@@ -2,15 +2,26 @@
2
2
  * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { placeTooltip, events, convertToDiagramModel, loadTheme, Diagram } from '@progress/kendo-diagram-common';
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';
5
+ import { placeTooltip, events, convertToDiagramModel, loadTheme, Diagram, EditingUtils, FlowchartShapeType, resolveFloatingToolbarPlacement, emptyDiagramEditorSnapshot, getContextToolbarAnchors, isDiagramItemVisibleInViewport, DiagramEditorController } from '@progress/kendo-diagram-common';
6
+ export { ArrowMarker, CapType, 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, signal, effect, ContentChild, ViewChild, Output, Input, HostBinding, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
8
+ import { Directive, EventEmitter, signal, effect, ContentChild, ViewChild, Output, Input, HostBinding, ChangeDetectionStrategy, Component, ElementRef, computed, forwardRef, inject, ViewContainerRef, afterNextRender, viewChild, Optional, NgModule } from '@angular/core';
9
9
  import { validatePackage } from '@progress/kendo-licensing';
10
- import { isPresent, getLicenseMessage, shouldShowValidationUI, hasObservers, isDocumentAvailable, WatermarkOverlayComponent } from '@progress/kendo-angular-common';
10
+ import { isPresent, getLicenseMessage, shouldShowValidationUI, hasObservers, isDocumentAvailable, WatermarkOverlayComponent, PrefixTemplateDirective } from '@progress/kendo-angular-common';
11
11
  import * as i1 from '@progress/kendo-angular-popup';
12
- import { PopupService } from '@progress/kendo-angular-popup';
12
+ import { PopupService, POPUP_CONTAINER, PopupComponent } from '@progress/kendo-angular-popup';
13
13
  import { NgTemplateOutlet } from '@angular/common';
14
+ import * as i1$1 from '@progress/kendo-angular-l10n';
15
+ import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
16
+ import { EditorComponent, Schema, Node, Plugin, EditorState, keymap, baseKeymap, TextSelection } from '@progress/kendo-angular-editor';
17
+ import { bold, italic, underline, placeholder, getInlineStyles, hasMark } from '@progress/kendo-editor-common';
18
+ import { ToolBarToolComponent, ToolBarComponent, ToolBarButtonComponent, ToolBarButtonGroupComponent, ToolBarSeparatorComponent } from '@progress/kendo-angular-toolbar';
19
+ import { chevronDownIcon, shapesIcon, undoIcon, redoIcon, pointerIcon, handIcon, freeTextIcon, borderTypeIcon, borderWidthIcon, rowsIcon, borderColorIcon, bringToFrontIcon, bringToBackIcon, rotateLeftIcon, rotateRightIcon, copyIcon, trashIcon, alignLeftIcon, alignTopIcon, boldIcon, foregroundColorIcon, italicIcon, underlineIcon, alignCenterIcon, alignRightIcon, alignMiddleIcon, alignBottomIcon } from '@progress/kendo-svg-icons';
20
+ import { ButtonComponent } from '@progress/kendo-angular-buttons';
21
+ import { SVGIconComponent } from '@progress/kendo-angular-icons';
22
+ import { NumericTextBoxComponent, ColorPickerComponent } from '@progress/kendo-angular-inputs';
23
+ import { Subscription } from 'rxjs';
24
+ import { DropDownListComponent, ItemTemplateDirective } from '@progress/kendo-angular-dropdowns';
14
25
 
15
26
  /**
16
27
  * @hidden
@@ -20,8 +31,8 @@ const packageMetadata = {
20
31
  productName: 'Kendo UI for Angular',
21
32
  productCode: 'KENDOUIANGULAR',
22
33
  productCodes: ['KENDOUIANGULAR'],
23
- publishDate: 1790323747,
24
- version: '25.2.1-develop.1',
34
+ publishDate: 1791359350,
35
+ version: '25.3.0-develop.10',
25
36
  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
37
  };
27
38
 
@@ -59,10 +70,10 @@ class ShapeTooltipTemplateDirective {
59
70
  constructor(templateRef) {
60
71
  this.templateRef = templateRef;
61
72
  }
62
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: ShapeTooltipTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
63
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.30", type: ShapeTooltipTemplateDirective, isStandalone: true, selector: "[kendoDiagramShapeTooltipTemplate]", ngImport: i0 });
73
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: ShapeTooltipTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
74
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.32", type: ShapeTooltipTemplateDirective, isStandalone: true, selector: "[kendoDiagramShapeTooltipTemplate]", ngImport: i0 });
64
75
  }
65
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: ShapeTooltipTemplateDirective, decorators: [{
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: ShapeTooltipTemplateDirective, decorators: [{
66
77
  type: Directive,
67
78
  args: [{
68
79
  selector: '[kendoDiagramShapeTooltipTemplate]',
@@ -101,10 +112,10 @@ class ConnectionTooltipTemplateDirective {
101
112
  constructor(templateRef) {
102
113
  this.templateRef = templateRef;
103
114
  }
104
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: ConnectionTooltipTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
105
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.30", type: ConnectionTooltipTemplateDirective, isStandalone: true, selector: "[kendoDiagramConnectionTooltipTemplate]", ngImport: i0 });
115
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: ConnectionTooltipTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
116
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.32", type: ConnectionTooltipTemplateDirective, isStandalone: true, selector: "[kendoDiagramConnectionTooltipTemplate]", ngImport: i0 });
106
117
  }
107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: ConnectionTooltipTemplateDirective, decorators: [{
118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: ConnectionTooltipTemplateDirective, decorators: [{
108
119
  type: Directive,
109
120
  args: [{
110
121
  selector: '[kendoDiagramConnectionTooltipTemplate]',
@@ -376,6 +387,13 @@ class DiagramComponent {
376
387
  * Represents the Diagram instance, holding the core functionality of the Diagram.
377
388
  */
378
389
  diagramWidget;
390
+ /**
391
+ * @hidden
392
+ * Reactive reference to the underlying `Diagram` instance. Set once the widget is
393
+ * created in `init` so content-projected children (for example, the Diagram editor)
394
+ * can react to its availability instead of racing lifecycle hooks.
395
+ */
396
+ diagramInstance = signal(null, ...(ngDevMode ? [{ debugName: "diagramInstance" }] : []));
379
397
  /**
380
398
  * The currently selected items in the `Diagram`.
381
399
  */
@@ -462,7 +480,11 @@ class DiagramComponent {
462
480
  if (!this.diagramWidget || shapeDefaults === undefined) {
463
481
  return;
464
482
  }
465
- this.options.shapeDefaults = { ...this.options.shapeDefaults, ...shapeDefaults };
483
+ this.options.shapeDefaults = {
484
+ ...this.options.shapeDefaults,
485
+ ...shapeDefaults,
486
+ content: { ...this.options.shapeDefaults?.content, ...shapeDefaults.content }
487
+ };
466
488
  this.loadOptions(this.options);
467
489
  }, ...(ngDevMode ? [{ debugName: "shapeDefaultsEffect" }] : []));
468
490
  scalarOptionsEffect = effect(() => {
@@ -537,7 +559,7 @@ class DiagramComponent {
537
559
  zoomMax: this.zoomMax,
538
560
  zoomMin: this.zoomMin,
539
561
  zoomRate: this.zoomRate,
540
- shapeDefaults: this.shapeDefaults,
562
+ shapeDefaults: this.getShapeDefaults(),
541
563
  connectionDefaults: this.connectionDefaults,
542
564
  layout: this.layout,
543
565
  pannable: this.pannable,
@@ -550,6 +572,7 @@ class DiagramComponent {
550
572
  ngOnDestroy() {
551
573
  this.hideTooltip();
552
574
  this.diagramWidget?.destroy();
575
+ this.diagramInstance.set(null);
553
576
  }
554
577
  /**
555
578
  * Provides the current `Diagram`'s shapes and connections that can be used to create a new `Diagram` when needed.
@@ -558,6 +581,17 @@ class DiagramComponent {
558
581
  getState() {
559
582
  return this.diagramWidget?.save();
560
583
  }
584
+ getShapeDefaults() {
585
+ const shapeDefaults = this.shapeDefaults ?? {};
586
+ return {
587
+ ...shapeDefaults,
588
+ content: {
589
+ ...shapeDefaults.content,
590
+ fontSize: shapeDefaults.content?.fontSize,
591
+ fontFamily: shapeDefaults.content?.fontFamily
592
+ }
593
+ };
594
+ }
561
595
  /**
562
596
  * Focuses the `Diagram`.
563
597
  * @returns {boolean} true if focus was set successfully.
@@ -637,7 +671,8 @@ class DiagramComponent {
637
671
  * @returns {(Shape | Connection)[]} Array of selected items.
638
672
  */
639
673
  select(items, options) {
640
- return this.diagramWidget?.select(items, options);
674
+ this.diagramWidget?.select(items, options);
675
+ return this.diagramWidget?.select() ?? [];
641
676
  }
642
677
  /**
643
678
  * Selects all items in the `Diagram`.
@@ -699,7 +734,8 @@ class DiagramComponent {
699
734
  * @returns {Point} Current pan position.
700
735
  */
701
736
  pan(pan, animate) {
702
- return this.diagramWidget?.pan(pan, animate);
737
+ this.diagramWidget?.pan(pan, animate);
738
+ return this.diagramWidget?.pan();
703
739
  }
704
740
  /**
705
741
  * Gets the current `Diagram` viewport rectangle.
@@ -876,10 +912,11 @@ class DiagramComponent {
876
912
  const popupElementRect = contentElement.getBoundingClientRect();
877
913
  const zoom = event.item.diagram.zoom();
878
914
  const pan = event.item.diagram.pan();
879
- const diagramRect = this.diagramWidget.element.getBoundingClientRect();
880
- const win = this.diagramWidget.element.ownerDocument.defaultView;
881
- const lines = this.diagramWidget.connections.map((con) => con.allPoints());
882
- const shapes = this.diagramWidget.shapes.map((shp) => shp.bounds());
915
+ const diagram = this.diagramWidget;
916
+ const diagramRect = diagram.element.getBoundingClientRect();
917
+ const win = diagram.element.ownerDocument.defaultView;
918
+ const lines = diagram.connections.map((con) => con.allPoints());
919
+ const shapes = diagram.shapes.map((shp) => shp.bounds());
883
920
  const pos = placeTooltip({
884
921
  hovered: event.item,
885
922
  mouse: event.point,
@@ -938,7 +975,7 @@ class DiagramComponent {
938
975
  */
939
976
  bindDiagramEvents() {
940
977
  events.forEach((eventName) => {
941
- this.diagramWidget.bind(eventName, (e) => {
978
+ this.diagramWidget?.bind(eventName, (e) => {
942
979
  if (eventName === 'click') {
943
980
  eventName = 'diagramClick';
944
981
  }
@@ -1030,10 +1067,12 @@ class DiagramComponent {
1030
1067
  }
1031
1068
  this.zone.runOutsideAngular(() => {
1032
1069
  const theme = loadTheme(this.wrapperElement.nativeElement);
1033
- this.diagramWidget = new Diagram(this.wrapperElement.nativeElement, this.options, theme);
1034
- this.diagramWidget._createOptionElements();
1035
- this.diagramWidget.zoom(this.diagramWidget.options.zoom);
1036
- this.diagramWidget.canvas.draw();
1070
+ const diagram = new Diagram(this.wrapperElement.nativeElement, this.options, theme);
1071
+ diagram._createOptionElements();
1072
+ diagram.zoom(diagram.options.zoom);
1073
+ diagram.canvas.draw();
1074
+ this.diagramWidget = diagram;
1075
+ this.diagramInstance.set(this.diagramWidget);
1037
1076
  });
1038
1077
  }
1039
1078
  updateOptions(prop) {
@@ -1052,8 +1091,8 @@ class DiagramComponent {
1052
1091
  largeStep: nav.largeStep,
1053
1092
  };
1054
1093
  }
1055
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: DiagramComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i1.PopupService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
1056
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.30", 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"], ngImport: i0, template: `
1094
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i1.PopupService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
1095
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.32", 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"], ngImport: i0, template: `
1057
1096
  @if (showLicenseWatermark) {
1058
1097
  <div kendoWatermarkOverlay [licenseMessage]="licenseMessage"></div>
1059
1098
  }
@@ -1065,9 +1104,11 @@ class DiagramComponent {
1065
1104
  <ng-template #defaultTemplate>
1066
1105
  {{dataItem?.tooltipText}}
1067
1106
  </ng-template>
1107
+
1108
+ <ng-content></ng-content>
1068
1109
  `, isInline: true, dependencies: [{ kind: "component", type: WatermarkOverlayComponent, selector: "div[kendoWatermarkOverlay], kendo-watermark-overlay", inputs: ["licenseMessage"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1069
1110
  }
1070
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: DiagramComponent, decorators: [{
1111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramComponent, decorators: [{
1071
1112
  type: Component,
1072
1113
  args: [{
1073
1114
  standalone: true,
@@ -1085,6 +1126,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
1085
1126
  <ng-template #defaultTemplate>
1086
1127
  {{dataItem?.tooltipText}}
1087
1128
  </ng-template>
1129
+
1130
+ <ng-content></ng-content>
1088
1131
  `,
1089
1132
  imports: [WatermarkOverlayComponent, NgTemplateOutlet],
1090
1133
  providers: [PopupService],
@@ -1167,6 +1210,4147 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
1167
1210
  args: [ConnectionTooltipTemplateDirective]
1168
1211
  }] } });
1169
1212
 
1213
+ let nextIconsDropdownOverlayId = 0;
1214
+ const popupBodyFactory = () => {
1215
+ if (isDocumentAvailable()) {
1216
+ return new ElementRef(document.body);
1217
+ }
1218
+ };
1219
+ /**
1220
+ * @hidden
1221
+ * Renders a button that opens a popup with a grid of icon buttons. Used by the shape type and
1222
+ * border style tools of the shape and connection toolbars.
1223
+ */
1224
+ class IconsDropdownComponent {
1225
+ popupService;
1226
+ controller = null;
1227
+ value = null;
1228
+ active;
1229
+ buttonTitle = '';
1230
+ buttonIcon;
1231
+ data = [];
1232
+ columns = 4;
1233
+ popupClass;
1234
+ overlayOwner = 'shape-toolbar';
1235
+ valueSelect = new EventEmitter();
1236
+ escape = new EventEmitter();
1237
+ anchor;
1238
+ popupContent;
1239
+ chevronDownIcon = chevronDownIcon;
1240
+ open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
1241
+ containerStyle = computed(() => this.columns === 4 ? '' : `grid-template-columns: repeat(${this.columns}, max-content);`, ...(ngDevMode ? [{ debugName: "containerStyle" }] : []));
1242
+ overlayId = `icons-dropdown-${nextIconsDropdownOverlayId++}`;
1243
+ surfaceCleanup = null;
1244
+ returnFocus = false;
1245
+ popupRef = null;
1246
+ constructor(popupService) {
1247
+ this.popupService = popupService;
1248
+ }
1249
+ ngOnDestroy() {
1250
+ this.returnFocus = false;
1251
+ this.open.set(false);
1252
+ this.closePopup();
1253
+ this.surfaceCleanup?.();
1254
+ this.surfaceCleanup = null;
1255
+ this.controller?.closeOverlay(this.overlayId);
1256
+ }
1257
+ toggle() {
1258
+ this.setOpen(!this.open());
1259
+ }
1260
+ onOpen() {
1261
+ const popupElement = this.popupRef?.popup.instance.contentContainer?.nativeElement;
1262
+ if (!popupElement) {
1263
+ return;
1264
+ }
1265
+ this.surfaceCleanup?.();
1266
+ this.surfaceCleanup = this.controller?.registerSurface(popupElement) ?? null;
1267
+ const container = popupElement.querySelector('.k-diagram-shapes-container');
1268
+ const selectedIndex = this.data.findIndex((item) => item.value === this.value);
1269
+ const optionIndex = selectedIndex >= 0 ? selectedIndex : 0;
1270
+ container?.querySelectorAll('button')[optionIndex]?.focus();
1271
+ }
1272
+ onClose() {
1273
+ this.popupRef = null;
1274
+ this.surfaceCleanup?.();
1275
+ this.surfaceCleanup = null;
1276
+ if (this.open()) {
1277
+ this.open.set(false);
1278
+ this.controller?.closeOverlay(this.overlayId);
1279
+ }
1280
+ if (this.returnFocus) {
1281
+ this.returnFocus = false;
1282
+ this.anchor?.nativeElement.focus();
1283
+ }
1284
+ }
1285
+ select(value) {
1286
+ this.returnFocus = true;
1287
+ this.setOpen(false);
1288
+ this.valueSelect.emit(value);
1289
+ }
1290
+ onKeyDown(event) {
1291
+ if (event.key === 'Escape') {
1292
+ event.preventDefault();
1293
+ this.returnFocus = true;
1294
+ this.setOpen(false);
1295
+ this.escape.emit();
1296
+ return;
1297
+ }
1298
+ const options = Array.from(event.currentTarget.querySelectorAll('button'));
1299
+ const currentIndex = options.indexOf(event.target);
1300
+ if (currentIndex < 0) {
1301
+ return;
1302
+ }
1303
+ const rowStart = Math.floor(currentIndex / this.columns) * this.columns;
1304
+ const column = currentIndex - rowStart;
1305
+ const lastRowStart = Math.floor((options.length - 1) / this.columns) * this.columns;
1306
+ let nextIndex;
1307
+ switch (event.key) {
1308
+ case 'ArrowLeft':
1309
+ nextIndex = currentIndex === 0 ? options.length - 1 : currentIndex - 1;
1310
+ break;
1311
+ case 'ArrowRight':
1312
+ nextIndex = currentIndex === options.length - 1 ? 0 : currentIndex + 1;
1313
+ break;
1314
+ case 'ArrowUp':
1315
+ nextIndex = currentIndex - this.columns;
1316
+ if (nextIndex < 0) {
1317
+ nextIndex = Math.min(lastRowStart + column, options.length - 1);
1318
+ }
1319
+ break;
1320
+ case 'ArrowDown':
1321
+ nextIndex = currentIndex + this.columns;
1322
+ if (nextIndex >= options.length) {
1323
+ nextIndex = column;
1324
+ }
1325
+ break;
1326
+ default:
1327
+ return;
1328
+ }
1329
+ event.preventDefault();
1330
+ event.stopPropagation();
1331
+ options[nextIndex].focus();
1332
+ }
1333
+ onBlur(event) {
1334
+ const nextTarget = event.relatedTarget;
1335
+ if (!nextTarget || !event.currentTarget.contains(nextTarget)) {
1336
+ this.setOpen(false);
1337
+ }
1338
+ }
1339
+ setOpen(next) {
1340
+ if (next === this.open()) {
1341
+ return;
1342
+ }
1343
+ this.open.set(next);
1344
+ if (next) {
1345
+ this.controller?.openOverlay(this.overlayId, this.overlayOwner);
1346
+ this.openPopup();
1347
+ }
1348
+ else {
1349
+ this.controller?.closeOverlay(this.overlayId);
1350
+ this.closePopup();
1351
+ }
1352
+ }
1353
+ openPopup() {
1354
+ this.popupRef = this.popupService.open({
1355
+ anchor: this.anchor,
1356
+ content: this.popupContent,
1357
+ popupClass: this.popupClass,
1358
+ animate: false
1359
+ });
1360
+ this.popupRef.popupOpen.subscribe(() => this.onOpen());
1361
+ this.popupRef.popupClose.subscribe(() => this.onClose());
1362
+ }
1363
+ closePopup() {
1364
+ const popupRef = this.popupRef;
1365
+ this.popupRef = null;
1366
+ popupRef?.close();
1367
+ }
1368
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: IconsDropdownComponent, deps: [{ token: i1.PopupService }], target: i0.ɵɵFactoryTarget.Component });
1369
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.32", type: IconsDropdownComponent, isStandalone: true, selector: "kendo-diagram-icons-dropdown", inputs: { controller: "controller", value: "value", active: "active", buttonTitle: "buttonTitle", buttonIcon: "buttonIcon", data: "data", columns: "columns", popupClass: "popupClass", overlayOwner: "overlayOwner" }, outputs: { valueSelect: "valueSelect", escape: "escape" }, providers: [
1370
+ PopupService,
1371
+ {
1372
+ provide: POPUP_CONTAINER,
1373
+ useFactory: popupBodyFactory
1374
+ }
1375
+ ], viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true, read: ElementRef }, { propertyName: "popupContent", first: true, predicate: ["popupContent"], descendants: true, static: true }], ngImport: i0, template: `
1376
+ <button
1377
+ #anchor
1378
+ kendoButton
1379
+ type="button"
1380
+ fillMode="flat"
1381
+ [svgIcon]="buttonIcon"
1382
+ [toggleable]="active !== undefined"
1383
+ [selected]="active === true"
1384
+ [title]="buttonTitle"
1385
+ [attr.aria-label]="buttonTitle"
1386
+ (click)="toggle()"
1387
+ >
1388
+ <kendo-svgicon [icon]="chevronDownIcon"></kendo-svgicon>
1389
+ </button>
1390
+ <ng-template #popupContent>
1391
+ <div
1392
+ class="k-diagram-shapes-container"
1393
+ [style]="containerStyle()"
1394
+ (keydown)="onKeyDown($event)"
1395
+ (focusout)="onBlur($event)"
1396
+ >
1397
+ @for (item of data; track item.value) {
1398
+ <button
1399
+ kendoButton
1400
+ type="button"
1401
+ fillMode="flat"
1402
+ size="large"
1403
+ [svgIcon]="item.icon"
1404
+ [toggleable]="true"
1405
+ [selected]="value === item.value"
1406
+ [title]="item.label"
1407
+ [attr.aria-label]="item.label"
1408
+ (mousedown)="$event.preventDefault()"
1409
+ (click)="select(item.value)"
1410
+ ></button>
1411
+ }
1412
+ </div>
1413
+ </ng-template>
1414
+ `, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconPosition", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "component", type: SVGIconComponent, selector: "kendo-svg-icon, kendo-svgicon", inputs: ["icon", "variant"], exportAs: ["kendoSVGIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1415
+ }
1416
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: IconsDropdownComponent, decorators: [{
1417
+ type: Component,
1418
+ args: [{
1419
+ selector: 'kendo-diagram-icons-dropdown',
1420
+ standalone: true,
1421
+ changeDetection: ChangeDetectionStrategy.OnPush,
1422
+ providers: [
1423
+ PopupService,
1424
+ {
1425
+ provide: POPUP_CONTAINER,
1426
+ useFactory: popupBodyFactory
1427
+ }
1428
+ ],
1429
+ imports: [ButtonComponent, SVGIconComponent],
1430
+ template: `
1431
+ <button
1432
+ #anchor
1433
+ kendoButton
1434
+ type="button"
1435
+ fillMode="flat"
1436
+ [svgIcon]="buttonIcon"
1437
+ [toggleable]="active !== undefined"
1438
+ [selected]="active === true"
1439
+ [title]="buttonTitle"
1440
+ [attr.aria-label]="buttonTitle"
1441
+ (click)="toggle()"
1442
+ >
1443
+ <kendo-svgicon [icon]="chevronDownIcon"></kendo-svgicon>
1444
+ </button>
1445
+ <ng-template #popupContent>
1446
+ <div
1447
+ class="k-diagram-shapes-container"
1448
+ [style]="containerStyle()"
1449
+ (keydown)="onKeyDown($event)"
1450
+ (focusout)="onBlur($event)"
1451
+ >
1452
+ @for (item of data; track item.value) {
1453
+ <button
1454
+ kendoButton
1455
+ type="button"
1456
+ fillMode="flat"
1457
+ size="large"
1458
+ [svgIcon]="item.icon"
1459
+ [toggleable]="true"
1460
+ [selected]="value === item.value"
1461
+ [title]="item.label"
1462
+ [attr.aria-label]="item.label"
1463
+ (mousedown)="$event.preventDefault()"
1464
+ (click)="select(item.value)"
1465
+ ></button>
1466
+ }
1467
+ </div>
1468
+ </ng-template>
1469
+ `
1470
+ }]
1471
+ }], ctorParameters: () => [{ type: i1.PopupService }], propDecorators: { controller: [{
1472
+ type: Input
1473
+ }], value: [{
1474
+ type: Input
1475
+ }], active: [{
1476
+ type: Input
1477
+ }], buttonTitle: [{
1478
+ type: Input
1479
+ }], buttonIcon: [{
1480
+ type: Input
1481
+ }], data: [{
1482
+ type: Input
1483
+ }], columns: [{
1484
+ type: Input
1485
+ }], popupClass: [{
1486
+ type: Input
1487
+ }], overlayOwner: [{
1488
+ type: Input
1489
+ }], valueSelect: [{
1490
+ type: Output
1491
+ }], escape: [{
1492
+ type: Output
1493
+ }], anchor: [{
1494
+ type: ViewChild,
1495
+ args: ['anchor', { read: ElementRef }]
1496
+ }], popupContent: [{
1497
+ type: ViewChild,
1498
+ args: ['popupContent', { static: true }]
1499
+ }] } });
1500
+
1501
+ /**
1502
+ * The default content style for shapes and connections in the diagram for text editing.
1503
+ */
1504
+ const diagramEditingContentDefaults = {
1505
+ fontSize: 16,
1506
+ fontFamily: EditingUtils.Data.fontNames[0].value
1507
+ };
1508
+ /**
1509
+ * @hidden
1510
+ */
1511
+ const mainToolbarPopupClass = 'k-diagram-main-toolbar-popup';
1512
+ /**
1513
+ * @hidden
1514
+ */
1515
+ const dropdownPopupClass = 'k-diagram-context-toolbar-popup';
1516
+ /**
1517
+ * @hidden
1518
+ */
1519
+ const toolbarPopupWrapClass = 'k-diagram-context-toolbar-container';
1520
+ /**
1521
+ * The default set of tools for the main toolbar.
1522
+ * @hidden
1523
+ */
1524
+ const defaultMainToolbarTools = [
1525
+ 'undo',
1526
+ 'redo',
1527
+ 'separator',
1528
+ 'select',
1529
+ 'pan',
1530
+ 'separator',
1531
+ 'text',
1532
+ 'separator',
1533
+ 'shape'
1534
+ ];
1535
+ const defaultConnectionToolbarTools = [
1536
+ 'color',
1537
+ 'separator',
1538
+ 'width',
1539
+ 'separator',
1540
+ 'style',
1541
+ 'separator',
1542
+ 'text',
1543
+ 'separator',
1544
+ 'startCap',
1545
+ 'separator',
1546
+ 'type',
1547
+ 'separator',
1548
+ 'endCap',
1549
+ 'separator',
1550
+ 'delete'
1551
+ ];
1552
+ /**
1553
+ * @hidden
1554
+ * Maps a flowchart shape type to the localization message key of its label.
1555
+ */
1556
+ const shapeMessageKeyMap = {
1557
+ [FlowchartShapeType.Collate]: 'shapeCollateLabel',
1558
+ [FlowchartShapeType.OnPageConnector]: 'shapeConnectorLabel',
1559
+ [FlowchartShapeType.DataStorage]: 'shapeDataStorageLabel',
1560
+ [FlowchartShapeType.Database]: 'shapeDatabaseLabel',
1561
+ [FlowchartShapeType.Decision]: 'shapeDecisionLabel',
1562
+ [FlowchartShapeType.Delay]: 'shapeDelayLabel',
1563
+ [FlowchartShapeType.DirectAccessStorage]: 'shapeDirectAccessStorageLabel',
1564
+ [FlowchartShapeType.Display]: 'shapeDisplayLabel',
1565
+ [FlowchartShapeType.Document]: 'shapeDocumentLabel',
1566
+ [FlowchartShapeType.Extract]: 'shapeExtractLabel',
1567
+ [FlowchartShapeType.DataInputOutput]: 'shapeInputOutputLabel',
1568
+ [FlowchartShapeType.InternalStorage]: 'shapeInternalStorageLabel',
1569
+ [FlowchartShapeType.LogicalOr]: 'shapeLogicalOrLabel',
1570
+ [FlowchartShapeType.ManualInputOutput]: 'shapeManualInputOutputLabel',
1571
+ [FlowchartShapeType.ManualOperation]: 'shapeManualOperationLabel',
1572
+ [FlowchartShapeType.Merge]: 'shapeMergeLabel',
1573
+ [FlowchartShapeType.MultipleDocuments]: 'shapeMultipleDocumentsLabel',
1574
+ [FlowchartShapeType.OffPageConnector]: 'shapeOffPageConnectorLabel',
1575
+ [FlowchartShapeType.PredefinedProcess]: 'shapePredefinedProcessLabel',
1576
+ [FlowchartShapeType.Preparation]: 'shapePreparationLabel',
1577
+ [FlowchartShapeType.Process]: 'shapeProcessLabel',
1578
+ [FlowchartShapeType.Sort]: 'shapeSortLabel',
1579
+ [FlowchartShapeType.SummingJunction]: 'shapeSummingJunctionLabel',
1580
+ [FlowchartShapeType.Terminator]: 'shapeTerminatorLabel'
1581
+ };
1582
+ /**
1583
+ * @hidden
1584
+ * Maps a border dash type to the localization message key of its label.
1585
+ */
1586
+ const borderStyleMessageKeyMap = {
1587
+ solid: 'borderStyleSolidLabel',
1588
+ dot: 'borderStyleDottedLabel',
1589
+ dash: 'borderStyleDashedLabel',
1590
+ dashDot: 'borderStyleDashDotLabel',
1591
+ longDash: 'borderStyleLongDashLabel',
1592
+ longDashDot: 'borderStyleLongDashDotLabel',
1593
+ longDashDotDot: 'borderStyleLongDashDotDotLabel'
1594
+ };
1595
+
1596
+ /**
1597
+ * @hidden
1598
+ * Renders the shape type tool used by both the main toolbar's shape insertion tool and the
1599
+ * shape editing toolbar's shape type tool.
1600
+ */
1601
+ class ShapeSelectorComponent {
1602
+ localization;
1603
+ controller = null;
1604
+ value = null;
1605
+ active;
1606
+ buttonTitle = '';
1607
+ popupClass;
1608
+ overlayOwner = 'main-toolbar';
1609
+ set shapes(value) {
1610
+ this._shapes.set(value);
1611
+ }
1612
+ get shapes() {
1613
+ return this._shapes();
1614
+ }
1615
+ valueSelect = new EventEmitter();
1616
+ buttonIcon = shapesIcon;
1617
+ columns = 4;
1618
+ shapeItems = computed(() => {
1619
+ const shapesData = EditingUtils.Icons.shapesData;
1620
+ const dataByType = new Map(shapesData.map(({ label, icon, type }) => [type, { label, icon }]));
1621
+ const types = this._shapes() || EditingUtils.Data.workflowShapes;
1622
+ return types.map((type) => {
1623
+ const data = dataByType.get(type) || shapesData[0];
1624
+ const messageKey = shapeMessageKeyMap[type];
1625
+ const label = (messageKey && this.localization.get(messageKey)) || data.label;
1626
+ return { label, icon: data.icon, value: type };
1627
+ });
1628
+ }, ...(ngDevMode ? [{ debugName: "shapeItems" }] : []));
1629
+ _shapes = signal(undefined, ...(ngDevMode ? [{ debugName: "_shapes" }] : []));
1630
+ constructor(localization) {
1631
+ this.localization = localization;
1632
+ }
1633
+ onEscape() {
1634
+ if (this.active) {
1635
+ this.controller?.dispatch({ type: 'setActiveTool', tool: { type: 'select' } });
1636
+ }
1637
+ }
1638
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: ShapeSelectorComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
1639
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.32", type: ShapeSelectorComponent, isStandalone: true, selector: "kendo-diagram-shape-selector", inputs: { controller: "controller", value: "value", active: "active", buttonTitle: "buttonTitle", popupClass: "popupClass", overlayOwner: "overlayOwner", shapes: "shapes" }, outputs: { valueSelect: "valueSelect" }, ngImport: i0, template: `
1640
+ <kendo-diagram-icons-dropdown
1641
+ [controller]="controller"
1642
+ [value]="value"
1643
+ [buttonTitle]="buttonTitle"
1644
+ [buttonIcon]="buttonIcon"
1645
+ [data]="shapeItems()"
1646
+ [columns]="columns"
1647
+ [popupClass]="popupClass"
1648
+ [overlayOwner]="overlayOwner"
1649
+ (valueSelect)="valueSelect.emit($event)"
1650
+ (escape)="onEscape()"
1651
+ ></kendo-diagram-icons-dropdown>
1652
+ `, isInline: true, dependencies: [{ kind: "component", type: IconsDropdownComponent, selector: "kendo-diagram-icons-dropdown", inputs: ["controller", "value", "active", "buttonTitle", "buttonIcon", "data", "columns", "popupClass", "overlayOwner"], outputs: ["valueSelect", "escape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1653
+ }
1654
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: ShapeSelectorComponent, decorators: [{
1655
+ type: Component,
1656
+ args: [{
1657
+ selector: 'kendo-diagram-shape-selector',
1658
+ standalone: true,
1659
+ changeDetection: ChangeDetectionStrategy.OnPush,
1660
+ imports: [IconsDropdownComponent],
1661
+ template: `
1662
+ <kendo-diagram-icons-dropdown
1663
+ [controller]="controller"
1664
+ [value]="value"
1665
+ [buttonTitle]="buttonTitle"
1666
+ [buttonIcon]="buttonIcon"
1667
+ [data]="shapeItems()"
1668
+ [columns]="columns"
1669
+ [popupClass]="popupClass"
1670
+ [overlayOwner]="overlayOwner"
1671
+ (valueSelect)="valueSelect.emit($event)"
1672
+ (escape)="onEscape()"
1673
+ ></kendo-diagram-icons-dropdown>
1674
+ `
1675
+ }]
1676
+ }], ctorParameters: () => [{ type: i1$1.LocalizationService }], propDecorators: { controller: [{
1677
+ type: Input
1678
+ }], value: [{
1679
+ type: Input
1680
+ }], active: [{
1681
+ type: Input
1682
+ }], buttonTitle: [{
1683
+ type: Input
1684
+ }], popupClass: [{
1685
+ type: Input
1686
+ }], overlayOwner: [{
1687
+ type: Input
1688
+ }], shapes: [{
1689
+ type: Input
1690
+ }], valueSelect: [{
1691
+ type: Output
1692
+ }] } });
1693
+
1694
+ /**
1695
+ * @hidden
1696
+ * Provides a Toolbar tool container for custom diagram controls.
1697
+ */
1698
+ class DiagramToolbarToolComponent extends ToolBarToolComponent {
1699
+ content;
1700
+ /**
1701
+ * @hidden
1702
+ */
1703
+ canFocus() {
1704
+ return Boolean(this.getFocusableButton());
1705
+ }
1706
+ /**
1707
+ * @hidden
1708
+ */
1709
+ focus(event) {
1710
+ if (event?.type === 'click') {
1711
+ return;
1712
+ }
1713
+ this.getFocusableButton()?.focus({ preventScroll: true });
1714
+ }
1715
+ /**
1716
+ * @hidden
1717
+ */
1718
+ handleKey() {
1719
+ return false;
1720
+ }
1721
+ getFocusableButton() {
1722
+ return this.content?.nativeElement.querySelector('button') ?? null;
1723
+ }
1724
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramToolbarToolComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1725
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.32", type: DiagramToolbarToolComponent, isStandalone: true, selector: "kendo-diagram-toolbar-tool", providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => DiagramToolbarToolComponent) }], viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: `
1726
+ <ng-template #toolbarTemplate>
1727
+ <span #content [style.display]="'contents'">
1728
+ <ng-content></ng-content>
1729
+ </span>
1730
+ </ng-template>
1731
+ `, isInline: true });
1732
+ }
1733
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramToolbarToolComponent, decorators: [{
1734
+ type: Component,
1735
+ args: [{
1736
+ selector: 'kendo-diagram-toolbar-tool',
1737
+ standalone: true,
1738
+ providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => DiagramToolbarToolComponent) }],
1739
+ template: `
1740
+ <ng-template #toolbarTemplate>
1741
+ <span #content [style.display]="'contents'">
1742
+ <ng-content></ng-content>
1743
+ </span>
1744
+ </ng-template>
1745
+ `
1746
+ }]
1747
+ }], propDecorators: { content: [{
1748
+ type: ViewChild,
1749
+ args: ['content', { read: ElementRef }]
1750
+ }] } });
1751
+
1752
+ const topToolbarOffset = 2;
1753
+ const scrollbarWidth = 10;
1754
+ const floatingToolbarBorderRadius = '8px';
1755
+ const topAnchorAlign = { horizontal: 'center', vertical: 'top' };
1756
+ const bottomAnchorAlign = { horizontal: 'center', vertical: 'bottom' };
1757
+ const topPopupAlign = { horizontal: 'center', vertical: 'top' };
1758
+ const bottomPopupAlign = { horizontal: 'center', vertical: 'bottom' };
1759
+ const topPopupOffset = { left: 0, top: topToolbarOffset };
1760
+ const bottomPopupOffset = { left: 0, top: -(topToolbarOffset + scrollbarWidth) };
1761
+ const topToolbarPopupClasses = [mainToolbarPopupClass, 'k-diagram-top-toolbar-container'];
1762
+ /**
1763
+ * @hidden
1764
+ * Renders the main diagram toolbar with the undo, redo, select, pan, text, and shape tools.
1765
+ */
1766
+ class MainToolbarComponent {
1767
+ localization;
1768
+ controller = null;
1769
+ diagram = null;
1770
+ snapshot = null;
1771
+ tools = defaultMainToolbarTools;
1772
+ position = 'top';
1773
+ shapes;
1774
+ visible = true;
1775
+ ariaLabel;
1776
+ undoIcon = undoIcon;
1777
+ redoIcon = redoIcon;
1778
+ pointerIcon = pointerIcon;
1779
+ handIcon = handIcon;
1780
+ freeTextIcon = freeTextIcon;
1781
+ mainToolbarPopupClass = mainToolbarPopupClass;
1782
+ topAnchorAlign = topAnchorAlign;
1783
+ bottomAnchorAlign = bottomAnchorAlign;
1784
+ topPopupAlign = topPopupAlign;
1785
+ bottomPopupAlign = bottomPopupAlign;
1786
+ topPopupOffset = topPopupOffset;
1787
+ bottomPopupOffset = bottomPopupOffset;
1788
+ topToolbarPopupClasses = topToolbarPopupClasses;
1789
+ topToolbarOffset = topToolbarOffset;
1790
+ scrollbarWidth = scrollbarWidth;
1791
+ floatingToolbarBorderRadius = floatingToolbarBorderRadius;
1792
+ set popup(value) {
1793
+ this.surfaceCleanup?.();
1794
+ this.surfaceCleanup = null;
1795
+ const popupElement = value?.contentContainer?.nativeElement;
1796
+ if (popupElement) {
1797
+ popupElement.style.borderRadius = floatingToolbarBorderRadius;
1798
+ this.surfaceCleanup = this.controller?.registerSurface(popupElement) ?? null;
1799
+ }
1800
+ }
1801
+ surfaceCleanup = null;
1802
+ constructor(localization) {
1803
+ this.localization = localization;
1804
+ }
1805
+ ngOnDestroy() {
1806
+ this.surfaceCleanup?.();
1807
+ this.surfaceCleanup = null;
1808
+ }
1809
+ get canUndo() {
1810
+ return Boolean(this.diagram && this.diagram.canUndo());
1811
+ }
1812
+ get canRedo() {
1813
+ return Boolean(this.diagram && this.diagram.canRedo());
1814
+ }
1815
+ get activeToolType() {
1816
+ return this.snapshot?.activeTool.type;
1817
+ }
1818
+ get activeShape() {
1819
+ const tool = this.snapshot?.activeTool;
1820
+ return tool && tool.type === 'insert-shape' ? tool.shape : null;
1821
+ }
1822
+ isArray(value) {
1823
+ return Array.isArray(value);
1824
+ }
1825
+ messageFor(key) {
1826
+ return this.localization.get(key);
1827
+ }
1828
+ execute(type) {
1829
+ this.controller?.execute({ type });
1830
+ }
1831
+ setActiveTool(tool) {
1832
+ this.controller?.dispatch({ type: 'setActiveTool', tool });
1833
+ }
1834
+ onInsertShape(shape) {
1835
+ this.setActiveTool({ type: 'insert-shape', shape });
1836
+ }
1837
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: MainToolbarComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
1838
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.32", type: MainToolbarComponent, isStandalone: true, selector: "kendo-diagram-main-toolbar", inputs: { controller: "controller", diagram: "diagram", snapshot: "snapshot", tools: "tools", position: "position", shapes: "shapes", visible: "visible", ariaLabel: "ariaLabel" }, viewQueries: [{ propertyName: "popup", first: true, predicate: PopupComponent, descendants: true }], ngImport: i0, template: `
1839
+ @if (diagram) {
1840
+ <kendo-popup
1841
+ [anchor]="diagram.element"
1842
+ [anchorAlign]="position === 'top' ? topAnchorAlign : bottomAnchorAlign"
1843
+ [popupAlign]="position === 'top' ? topPopupAlign : bottomPopupAlign"
1844
+ [offset]="position === 'top' ? topPopupOffset : bottomPopupOffset"
1845
+ [animate]="false"
1846
+ [positionMode]="'fixed'"
1847
+ [popupClass]="topToolbarPopupClasses"
1848
+ [style.opacity]="visible ? 1 : 0"
1849
+ [style.visibility]="visible ? 'visible' : 'hidden'"
1850
+ [style.pointer-events]="visible ? 'auto' : 'none'"
1851
+ >
1852
+ <div
1853
+ (pointerenter)="controller?.handlePointerEnter()"
1854
+ (pointerleave)="controller?.handlePointerLeave()"
1855
+ >
1856
+ <kendo-toolbar fillMode="flat" [attr.aria-label]="ariaLabel">
1857
+ <ng-template #toolTemplate let-tool>
1858
+ @switch (tool) {
1859
+ @case ('undo') {
1860
+ <kendo-toolbar-button
1861
+ fillMode="flat"
1862
+ [svgIcon]="undoIcon"
1863
+ [disabled]="!canUndo"
1864
+ [title]="messageFor('undoTitle')"
1865
+ (click)="execute('undo')"
1866
+ ></kendo-toolbar-button>
1867
+ }
1868
+ @case ('redo') {
1869
+ <kendo-toolbar-button
1870
+ fillMode="flat"
1871
+ [svgIcon]="redoIcon"
1872
+ [disabled]="!canRedo"
1873
+ [title]="messageFor('redoTitle')"
1874
+ (click)="execute('redo')"
1875
+ ></kendo-toolbar-button>
1876
+ }
1877
+ @case ('select') {
1878
+ <kendo-toolbar-button
1879
+ fillMode="flat"
1880
+ [svgIcon]="pointerIcon"
1881
+ [selected]="activeToolType === 'select'"
1882
+ [title]="messageFor('selectTitle')"
1883
+ (click)="setActiveTool({ type: 'select' })"
1884
+ ></kendo-toolbar-button>
1885
+ }
1886
+ @case ('pan') {
1887
+ <kendo-toolbar-button
1888
+ fillMode="flat"
1889
+ [svgIcon]="handIcon"
1890
+ [selected]="activeToolType === 'pan'"
1891
+ [title]="messageFor('panTitle')"
1892
+ (click)="setActiveTool({ type: 'pan' })"
1893
+ ></kendo-toolbar-button>
1894
+ }
1895
+ @case ('text') {
1896
+ <kendo-toolbar-button
1897
+ fillMode="flat"
1898
+ [svgIcon]="freeTextIcon"
1899
+ [selected]="activeToolType === 'insert-text'"
1900
+ [title]="messageFor('textTitle')"
1901
+ (click)="setActiveTool({ type: 'insert-text' })"
1902
+ ></kendo-toolbar-button>
1903
+ }
1904
+ @case ('shape') {
1905
+ <kendo-diagram-toolbar-tool>
1906
+ <kendo-diagram-shape-selector
1907
+ [controller]="controller"
1908
+ [shapes]="shapes"
1909
+ [value]="activeToolType === 'insert-shape' ? activeShape : null"
1910
+ [active]="activeToolType === 'insert-shape'"
1911
+ [buttonTitle]="messageFor('shapeTitle')"
1912
+ [popupClass]="mainToolbarPopupClass"
1913
+ overlayOwner="main-toolbar"
1914
+ (valueSelect)="onInsertShape($event)"
1915
+ ></kendo-diagram-shape-selector>
1916
+ </kendo-diagram-toolbar-tool>
1917
+ }
1918
+ @case ('separator') {
1919
+ <kendo-toolbar-separator></kendo-toolbar-separator>
1920
+ }
1921
+ }
1922
+ </ng-template>
1923
+ @for (tool of tools; track $index) {
1924
+ @if (isArray(tool)) {
1925
+ <kendo-toolbar-buttongroup>
1926
+ @for (subTool of $any(tool); track $index) {
1927
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: subTool }"></ng-container>
1928
+ }
1929
+ </kendo-toolbar-buttongroup>
1930
+ } @else {
1931
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: tool }"></ng-container>
1932
+ }
1933
+ }
1934
+ </kendo-toolbar>
1935
+ </div>
1936
+ </kendo-popup>
1937
+ }
1938
+ `, isInline: true, dependencies: [{ kind: "component", type: PopupComponent, selector: "kendo-popup", inputs: ["animate", "anchor", "anchorAlign", "collision", "popupAlign", "copyAnchorStyles", "popupClass", "positionMode", "offset", "margin"], outputs: ["anchorViewportLeave", "close", "open", "positionChange"], exportAs: ["kendo-popup"] }, { kind: "component", type: ToolBarComponent, selector: "kendo-toolbar", inputs: ["overflow", "resizable", "popupSettings", "fillMode", "tabindex", "size", "tabIndex", "showIcon", "showText", "toolsSource"], outputs: ["open", "close"], exportAs: ["kendoToolBar"] }, { kind: "component", type: ToolBarButtonComponent, selector: "kendo-toolbar-button", inputs: ["showText", "showIcon", "text", "style", "className", "title", "disabled", "toggleable", "look", "togglable", "selected", "fillMode", "rounded", "themeColor", "icon", "iconClass", "svgIcon", "imageUrl"], outputs: ["click", "pointerdown", "selectedChange"], exportAs: ["kendoToolBarButton"] }, { kind: "component", type: ToolBarButtonGroupComponent, selector: "kendo-toolbar-buttongroup", inputs: ["disabled", "fillMode", "selection", "width", "look"], exportAs: ["kendoToolBarButtonGroup"] }, { kind: "component", type: ToolBarSeparatorComponent, selector: "kendo-toolbar-separator", exportAs: ["kendoToolBarSeparator"] }, { kind: "component", type: DiagramToolbarToolComponent, selector: "kendo-diagram-toolbar-tool" }, { kind: "component", type: ShapeSelectorComponent, selector: "kendo-diagram-shape-selector", inputs: ["controller", "value", "active", "buttonTitle", "popupClass", "overlayOwner", "shapes"], outputs: ["valueSelect"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1939
+ }
1940
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: MainToolbarComponent, decorators: [{
1941
+ type: Component,
1942
+ args: [{
1943
+ selector: 'kendo-diagram-main-toolbar',
1944
+ standalone: true,
1945
+ changeDetection: ChangeDetectionStrategy.OnPush,
1946
+ imports: [PopupComponent, ToolBarComponent, ToolBarButtonComponent, ToolBarButtonGroupComponent, ToolBarSeparatorComponent, DiagramToolbarToolComponent, ShapeSelectorComponent, NgTemplateOutlet],
1947
+ template: `
1948
+ @if (diagram) {
1949
+ <kendo-popup
1950
+ [anchor]="diagram.element"
1951
+ [anchorAlign]="position === 'top' ? topAnchorAlign : bottomAnchorAlign"
1952
+ [popupAlign]="position === 'top' ? topPopupAlign : bottomPopupAlign"
1953
+ [offset]="position === 'top' ? topPopupOffset : bottomPopupOffset"
1954
+ [animate]="false"
1955
+ [positionMode]="'fixed'"
1956
+ [popupClass]="topToolbarPopupClasses"
1957
+ [style.opacity]="visible ? 1 : 0"
1958
+ [style.visibility]="visible ? 'visible' : 'hidden'"
1959
+ [style.pointer-events]="visible ? 'auto' : 'none'"
1960
+ >
1961
+ <div
1962
+ (pointerenter)="controller?.handlePointerEnter()"
1963
+ (pointerleave)="controller?.handlePointerLeave()"
1964
+ >
1965
+ <kendo-toolbar fillMode="flat" [attr.aria-label]="ariaLabel">
1966
+ <ng-template #toolTemplate let-tool>
1967
+ @switch (tool) {
1968
+ @case ('undo') {
1969
+ <kendo-toolbar-button
1970
+ fillMode="flat"
1971
+ [svgIcon]="undoIcon"
1972
+ [disabled]="!canUndo"
1973
+ [title]="messageFor('undoTitle')"
1974
+ (click)="execute('undo')"
1975
+ ></kendo-toolbar-button>
1976
+ }
1977
+ @case ('redo') {
1978
+ <kendo-toolbar-button
1979
+ fillMode="flat"
1980
+ [svgIcon]="redoIcon"
1981
+ [disabled]="!canRedo"
1982
+ [title]="messageFor('redoTitle')"
1983
+ (click)="execute('redo')"
1984
+ ></kendo-toolbar-button>
1985
+ }
1986
+ @case ('select') {
1987
+ <kendo-toolbar-button
1988
+ fillMode="flat"
1989
+ [svgIcon]="pointerIcon"
1990
+ [selected]="activeToolType === 'select'"
1991
+ [title]="messageFor('selectTitle')"
1992
+ (click)="setActiveTool({ type: 'select' })"
1993
+ ></kendo-toolbar-button>
1994
+ }
1995
+ @case ('pan') {
1996
+ <kendo-toolbar-button
1997
+ fillMode="flat"
1998
+ [svgIcon]="handIcon"
1999
+ [selected]="activeToolType === 'pan'"
2000
+ [title]="messageFor('panTitle')"
2001
+ (click)="setActiveTool({ type: 'pan' })"
2002
+ ></kendo-toolbar-button>
2003
+ }
2004
+ @case ('text') {
2005
+ <kendo-toolbar-button
2006
+ fillMode="flat"
2007
+ [svgIcon]="freeTextIcon"
2008
+ [selected]="activeToolType === 'insert-text'"
2009
+ [title]="messageFor('textTitle')"
2010
+ (click)="setActiveTool({ type: 'insert-text' })"
2011
+ ></kendo-toolbar-button>
2012
+ }
2013
+ @case ('shape') {
2014
+ <kendo-diagram-toolbar-tool>
2015
+ <kendo-diagram-shape-selector
2016
+ [controller]="controller"
2017
+ [shapes]="shapes"
2018
+ [value]="activeToolType === 'insert-shape' ? activeShape : null"
2019
+ [active]="activeToolType === 'insert-shape'"
2020
+ [buttonTitle]="messageFor('shapeTitle')"
2021
+ [popupClass]="mainToolbarPopupClass"
2022
+ overlayOwner="main-toolbar"
2023
+ (valueSelect)="onInsertShape($event)"
2024
+ ></kendo-diagram-shape-selector>
2025
+ </kendo-diagram-toolbar-tool>
2026
+ }
2027
+ @case ('separator') {
2028
+ <kendo-toolbar-separator></kendo-toolbar-separator>
2029
+ }
2030
+ }
2031
+ </ng-template>
2032
+ @for (tool of tools; track $index) {
2033
+ @if (isArray(tool)) {
2034
+ <kendo-toolbar-buttongroup>
2035
+ @for (subTool of $any(tool); track $index) {
2036
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: subTool }"></ng-container>
2037
+ }
2038
+ </kendo-toolbar-buttongroup>
2039
+ } @else {
2040
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: tool }"></ng-container>
2041
+ }
2042
+ }
2043
+ </kendo-toolbar>
2044
+ </div>
2045
+ </kendo-popup>
2046
+ }
2047
+ `
2048
+ }]
2049
+ }], ctorParameters: () => [{ type: i1$1.LocalizationService }], propDecorators: { controller: [{
2050
+ type: Input
2051
+ }], diagram: [{
2052
+ type: Input
2053
+ }], snapshot: [{
2054
+ type: Input
2055
+ }], tools: [{
2056
+ type: Input
2057
+ }], position: [{
2058
+ type: Input
2059
+ }], shapes: [{
2060
+ type: Input
2061
+ }], visible: [{
2062
+ type: Input
2063
+ }], ariaLabel: [{
2064
+ type: Input
2065
+ }], popup: [{
2066
+ type: ViewChild,
2067
+ args: [PopupComponent]
2068
+ }] } });
2069
+
2070
+ /**
2071
+ * @hidden
2072
+ * Renders the border style tool of the shape and connection editing toolbars.
2073
+ */
2074
+ class BorderStyleComponent {
2075
+ localization;
2076
+ controller = null;
2077
+ value = null;
2078
+ buttonTitle = '';
2079
+ overlayOwner = 'shape-toolbar';
2080
+ valueSelect = new EventEmitter();
2081
+ buttonIcon = borderTypeIcon;
2082
+ dropdownPopupClass = dropdownPopupClass;
2083
+ items = computed(() => {
2084
+ return EditingUtils.Data.borderTypes.map(({ label, icon, value }) => {
2085
+ const messageKey = borderStyleMessageKeyMap[value];
2086
+ return { label: (messageKey && this.localization.get(messageKey)) || label, icon, value };
2087
+ });
2088
+ }, ...(ngDevMode ? [{ debugName: "items" }] : []));
2089
+ constructor(localization) {
2090
+ this.localization = localization;
2091
+ }
2092
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: BorderStyleComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
2093
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.32", type: BorderStyleComponent, isStandalone: true, selector: "kendo-diagram-border-style", inputs: { controller: "controller", value: "value", buttonTitle: "buttonTitle", overlayOwner: "overlayOwner" }, outputs: { valueSelect: "valueSelect" }, ngImport: i0, template: `
2094
+ <kendo-diagram-icons-dropdown
2095
+ [controller]="controller"
2096
+ [value]="value"
2097
+ [buttonTitle]="buttonTitle"
2098
+ [buttonIcon]="buttonIcon"
2099
+ [data]="items()"
2100
+ [columns]="items().length"
2101
+ [popupClass]="dropdownPopupClass"
2102
+ [overlayOwner]="overlayOwner"
2103
+ (valueSelect)="valueSelect.emit($event)"
2104
+ ></kendo-diagram-icons-dropdown>
2105
+ `, isInline: true, dependencies: [{ kind: "component", type: IconsDropdownComponent, selector: "kendo-diagram-icons-dropdown", inputs: ["controller", "value", "active", "buttonTitle", "buttonIcon", "data", "columns", "popupClass", "overlayOwner"], outputs: ["valueSelect", "escape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2106
+ }
2107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: BorderStyleComponent, decorators: [{
2108
+ type: Component,
2109
+ args: [{
2110
+ selector: 'kendo-diagram-border-style',
2111
+ standalone: true,
2112
+ changeDetection: ChangeDetectionStrategy.OnPush,
2113
+ imports: [IconsDropdownComponent],
2114
+ template: `
2115
+ <kendo-diagram-icons-dropdown
2116
+ [controller]="controller"
2117
+ [value]="value"
2118
+ [buttonTitle]="buttonTitle"
2119
+ [buttonIcon]="buttonIcon"
2120
+ [data]="items()"
2121
+ [columns]="items().length"
2122
+ [popupClass]="dropdownPopupClass"
2123
+ [overlayOwner]="overlayOwner"
2124
+ (valueSelect)="valueSelect.emit($event)"
2125
+ ></kendo-diagram-icons-dropdown>
2126
+ `
2127
+ }]
2128
+ }], ctorParameters: () => [{ type: i1$1.LocalizationService }], propDecorators: { controller: [{
2129
+ type: Input
2130
+ }], value: [{
2131
+ type: Input
2132
+ }], buttonTitle: [{
2133
+ type: Input
2134
+ }], overlayOwner: [{
2135
+ type: Input
2136
+ }], valueSelect: [{
2137
+ type: Output
2138
+ }] } });
2139
+
2140
+ let nextBorderWidthOverlayId = 0;
2141
+ const maxValue = 20;
2142
+ const step = 1;
2143
+ const borderWidthInputWidth = 60;
2144
+ /**
2145
+ * @hidden
2146
+ * Renders the border width tool of the shape and connection editing toolbars.
2147
+ */
2148
+ class BorderWidthComponent {
2149
+ controller = null;
2150
+ value = 1;
2151
+ min = 0;
2152
+ label = '';
2153
+ overlayOwner = 'shape-toolbar';
2154
+ valueSelect = new EventEmitter();
2155
+ anchor;
2156
+ numericInput;
2157
+ borderWidthIcon = borderWidthIcon;
2158
+ chevronDownIcon = chevronDownIcon;
2159
+ rowsIcon = rowsIcon;
2160
+ dropdownPopupClass = dropdownPopupClass;
2161
+ maxValue = maxValue;
2162
+ step = step;
2163
+ borderWidthInputWidth = borderWidthInputWidth;
2164
+ open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
2165
+ overlayId = `border-width-${nextBorderWidthOverlayId++}`;
2166
+ surfaceCleanup = null;
2167
+ ngOnDestroy() {
2168
+ this.surfaceCleanup?.();
2169
+ this.surfaceCleanup = null;
2170
+ this.controller?.closeOverlay(this.overlayId);
2171
+ }
2172
+ toggle() {
2173
+ this.setOpen(!this.open());
2174
+ }
2175
+ onOpen() {
2176
+ if (!this.controller || !this.anchor) {
2177
+ return;
2178
+ }
2179
+ const popupElement = this.anchor.nativeElement.ownerDocument.querySelector(`.${dropdownPopupClass}`);
2180
+ if (popupElement) {
2181
+ this.surfaceCleanup?.();
2182
+ this.surfaceCleanup = this.controller.registerSurface(popupElement);
2183
+ }
2184
+ const input = popupElement?.querySelector('input');
2185
+ input?.focus();
2186
+ input?.select();
2187
+ }
2188
+ onClose() {
2189
+ this.surfaceCleanup?.();
2190
+ this.surfaceCleanup = null;
2191
+ }
2192
+ onValueChange(value) {
2193
+ this.valueSelect.emit(value || 0);
2194
+ }
2195
+ onKeyDown(event) {
2196
+ if (event.key === 'Enter') {
2197
+ event.preventDefault();
2198
+ this.onValueChange(this.numericInput?.value ?? this.value);
2199
+ this.setOpen(false);
2200
+ this.anchor?.nativeElement.focus();
2201
+ return;
2202
+ }
2203
+ if (event.key === 'Escape') {
2204
+ event.stopPropagation();
2205
+ this.setOpen(false);
2206
+ this.anchor?.nativeElement.focus();
2207
+ }
2208
+ }
2209
+ onBlur() {
2210
+ this.setOpen(false);
2211
+ }
2212
+ setOpen(next) {
2213
+ if (next === this.open()) {
2214
+ return;
2215
+ }
2216
+ this.open.set(next);
2217
+ if (!this.controller) {
2218
+ return;
2219
+ }
2220
+ if (next) {
2221
+ this.controller.openOverlay(this.overlayId, this.overlayOwner);
2222
+ }
2223
+ else {
2224
+ this.controller.closeOverlay(this.overlayId);
2225
+ }
2226
+ }
2227
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: BorderWidthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2228
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.32", type: BorderWidthComponent, isStandalone: true, selector: "kendo-diagram-border-width", inputs: { controller: "controller", value: "value", min: "min", label: "label", overlayOwner: "overlayOwner" }, outputs: { valueSelect: "valueSelect" }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true, read: ElementRef }, { propertyName: "numericInput", first: true, predicate: ["numericInput"], descendants: true }], ngImport: i0, template: `
2229
+ <button
2230
+ #anchor
2231
+ kendoButton
2232
+ type="button"
2233
+ fillMode="flat"
2234
+ [svgIcon]="borderWidthIcon"
2235
+ [title]="label"
2236
+ [attr.aria-label]="label"
2237
+ (click)="toggle()"
2238
+ (mousedown)="$event.preventDefault()"
2239
+ >
2240
+ <kendo-svgicon [icon]="chevronDownIcon"></kendo-svgicon>
2241
+ </button>
2242
+ @if (open()) {
2243
+ <kendo-popup
2244
+ [anchor]="anchor"
2245
+ [popupClass]="dropdownPopupClass"
2246
+ [animate]="false"
2247
+ (open)="onOpen()"
2248
+ (close)="onClose()"
2249
+ >
2250
+ <kendo-numerictextbox
2251
+ #numericInput
2252
+ [style.width.px]="borderWidthInputWidth"
2253
+ [spinners]="false"
2254
+ [value]="value"
2255
+ [min]="min"
2256
+ [max]="maxValue"
2257
+ [step]="step"
2258
+ fillMode="flat"
2259
+ (keydown)="onKeyDown($event)"
2260
+ (blur)="onBlur()"
2261
+ (valueChange)="onValueChange($event)"
2262
+ >
2263
+ <ng-template kendoPrefixTemplate>
2264
+ <kendo-svgicon [icon]="rowsIcon"></kendo-svgicon>
2265
+ </ng-template>
2266
+ </kendo-numerictextbox>
2267
+ </kendo-popup>
2268
+ }
2269
+ `, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconPosition", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "component", type: PopupComponent, selector: "kendo-popup", inputs: ["animate", "anchor", "anchorAlign", "collision", "popupAlign", "copyAnchorStyles", "popupClass", "positionMode", "offset", "margin"], outputs: ["anchorViewportLeave", "close", "open", "positionChange"], exportAs: ["kendo-popup"] }, { kind: "component", type: NumericTextBoxComponent, selector: "kendo-numerictextbox", inputs: ["focusableId", "disabled", "readonly", "title", "autoCorrect", "format", "max", "min", "decimals", "placeholder", "step", "spinners", "rangeValidation", "tabindex", "tabIndex", "changeValueOnScroll", "selectOnFocus", "value", "maxlength", "size", "rounded", "fillMode", "inputAttributes"], outputs: ["valueChange", "focus", "blur", "inputFocus", "inputBlur"], exportAs: ["kendoNumericTextBox"] }, { kind: "directive", type: PrefixTemplateDirective, selector: "[kendoPrefixTemplate]", inputs: ["showSeparator"] }, { kind: "component", type: SVGIconComponent, selector: "kendo-svg-icon, kendo-svgicon", inputs: ["icon", "variant"], exportAs: ["kendoSVGIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2270
+ }
2271
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: BorderWidthComponent, decorators: [{
2272
+ type: Component,
2273
+ args: [{
2274
+ selector: 'kendo-diagram-border-width',
2275
+ standalone: true,
2276
+ changeDetection: ChangeDetectionStrategy.OnPush,
2277
+ imports: [ButtonComponent, PopupComponent, NumericTextBoxComponent, PrefixTemplateDirective, SVGIconComponent],
2278
+ template: `
2279
+ <button
2280
+ #anchor
2281
+ kendoButton
2282
+ type="button"
2283
+ fillMode="flat"
2284
+ [svgIcon]="borderWidthIcon"
2285
+ [title]="label"
2286
+ [attr.aria-label]="label"
2287
+ (click)="toggle()"
2288
+ (mousedown)="$event.preventDefault()"
2289
+ >
2290
+ <kendo-svgicon [icon]="chevronDownIcon"></kendo-svgicon>
2291
+ </button>
2292
+ @if (open()) {
2293
+ <kendo-popup
2294
+ [anchor]="anchor"
2295
+ [popupClass]="dropdownPopupClass"
2296
+ [animate]="false"
2297
+ (open)="onOpen()"
2298
+ (close)="onClose()"
2299
+ >
2300
+ <kendo-numerictextbox
2301
+ #numericInput
2302
+ [style.width.px]="borderWidthInputWidth"
2303
+ [spinners]="false"
2304
+ [value]="value"
2305
+ [min]="min"
2306
+ [max]="maxValue"
2307
+ [step]="step"
2308
+ fillMode="flat"
2309
+ (keydown)="onKeyDown($event)"
2310
+ (blur)="onBlur()"
2311
+ (valueChange)="onValueChange($event)"
2312
+ >
2313
+ <ng-template kendoPrefixTemplate>
2314
+ <kendo-svgicon [icon]="rowsIcon"></kendo-svgicon>
2315
+ </ng-template>
2316
+ </kendo-numerictextbox>
2317
+ </kendo-popup>
2318
+ }
2319
+ `
2320
+ }]
2321
+ }], propDecorators: { controller: [{
2322
+ type: Input
2323
+ }], value: [{
2324
+ type: Input
2325
+ }], min: [{
2326
+ type: Input
2327
+ }], label: [{
2328
+ type: Input
2329
+ }], overlayOwner: [{
2330
+ type: Input
2331
+ }], valueSelect: [{
2332
+ type: Output
2333
+ }], anchor: [{
2334
+ type: ViewChild,
2335
+ args: ['anchor', { read: ElementRef }]
2336
+ }], numericInput: [{
2337
+ type: ViewChild,
2338
+ args: ['numericInput']
2339
+ }] } });
2340
+
2341
+ /**
2342
+ * The default set of tools for the shape editing toolbar.
2343
+ * @hidden
2344
+ */
2345
+ const defaultShapeToolbarTools = [
2346
+ 'type',
2347
+ 'backColor',
2348
+ 'separator',
2349
+ 'borderWidth',
2350
+ 'borderColor',
2351
+ 'borderStyle',
2352
+ 'separator',
2353
+ 'toFront',
2354
+ 'toBack',
2355
+ 'separator',
2356
+ 'rotateLeft',
2357
+ 'rotateRight',
2358
+ 'separator',
2359
+ 'duplicate',
2360
+ 'delete'
2361
+ ];
2362
+ /**
2363
+ * @hidden
2364
+ * Renders the contextual toolbar shown next to a selected shape.
2365
+ */
2366
+ class ShapeEditingToolbarComponent {
2367
+ localization;
2368
+ controller = null;
2369
+ shape = null;
2370
+ stateVersion;
2371
+ tools = defaultShapeToolbarTools;
2372
+ shapes;
2373
+ ariaLabel;
2374
+ borderColorIcon = borderColorIcon;
2375
+ bringToFrontIcon = bringToFrontIcon;
2376
+ bringToBackIcon = bringToBackIcon;
2377
+ rotateLeftIcon = rotateLeftIcon;
2378
+ rotateRightIcon = rotateRightIcon;
2379
+ copyIcon = copyIcon;
2380
+ trashIcon = trashIcon;
2381
+ dropdownPopupClass = dropdownPopupClass;
2382
+ constructor(localization) {
2383
+ this.localization = localization;
2384
+ }
2385
+ get options() {
2386
+ return (this.shape?.options ?? {});
2387
+ }
2388
+ get shapeType() {
2389
+ return this.options.type ?? FlowchartShapeType.Process;
2390
+ }
2391
+ get fillColor() {
2392
+ const fill = this.options.fill;
2393
+ return typeof fill === 'string' ? fill : fill?.color || '#ffffff';
2394
+ }
2395
+ get strokeColor() {
2396
+ return this.shape?.shapeVisual?.options?.stroke?.color || '';
2397
+ }
2398
+ get strokeWidth() {
2399
+ return this.shape?.shapeVisual?.options?.stroke?.width || 1;
2400
+ }
2401
+ get strokeDashType() {
2402
+ return this.shape?.shapeVisual?.options?.stroke?.dashType || 'solid';
2403
+ }
2404
+ isArray(value) {
2405
+ return Array.isArray(value);
2406
+ }
2407
+ messageFor(key) {
2408
+ return this.localization.get(key);
2409
+ }
2410
+ execute(type) {
2411
+ this.controller?.execute({ type });
2412
+ }
2413
+ setShapeType(value) {
2414
+ if (value !== this.shapeType) {
2415
+ this.controller?.execute({ type: 'setShapeType', value });
2416
+ }
2417
+ }
2418
+ setFillColor(value, picker) {
2419
+ this.controller?.execute({ type: 'setShapeFillColor', value });
2420
+ this.closePopup(picker);
2421
+ }
2422
+ setStrokeColor(value, picker) {
2423
+ this.controller?.execute({ type: 'setShapeStrokeColor', value });
2424
+ this.closePopup(picker);
2425
+ }
2426
+ setStrokeWidth(value) {
2427
+ this.controller?.execute({ type: 'setShapeStrokeWidth', value });
2428
+ }
2429
+ setStrokeDashType(value) {
2430
+ this.controller?.execute({ type: 'setShapeStrokeDashType', value });
2431
+ }
2432
+ closePopup(picker) {
2433
+ if (picker?.isOpen) {
2434
+ picker.togglePopup();
2435
+ }
2436
+ }
2437
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: ShapeEditingToolbarComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
2438
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.32", type: ShapeEditingToolbarComponent, isStandalone: true, selector: "kendo-diagram-shape-editing-toolbar", inputs: { controller: "controller", shape: "shape", stateVersion: "stateVersion", tools: "tools", shapes: "shapes", ariaLabel: "ariaLabel" }, ngImport: i0, template: `
2439
+ <kendo-toolbar fillMode="flat" [attr.aria-label]="ariaLabel" overflow="scroll">
2440
+ <ng-template #toolTemplate let-tool>
2441
+ @switch (tool) {
2442
+ @case ('type') {
2443
+ <kendo-diagram-toolbar-tool>
2444
+ <kendo-diagram-shape-selector
2445
+ [controller]="controller"
2446
+ [shapes]="shapes"
2447
+ [value]="shapeType"
2448
+ [buttonTitle]="messageFor('shapeTypeTitle')"
2449
+ [popupClass]="dropdownPopupClass"
2450
+ overlayOwner="shape-toolbar"
2451
+ (valueSelect)="setShapeType($event)"
2452
+ ></kendo-diagram-shape-selector>
2453
+ </kendo-diagram-toolbar-tool>
2454
+ }
2455
+ @case ('backColor') {
2456
+ <kendo-diagram-toolbar-tool>
2457
+ <kendo-colorpicker
2458
+ #fillPicker="kendoColorPicker"
2459
+ [value]="fillColor"
2460
+ [clearButton]="false"
2461
+ [views]="['palette']"
2462
+ [gradientSettings]="{ opacity: false }"
2463
+ fillMode="flat"
2464
+ [attr.title]="messageFor('fillColorTitle')"
2465
+ [attr.aria-label]="messageFor('fillColorTitle')"
2466
+ (valueChange)="setFillColor($event, fillPicker)"
2467
+ ></kendo-colorpicker>
2468
+ </kendo-diagram-toolbar-tool>
2469
+ }
2470
+ @case ('borderWidth') {
2471
+ <kendo-diagram-toolbar-tool>
2472
+ <kendo-diagram-border-width
2473
+ [controller]="controller"
2474
+ [value]="strokeWidth"
2475
+ [label]="messageFor('borderWidthTitle')"
2476
+ overlayOwner="shape-toolbar"
2477
+ (valueSelect)="setStrokeWidth($event)"
2478
+ ></kendo-diagram-border-width>
2479
+ </kendo-diagram-toolbar-tool>
2480
+ }
2481
+ @case ('borderColor') {
2482
+ <kendo-diagram-toolbar-tool>
2483
+ <kendo-colorpicker
2484
+ #strokePicker="kendoColorPicker"
2485
+ [value]="strokeColor"
2486
+ [clearButton]="false"
2487
+ [svgIcon]="borderColorIcon"
2488
+ [views]="['palette']"
2489
+ [gradientSettings]="{ opacity: false }"
2490
+ fillMode="flat"
2491
+ [attr.title]="messageFor('borderColorTitle')"
2492
+ [attr.aria-label]="messageFor('borderColorTitle')"
2493
+ (valueChange)="setStrokeColor($event, strokePicker)"
2494
+ ></kendo-colorpicker>
2495
+ </kendo-diagram-toolbar-tool>
2496
+ }
2497
+ @case ('borderStyle') {
2498
+ <kendo-diagram-toolbar-tool>
2499
+ <kendo-diagram-border-style
2500
+ [controller]="controller"
2501
+ [value]="strokeDashType"
2502
+ [buttonTitle]="messageFor('borderStyleTitle')"
2503
+ overlayOwner="shape-toolbar"
2504
+ (valueSelect)="setStrokeDashType($event)"
2505
+ ></kendo-diagram-border-style>
2506
+ </kendo-diagram-toolbar-tool>
2507
+ }
2508
+ @case ('toFront') {
2509
+ <kendo-toolbar-button
2510
+ fillMode="flat"
2511
+ [svgIcon]="bringToFrontIcon"
2512
+ [title]="messageFor('toFrontTitle')"
2513
+ [attr.aria-label]="messageFor('toFrontTitle')"
2514
+ (click)="execute('shapeToFront')"
2515
+ ></kendo-toolbar-button>
2516
+ }
2517
+ @case ('toBack') {
2518
+ <kendo-toolbar-button
2519
+ fillMode="flat"
2520
+ [svgIcon]="bringToBackIcon"
2521
+ [title]="messageFor('toBackTitle')"
2522
+ [attr.aria-label]="messageFor('toBackTitle')"
2523
+ (click)="execute('shapeToBack')"
2524
+ ></kendo-toolbar-button>
2525
+ }
2526
+ @case ('rotateLeft') {
2527
+ <kendo-toolbar-button
2528
+ fillMode="flat"
2529
+ [svgIcon]="rotateLeftIcon"
2530
+ [title]="messageFor('rotateLeftTitle')"
2531
+ [attr.aria-label]="messageFor('rotateLeftTitle')"
2532
+ (click)="execute('rotateShapeLeft')"
2533
+ ></kendo-toolbar-button>
2534
+ }
2535
+ @case ('rotateRight') {
2536
+ <kendo-toolbar-button
2537
+ fillMode="flat"
2538
+ [svgIcon]="rotateRightIcon"
2539
+ [title]="messageFor('rotateRightTitle')"
2540
+ [attr.aria-label]="messageFor('rotateRightTitle')"
2541
+ (click)="execute('rotateShapeRight')"
2542
+ ></kendo-toolbar-button>
2543
+ }
2544
+ @case ('duplicate') {
2545
+ <kendo-toolbar-button
2546
+ fillMode="flat"
2547
+ [svgIcon]="copyIcon"
2548
+ [title]="messageFor('duplicateTitle')"
2549
+ [attr.aria-label]="messageFor('duplicateTitle')"
2550
+ (click)="execute('duplicateSelection')"
2551
+ ></kendo-toolbar-button>
2552
+ }
2553
+ @case ('delete') {
2554
+ <kendo-toolbar-button
2555
+ fillMode="flat"
2556
+ [svgIcon]="trashIcon"
2557
+ [title]="messageFor('deleteTitle')"
2558
+ [attr.aria-label]="messageFor('deleteTitle')"
2559
+ (click)="execute('deleteSelection')"
2560
+ ></kendo-toolbar-button>
2561
+ }
2562
+ @case ('separator') {
2563
+ <kendo-toolbar-separator></kendo-toolbar-separator>
2564
+ }
2565
+ }
2566
+ </ng-template>
2567
+ @for (tool of tools; track $index) {
2568
+ @if (isArray(tool)) {
2569
+ <kendo-toolbar-buttongroup>
2570
+ @for (subTool of $any(tool); track $index) {
2571
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: subTool }"></ng-container>
2572
+ }
2573
+ </kendo-toolbar-buttongroup>
2574
+ } @else {
2575
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: tool }"></ng-container>
2576
+ }
2577
+ }
2578
+ </kendo-toolbar>
2579
+ `, isInline: true, dependencies: [{ kind: "component", type: ToolBarComponent, selector: "kendo-toolbar", inputs: ["overflow", "resizable", "popupSettings", "fillMode", "tabindex", "size", "tabIndex", "showIcon", "showText", "toolsSource"], outputs: ["open", "close"], exportAs: ["kendoToolBar"] }, { kind: "component", type: ToolBarButtonComponent, selector: "kendo-toolbar-button", inputs: ["showText", "showIcon", "text", "style", "className", "title", "disabled", "toggleable", "look", "togglable", "selected", "fillMode", "rounded", "themeColor", "icon", "iconClass", "svgIcon", "imageUrl"], outputs: ["click", "pointerdown", "selectedChange"], exportAs: ["kendoToolBarButton"] }, { kind: "component", type: ToolBarButtonGroupComponent, selector: "kendo-toolbar-buttongroup", inputs: ["disabled", "fillMode", "selection", "width", "look"], exportAs: ["kendoToolBarButtonGroup"] }, { kind: "component", type: ToolBarSeparatorComponent, selector: "kendo-toolbar-separator", exportAs: ["kendoToolBarSeparator"] }, { kind: "component", type: DiagramToolbarToolComponent, selector: "kendo-diagram-toolbar-tool" }, { kind: "component", type: ColorPickerComponent, selector: "kendo-colorpicker", inputs: ["views", "view", "adaptiveMode", "activeView", "readonly", "disabled", "format", "value", "popupSettings", "paletteSettings", "gradientSettings", "icon", "iconClass", "svgIcon", "adaptiveTitle", "adaptiveSubtitle", "clearButton", "tabindex", "preview", "actionsLayout", "size", "rounded", "fillMode"], outputs: ["valueChange", "open", "close", "focus", "blur", "cancel", "activeColorClick", "clearButtonClick", "activeViewChange"], exportAs: ["kendoColorPicker"] }, { kind: "component", type: BorderWidthComponent, selector: "kendo-diagram-border-width", inputs: ["controller", "value", "min", "label", "overlayOwner"], outputs: ["valueSelect"] }, { kind: "component", type: BorderStyleComponent, selector: "kendo-diagram-border-style", inputs: ["controller", "value", "buttonTitle", "overlayOwner"], outputs: ["valueSelect"] }, { kind: "component", type: ShapeSelectorComponent, selector: "kendo-diagram-shape-selector", inputs: ["controller", "value", "active", "buttonTitle", "popupClass", "overlayOwner", "shapes"], outputs: ["valueSelect"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2580
+ }
2581
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: ShapeEditingToolbarComponent, decorators: [{
2582
+ type: Component,
2583
+ args: [{
2584
+ selector: 'kendo-diagram-shape-editing-toolbar',
2585
+ standalone: true,
2586
+ changeDetection: ChangeDetectionStrategy.OnPush,
2587
+ imports: [
2588
+ ToolBarComponent,
2589
+ ToolBarButtonComponent,
2590
+ ToolBarButtonGroupComponent,
2591
+ ToolBarSeparatorComponent,
2592
+ DiagramToolbarToolComponent,
2593
+ ColorPickerComponent,
2594
+ BorderWidthComponent,
2595
+ BorderStyleComponent,
2596
+ ShapeSelectorComponent,
2597
+ NgTemplateOutlet
2598
+ ],
2599
+ template: `
2600
+ <kendo-toolbar fillMode="flat" [attr.aria-label]="ariaLabel" overflow="scroll">
2601
+ <ng-template #toolTemplate let-tool>
2602
+ @switch (tool) {
2603
+ @case ('type') {
2604
+ <kendo-diagram-toolbar-tool>
2605
+ <kendo-diagram-shape-selector
2606
+ [controller]="controller"
2607
+ [shapes]="shapes"
2608
+ [value]="shapeType"
2609
+ [buttonTitle]="messageFor('shapeTypeTitle')"
2610
+ [popupClass]="dropdownPopupClass"
2611
+ overlayOwner="shape-toolbar"
2612
+ (valueSelect)="setShapeType($event)"
2613
+ ></kendo-diagram-shape-selector>
2614
+ </kendo-diagram-toolbar-tool>
2615
+ }
2616
+ @case ('backColor') {
2617
+ <kendo-diagram-toolbar-tool>
2618
+ <kendo-colorpicker
2619
+ #fillPicker="kendoColorPicker"
2620
+ [value]="fillColor"
2621
+ [clearButton]="false"
2622
+ [views]="['palette']"
2623
+ [gradientSettings]="{ opacity: false }"
2624
+ fillMode="flat"
2625
+ [attr.title]="messageFor('fillColorTitle')"
2626
+ [attr.aria-label]="messageFor('fillColorTitle')"
2627
+ (valueChange)="setFillColor($event, fillPicker)"
2628
+ ></kendo-colorpicker>
2629
+ </kendo-diagram-toolbar-tool>
2630
+ }
2631
+ @case ('borderWidth') {
2632
+ <kendo-diagram-toolbar-tool>
2633
+ <kendo-diagram-border-width
2634
+ [controller]="controller"
2635
+ [value]="strokeWidth"
2636
+ [label]="messageFor('borderWidthTitle')"
2637
+ overlayOwner="shape-toolbar"
2638
+ (valueSelect)="setStrokeWidth($event)"
2639
+ ></kendo-diagram-border-width>
2640
+ </kendo-diagram-toolbar-tool>
2641
+ }
2642
+ @case ('borderColor') {
2643
+ <kendo-diagram-toolbar-tool>
2644
+ <kendo-colorpicker
2645
+ #strokePicker="kendoColorPicker"
2646
+ [value]="strokeColor"
2647
+ [clearButton]="false"
2648
+ [svgIcon]="borderColorIcon"
2649
+ [views]="['palette']"
2650
+ [gradientSettings]="{ opacity: false }"
2651
+ fillMode="flat"
2652
+ [attr.title]="messageFor('borderColorTitle')"
2653
+ [attr.aria-label]="messageFor('borderColorTitle')"
2654
+ (valueChange)="setStrokeColor($event, strokePicker)"
2655
+ ></kendo-colorpicker>
2656
+ </kendo-diagram-toolbar-tool>
2657
+ }
2658
+ @case ('borderStyle') {
2659
+ <kendo-diagram-toolbar-tool>
2660
+ <kendo-diagram-border-style
2661
+ [controller]="controller"
2662
+ [value]="strokeDashType"
2663
+ [buttonTitle]="messageFor('borderStyleTitle')"
2664
+ overlayOwner="shape-toolbar"
2665
+ (valueSelect)="setStrokeDashType($event)"
2666
+ ></kendo-diagram-border-style>
2667
+ </kendo-diagram-toolbar-tool>
2668
+ }
2669
+ @case ('toFront') {
2670
+ <kendo-toolbar-button
2671
+ fillMode="flat"
2672
+ [svgIcon]="bringToFrontIcon"
2673
+ [title]="messageFor('toFrontTitle')"
2674
+ [attr.aria-label]="messageFor('toFrontTitle')"
2675
+ (click)="execute('shapeToFront')"
2676
+ ></kendo-toolbar-button>
2677
+ }
2678
+ @case ('toBack') {
2679
+ <kendo-toolbar-button
2680
+ fillMode="flat"
2681
+ [svgIcon]="bringToBackIcon"
2682
+ [title]="messageFor('toBackTitle')"
2683
+ [attr.aria-label]="messageFor('toBackTitle')"
2684
+ (click)="execute('shapeToBack')"
2685
+ ></kendo-toolbar-button>
2686
+ }
2687
+ @case ('rotateLeft') {
2688
+ <kendo-toolbar-button
2689
+ fillMode="flat"
2690
+ [svgIcon]="rotateLeftIcon"
2691
+ [title]="messageFor('rotateLeftTitle')"
2692
+ [attr.aria-label]="messageFor('rotateLeftTitle')"
2693
+ (click)="execute('rotateShapeLeft')"
2694
+ ></kendo-toolbar-button>
2695
+ }
2696
+ @case ('rotateRight') {
2697
+ <kendo-toolbar-button
2698
+ fillMode="flat"
2699
+ [svgIcon]="rotateRightIcon"
2700
+ [title]="messageFor('rotateRightTitle')"
2701
+ [attr.aria-label]="messageFor('rotateRightTitle')"
2702
+ (click)="execute('rotateShapeRight')"
2703
+ ></kendo-toolbar-button>
2704
+ }
2705
+ @case ('duplicate') {
2706
+ <kendo-toolbar-button
2707
+ fillMode="flat"
2708
+ [svgIcon]="copyIcon"
2709
+ [title]="messageFor('duplicateTitle')"
2710
+ [attr.aria-label]="messageFor('duplicateTitle')"
2711
+ (click)="execute('duplicateSelection')"
2712
+ ></kendo-toolbar-button>
2713
+ }
2714
+ @case ('delete') {
2715
+ <kendo-toolbar-button
2716
+ fillMode="flat"
2717
+ [svgIcon]="trashIcon"
2718
+ [title]="messageFor('deleteTitle')"
2719
+ [attr.aria-label]="messageFor('deleteTitle')"
2720
+ (click)="execute('deleteSelection')"
2721
+ ></kendo-toolbar-button>
2722
+ }
2723
+ @case ('separator') {
2724
+ <kendo-toolbar-separator></kendo-toolbar-separator>
2725
+ }
2726
+ }
2727
+ </ng-template>
2728
+ @for (tool of tools; track $index) {
2729
+ @if (isArray(tool)) {
2730
+ <kendo-toolbar-buttongroup>
2731
+ @for (subTool of $any(tool); track $index) {
2732
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: subTool }"></ng-container>
2733
+ }
2734
+ </kendo-toolbar-buttongroup>
2735
+ } @else {
2736
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: tool }"></ng-container>
2737
+ }
2738
+ }
2739
+ </kendo-toolbar>
2740
+ `
2741
+ }]
2742
+ }], ctorParameters: () => [{ type: i1$1.LocalizationService }], propDecorators: { controller: [{
2743
+ type: Input
2744
+ }], shape: [{
2745
+ type: Input
2746
+ }], stateVersion: [{
2747
+ type: Input
2748
+ }], tools: [{
2749
+ type: Input
2750
+ }], shapes: [{
2751
+ type: Input
2752
+ }], ariaLabel: [{
2753
+ type: Input
2754
+ }] } });
2755
+
2756
+ const { connectionTypes, leftCapTypes, rightCapTypes } = EditingUtils.Data;
2757
+ class ConnectionEditingToolbarComponent {
2758
+ localization;
2759
+ controller = null;
2760
+ connection = null;
2761
+ stateVersion;
2762
+ tools = defaultConnectionToolbarTools;
2763
+ ariaLabel;
2764
+ connectionTypes = connectionTypes;
2765
+ leftCapTypes = leftCapTypes;
2766
+ rightCapTypes = rightCapTypes;
2767
+ dropdownPopupClass = dropdownPopupClass;
2768
+ freeTextIcon = freeTextIcon;
2769
+ trashIcon = trashIcon;
2770
+ constructor(localization) {
2771
+ this.localization = localization;
2772
+ }
2773
+ get connectionTypeItems() {
2774
+ return connectionTypes.map(({ label, icon, value }) => ({
2775
+ label: this.messageFor(`connectionType${value[0].toUpperCase()}${value.slice(1)}Label`) || label,
2776
+ icon,
2777
+ value
2778
+ }));
2779
+ }
2780
+ get startCapItems() {
2781
+ return leftCapTypes.map(({ label, icon, value }) => ({ label: this.capLabel(value, label), icon, value }));
2782
+ }
2783
+ get endCapItems() {
2784
+ return rightCapTypes.map(({ label, icon, value }) => ({ label: this.capLabel(value, label), icon, value }));
2785
+ }
2786
+ get connectionOptions() {
2787
+ return (this.connection?.serialize().options ?? {});
2788
+ }
2789
+ get connectionType() {
2790
+ return this.connectionOptions.type ?? 'polyline';
2791
+ }
2792
+ get connectionTypeIcon() {
2793
+ return connectionTypes.find(({ value }) => value === this.connectionType)?.icon || connectionTypes[0].icon;
2794
+ }
2795
+ get strokeColor() {
2796
+ const stroke = this.connectionOptions.stroke;
2797
+ return typeof stroke === 'string' ? stroke : stroke?.color || '';
2798
+ }
2799
+ get strokeWidth() {
2800
+ const stroke = this.connectionOptions.stroke;
2801
+ return typeof stroke === 'object' ? stroke.width || 1 : 1;
2802
+ }
2803
+ get strokeDashType() {
2804
+ const stroke = this.connectionOptions.stroke;
2805
+ return typeof stroke === 'object' ? stroke.dashType || 'solid' : 'solid';
2806
+ }
2807
+ get startCap() {
2808
+ return EditingUtils.getCapTypeValue(this.connectionOptions.startCap, 'start');
2809
+ }
2810
+ get startCapIcon() {
2811
+ return leftCapTypes.find(({ value }) => value === this.startCap)?.icon || leftCapTypes[0].icon;
2812
+ }
2813
+ get endCap() {
2814
+ return EditingUtils.getCapTypeValue(this.connectionOptions.endCap, 'end');
2815
+ }
2816
+ get endCapIcon() {
2817
+ return rightCapTypes.find(({ value }) => value === this.endCap)?.icon || rightCapTypes[0].icon;
2818
+ }
2819
+ isArray(value) {
2820
+ return Array.isArray(value);
2821
+ }
2822
+ messageFor(key) {
2823
+ return this.localization.get(key);
2824
+ }
2825
+ setConnectionType(value) {
2826
+ this.controller?.execute({ type: 'setConnectionType', value });
2827
+ }
2828
+ setStrokeColor(value, picker) {
2829
+ this.controller?.execute({ type: 'setConnectionStrokeColor', value });
2830
+ if (picker?.isOpen) {
2831
+ picker.togglePopup();
2832
+ }
2833
+ }
2834
+ setStrokeWidth(value) {
2835
+ this.controller?.execute({ type: 'setConnectionStrokeWidth', value });
2836
+ }
2837
+ setStrokeDashType(value) {
2838
+ this.controller?.execute({ type: 'setConnectionStrokeDashType', value });
2839
+ }
2840
+ setStartCap(value) {
2841
+ this.controller?.execute({ type: 'setConnectionStartCap', value });
2842
+ }
2843
+ setEndCap(value) {
2844
+ this.controller?.execute({ type: 'setConnectionEndCap', value });
2845
+ }
2846
+ deleteSelection() {
2847
+ this.controller?.execute({ type: 'deleteSelection' });
2848
+ }
2849
+ openTextEditor() {
2850
+ this.controller?.execute({ type: 'openSelectedTextEditor' });
2851
+ }
2852
+ capLabel(value, fallback) {
2853
+ const capLabelKeys = {
2854
+ none: 'capNoneLabel',
2855
+ TriangleArrow: 'capTriangleArrowLabel',
2856
+ LineArrow: 'capLineArrowLabel',
2857
+ FilledCircle: 'capFilledCircleLabel',
2858
+ FilledDiamond: 'capFilledDiamondLabel'
2859
+ };
2860
+ const key = capLabelKeys[value] ?? 'capArrowLabel';
2861
+ return this.messageFor(key) || fallback;
2862
+ }
2863
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: ConnectionEditingToolbarComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
2864
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.32", type: ConnectionEditingToolbarComponent, isStandalone: true, selector: "kendo-diagram-connection-editing-toolbar", inputs: { controller: "controller", connection: "connection", stateVersion: "stateVersion", tools: "tools", ariaLabel: "ariaLabel" }, ngImport: i0, template: `
2865
+ <kendo-toolbar fillMode="flat" [attr.aria-label]="ariaLabel" overflow="scroll">
2866
+ <ng-template #toolTemplate let-tool>
2867
+ @switch (tool) {
2868
+ @case ('type') {
2869
+ <kendo-diagram-toolbar-tool>
2870
+ <kendo-diagram-icons-dropdown
2871
+ [controller]="controller"
2872
+ [value]="connectionType"
2873
+ [buttonTitle]="messageFor('connectionTypeTitle')"
2874
+ [buttonIcon]="connectionTypeIcon"
2875
+ [data]="connectionTypeItems"
2876
+ [columns]="connectionTypeItems.length"
2877
+ [popupClass]="dropdownPopupClass"
2878
+ overlayOwner="connection-toolbar"
2879
+ (valueSelect)="setConnectionType($event)"
2880
+ ></kendo-diagram-icons-dropdown>
2881
+ </kendo-diagram-toolbar-tool>
2882
+ }
2883
+ @case ('width') {
2884
+ <kendo-diagram-toolbar-tool>
2885
+ <kendo-diagram-border-width
2886
+ [controller]="controller"
2887
+ [value]="strokeWidth"
2888
+ [label]="messageFor('connectionWidthTitle')"
2889
+ overlayOwner="connection-toolbar"
2890
+ (valueSelect)="setStrokeWidth($event)"
2891
+ ></kendo-diagram-border-width>
2892
+ </kendo-diagram-toolbar-tool>
2893
+ }
2894
+ @case ('color') {
2895
+ <kendo-diagram-toolbar-tool>
2896
+ <kendo-colorpicker
2897
+ #strokePicker="kendoColorPicker"
2898
+ [value]="strokeColor"
2899
+ [views]="['palette']"
2900
+ fillMode="flat"
2901
+ [attr.title]="messageFor('connectionColorTitle')"
2902
+ [attr.aria-label]="messageFor('connectionColorTitle')"
2903
+ (valueChange)="setStrokeColor($event, strokePicker)"
2904
+ ></kendo-colorpicker>
2905
+ </kendo-diagram-toolbar-tool>
2906
+ }
2907
+ @case ('style') {
2908
+ <kendo-diagram-toolbar-tool>
2909
+ <kendo-diagram-border-style
2910
+ [controller]="controller"
2911
+ [value]="strokeDashType"
2912
+ [buttonTitle]="messageFor('connectionStyleTitle')"
2913
+ overlayOwner="connection-toolbar"
2914
+ (valueSelect)="setStrokeDashType($event)"
2915
+ ></kendo-diagram-border-style>
2916
+ </kendo-diagram-toolbar-tool>
2917
+ }
2918
+ @case ('startCap') {
2919
+ <kendo-diagram-toolbar-tool>
2920
+ <kendo-diagram-icons-dropdown
2921
+ [controller]="controller"
2922
+ [value]="startCap"
2923
+ [buttonTitle]="messageFor('startCapTitle')"
2924
+ [buttonIcon]="startCapIcon"
2925
+ [data]="startCapItems"
2926
+ [columns]="startCapItems.length"
2927
+ [popupClass]="dropdownPopupClass"
2928
+ overlayOwner="connection-toolbar"
2929
+ (valueSelect)="setStartCap($event)"
2930
+ ></kendo-diagram-icons-dropdown>
2931
+ </kendo-diagram-toolbar-tool>
2932
+ }
2933
+ @case ('endCap') {
2934
+ <kendo-diagram-toolbar-tool>
2935
+ <kendo-diagram-icons-dropdown
2936
+ [controller]="controller"
2937
+ [value]="endCap"
2938
+ [buttonTitle]="messageFor('endCapTitle')"
2939
+ [buttonIcon]="endCapIcon"
2940
+ [data]="endCapItems"
2941
+ [columns]="endCapItems.length"
2942
+ [popupClass]="dropdownPopupClass"
2943
+ overlayOwner="connection-toolbar"
2944
+ (valueSelect)="setEndCap($event)"
2945
+ ></kendo-diagram-icons-dropdown>
2946
+ </kendo-diagram-toolbar-tool>
2947
+ }
2948
+ @case ('text') {
2949
+ <kendo-toolbar-button
2950
+ fillMode="flat"
2951
+ [svgIcon]="freeTextIcon"
2952
+ [title]="messageFor('editTextTitle')"
2953
+ [attr.aria-label]="messageFor('editTextTitle')"
2954
+ (click)="openTextEditor()"
2955
+ ></kendo-toolbar-button>
2956
+ }
2957
+ @case ('delete') {
2958
+ <kendo-toolbar-button
2959
+ fillMode="flat"
2960
+ [svgIcon]="trashIcon"
2961
+ [title]="messageFor('deleteTitle')"
2962
+ [attr.aria-label]="messageFor('deleteTitle')"
2963
+ (click)="deleteSelection()"
2964
+ ></kendo-toolbar-button>
2965
+ }
2966
+ @case ('separator') {
2967
+ <kendo-toolbar-separator></kendo-toolbar-separator>
2968
+ }
2969
+ }
2970
+ </ng-template>
2971
+ @for (tool of tools; track $index) {
2972
+ @if (isArray(tool)) {
2973
+ <kendo-toolbar-buttongroup>
2974
+ @for (subTool of $any(tool); track $index) {
2975
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: subTool }"></ng-container>
2976
+ }
2977
+ </kendo-toolbar-buttongroup>
2978
+ } @else {
2979
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: tool }"></ng-container>
2980
+ }
2981
+ }
2982
+ </kendo-toolbar>
2983
+ `, isInline: true, dependencies: [{ kind: "component", type: ToolBarComponent, selector: "kendo-toolbar", inputs: ["overflow", "resizable", "popupSettings", "fillMode", "tabindex", "size", "tabIndex", "showIcon", "showText", "toolsSource"], outputs: ["open", "close"], exportAs: ["kendoToolBar"] }, { kind: "component", type: ToolBarButtonComponent, selector: "kendo-toolbar-button", inputs: ["showText", "showIcon", "text", "style", "className", "title", "disabled", "toggleable", "look", "togglable", "selected", "fillMode", "rounded", "themeColor", "icon", "iconClass", "svgIcon", "imageUrl"], outputs: ["click", "pointerdown", "selectedChange"], exportAs: ["kendoToolBarButton"] }, { kind: "component", type: ToolBarButtonGroupComponent, selector: "kendo-toolbar-buttongroup", inputs: ["disabled", "fillMode", "selection", "width", "look"], exportAs: ["kendoToolBarButtonGroup"] }, { kind: "component", type: ToolBarSeparatorComponent, selector: "kendo-toolbar-separator", exportAs: ["kendoToolBarSeparator"] }, { kind: "component", type: DiagramToolbarToolComponent, selector: "kendo-diagram-toolbar-tool" }, { kind: "component", type: ColorPickerComponent, selector: "kendo-colorpicker", inputs: ["views", "view", "adaptiveMode", "activeView", "readonly", "disabled", "format", "value", "popupSettings", "paletteSettings", "gradientSettings", "icon", "iconClass", "svgIcon", "adaptiveTitle", "adaptiveSubtitle", "clearButton", "tabindex", "preview", "actionsLayout", "size", "rounded", "fillMode"], outputs: ["valueChange", "open", "close", "focus", "blur", "cancel", "activeColorClick", "clearButtonClick", "activeViewChange"], exportAs: ["kendoColorPicker"] }, { kind: "component", type: BorderWidthComponent, selector: "kendo-diagram-border-width", inputs: ["controller", "value", "min", "label", "overlayOwner"], outputs: ["valueSelect"] }, { kind: "component", type: BorderStyleComponent, selector: "kendo-diagram-border-style", inputs: ["controller", "value", "buttonTitle", "overlayOwner"], outputs: ["valueSelect"] }, { kind: "component", type: IconsDropdownComponent, selector: "kendo-diagram-icons-dropdown", inputs: ["controller", "value", "active", "buttonTitle", "buttonIcon", "data", "columns", "popupClass", "overlayOwner"], outputs: ["valueSelect", "escape"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2984
+ }
2985
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: ConnectionEditingToolbarComponent, decorators: [{
2986
+ type: Component,
2987
+ args: [{
2988
+ selector: 'kendo-diagram-connection-editing-toolbar',
2989
+ standalone: true,
2990
+ changeDetection: ChangeDetectionStrategy.OnPush,
2991
+ imports: [
2992
+ ToolBarComponent,
2993
+ ToolBarButtonComponent,
2994
+ ToolBarButtonGroupComponent,
2995
+ ToolBarSeparatorComponent,
2996
+ DiagramToolbarToolComponent,
2997
+ ColorPickerComponent,
2998
+ BorderWidthComponent,
2999
+ BorderStyleComponent,
3000
+ IconsDropdownComponent,
3001
+ NgTemplateOutlet
3002
+ ],
3003
+ template: `
3004
+ <kendo-toolbar fillMode="flat" [attr.aria-label]="ariaLabel" overflow="scroll">
3005
+ <ng-template #toolTemplate let-tool>
3006
+ @switch (tool) {
3007
+ @case ('type') {
3008
+ <kendo-diagram-toolbar-tool>
3009
+ <kendo-diagram-icons-dropdown
3010
+ [controller]="controller"
3011
+ [value]="connectionType"
3012
+ [buttonTitle]="messageFor('connectionTypeTitle')"
3013
+ [buttonIcon]="connectionTypeIcon"
3014
+ [data]="connectionTypeItems"
3015
+ [columns]="connectionTypeItems.length"
3016
+ [popupClass]="dropdownPopupClass"
3017
+ overlayOwner="connection-toolbar"
3018
+ (valueSelect)="setConnectionType($event)"
3019
+ ></kendo-diagram-icons-dropdown>
3020
+ </kendo-diagram-toolbar-tool>
3021
+ }
3022
+ @case ('width') {
3023
+ <kendo-diagram-toolbar-tool>
3024
+ <kendo-diagram-border-width
3025
+ [controller]="controller"
3026
+ [value]="strokeWidth"
3027
+ [label]="messageFor('connectionWidthTitle')"
3028
+ overlayOwner="connection-toolbar"
3029
+ (valueSelect)="setStrokeWidth($event)"
3030
+ ></kendo-diagram-border-width>
3031
+ </kendo-diagram-toolbar-tool>
3032
+ }
3033
+ @case ('color') {
3034
+ <kendo-diagram-toolbar-tool>
3035
+ <kendo-colorpicker
3036
+ #strokePicker="kendoColorPicker"
3037
+ [value]="strokeColor"
3038
+ [views]="['palette']"
3039
+ fillMode="flat"
3040
+ [attr.title]="messageFor('connectionColorTitle')"
3041
+ [attr.aria-label]="messageFor('connectionColorTitle')"
3042
+ (valueChange)="setStrokeColor($event, strokePicker)"
3043
+ ></kendo-colorpicker>
3044
+ </kendo-diagram-toolbar-tool>
3045
+ }
3046
+ @case ('style') {
3047
+ <kendo-diagram-toolbar-tool>
3048
+ <kendo-diagram-border-style
3049
+ [controller]="controller"
3050
+ [value]="strokeDashType"
3051
+ [buttonTitle]="messageFor('connectionStyleTitle')"
3052
+ overlayOwner="connection-toolbar"
3053
+ (valueSelect)="setStrokeDashType($event)"
3054
+ ></kendo-diagram-border-style>
3055
+ </kendo-diagram-toolbar-tool>
3056
+ }
3057
+ @case ('startCap') {
3058
+ <kendo-diagram-toolbar-tool>
3059
+ <kendo-diagram-icons-dropdown
3060
+ [controller]="controller"
3061
+ [value]="startCap"
3062
+ [buttonTitle]="messageFor('startCapTitle')"
3063
+ [buttonIcon]="startCapIcon"
3064
+ [data]="startCapItems"
3065
+ [columns]="startCapItems.length"
3066
+ [popupClass]="dropdownPopupClass"
3067
+ overlayOwner="connection-toolbar"
3068
+ (valueSelect)="setStartCap($event)"
3069
+ ></kendo-diagram-icons-dropdown>
3070
+ </kendo-diagram-toolbar-tool>
3071
+ }
3072
+ @case ('endCap') {
3073
+ <kendo-diagram-toolbar-tool>
3074
+ <kendo-diagram-icons-dropdown
3075
+ [controller]="controller"
3076
+ [value]="endCap"
3077
+ [buttonTitle]="messageFor('endCapTitle')"
3078
+ [buttonIcon]="endCapIcon"
3079
+ [data]="endCapItems"
3080
+ [columns]="endCapItems.length"
3081
+ [popupClass]="dropdownPopupClass"
3082
+ overlayOwner="connection-toolbar"
3083
+ (valueSelect)="setEndCap($event)"
3084
+ ></kendo-diagram-icons-dropdown>
3085
+ </kendo-diagram-toolbar-tool>
3086
+ }
3087
+ @case ('text') {
3088
+ <kendo-toolbar-button
3089
+ fillMode="flat"
3090
+ [svgIcon]="freeTextIcon"
3091
+ [title]="messageFor('editTextTitle')"
3092
+ [attr.aria-label]="messageFor('editTextTitle')"
3093
+ (click)="openTextEditor()"
3094
+ ></kendo-toolbar-button>
3095
+ }
3096
+ @case ('delete') {
3097
+ <kendo-toolbar-button
3098
+ fillMode="flat"
3099
+ [svgIcon]="trashIcon"
3100
+ [title]="messageFor('deleteTitle')"
3101
+ [attr.aria-label]="messageFor('deleteTitle')"
3102
+ (click)="deleteSelection()"
3103
+ ></kendo-toolbar-button>
3104
+ }
3105
+ @case ('separator') {
3106
+ <kendo-toolbar-separator></kendo-toolbar-separator>
3107
+ }
3108
+ }
3109
+ </ng-template>
3110
+ @for (tool of tools; track $index) {
3111
+ @if (isArray(tool)) {
3112
+ <kendo-toolbar-buttongroup>
3113
+ @for (subTool of $any(tool); track $index) {
3114
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: subTool }"></ng-container>
3115
+ }
3116
+ </kendo-toolbar-buttongroup>
3117
+ } @else {
3118
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: tool }"></ng-container>
3119
+ }
3120
+ }
3121
+ </kendo-toolbar>
3122
+ `
3123
+ }]
3124
+ }], ctorParameters: () => [{ type: i1$1.LocalizationService }], propDecorators: { controller: [{
3125
+ type: Input
3126
+ }], connection: [{
3127
+ type: Input
3128
+ }], stateVersion: [{
3129
+ type: Input
3130
+ }], tools: [{
3131
+ type: Input
3132
+ }], ariaLabel: [{
3133
+ type: Input
3134
+ }] } });
3135
+
3136
+ const defaultTextToolbarTools = [
3137
+ 'color',
3138
+ 'separator',
3139
+ 'fontSize',
3140
+ 'separator',
3141
+ 'fontType',
3142
+ 'separator',
3143
+ 'bold',
3144
+ 'italic',
3145
+ 'underline',
3146
+ 'separator',
3147
+ 'align'
3148
+ ];
3149
+ class TextEditingToolbarComponent {
3150
+ localization;
3151
+ injector;
3152
+ cdr;
3153
+ controller = null;
3154
+ editor = null;
3155
+ tools = defaultTextToolbarTools;
3156
+ fontTypes = EditingUtils.Data.fontNames;
3157
+ fontSizes = EditingUtils.Data.fontSizes;
3158
+ fontSize;
3159
+ fontType;
3160
+ color;
3161
+ bold = false;
3162
+ italic = false;
3163
+ underline = false;
3164
+ renderVerticalAlignment = false;
3165
+ ariaLabel;
3166
+ alignmentChange = new EventEmitter();
3167
+ stateChange = new EventEmitter();
3168
+ set alignment(value) {
3169
+ const { horizontal, vertical } = EditingUtils.parseAlignment(value ?? '');
3170
+ this.horizontalAlignment = horizontal;
3171
+ this.horizontalAlignmentIcon = this.horizontalAlignments.find((item) => item.value === horizontal)?.icon ?? alignLeftIcon;
3172
+ this.verticalAlignment = vertical;
3173
+ this.verticalAlignmentIcon = this.verticalAlignments.find((item) => item.value === vertical)?.icon ?? alignTopIcon;
3174
+ }
3175
+ popupViewContainer = inject(ViewContainerRef);
3176
+ boldIcon = boldIcon;
3177
+ foregroundColorIcon = foregroundColorIcon;
3178
+ italicIcon = italicIcon;
3179
+ underlineIcon = underlineIcon;
3180
+ alignLeftIcon = alignLeftIcon;
3181
+ alignCenterIcon = alignCenterIcon;
3182
+ alignRightIcon = alignRightIcon;
3183
+ alignTopIcon = alignTopIcon;
3184
+ alignMiddleIcon = alignMiddleIcon;
3185
+ alignBottomIcon = alignBottomIcon;
3186
+ horizontalAlignment = 'left';
3187
+ horizontalAlignmentIcon = alignLeftIcon;
3188
+ verticalAlignment = 'top';
3189
+ verticalAlignmentIcon = alignTopIcon;
3190
+ horizontalAlignments = [];
3191
+ verticalAlignments = [];
3192
+ subs = new Subscription();
3193
+ overlaySurfaceCleanup = null;
3194
+ constructor(localization, injector, cdr) {
3195
+ this.localization = localization;
3196
+ this.injector = injector;
3197
+ this.cdr = cdr;
3198
+ this.buildAlignmentItems();
3199
+ this.subs.add(this.localization.changes.subscribe(() => {
3200
+ this.buildAlignmentItems();
3201
+ this.cdr.markForCheck();
3202
+ }));
3203
+ }
3204
+ ngOnDestroy() {
3205
+ this.subs.unsubscribe();
3206
+ this.releaseOverlaySurface();
3207
+ }
3208
+ isArray(value) {
3209
+ return Array.isArray(value);
3210
+ }
3211
+ messageFor(key) {
3212
+ return this.localization.get(key);
3213
+ }
3214
+ execute(command, value) {
3215
+ this.editor?.exec(command, value);
3216
+ this.stateChange.emit();
3217
+ this.editor?.focus();
3218
+ }
3219
+ onColorPickerOpen() {
3220
+ afterNextRender(() => this.registerOverlaySurface('k-colorpicker-popup'), { injector: this.injector });
3221
+ }
3222
+ onColorPickerClose() {
3223
+ this.releaseOverlaySurface();
3224
+ }
3225
+ // Registers a toolbar overlay popup as an editor surface so interacting with it does not close the text editor.
3226
+ registerOverlaySurface(popupClass) {
3227
+ const doc = this.popupViewContainer.element.nativeElement.ownerDocument;
3228
+ const popupElement = doc?.querySelector(`.${popupClass}`);
3229
+ if (this.controller && popupElement) {
3230
+ this.releaseOverlaySurface();
3231
+ this.overlaySurfaceCleanup = this.controller.registerSurface(popupElement);
3232
+ }
3233
+ }
3234
+ releaseOverlaySurface() {
3235
+ this.overlaySurfaceCleanup?.();
3236
+ this.overlaySurfaceCleanup = null;
3237
+ }
3238
+ setHorizontalAlignment(value) {
3239
+ this.horizontalAlignment = value;
3240
+ this.horizontalAlignmentIcon = this.horizontalAlignments.find((item) => item.value === value)?.icon ?? alignLeftIcon;
3241
+ this.alignmentChange.emit(`${value} ${this.verticalAlignment}`);
3242
+ this.editor?.focus();
3243
+ }
3244
+ setVerticalAlignment(value) {
3245
+ this.verticalAlignment = value;
3246
+ this.verticalAlignmentIcon = this.verticalAlignments.find((item) => item.value === value)?.icon ?? alignTopIcon;
3247
+ this.alignmentChange.emit(`${this.horizontalAlignment} ${value}`);
3248
+ this.editor?.focus();
3249
+ }
3250
+ buildAlignmentItems() {
3251
+ this.horizontalAlignments = [
3252
+ { label: this.messageFor('alignLeftLabel'), value: 'left', icon: alignLeftIcon },
3253
+ { label: this.messageFor('alignCenterLabel'), value: 'center', icon: alignCenterIcon },
3254
+ { label: this.messageFor('alignRightLabel'), value: 'right', icon: alignRightIcon }
3255
+ ];
3256
+ this.verticalAlignments = [
3257
+ { label: this.messageFor('alignTopLabel'), value: 'top', icon: alignTopIcon },
3258
+ { label: this.messageFor('alignMiddleLabel'), value: 'middle', icon: alignMiddleIcon },
3259
+ { label: this.messageFor('alignBottomLabel'), value: 'bottom', icon: alignBottomIcon }
3260
+ ];
3261
+ }
3262
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: TextEditingToolbarComponent, deps: [{ token: i1$1.LocalizationService }, { token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3263
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.32", type: TextEditingToolbarComponent, isStandalone: true, selector: "kendo-diagram-text-editing-toolbar", inputs: { controller: "controller", editor: "editor", tools: "tools", fontTypes: "fontTypes", fontSizes: "fontSizes", fontSize: "fontSize", fontType: "fontType", color: "color", bold: "bold", italic: "italic", underline: "underline", renderVerticalAlignment: "renderVerticalAlignment", ariaLabel: "ariaLabel", alignment: "alignment" }, outputs: { alignmentChange: "alignmentChange", stateChange: "stateChange" }, ngImport: i0, template: `
3264
+ <kendo-toolbar fillMode="flat" [attr.aria-label]="ariaLabel" overflow="scroll">
3265
+ <ng-template #toolTemplate let-tool>
3266
+ @switch (tool) {
3267
+ @case ('color') {
3268
+ <kendo-diagram-toolbar-tool>
3269
+ <kendo-colorpicker
3270
+ [value]="color"
3271
+ [views]="['palette']"
3272
+ [clearButton]="false"
3273
+ fillMode="flat"
3274
+ [svgIcon]="foregroundColorIcon"
3275
+ [attr.title]="messageFor('textColorTitle')"
3276
+ [attr.aria-label]="messageFor('textColorTitle')"
3277
+ (open)="onColorPickerOpen()"
3278
+ (close)="onColorPickerClose()"
3279
+ (valueChange)="execute('foreColor', $event)"
3280
+ ></kendo-colorpicker>
3281
+ </kendo-diagram-toolbar-tool>
3282
+ }
3283
+ @case ('fontSize') {
3284
+ <kendo-diagram-toolbar-tool>
3285
+ <kendo-dropdownlist
3286
+ [data]="fontSizes"
3287
+ textField="text"
3288
+ valueField="value"
3289
+ [value]="fontSize"
3290
+ [valuePrimitive]="true"
3291
+ [popupSettings]="{ popupClass: 'k-diagram-font-size-popup' }"
3292
+ [attr.title]="messageFor('fontSizeTitle')"
3293
+ [attr.aria-label]="messageFor('fontSizeTitle')"
3294
+ (opened)="registerOverlaySurface('k-diagram-font-size-popup')"
3295
+ (closed)="releaseOverlaySurface()"
3296
+ (valueChange)="execute('fontSize', $event)"
3297
+ ></kendo-dropdownlist>
3298
+ </kendo-diagram-toolbar-tool>
3299
+ }
3300
+ @case ('fontType') {
3301
+ <kendo-diagram-toolbar-tool>
3302
+ <kendo-dropdownlist
3303
+ [data]="fontTypes"
3304
+ textField="text"
3305
+ valueField="value"
3306
+ [value]="fontType"
3307
+ [valuePrimitive]="true"
3308
+ [popupSettings]="{ popupClass: 'k-diagram-font-type-popup' }"
3309
+ [attr.title]="messageFor('fontTypeTitle')"
3310
+ [attr.aria-label]="messageFor('fontTypeTitle')"
3311
+ (opened)="registerOverlaySurface('k-diagram-font-type-popup')"
3312
+ (closed)="releaseOverlaySurface()"
3313
+ (valueChange)="execute('fontFamily', $event)"
3314
+ >
3315
+ <ng-template kendoDropDownListItemTemplate let-dataItem>
3316
+ <span [style.font-family]="dataItem.value">{{ dataItem.text }}</span>
3317
+ </ng-template>
3318
+ </kendo-dropdownlist>
3319
+ </kendo-diagram-toolbar-tool>
3320
+ }
3321
+ @case ('bold') {
3322
+ <kendo-toolbar-button
3323
+ fillMode="flat"
3324
+ [selected]="bold"
3325
+ [svgIcon]="boldIcon"
3326
+ [title]="messageFor('boldTitle')"
3327
+ [attr.aria-label]="messageFor('boldTitle')"
3328
+ (pointerdown)="$event.preventDefault()"
3329
+ (click)="execute('bold')"
3330
+ ></kendo-toolbar-button>
3331
+ }
3332
+ @case ('italic') {
3333
+ <kendo-toolbar-button
3334
+ fillMode="flat"
3335
+ [selected]="italic"
3336
+ [svgIcon]="italicIcon"
3337
+ [title]="messageFor('italicTitle')"
3338
+ [attr.aria-label]="messageFor('italicTitle')"
3339
+ (pointerdown)="$event.preventDefault()"
3340
+ (click)="execute('italic')"
3341
+ ></kendo-toolbar-button>
3342
+ }
3343
+ @case ('underline') {
3344
+ <kendo-toolbar-button
3345
+ fillMode="flat"
3346
+ [selected]="underline"
3347
+ [svgIcon]="underlineIcon"
3348
+ [title]="messageFor('underlineTitle')"
3349
+ (pointerdown)="$event.preventDefault()"
3350
+ [attr.aria-label]="messageFor('underlineTitle')"
3351
+ (click)="execute('underline')"
3352
+ ></kendo-toolbar-button>
3353
+ }
3354
+ @case ('align') {
3355
+ <kendo-diagram-toolbar-tool>
3356
+ <kendo-diagram-icons-dropdown
3357
+ [controller]="controller"
3358
+ [data]="horizontalAlignments"
3359
+ [value]="horizontalAlignment"
3360
+ [buttonIcon]="horizontalAlignmentIcon"
3361
+ [buttonTitle]="messageFor('alignHorizontalTitle')"
3362
+ overlayOwner="text-toolbar"
3363
+ [columns]="3"
3364
+ (valueSelect)="setHorizontalAlignment($event)"
3365
+ ></kendo-diagram-icons-dropdown>
3366
+ </kendo-diagram-toolbar-tool>
3367
+ @if (renderVerticalAlignment) {
3368
+ <kendo-diagram-toolbar-tool>
3369
+ <kendo-diagram-icons-dropdown
3370
+ [controller]="controller"
3371
+ [data]="verticalAlignments"
3372
+ [value]="verticalAlignment"
3373
+ [buttonIcon]="verticalAlignmentIcon"
3374
+ [buttonTitle]="messageFor('alignVerticalTitle')"
3375
+ overlayOwner="text-toolbar"
3376
+ [columns]="3"
3377
+ (valueSelect)="setVerticalAlignment($event)"
3378
+ ></kendo-diagram-icons-dropdown>
3379
+ </kendo-diagram-toolbar-tool>
3380
+ }
3381
+ }
3382
+ @case ('separator') {
3383
+ <kendo-toolbar-separator></kendo-toolbar-separator>
3384
+ }
3385
+ }
3386
+ </ng-template>
3387
+ @for (tool of tools; track $index) {
3388
+ @if (isArray(tool)) {
3389
+ <kendo-toolbar-buttongroup>
3390
+ @for (subTool of $any(tool); track $index) {
3391
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: subTool }"></ng-container>
3392
+ }
3393
+ </kendo-toolbar-buttongroup>
3394
+ } @else {
3395
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: tool }"></ng-container>
3396
+ }
3397
+ }
3398
+ </kendo-toolbar>
3399
+ `, isInline: true, dependencies: [{ kind: "component", type: ToolBarComponent, selector: "kendo-toolbar", inputs: ["overflow", "resizable", "popupSettings", "fillMode", "tabindex", "size", "tabIndex", "showIcon", "showText", "toolsSource"], outputs: ["open", "close"], exportAs: ["kendoToolBar"] }, { kind: "component", type: ToolBarButtonComponent, selector: "kendo-toolbar-button", inputs: ["showText", "showIcon", "text", "style", "className", "title", "disabled", "toggleable", "look", "togglable", "selected", "fillMode", "rounded", "themeColor", "icon", "iconClass", "svgIcon", "imageUrl"], outputs: ["click", "pointerdown", "selectedChange"], exportAs: ["kendoToolBarButton"] }, { kind: "component", type: ToolBarButtonGroupComponent, selector: "kendo-toolbar-buttongroup", inputs: ["disabled", "fillMode", "selection", "width", "look"], exportAs: ["kendoToolBarButtonGroup"] }, { kind: "component", type: ToolBarSeparatorComponent, selector: "kendo-toolbar-separator", exportAs: ["kendoToolBarSeparator"] }, { kind: "component", type: DiagramToolbarToolComponent, selector: "kendo-diagram-toolbar-tool" }, { kind: "component", type: ColorPickerComponent, selector: "kendo-colorpicker", inputs: ["views", "view", "adaptiveMode", "activeView", "readonly", "disabled", "format", "value", "popupSettings", "paletteSettings", "gradientSettings", "icon", "iconClass", "svgIcon", "adaptiveTitle", "adaptiveSubtitle", "clearButton", "tabindex", "preview", "actionsLayout", "size", "rounded", "fillMode"], outputs: ["valueChange", "open", "close", "focus", "blur", "cancel", "activeColorClick", "clearButtonClick", "activeViewChange"], exportAs: ["kendoColorPicker"] }, { kind: "component", type: DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["customIconClass", "showStickyHeader", "icon", "svgIcon", "loading", "data", "value", "textField", "valueField", "adaptiveMode", "adaptiveTitle", "adaptiveSubtitle", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "leftRightArrowsNavigation", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }, { kind: "directive", type: ItemTemplateDirective, selector: "[kendoDropDownListItemTemplate],[kendoComboBoxItemTemplate],[kendoAutoCompleteItemTemplate],[kendoMultiSelectItemTemplate]" }, { kind: "component", type: IconsDropdownComponent, selector: "kendo-diagram-icons-dropdown", inputs: ["controller", "value", "active", "buttonTitle", "buttonIcon", "data", "columns", "popupClass", "overlayOwner"], outputs: ["valueSelect", "escape"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3400
+ }
3401
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: TextEditingToolbarComponent, decorators: [{
3402
+ type: Component,
3403
+ args: [{
3404
+ selector: 'kendo-diagram-text-editing-toolbar',
3405
+ standalone: true,
3406
+ changeDetection: ChangeDetectionStrategy.OnPush,
3407
+ imports: [
3408
+ ToolBarComponent,
3409
+ ToolBarButtonComponent,
3410
+ ToolBarButtonGroupComponent,
3411
+ ToolBarSeparatorComponent,
3412
+ DiagramToolbarToolComponent,
3413
+ ColorPickerComponent,
3414
+ DropDownListComponent,
3415
+ ItemTemplateDirective,
3416
+ IconsDropdownComponent,
3417
+ NgTemplateOutlet
3418
+ ],
3419
+ template: `
3420
+ <kendo-toolbar fillMode="flat" [attr.aria-label]="ariaLabel" overflow="scroll">
3421
+ <ng-template #toolTemplate let-tool>
3422
+ @switch (tool) {
3423
+ @case ('color') {
3424
+ <kendo-diagram-toolbar-tool>
3425
+ <kendo-colorpicker
3426
+ [value]="color"
3427
+ [views]="['palette']"
3428
+ [clearButton]="false"
3429
+ fillMode="flat"
3430
+ [svgIcon]="foregroundColorIcon"
3431
+ [attr.title]="messageFor('textColorTitle')"
3432
+ [attr.aria-label]="messageFor('textColorTitle')"
3433
+ (open)="onColorPickerOpen()"
3434
+ (close)="onColorPickerClose()"
3435
+ (valueChange)="execute('foreColor', $event)"
3436
+ ></kendo-colorpicker>
3437
+ </kendo-diagram-toolbar-tool>
3438
+ }
3439
+ @case ('fontSize') {
3440
+ <kendo-diagram-toolbar-tool>
3441
+ <kendo-dropdownlist
3442
+ [data]="fontSizes"
3443
+ textField="text"
3444
+ valueField="value"
3445
+ [value]="fontSize"
3446
+ [valuePrimitive]="true"
3447
+ [popupSettings]="{ popupClass: 'k-diagram-font-size-popup' }"
3448
+ [attr.title]="messageFor('fontSizeTitle')"
3449
+ [attr.aria-label]="messageFor('fontSizeTitle')"
3450
+ (opened)="registerOverlaySurface('k-diagram-font-size-popup')"
3451
+ (closed)="releaseOverlaySurface()"
3452
+ (valueChange)="execute('fontSize', $event)"
3453
+ ></kendo-dropdownlist>
3454
+ </kendo-diagram-toolbar-tool>
3455
+ }
3456
+ @case ('fontType') {
3457
+ <kendo-diagram-toolbar-tool>
3458
+ <kendo-dropdownlist
3459
+ [data]="fontTypes"
3460
+ textField="text"
3461
+ valueField="value"
3462
+ [value]="fontType"
3463
+ [valuePrimitive]="true"
3464
+ [popupSettings]="{ popupClass: 'k-diagram-font-type-popup' }"
3465
+ [attr.title]="messageFor('fontTypeTitle')"
3466
+ [attr.aria-label]="messageFor('fontTypeTitle')"
3467
+ (opened)="registerOverlaySurface('k-diagram-font-type-popup')"
3468
+ (closed)="releaseOverlaySurface()"
3469
+ (valueChange)="execute('fontFamily', $event)"
3470
+ >
3471
+ <ng-template kendoDropDownListItemTemplate let-dataItem>
3472
+ <span [style.font-family]="dataItem.value">{{ dataItem.text }}</span>
3473
+ </ng-template>
3474
+ </kendo-dropdownlist>
3475
+ </kendo-diagram-toolbar-tool>
3476
+ }
3477
+ @case ('bold') {
3478
+ <kendo-toolbar-button
3479
+ fillMode="flat"
3480
+ [selected]="bold"
3481
+ [svgIcon]="boldIcon"
3482
+ [title]="messageFor('boldTitle')"
3483
+ [attr.aria-label]="messageFor('boldTitle')"
3484
+ (pointerdown)="$event.preventDefault()"
3485
+ (click)="execute('bold')"
3486
+ ></kendo-toolbar-button>
3487
+ }
3488
+ @case ('italic') {
3489
+ <kendo-toolbar-button
3490
+ fillMode="flat"
3491
+ [selected]="italic"
3492
+ [svgIcon]="italicIcon"
3493
+ [title]="messageFor('italicTitle')"
3494
+ [attr.aria-label]="messageFor('italicTitle')"
3495
+ (pointerdown)="$event.preventDefault()"
3496
+ (click)="execute('italic')"
3497
+ ></kendo-toolbar-button>
3498
+ }
3499
+ @case ('underline') {
3500
+ <kendo-toolbar-button
3501
+ fillMode="flat"
3502
+ [selected]="underline"
3503
+ [svgIcon]="underlineIcon"
3504
+ [title]="messageFor('underlineTitle')"
3505
+ (pointerdown)="$event.preventDefault()"
3506
+ [attr.aria-label]="messageFor('underlineTitle')"
3507
+ (click)="execute('underline')"
3508
+ ></kendo-toolbar-button>
3509
+ }
3510
+ @case ('align') {
3511
+ <kendo-diagram-toolbar-tool>
3512
+ <kendo-diagram-icons-dropdown
3513
+ [controller]="controller"
3514
+ [data]="horizontalAlignments"
3515
+ [value]="horizontalAlignment"
3516
+ [buttonIcon]="horizontalAlignmentIcon"
3517
+ [buttonTitle]="messageFor('alignHorizontalTitle')"
3518
+ overlayOwner="text-toolbar"
3519
+ [columns]="3"
3520
+ (valueSelect)="setHorizontalAlignment($event)"
3521
+ ></kendo-diagram-icons-dropdown>
3522
+ </kendo-diagram-toolbar-tool>
3523
+ @if (renderVerticalAlignment) {
3524
+ <kendo-diagram-toolbar-tool>
3525
+ <kendo-diagram-icons-dropdown
3526
+ [controller]="controller"
3527
+ [data]="verticalAlignments"
3528
+ [value]="verticalAlignment"
3529
+ [buttonIcon]="verticalAlignmentIcon"
3530
+ [buttonTitle]="messageFor('alignVerticalTitle')"
3531
+ overlayOwner="text-toolbar"
3532
+ [columns]="3"
3533
+ (valueSelect)="setVerticalAlignment($event)"
3534
+ ></kendo-diagram-icons-dropdown>
3535
+ </kendo-diagram-toolbar-tool>
3536
+ }
3537
+ }
3538
+ @case ('separator') {
3539
+ <kendo-toolbar-separator></kendo-toolbar-separator>
3540
+ }
3541
+ }
3542
+ </ng-template>
3543
+ @for (tool of tools; track $index) {
3544
+ @if (isArray(tool)) {
3545
+ <kendo-toolbar-buttongroup>
3546
+ @for (subTool of $any(tool); track $index) {
3547
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: subTool }"></ng-container>
3548
+ }
3549
+ </kendo-toolbar-buttongroup>
3550
+ } @else {
3551
+ <ng-container [ngTemplateOutlet]="toolTemplate" [ngTemplateOutletContext]="{ $implicit: tool }"></ng-container>
3552
+ }
3553
+ }
3554
+ </kendo-toolbar>
3555
+ `
3556
+ }]
3557
+ }], ctorParameters: () => [{ type: i1$1.LocalizationService }, { type: i0.Injector }, { type: i0.ChangeDetectorRef }], propDecorators: { controller: [{
3558
+ type: Input
3559
+ }], editor: [{
3560
+ type: Input
3561
+ }], tools: [{
3562
+ type: Input
3563
+ }], fontTypes: [{
3564
+ type: Input
3565
+ }], fontSizes: [{
3566
+ type: Input
3567
+ }], fontSize: [{
3568
+ type: Input
3569
+ }], fontType: [{
3570
+ type: Input
3571
+ }], color: [{
3572
+ type: Input
3573
+ }], bold: [{
3574
+ type: Input
3575
+ }], italic: [{
3576
+ type: Input
3577
+ }], underline: [{
3578
+ type: Input
3579
+ }], renderVerticalAlignment: [{
3580
+ type: Input
3581
+ }], ariaLabel: [{
3582
+ type: Input
3583
+ }], alignmentChange: [{
3584
+ type: Output
3585
+ }], stateChange: [{
3586
+ type: Output
3587
+ }], alignment: [{
3588
+ type: Input
3589
+ }] } });
3590
+
3591
+ const { floatingToolbarStyle } = EditingUtils.Data;
3592
+ const centeredAlign = { horizontal: 'center', vertical: 'center' };
3593
+ const popupAboveAnchor = { horizontal: 'center', vertical: 'bottom' };
3594
+ const popupAtAnchorTop = { horizontal: 'center', vertical: 'top' };
3595
+ const zeroOffset = { left: 0, top: 0 };
3596
+ const hiddenPlacement = { offset: zeroOffset, placement: 'above', visible: false };
3597
+ /**
3598
+ * @hidden
3599
+ * Positions a contextual toolbar next to a diagram item, flipping between the space above and
3600
+ * below the item's anchor point depending on the available room within `boundaryElement`.
3601
+ */
3602
+ class FloatingToolbarPopupComponent {
3603
+ controller = null;
3604
+ set show(value) {
3605
+ this._show.set(value);
3606
+ }
3607
+ get show() {
3608
+ return this._show();
3609
+ }
3610
+ set baseAnchor(value) {
3611
+ this._baseAnchor.set(value);
3612
+ }
3613
+ get baseAnchor() {
3614
+ return this._baseAnchor();
3615
+ }
3616
+ set fallbackAnchor(value) {
3617
+ this._fallbackAnchor.set(value);
3618
+ }
3619
+ get fallbackAnchor() {
3620
+ return this._fallbackAnchor();
3621
+ }
3622
+ set boundaryElement(value) {
3623
+ this._boundaryElement.set(value ?? null);
3624
+ }
3625
+ get boundaryElement() {
3626
+ return this._boundaryElement();
3627
+ }
3628
+ set popup(value) {
3629
+ this._popup = value;
3630
+ if (value) {
3631
+ this.onOpen();
3632
+ }
3633
+ else {
3634
+ this.surfaceCleanup?.();
3635
+ this.surfaceCleanup = null;
3636
+ }
3637
+ }
3638
+ centeredAlign = centeredAlign;
3639
+ shouldRender = computed(() => this._show() && Boolean(this._baseAnchor()), ...(ngDevMode ? [{ debugName: "shouldRender" }] : []));
3640
+ resolvedOffset = computed(() => {
3641
+ const current = this.placement();
3642
+ return current.visible ? current.offset : this._baseAnchor() ?? zeroOffset;
3643
+ }, ...(ngDevMode ? [{ debugName: "resolvedOffset" }] : []));
3644
+ resolvedPopupAlign = computed(() => {
3645
+ const current = this.placement();
3646
+ return current.visible && current.placement === 'below' ? popupAtAnchorTop : popupAboveAnchor;
3647
+ }, ...(ngDevMode ? [{ debugName: "resolvedPopupAlign" }] : []));
3648
+ // Popup content is measured asynchronously because kendo-popup renders it a tick after `shouldRender` becomes true.
3649
+ recomputePlacementEffect = effect(() => {
3650
+ const base = this._baseAnchor();
3651
+ const fallback = this._fallbackAnchor();
3652
+ const boundary = this._boundaryElement();
3653
+ const visible = this.shouldRender();
3654
+ if (!visible || !base) {
3655
+ this.placement.set(hiddenPlacement);
3656
+ return;
3657
+ }
3658
+ if (!boundary || !fallback) {
3659
+ this.placement.set({ offset: base, placement: 'above', visible: true });
3660
+ return;
3661
+ }
3662
+ this.measurePlacement();
3663
+ }, ...(ngDevMode ? [{ debugName: "recomputePlacementEffect" }] : []));
3664
+ _show = signal(false, ...(ngDevMode ? [{ debugName: "_show" }] : []));
3665
+ _baseAnchor = signal(null, ...(ngDevMode ? [{ debugName: "_baseAnchor" }] : []));
3666
+ _fallbackAnchor = signal(null, ...(ngDevMode ? [{ debugName: "_fallbackAnchor" }] : []));
3667
+ _boundaryElement = signal(null, ...(ngDevMode ? [{ debugName: "_boundaryElement" }] : []));
3668
+ placement = signal(hiddenPlacement, ...(ngDevMode ? [{ debugName: "placement" }] : []));
3669
+ popupHeight = 0;
3670
+ surfaceCleanup = null;
3671
+ _popup;
3672
+ get popupElement() {
3673
+ return this._popup?.contentContainer?.nativeElement;
3674
+ }
3675
+ ngOnDestroy() {
3676
+ this.surfaceCleanup?.();
3677
+ this.surfaceCleanup = null;
3678
+ }
3679
+ onOpen() {
3680
+ const popupElement = this.popupElement;
3681
+ if (!isDocumentAvailable() || !popupElement) {
3682
+ return;
3683
+ }
3684
+ Object.assign(popupElement.style, floatingToolbarStyle);
3685
+ this.surfaceCleanup?.();
3686
+ this.surfaceCleanup = this.controller?.registerSurface(popupElement) ?? null;
3687
+ }
3688
+ measurePlacement() {
3689
+ const base = this._baseAnchor();
3690
+ const fallback = this._fallbackAnchor();
3691
+ const boundary = this._boundaryElement();
3692
+ if (!isDocumentAvailable() || !base || !fallback || !boundary) {
3693
+ return;
3694
+ }
3695
+ const popupElement = this.popupElement;
3696
+ const measuredHeight = popupElement?.getBoundingClientRect().height || 0;
3697
+ if (measuredHeight > 0) {
3698
+ this.popupHeight = measuredHeight;
3699
+ }
3700
+ if (this.popupHeight <= 0) {
3701
+ this.placement.set({ offset: base, placement: 'above', visible: true });
3702
+ return;
3703
+ }
3704
+ const boundaryRect = boundary.getBoundingClientRect();
3705
+ const ownerWindow = boundary.ownerDocument.defaultView;
3706
+ const scrollY = ownerWindow?.scrollY ?? 0;
3707
+ this.placement.set(resolveFloatingToolbarPlacement({
3708
+ baseAnchor: base,
3709
+ fallbackAnchor: fallback,
3710
+ popupHeight: this.popupHeight,
3711
+ boundaryTop: boundaryRect.top + scrollY,
3712
+ boundaryBottom: boundaryRect.bottom + scrollY
3713
+ }));
3714
+ }
3715
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: FloatingToolbarPopupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3716
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.32", type: FloatingToolbarPopupComponent, isStandalone: true, selector: "kendo-diagram-floating-toolbar-popup", inputs: { controller: "controller", show: "show", baseAnchor: "baseAnchor", fallbackAnchor: "fallbackAnchor", boundaryElement: "boundaryElement" }, viewQueries: [{ propertyName: "popup", first: true, predicate: PopupComponent, descendants: true }], ngImport: i0, template: `
3717
+ @if (shouldRender()) {
3718
+ <kendo-popup
3719
+ [anchorAlign]="centeredAlign"
3720
+ [popupAlign]="resolvedPopupAlign()"
3721
+ [offset]="resolvedOffset()"
3722
+ [animate]="false"
3723
+ positionMode="fixed"
3724
+ >
3725
+ <ng-content></ng-content>
3726
+ </kendo-popup>
3727
+ }
3728
+ `, isInline: true, dependencies: [{ kind: "component", type: PopupComponent, selector: "kendo-popup", inputs: ["animate", "anchor", "anchorAlign", "collision", "popupAlign", "copyAnchorStyles", "popupClass", "positionMode", "offset", "margin"], outputs: ["anchorViewportLeave", "close", "open", "positionChange"], exportAs: ["kendo-popup"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3729
+ }
3730
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: FloatingToolbarPopupComponent, decorators: [{
3731
+ type: Component,
3732
+ args: [{
3733
+ selector: 'kendo-diagram-floating-toolbar-popup',
3734
+ standalone: true,
3735
+ changeDetection: ChangeDetectionStrategy.OnPush,
3736
+ imports: [PopupComponent],
3737
+ template: `
3738
+ @if (shouldRender()) {
3739
+ <kendo-popup
3740
+ [anchorAlign]="centeredAlign"
3741
+ [popupAlign]="resolvedPopupAlign()"
3742
+ [offset]="resolvedOffset()"
3743
+ [animate]="false"
3744
+ positionMode="fixed"
3745
+ >
3746
+ <ng-content></ng-content>
3747
+ </kendo-popup>
3748
+ }
3749
+ `
3750
+ }]
3751
+ }], propDecorators: { controller: [{
3752
+ type: Input
3753
+ }], show: [{
3754
+ type: Input
3755
+ }], baseAnchor: [{
3756
+ type: Input
3757
+ }], fallbackAnchor: [{
3758
+ type: Input
3759
+ }], boundaryElement: [{
3760
+ type: Input
3761
+ }], popup: [{
3762
+ type: ViewChild,
3763
+ args: [PopupComponent]
3764
+ }] } });
3765
+
3766
+ /**
3767
+ * @hidden
3768
+ */
3769
+ class DiagramEditorMessages extends ComponentMessages {
3770
+ /**
3771
+ * Sets the title of the undo tool in the main toolbar.
3772
+ */
3773
+ undoTitle;
3774
+ /**
3775
+ * Sets the title of the redo tool in the main toolbar.
3776
+ */
3777
+ redoTitle;
3778
+ /**
3779
+ * Sets the title of the select tool in the main toolbar.
3780
+ */
3781
+ selectTitle;
3782
+ /**
3783
+ * Sets the title of the pan tool in the main toolbar.
3784
+ */
3785
+ panTitle;
3786
+ /**
3787
+ * Sets the title of the text insertion tool in the main toolbar.
3788
+ */
3789
+ textTitle;
3790
+ /**
3791
+ * Sets the title of the shape insertion tool in the main toolbar.
3792
+ */
3793
+ shapeTitle;
3794
+ /**
3795
+ * Sets the label of the collate shape.
3796
+ */
3797
+ shapeCollateLabel;
3798
+ /**
3799
+ * Sets the label of the connector shape.
3800
+ */
3801
+ shapeConnectorLabel;
3802
+ /**
3803
+ * Sets the label of the data storage shape.
3804
+ */
3805
+ shapeDataStorageLabel;
3806
+ /**
3807
+ * Sets the label of the database shape.
3808
+ */
3809
+ shapeDatabaseLabel;
3810
+ /**
3811
+ * Sets the label of the decision shape.
3812
+ */
3813
+ shapeDecisionLabel;
3814
+ /**
3815
+ * Sets the label of the delay shape.
3816
+ */
3817
+ shapeDelayLabel;
3818
+ /**
3819
+ * Sets the label of the direct access storage shape.
3820
+ */
3821
+ shapeDirectAccessStorageLabel;
3822
+ /**
3823
+ * Sets the label of the display shape.
3824
+ */
3825
+ shapeDisplayLabel;
3826
+ /**
3827
+ * Sets the label of the document shape.
3828
+ */
3829
+ shapeDocumentLabel;
3830
+ /**
3831
+ * Sets the label of the extract shape.
3832
+ */
3833
+ shapeExtractLabel;
3834
+ /**
3835
+ * Sets the label of the input output shape.
3836
+ */
3837
+ shapeInputOutputLabel;
3838
+ /**
3839
+ * Sets the label of the internal storage shape.
3840
+ */
3841
+ shapeInternalStorageLabel;
3842
+ /**
3843
+ * Sets the label of the logical OR shape.
3844
+ */
3845
+ shapeLogicalOrLabel;
3846
+ /**
3847
+ * Sets the label of the manual input output shape.
3848
+ */
3849
+ shapeManualInputOutputLabel;
3850
+ /**
3851
+ * Sets the label of the manual operation shape.
3852
+ */
3853
+ shapeManualOperationLabel;
3854
+ /**
3855
+ * Sets the label of the merge shape.
3856
+ */
3857
+ shapeMergeLabel;
3858
+ /**
3859
+ * Sets the label of the multiple documents shape.
3860
+ */
3861
+ shapeMultipleDocumentsLabel;
3862
+ /**
3863
+ * Sets the label of the off-page connector shape.
3864
+ */
3865
+ shapeOffPageConnectorLabel;
3866
+ /**
3867
+ * Sets the label of the predefined process shape.
3868
+ */
3869
+ shapePredefinedProcessLabel;
3870
+ /**
3871
+ * Sets the label of the preparation shape.
3872
+ */
3873
+ shapePreparationLabel;
3874
+ /**
3875
+ * Sets the label of the process shape.
3876
+ */
3877
+ shapeProcessLabel;
3878
+ /**
3879
+ * Sets the label of the sort shape.
3880
+ */
3881
+ shapeSortLabel;
3882
+ /**
3883
+ * Sets the label of the summing junction shape.
3884
+ */
3885
+ shapeSummingJunctionLabel;
3886
+ /**
3887
+ * Sets the label of the terminator shape.
3888
+ */
3889
+ shapeTerminatorLabel;
3890
+ /**
3891
+ * Sets the title of the shape type tool in the shape editing toolbar.
3892
+ */
3893
+ shapeTypeTitle;
3894
+ /**
3895
+ * Sets the title of the fill color tool in the shape editing toolbar.
3896
+ */
3897
+ fillColorTitle;
3898
+ /**
3899
+ * Sets the title of the border width tool in the shape and connection editing toolbars.
3900
+ */
3901
+ borderWidthTitle;
3902
+ /**
3903
+ * Sets the title of the border color tool in the shape editing toolbar.
3904
+ */
3905
+ borderColorTitle;
3906
+ /**
3907
+ * Sets the title of the border style tool in the shape and connection editing toolbars.
3908
+ */
3909
+ borderStyleTitle;
3910
+ /**
3911
+ * Sets the label of the solid border style.
3912
+ */
3913
+ borderStyleSolidLabel;
3914
+ /**
3915
+ * Sets the label of the dotted border style.
3916
+ */
3917
+ borderStyleDottedLabel;
3918
+ /**
3919
+ * Sets the label of the dashed border style.
3920
+ */
3921
+ borderStyleDashedLabel;
3922
+ /**
3923
+ * Sets the label of the dash-dot border style.
3924
+ */
3925
+ borderStyleDashDotLabel;
3926
+ /**
3927
+ * Sets the label of the long dash border style.
3928
+ */
3929
+ borderStyleLongDashLabel;
3930
+ /**
3931
+ * Sets the label of the long dash-dot border style.
3932
+ */
3933
+ borderStyleLongDashDotLabel;
3934
+ /**
3935
+ * Sets the label of the long dash-dot-dot border style.
3936
+ */
3937
+ borderStyleLongDashDotDotLabel;
3938
+ /**
3939
+ * Sets the title of the bring-to-front tool in the shape editing toolbar.
3940
+ */
3941
+ toFrontTitle;
3942
+ /**
3943
+ * Sets the title of the send-to-back tool in the shape editing toolbar.
3944
+ */
3945
+ toBackTitle;
3946
+ /**
3947
+ * Sets the title of the rotate-left tool in the shape editing toolbar.
3948
+ */
3949
+ rotateLeftTitle;
3950
+ /**
3951
+ * Sets the title of the rotate-right tool in the shape editing toolbar.
3952
+ */
3953
+ rotateRightTitle;
3954
+ /**
3955
+ * Sets the title of the duplicate tool in the shape editing toolbar.
3956
+ */
3957
+ duplicateTitle;
3958
+ /**
3959
+ * Sets the title of the delete tool in the shape editing toolbar.
3960
+ */
3961
+ deleteTitle;
3962
+ /**
3963
+ * Sets the title of the connection type tool in the connection editing toolbar.
3964
+ */
3965
+ connectionTypeTitle;
3966
+ /**
3967
+ * Sets the label of the cascading connection type.
3968
+ */
3969
+ connectionTypeCascadingLabel;
3970
+ /**
3971
+ * Sets the label of the polyline connection type.
3972
+ */
3973
+ connectionTypePolylineLabel;
3974
+ /**
3975
+ * Sets the title of the start cap tool in the connection editing toolbar.
3976
+ */
3977
+ startCapTitle;
3978
+ /**
3979
+ * Sets the title of the end cap tool in the connection editing toolbar.
3980
+ */
3981
+ endCapTitle;
3982
+ /**
3983
+ * Sets the label of the no-cap option.
3984
+ */
3985
+ capNoneLabel;
3986
+ /**
3987
+ * Sets the label of the arrow cap option.
3988
+ */
3989
+ capArrowLabel;
3990
+ /**
3991
+ * Sets the label of the triangle arrow cap option.
3992
+ */
3993
+ capTriangleArrowLabel;
3994
+ /**
3995
+ * Sets the label of the line arrow cap option.
3996
+ */
3997
+ capLineArrowLabel;
3998
+ /**
3999
+ * Sets the label of the filled circle cap option.
4000
+ */
4001
+ capFilledCircleLabel;
4002
+ /**
4003
+ * Sets the label of the filled diamond cap option.
4004
+ */
4005
+ capFilledDiamondLabel;
4006
+ /**
4007
+ * Sets the title of the connection color tool in the connection editing toolbar.
4008
+ */
4009
+ connectionColorTitle;
4010
+ /**
4011
+ * Sets the title of the connection width tool in the connection editing toolbar.
4012
+ */
4013
+ connectionWidthTitle;
4014
+ /**
4015
+ * Sets the title of the connection style tool in the connection editing toolbar.
4016
+ */
4017
+ connectionStyleTitle;
4018
+ /**
4019
+ * Sets the title of the text color tool in the text editing toolbar.
4020
+ */
4021
+ textColorTitle;
4022
+ /**
4023
+ * Sets the title of the font size tool in the text editing toolbar.
4024
+ */
4025
+ fontSizeTitle;
4026
+ /**
4027
+ * Sets the title of the font type tool in the text editing toolbar.
4028
+ */
4029
+ fontTypeTitle;
4030
+ /**
4031
+ * Sets the title of the bold tool in the text editing toolbar.
4032
+ */
4033
+ boldTitle;
4034
+ /**
4035
+ * Sets the title of the italic tool in the text editing toolbar.
4036
+ */
4037
+ italicTitle;
4038
+ /**
4039
+ * Sets the title of the underline tool in the text editing toolbar.
4040
+ */
4041
+ underlineTitle;
4042
+ /**
4043
+ * Sets the title of the horizontal alignment tool in the text editing toolbar.
4044
+ */
4045
+ alignHorizontalTitle;
4046
+ /**
4047
+ * Sets the title of the vertical alignment tool in the text editing toolbar.
4048
+ */
4049
+ alignVerticalTitle;
4050
+ /**
4051
+ * Sets the label of the left horizontal alignment option in the text editing toolbar.
4052
+ */
4053
+ alignLeftLabel;
4054
+ /**
4055
+ * Sets the label of the center horizontal alignment option in the text editing toolbar.
4056
+ */
4057
+ alignCenterLabel;
4058
+ /**
4059
+ * Sets the label of the right horizontal alignment option in the text editing toolbar.
4060
+ */
4061
+ alignRightLabel;
4062
+ /**
4063
+ * Sets the label of the top vertical alignment option in the text editing toolbar.
4064
+ */
4065
+ alignTopLabel;
4066
+ /**
4067
+ * Sets the label of the middle vertical alignment option in the text editing toolbar.
4068
+ */
4069
+ alignMiddleLabel;
4070
+ /**
4071
+ * Sets the label of the bottom vertical alignment option in the text editing toolbar.
4072
+ */
4073
+ alignBottomLabel;
4074
+ /**
4075
+ * Sets the title of the text editing tool in the shape and connection editing toolbars.
4076
+ */
4077
+ editTextTitle;
4078
+ /**
4079
+ * Sets the placeholder text of the text editor.
4080
+ */
4081
+ textEditorPlaceholder;
4082
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramEditorMessages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
4083
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.32", type: DiagramEditorMessages, isStandalone: true, selector: "kendoDiagramEditorMessages", inputs: { undoTitle: "undoTitle", redoTitle: "redoTitle", selectTitle: "selectTitle", panTitle: "panTitle", textTitle: "textTitle", shapeTitle: "shapeTitle", shapeCollateLabel: "shapeCollateLabel", shapeConnectorLabel: "shapeConnectorLabel", shapeDataStorageLabel: "shapeDataStorageLabel", shapeDatabaseLabel: "shapeDatabaseLabel", shapeDecisionLabel: "shapeDecisionLabel", shapeDelayLabel: "shapeDelayLabel", shapeDirectAccessStorageLabel: "shapeDirectAccessStorageLabel", shapeDisplayLabel: "shapeDisplayLabel", shapeDocumentLabel: "shapeDocumentLabel", shapeExtractLabel: "shapeExtractLabel", shapeInputOutputLabel: "shapeInputOutputLabel", shapeInternalStorageLabel: "shapeInternalStorageLabel", shapeLogicalOrLabel: "shapeLogicalOrLabel", shapeManualInputOutputLabel: "shapeManualInputOutputLabel", shapeManualOperationLabel: "shapeManualOperationLabel", shapeMergeLabel: "shapeMergeLabel", shapeMultipleDocumentsLabel: "shapeMultipleDocumentsLabel", shapeOffPageConnectorLabel: "shapeOffPageConnectorLabel", shapePredefinedProcessLabel: "shapePredefinedProcessLabel", shapePreparationLabel: "shapePreparationLabel", shapeProcessLabel: "shapeProcessLabel", shapeSortLabel: "shapeSortLabel", shapeSummingJunctionLabel: "shapeSummingJunctionLabel", shapeTerminatorLabel: "shapeTerminatorLabel", shapeTypeTitle: "shapeTypeTitle", fillColorTitle: "fillColorTitle", borderWidthTitle: "borderWidthTitle", borderColorTitle: "borderColorTitle", borderStyleTitle: "borderStyleTitle", borderStyleSolidLabel: "borderStyleSolidLabel", borderStyleDottedLabel: "borderStyleDottedLabel", borderStyleDashedLabel: "borderStyleDashedLabel", borderStyleDashDotLabel: "borderStyleDashDotLabel", borderStyleLongDashLabel: "borderStyleLongDashLabel", borderStyleLongDashDotLabel: "borderStyleLongDashDotLabel", borderStyleLongDashDotDotLabel: "borderStyleLongDashDotDotLabel", toFrontTitle: "toFrontTitle", toBackTitle: "toBackTitle", rotateLeftTitle: "rotateLeftTitle", rotateRightTitle: "rotateRightTitle", duplicateTitle: "duplicateTitle", deleteTitle: "deleteTitle", connectionTypeTitle: "connectionTypeTitle", connectionTypeCascadingLabel: "connectionTypeCascadingLabel", connectionTypePolylineLabel: "connectionTypePolylineLabel", startCapTitle: "startCapTitle", endCapTitle: "endCapTitle", capNoneLabel: "capNoneLabel", capArrowLabel: "capArrowLabel", capTriangleArrowLabel: "capTriangleArrowLabel", capLineArrowLabel: "capLineArrowLabel", capFilledCircleLabel: "capFilledCircleLabel", capFilledDiamondLabel: "capFilledDiamondLabel", connectionColorTitle: "connectionColorTitle", connectionWidthTitle: "connectionWidthTitle", connectionStyleTitle: "connectionStyleTitle", textColorTitle: "textColorTitle", fontSizeTitle: "fontSizeTitle", fontTypeTitle: "fontTypeTitle", boldTitle: "boldTitle", italicTitle: "italicTitle", underlineTitle: "underlineTitle", alignHorizontalTitle: "alignHorizontalTitle", alignVerticalTitle: "alignVerticalTitle", alignLeftLabel: "alignLeftLabel", alignCenterLabel: "alignCenterLabel", alignRightLabel: "alignRightLabel", alignTopLabel: "alignTopLabel", alignMiddleLabel: "alignMiddleLabel", alignBottomLabel: "alignBottomLabel", editTextTitle: "editTextTitle", textEditorPlaceholder: "textEditorPlaceholder" }, usesInheritance: true, ngImport: i0 });
4084
+ }
4085
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramEditorMessages, decorators: [{
4086
+ type: Directive,
4087
+ args: [{
4088
+ selector: 'kendoDiagramEditorMessages'
4089
+ }]
4090
+ }], propDecorators: { undoTitle: [{
4091
+ type: Input
4092
+ }], redoTitle: [{
4093
+ type: Input
4094
+ }], selectTitle: [{
4095
+ type: Input
4096
+ }], panTitle: [{
4097
+ type: Input
4098
+ }], textTitle: [{
4099
+ type: Input
4100
+ }], shapeTitle: [{
4101
+ type: Input
4102
+ }], shapeCollateLabel: [{
4103
+ type: Input
4104
+ }], shapeConnectorLabel: [{
4105
+ type: Input
4106
+ }], shapeDataStorageLabel: [{
4107
+ type: Input
4108
+ }], shapeDatabaseLabel: [{
4109
+ type: Input
4110
+ }], shapeDecisionLabel: [{
4111
+ type: Input
4112
+ }], shapeDelayLabel: [{
4113
+ type: Input
4114
+ }], shapeDirectAccessStorageLabel: [{
4115
+ type: Input
4116
+ }], shapeDisplayLabel: [{
4117
+ type: Input
4118
+ }], shapeDocumentLabel: [{
4119
+ type: Input
4120
+ }], shapeExtractLabel: [{
4121
+ type: Input
4122
+ }], shapeInputOutputLabel: [{
4123
+ type: Input
4124
+ }], shapeInternalStorageLabel: [{
4125
+ type: Input
4126
+ }], shapeLogicalOrLabel: [{
4127
+ type: Input
4128
+ }], shapeManualInputOutputLabel: [{
4129
+ type: Input
4130
+ }], shapeManualOperationLabel: [{
4131
+ type: Input
4132
+ }], shapeMergeLabel: [{
4133
+ type: Input
4134
+ }], shapeMultipleDocumentsLabel: [{
4135
+ type: Input
4136
+ }], shapeOffPageConnectorLabel: [{
4137
+ type: Input
4138
+ }], shapePredefinedProcessLabel: [{
4139
+ type: Input
4140
+ }], shapePreparationLabel: [{
4141
+ type: Input
4142
+ }], shapeProcessLabel: [{
4143
+ type: Input
4144
+ }], shapeSortLabel: [{
4145
+ type: Input
4146
+ }], shapeSummingJunctionLabel: [{
4147
+ type: Input
4148
+ }], shapeTerminatorLabel: [{
4149
+ type: Input
4150
+ }], shapeTypeTitle: [{
4151
+ type: Input
4152
+ }], fillColorTitle: [{
4153
+ type: Input
4154
+ }], borderWidthTitle: [{
4155
+ type: Input
4156
+ }], borderColorTitle: [{
4157
+ type: Input
4158
+ }], borderStyleTitle: [{
4159
+ type: Input
4160
+ }], borderStyleSolidLabel: [{
4161
+ type: Input
4162
+ }], borderStyleDottedLabel: [{
4163
+ type: Input
4164
+ }], borderStyleDashedLabel: [{
4165
+ type: Input
4166
+ }], borderStyleDashDotLabel: [{
4167
+ type: Input
4168
+ }], borderStyleLongDashLabel: [{
4169
+ type: Input
4170
+ }], borderStyleLongDashDotLabel: [{
4171
+ type: Input
4172
+ }], borderStyleLongDashDotDotLabel: [{
4173
+ type: Input
4174
+ }], toFrontTitle: [{
4175
+ type: Input
4176
+ }], toBackTitle: [{
4177
+ type: Input
4178
+ }], rotateLeftTitle: [{
4179
+ type: Input
4180
+ }], rotateRightTitle: [{
4181
+ type: Input
4182
+ }], duplicateTitle: [{
4183
+ type: Input
4184
+ }], deleteTitle: [{
4185
+ type: Input
4186
+ }], connectionTypeTitle: [{
4187
+ type: Input
4188
+ }], connectionTypeCascadingLabel: [{
4189
+ type: Input
4190
+ }], connectionTypePolylineLabel: [{
4191
+ type: Input
4192
+ }], startCapTitle: [{
4193
+ type: Input
4194
+ }], endCapTitle: [{
4195
+ type: Input
4196
+ }], capNoneLabel: [{
4197
+ type: Input
4198
+ }], capArrowLabel: [{
4199
+ type: Input
4200
+ }], capTriangleArrowLabel: [{
4201
+ type: Input
4202
+ }], capLineArrowLabel: [{
4203
+ type: Input
4204
+ }], capFilledCircleLabel: [{
4205
+ type: Input
4206
+ }], capFilledDiamondLabel: [{
4207
+ type: Input
4208
+ }], connectionColorTitle: [{
4209
+ type: Input
4210
+ }], connectionWidthTitle: [{
4211
+ type: Input
4212
+ }], connectionStyleTitle: [{
4213
+ type: Input
4214
+ }], textColorTitle: [{
4215
+ type: Input
4216
+ }], fontSizeTitle: [{
4217
+ type: Input
4218
+ }], fontTypeTitle: [{
4219
+ type: Input
4220
+ }], boldTitle: [{
4221
+ type: Input
4222
+ }], italicTitle: [{
4223
+ type: Input
4224
+ }], underlineTitle: [{
4225
+ type: Input
4226
+ }], alignHorizontalTitle: [{
4227
+ type: Input
4228
+ }], alignVerticalTitle: [{
4229
+ type: Input
4230
+ }], alignLeftLabel: [{
4231
+ type: Input
4232
+ }], alignCenterLabel: [{
4233
+ type: Input
4234
+ }], alignRightLabel: [{
4235
+ type: Input
4236
+ }], alignTopLabel: [{
4237
+ type: Input
4238
+ }], alignMiddleLabel: [{
4239
+ type: Input
4240
+ }], alignBottomLabel: [{
4241
+ type: Input
4242
+ }], editTextTitle: [{
4243
+ type: Input
4244
+ }], textEditorPlaceholder: [{
4245
+ type: Input
4246
+ }] } });
4247
+
4248
+ /**
4249
+ * @hidden
4250
+ */
4251
+ class DiagramEditorLocalizedMessagesDirective extends DiagramEditorMessages {
4252
+ service;
4253
+ constructor(service) {
4254
+ super();
4255
+ this.service = service;
4256
+ }
4257
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramEditorLocalizedMessagesDirective, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
4258
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.32", type: DiagramEditorLocalizedMessagesDirective, isStandalone: true, selector: "[kendoDiagramEditorLocalizedMessages]", providers: [
4259
+ {
4260
+ provide: DiagramEditorMessages,
4261
+ useExisting: forwardRef(() => DiagramEditorLocalizedMessagesDirective)
4262
+ }
4263
+ ], usesInheritance: true, ngImport: i0 });
4264
+ }
4265
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramEditorLocalizedMessagesDirective, decorators: [{
4266
+ type: Directive,
4267
+ args: [{
4268
+ providers: [
4269
+ {
4270
+ provide: DiagramEditorMessages,
4271
+ useExisting: forwardRef(() => DiagramEditorLocalizedMessagesDirective)
4272
+ }
4273
+ ],
4274
+ selector: '[kendoDiagramEditorLocalizedMessages]',
4275
+ standalone: true
4276
+ }]
4277
+ }], ctorParameters: () => [{ type: i1$1.LocalizationService }] });
4278
+
4279
+ /**
4280
+ * Represents the [Kendo UI Diagram Editor component for Angular](slug:overview_diagrameditor).
4281
+ *
4282
+ * The Diagram Editor renders floating toolbars that let users edit the shapes, connections,
4283
+ * and text of the parent Diagram. Render it inside a `<kendo-diagram>` component.
4284
+ *
4285
+ * @example
4286
+ * ```html
4287
+ * <kendo-diagram>
4288
+ * <kendo-diagram-editor></kendo-diagram-editor>
4289
+ * </kendo-diagram>
4290
+ * ```
4291
+ */
4292
+ class DiagramEditorComponent {
4293
+ host;
4294
+ localization;
4295
+ ngZone;
4296
+ renderer;
4297
+ editorComponent = viewChild(EditorComponent, ...(ngDevMode ? [{ debugName: "editorComponent" }] : []));
4298
+ editorElementRef = viewChild(EditorComponent, ...(ngDevMode ? [{ debugName: "editorElementRef", read: ElementRef }] : [{ read: ElementRef }]));
4299
+ /**
4300
+ * Configures the diagram editor toolbars.
4301
+ */
4302
+ set toolbars(value) {
4303
+ this._toolbars.set(value ?? {});
4304
+ }
4305
+ get toolbars() {
4306
+ return this._toolbars();
4307
+ }
4308
+ /**
4309
+ * Sets the available flowchart shape types shown in the shape tools.
4310
+ */
4311
+ set shapes(value) {
4312
+ this._shapes.set(value);
4313
+ }
4314
+ get shapes() {
4315
+ return this._shapes();
4316
+ }
4317
+ /**
4318
+ * Sets the available font families shown in the text toolbar.
4319
+ */
4320
+ set fontTypes(value) {
4321
+ this._fontTypes.set(value);
4322
+ }
4323
+ get fontTypes() {
4324
+ return this._fontTypes();
4325
+ }
4326
+ /**
4327
+ * Sets the available font sizes shown in the text toolbar.
4328
+ */
4329
+ set fontSizes(value) {
4330
+ this._fontSizes.set(value);
4331
+ }
4332
+ get fontSizes() {
4333
+ return this._fontSizes();
4334
+ }
4335
+ /**
4336
+ * @hidden
4337
+ */
4338
+ controller = signal(null, ...(ngDevMode ? [{ debugName: "controller" }] : []));
4339
+ /**
4340
+ * @hidden
4341
+ */
4342
+ snapshot = signal(emptyDiagramEditorSnapshot, ...(ngDevMode ? [{ debugName: "snapshot" }] : []));
4343
+ textEditorSelectionVersion = signal(0, ...(ngDevMode ? [{ debugName: "textEditorSelectionVersion" }] : []));
4344
+ /**
4345
+ * @hidden
4346
+ */
4347
+ toolbarPopupWrapClass = toolbarPopupWrapClass;
4348
+ get textEditorPlaceholder() {
4349
+ return this.localization.get('textEditorPlaceholder');
4350
+ }
4351
+ get textEditor() {
4352
+ return this.editorComponent();
4353
+ }
4354
+ get textEditorElement() {
4355
+ return this.editorElementRef();
4356
+ }
4357
+ _toolbars = signal({}, ...(ngDevMode ? [{ debugName: "_toolbars" }] : []));
4358
+ _shapes = signal(undefined, ...(ngDevMode ? [{ debugName: "_shapes" }] : []));
4359
+ _fontTypes = signal(undefined, ...(ngDevMode ? [{ debugName: "_fontTypes" }] : []));
4360
+ _fontSizes = signal(undefined, ...(ngDevMode ? [{ debugName: "_fontSizes" }] : []));
4361
+ constructor(host, localization, ngZone, renderer) {
4362
+ this.host = host;
4363
+ this.localization = localization;
4364
+ this.ngZone = ngZone;
4365
+ this.renderer = renderer;
4366
+ }
4367
+ /**
4368
+ * @hidden
4369
+ */
4370
+ resolvedDiagram = computed(() => this.host?.diagramInstance() ?? null, ...(ngDevMode ? [{ debugName: "resolvedDiagram" }] : []));
4371
+ /**
4372
+ * @hidden
4373
+ */
4374
+ mainToolbarOptions = computed(() => {
4375
+ const config = this._toolbars().diagram;
4376
+ const fallback = {
4377
+ position: 'top',
4378
+ tools: defaultMainToolbarTools,
4379
+ shapes: this._shapes()
4380
+ };
4381
+ if (config === undefined) {
4382
+ return fallback;
4383
+ }
4384
+ if (typeof config === 'boolean') {
4385
+ return config ? fallback : { position: 'top', tools: [] };
4386
+ }
4387
+ return {
4388
+ position: config.position ?? 'top',
4389
+ tools: config.tools ?? defaultMainToolbarTools,
4390
+ shapes: config.shapes ?? this._shapes()
4391
+ };
4392
+ }, ...(ngDevMode ? [{ debugName: "mainToolbarOptions" }] : []));
4393
+ /**
4394
+ * @hidden
4395
+ */
4396
+ shapeToolbarOptions = computed(() => {
4397
+ const config = this._toolbars().shape;
4398
+ const fallback = { tools: defaultShapeToolbarTools, shapes: this._shapes() };
4399
+ if (config === undefined) {
4400
+ return fallback;
4401
+ }
4402
+ if (typeof config === 'boolean') {
4403
+ return config ? fallback : { tools: [] };
4404
+ }
4405
+ return {
4406
+ tools: config.tools ?? defaultShapeToolbarTools,
4407
+ shapes: config.shapes ?? this._shapes()
4408
+ };
4409
+ }, ...(ngDevMode ? [{ debugName: "shapeToolbarOptions" }] : []));
4410
+ /**
4411
+ * @hidden
4412
+ */
4413
+ shapeToolbarAnchors = computed(() => getContextToolbarAnchors(this.snapshot().selectedShape, this.snapshot().anchors.shape), ...(ngDevMode ? [{ debugName: "shapeToolbarAnchors" }] : []));
4414
+ /**
4415
+ * @hidden
4416
+ */
4417
+ shapeToolbarVisible = computed(() => {
4418
+ const snapshot = this.snapshot();
4419
+ const selectedShape = snapshot.selectedShape;
4420
+ return Boolean(selectedShape &&
4421
+ this.shapeToolbarAnchors().base &&
4422
+ snapshot.visibility.shape &&
4423
+ this.shapeToolbarOptions().tools.length > 0 &&
4424
+ isDiagramItemVisibleInViewport(selectedShape, this.resolvedDiagram()?.element));
4425
+ }, ...(ngDevMode ? [{ debugName: "shapeToolbarVisible" }] : []));
4426
+ connectionToolbarOptions = computed(() => {
4427
+ const config = this._toolbars().connection;
4428
+ const fallback = { tools: defaultConnectionToolbarTools };
4429
+ if (config === undefined) {
4430
+ return fallback;
4431
+ }
4432
+ if (typeof config === 'boolean') {
4433
+ return config ? fallback : { tools: [] };
4434
+ }
4435
+ return { tools: config.tools ?? defaultConnectionToolbarTools };
4436
+ }, ...(ngDevMode ? [{ debugName: "connectionToolbarOptions" }] : []));
4437
+ connectionToolbarAnchors = computed(() => getContextToolbarAnchors(this.snapshot().selectedConnection, this.snapshot().anchors.connection), ...(ngDevMode ? [{ debugName: "connectionToolbarAnchors" }] : []));
4438
+ connectionToolbarVisible = computed(() => {
4439
+ const snapshot = this.snapshot();
4440
+ const selectedConnection = snapshot.selectedConnection;
4441
+ return Boolean(selectedConnection &&
4442
+ this.connectionToolbarAnchors().base &&
4443
+ snapshot.visibility.connection &&
4444
+ this.connectionToolbarOptions().tools.length > 0 &&
4445
+ isDiagramItemVisibleInViewport(selectedConnection, this.resolvedDiagram()?.element));
4446
+ }, ...(ngDevMode ? [{ debugName: "connectionToolbarVisible" }] : []));
4447
+ textToolbarOptions = computed(() => {
4448
+ const config = this._toolbars().text;
4449
+ const fallback = {
4450
+ tools: defaultTextToolbarTools,
4451
+ fontNames: this.fontTypes ?? EditingUtils.Data.fontNames,
4452
+ fontSizes: this.fontSizes ?? EditingUtils.Data.fontSizes
4453
+ };
4454
+ if (config === undefined) {
4455
+ return fallback;
4456
+ }
4457
+ if (typeof config === 'boolean') {
4458
+ return config ? fallback : { tools: [] };
4459
+ }
4460
+ return {
4461
+ tools: config.tools ?? defaultTextToolbarTools,
4462
+ fontNames: config.fontNames ?? this.fontTypes ?? EditingUtils.Data.fontNames,
4463
+ fontSizes: config.fontSizes ?? this.fontSizes ?? EditingUtils.Data.fontSizes
4464
+ };
4465
+ }, ...(ngDevMode ? [{ debugName: "textToolbarOptions" }] : []));
4466
+ textToolbarAnchor = computed(() => {
4467
+ const anchor = this.snapshot().anchors.textEditing;
4468
+ return anchor ? { left: anchor.x, top: anchor.y } : null;
4469
+ }, ...(ngDevMode ? [{ debugName: "textToolbarAnchor" }] : []));
4470
+ textToolbarVisible = computed(() => {
4471
+ const snapshot = this.snapshot();
4472
+ return Boolean(snapshot.editingSession &&
4473
+ this.textToolbarAnchor() &&
4474
+ snapshot.visibility.textEditing &&
4475
+ this.textToolbarOptions().tools.length > 0);
4476
+ }, ...(ngDevMode ? [{ debugName: "textToolbarVisible" }] : []));
4477
+ activeContextToolbar = computed(() => {
4478
+ if (this.shapeToolbarVisible()) {
4479
+ const anchors = this.shapeToolbarAnchors();
4480
+ return { type: 'shape', baseAnchor: anchors.base, fallbackAnchor: anchors.fallback };
4481
+ }
4482
+ if (this.connectionToolbarVisible()) {
4483
+ const anchors = this.connectionToolbarAnchors();
4484
+ return { type: 'connection', baseAnchor: anchors.base, fallbackAnchor: anchors.fallback };
4485
+ }
4486
+ if (this.textToolbarVisible()) {
4487
+ return { type: 'text', baseAnchor: this.textToolbarAnchor(), fallbackAnchor: null };
4488
+ }
4489
+ return null;
4490
+ }, ...(ngDevMode ? [{ debugName: "activeContextToolbar" }] : []));
4491
+ textToolbarRenderVerticalAlignment = computed(() => {
4492
+ const item = this.snapshot().editingSession?.item;
4493
+ return item?.name === 'Shape' && item.type !== 'text';
4494
+ }, ...(ngDevMode ? [{ debugName: "textToolbarRenderVerticalAlignment" }] : []));
4495
+ textToolbarAlignment = computed(() => {
4496
+ this.textEditorSelectionVersion();
4497
+ const item = this.snapshot().editingSession?.item;
4498
+ return this.textEditor?.view?.state.doc.attrs['alignment'] ?? item?._contentVisual?.options?.align ?? '';
4499
+ }, ...(ngDevMode ? [{ debugName: "textToolbarAlignment" }] : []));
4500
+ textToolbarBold = computed(() => this.hasTextEditorMark(bold), ...(ngDevMode ? [{ debugName: "textToolbarBold" }] : []));
4501
+ textToolbarItalic = computed(() => this.hasTextEditorMark(italic), ...(ngDevMode ? [{ debugName: "textToolbarItalic" }] : []));
4502
+ textToolbarUnderline = computed(() => this.hasTextEditorMark(underline), ...(ngDevMode ? [{ debugName: "textToolbarUnderline" }] : []));
4503
+ textToolbarFontSize = computed(() => {
4504
+ this.textEditorSelectionVersion();
4505
+ const item = this.snapshot().editingSession?.item;
4506
+ const fontSizes = this.getTextEditorInlineStyles('font-size');
4507
+ if (fontSizes.length === 1) {
4508
+ return fontSizes[0];
4509
+ }
4510
+ const fallback = item?._contentVisual?.options?.fontSize ?? this.resolvedDiagram()?.options?.shapeDefaults?.content?.fontSize;
4511
+ return typeof fallback === 'number' ? `${fallback}px` : fallback;
4512
+ }, ...(ngDevMode ? [{ debugName: "textToolbarFontSize" }] : []));
4513
+ textToolbarFontType = computed(() => {
4514
+ this.textEditorSelectionVersion();
4515
+ const item = this.snapshot().editingSession?.item;
4516
+ const fontFamilies = this.getTextEditorInlineStyles('font-family');
4517
+ if (fontFamilies.length === 1) {
4518
+ return fontFamilies[0];
4519
+ }
4520
+ return item?._contentVisual?.options?.fontFamily ?? this.resolvedDiagram()?.options?.shapeDefaults?.content?.fontFamily;
4521
+ }, ...(ngDevMode ? [{ debugName: "textToolbarFontType" }] : []));
4522
+ textToolbarColor = computed(() => {
4523
+ this.textEditorSelectionVersion();
4524
+ const item = this.snapshot().editingSession?.item;
4525
+ const colors = this.getTextEditorInlineStyles('color');
4526
+ if (colors.length === 1) {
4527
+ return colors[0];
4528
+ }
4529
+ return item?._contentVisual?.options?.color ?? this.resolvedDiagram()?.options?.shapeDefaults?.content?.color;
4530
+ }, ...(ngDevMode ? [{ debugName: "textToolbarColor" }] : []));
4531
+ onTextEditorAlignmentChange(value) {
4532
+ const view = this.textEditor?.view;
4533
+ if (!view) {
4534
+ return;
4535
+ }
4536
+ const requestedAlignment = EditingUtils.parseAlignment(value);
4537
+ const currentAlignment = EditingUtils.parseAlignment(view.state.doc.attrs['alignment'] || 'left top');
4538
+ const alignment = `${requestedAlignment.horizontal || currentAlignment.horizontal} ${requestedAlignment.vertical || currentAlignment.vertical}`;
4539
+ view.updateState(view.state.apply(view.state.tr.setDocAttribute('alignment', alignment)));
4540
+ this.recalculateTextEditorAlignment();
4541
+ }
4542
+ recalculateTextEditorAlignment() {
4543
+ const view = this.textEditor?.view;
4544
+ const item = this.snapshot().editingSession?.item;
4545
+ if (!view || !item) {
4546
+ return;
4547
+ }
4548
+ const defaultPadding = item.name === 'Shape' ? item._contentVisual.padding() : { top: 0, bottom: 0, left: 0, right: 0 };
4549
+ EditingUtils.recalcVerticalAlign(view.state.doc.attrs['alignment'] || 'left top', view.dom, defaultPadding);
4550
+ }
4551
+ refreshTextEditorSelection() {
4552
+ this.textEditorSelectionVersion.update((version) => version + 1);
4553
+ }
4554
+ unsubscribe = null;
4555
+ textEditingSessionKey = null;
4556
+ textEditingSurfaceCleanup = null;
4557
+ textEditorPointerDownCleanup = null;
4558
+ textEditorKeyDownCleanup = null;
4559
+ textEditorSelectionCleanup = null;
4560
+ textEditingAdapter = null;
4561
+ textEditorPositionFrame = null;
4562
+ pendingTextEditorPoint = null;
4563
+ textEditorSchema = new Schema(EditingUtils.schemaSpec);
4564
+ controllerEffect = effect((onCleanup) => {
4565
+ const diagram = this.resolvedDiagram();
4566
+ if (!diagram) {
4567
+ this.controller.set(null);
4568
+ this.snapshot.set(emptyDiagramEditorSnapshot);
4569
+ return;
4570
+ }
4571
+ const controller = this.ngZone.runOutsideAngular(() => new DiagramEditorController({ diagram }));
4572
+ this.controller.set(controller);
4573
+ this.snapshot.set(controller.getSnapshot());
4574
+ this.unsubscribe = controller.subscribe(() => this.ngZone.run(() => this.snapshot.set({ ...controller.getSnapshot() })));
4575
+ const captureTextEditorPoint = (event) => {
4576
+ const nativeEvent = event?.nativeEvent ?? event;
4577
+ if (typeof nativeEvent?.clientX === 'number' && typeof nativeEvent?.clientY === 'number') {
4578
+ this.pendingTextEditorPoint = { left: nativeEvent.clientX, top: nativeEvent.clientY };
4579
+ }
4580
+ };
4581
+ diagram.bind('pointerup', captureTextEditorPoint);
4582
+ diagram.bind('dblclick', captureTextEditorPoint);
4583
+ onCleanup(() => {
4584
+ diagram.unbind('pointerup', captureTextEditorPoint);
4585
+ diagram.unbind('dblclick', captureTextEditorPoint);
4586
+ this.unsubscribe?.();
4587
+ this.unsubscribe = null;
4588
+ controller.destroy();
4589
+ });
4590
+ }, ...(ngDevMode ? [{ debugName: "controllerEffect" }] : []));
4591
+ ngAfterViewChecked() {
4592
+ const controller = this.controller();
4593
+ const session = this.snapshot().editingSession;
4594
+ const editor = this.textEditor;
4595
+ const editorElement = this.textEditorElement?.nativeElement;
4596
+ if (editorElement) {
4597
+ this.renderer.setStyle(editorElement, 'display', session ? null : 'none');
4598
+ const toolbarElement = editorElement.querySelector('.k-toolbar');
4599
+ if (toolbarElement) {
4600
+ this.renderer.setStyle(toolbarElement, 'display', 'none');
4601
+ }
4602
+ }
4603
+ if (!controller || !session || !editor?.view || !editorElement) {
4604
+ this.cancelTextEditorPositionFrame();
4605
+ this.textEditingSurfaceCleanup?.();
4606
+ this.textEditingSurfaceCleanup = null;
4607
+ this.textEditorPointerDownCleanup?.();
4608
+ this.textEditorPointerDownCleanup = null;
4609
+ this.textEditorKeyDownCleanup?.();
4610
+ this.textEditorKeyDownCleanup = null;
4611
+ this.textEditorSelectionCleanup?.();
4612
+ this.textEditorSelectionCleanup = null;
4613
+ this.textEditingAdapter = null;
4614
+ this.textEditingSessionKey = null;
4615
+ controller?.setTextEditingAdapter(null);
4616
+ return;
4617
+ }
4618
+ const sessionKey = `${session.target.type}:${session.target.id}`;
4619
+ if (sessionKey === this.textEditingSessionKey) {
4620
+ this.ngZone.runOutsideAngular(() => {
4621
+ EditingUtils.styleEditor(session.item, editorElement);
4622
+ this.recalculateTextEditorAlignment();
4623
+ });
4624
+ return;
4625
+ }
4626
+ const content = EditingUtils.rtContentToPM(Node, this.textEditorSchema)(session.item._contentVisual.options);
4627
+ const view = editor.view;
4628
+ const defaultPadding = session.item.name === 'Shape'
4629
+ ? session.item._contentVisual.padding()
4630
+ : { top: 0, bottom: 0, left: 0, right: 0 };
4631
+ const alignmentPlugin = new Plugin({
4632
+ filterTransaction: (transaction) => {
4633
+ EditingUtils.scheduleRafCall(EditingUtils.recalcVerticalAlign, [transaction.doc.attrs['alignment'], view.dom, defaultPadding]);
4634
+ return true;
4635
+ }
4636
+ });
4637
+ const escapePlugin = new Plugin({
4638
+ props: {
4639
+ handleKeyDown: (_editorView, event) => {
4640
+ if (event.key !== 'Escape') {
4641
+ return false;
4642
+ }
4643
+ controller.handleKeyDown(event);
4644
+ return event.defaultPrevented;
4645
+ }
4646
+ }
4647
+ });
4648
+ if (session.target.type === 'new-text') {
4649
+ this.resolvedDiagram()?.select(session.item);
4650
+ }
4651
+ view.updateState(EditorState.create({
4652
+ schema: this.textEditorSchema,
4653
+ doc: content,
4654
+ plugins: [keymap(baseKeymap), placeholder(this.textEditorPlaceholder), alignmentPlugin, escapePlugin]
4655
+ }));
4656
+ this.ngZone.runOutsideAngular(() => {
4657
+ EditingUtils.styleEditor(session.item, editorElement);
4658
+ this.recalculateTextEditorAlignment();
4659
+ this.scheduleTextEditorPosition(session.item, editorElement);
4660
+ });
4661
+ const pendingPoint = this.pendingTextEditorPoint;
4662
+ this.pendingTextEditorPoint = null;
4663
+ if (pendingPoint && session.target.type !== 'new-text') {
4664
+ const position = view.posAtCoords(pendingPoint);
4665
+ if (position) {
4666
+ view.dispatch(view.state.tr.setSelection(TextSelection.create(view.state.doc, position.pos)));
4667
+ }
4668
+ }
4669
+ this.textEditingSurfaceCleanup?.();
4670
+ this.textEditingSurfaceCleanup = controller.registerSurface(editorElement);
4671
+ this.textEditorPointerDownCleanup?.();
4672
+ const stopDiagramPointerDown = (event) => event.stopPropagation();
4673
+ editorElement.addEventListener('pointerdown', stopDiagramPointerDown);
4674
+ this.textEditorPointerDownCleanup = () => editorElement.removeEventListener('pointerdown', stopDiagramPointerDown);
4675
+ this.textEditorKeyDownCleanup?.();
4676
+ const handleTextEditorDelete = (event) => {
4677
+ const target = event.target;
4678
+ if (!target ||
4679
+ !editorElement.contains(target) ||
4680
+ (event.key !== 'Backspace' && event.key !== 'Delete') ||
4681
+ event.metaKey ||
4682
+ event.ctrlKey ||
4683
+ event.altKey) {
4684
+ return;
4685
+ }
4686
+ const command = baseKeymap[event.key];
4687
+ const handled = command(view.state, view.dispatch, view);
4688
+ if (!handled && view.state.selection.empty) {
4689
+ const position = view.state.selection.from;
4690
+ const from = event.key === 'Backspace' ? position - 1 : position;
4691
+ const to = event.key === 'Backspace' ? position : position + 1;
4692
+ if (from >= 1 && to <= view.state.doc.content.size - 1) {
4693
+ view.dispatch(view.state.tr.delete(from, to));
4694
+ }
4695
+ }
4696
+ event.preventDefault();
4697
+ event.stopPropagation();
4698
+ };
4699
+ const ownerDocument = editorElement.ownerDocument;
4700
+ ownerDocument.addEventListener('keydown', handleTextEditorDelete, true);
4701
+ this.textEditorKeyDownCleanup = () => ownerDocument.removeEventListener('keydown', handleTextEditorDelete, true);
4702
+ this.textEditorSelectionCleanup?.();
4703
+ const updateTextEditorSelection = () => this.textEditorSelectionVersion.update((version) => version + 1);
4704
+ ownerDocument.addEventListener('selectionchange', updateTextEditorSelection);
4705
+ editorElement.addEventListener('input', updateTextEditorSelection);
4706
+ editorElement.addEventListener('keyup', updateTextEditorSelection);
4707
+ editorElement.addEventListener('mouseup', updateTextEditorSelection);
4708
+ this.textEditorSelectionCleanup = () => {
4709
+ ownerDocument.removeEventListener('selectionchange', updateTextEditorSelection);
4710
+ editorElement.removeEventListener('input', updateTextEditorSelection);
4711
+ editorElement.removeEventListener('keyup', updateTextEditorSelection);
4712
+ editorElement.removeEventListener('mouseup', updateTextEditorSelection);
4713
+ };
4714
+ this.textEditingAdapter = {
4715
+ getCommitPayload: () => {
4716
+ const doc = view.state.doc;
4717
+ const richTextContent = EditingUtils.pmDocToRTContent(doc);
4718
+ return {
4719
+ content: richTextContent,
4720
+ isEmpty: doc.childCount === 0 || (doc.childCount === 1 && doc.firstChild?.inlineContent && doc.firstChild.childCount === 0),
4721
+ textContent: doc.textContent
4722
+ };
4723
+ }
4724
+ };
4725
+ controller.setTextEditingAdapter(this.textEditingAdapter);
4726
+ this.textEditingSessionKey = sessionKey;
4727
+ view.focus();
4728
+ }
4729
+ ngOnDestroy() {
4730
+ this.cancelTextEditorPositionFrame();
4731
+ this.textEditingSurfaceCleanup?.();
4732
+ this.textEditingSurfaceCleanup = null;
4733
+ this.textEditorPointerDownCleanup?.();
4734
+ this.textEditorPointerDownCleanup = null;
4735
+ this.textEditorKeyDownCleanup?.();
4736
+ this.textEditorKeyDownCleanup = null;
4737
+ this.textEditorSelectionCleanup?.();
4738
+ this.textEditorSelectionCleanup = null;
4739
+ this.textEditingAdapter = null;
4740
+ this.controller()?.setTextEditingAdapter(null);
4741
+ }
4742
+ scheduleTextEditorPosition(item, editorElement) {
4743
+ if (this.textEditorPositionFrame !== null) {
4744
+ return;
4745
+ }
4746
+ const ownerWindow = editorElement.ownerDocument.defaultView;
4747
+ if (!ownerWindow) {
4748
+ return;
4749
+ }
4750
+ this.textEditorPositionFrame = ownerWindow.requestAnimationFrame(() => {
4751
+ this.textEditorPositionFrame = null;
4752
+ if (this.snapshot().editingSession?.item === item) {
4753
+ EditingUtils.styleEditor(item, editorElement);
4754
+ this.recalculateTextEditorAlignment();
4755
+ }
4756
+ });
4757
+ }
4758
+ cancelTextEditorPositionFrame() {
4759
+ if (this.textEditorPositionFrame === null) {
4760
+ return;
4761
+ }
4762
+ const ownerWindow = this.textEditorElement?.nativeElement.ownerDocument.defaultView;
4763
+ ownerWindow?.cancelAnimationFrame(this.textEditorPositionFrame);
4764
+ this.textEditorPositionFrame = null;
4765
+ }
4766
+ getTextEditorInlineStyles(style) {
4767
+ const view = this.textEditor?.view;
4768
+ if (!view) {
4769
+ return [];
4770
+ }
4771
+ return [...new Set(getInlineStyles(view.state, { name: style, value: /^.+$/ }))];
4772
+ }
4773
+ hasTextEditorMark(mark) {
4774
+ this.textEditorSelectionVersion();
4775
+ const view = this.textEditor?.view;
4776
+ return Boolean(view && hasMark(view.state, mark));
4777
+ }
4778
+ onTextEditorValueChange() {
4779
+ const session = this.snapshot().editingSession;
4780
+ const view = this.textEditor?.view;
4781
+ const item = session?.item;
4782
+ if (!view || !item || item.name !== 'Shape' || item.type !== 'text') {
4783
+ return;
4784
+ }
4785
+ const nextContent = {
4786
+ ...item.options.content,
4787
+ ...EditingUtils.pmDocToRTContent(view.state.doc)
4788
+ };
4789
+ item._syncAutoHeightBounds?.(nextContent);
4790
+ }
4791
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramEditorComponent, deps: [{ token: DiagramComponent, optional: true }, { token: i1$1.LocalizationService }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
4792
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.32", type: DiagramEditorComponent, isStandalone: true, selector: "kendo-diagram-editor", inputs: { toolbars: "toolbars", shapes: "shapes", fontTypes: "fontTypes", fontSizes: "fontSizes" }, providers: [
4793
+ LocalizationService,
4794
+ {
4795
+ provide: L10N_PREFIX,
4796
+ useValue: 'kendo.diagram.editing'
4797
+ }
4798
+ ], viewQueries: [{ propertyName: "editorComponent", first: true, predicate: EditorComponent, descendants: true, isSignal: true }, { propertyName: "editorElementRef", first: true, predicate: EditorComponent, descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
4799
+ <ng-container
4800
+ kendoDiagramEditorLocalizedMessages
4801
+ i18n-undoTitle="kendo.diagram.editing.undo|The title of the undo tool"
4802
+ undoTitle="Undo"
4803
+ i18n-redoTitle="kendo.diagram.editing.redo|The title of the redo tool"
4804
+ redoTitle="Redo"
4805
+ i18n-selectTitle="kendo.diagram.editing.select|The title of the select tool"
4806
+ selectTitle="Select"
4807
+ i18n-panTitle="kendo.diagram.editing.pan|The title of the pan tool"
4808
+ panTitle="Pan"
4809
+ i18n-textTitle="kendo.diagram.editing.text|The title of the text insertion tool"
4810
+ textTitle="Text"
4811
+ i18n-shapeTitle="kendo.diagram.editing.shape|The title of the shape insertion tool"
4812
+ shapeTitle="Shape"
4813
+ i18n-shapeCollateLabel="kendo.diagram.editing.shape.collate|The label of the collate shape"
4814
+ shapeCollateLabel="Collate"
4815
+ i18n-shapeConnectorLabel="kendo.diagram.editing.shape.connector|The label of the connector shape"
4816
+ shapeConnectorLabel="Connector"
4817
+ i18n-shapeDataStorageLabel="kendo.diagram.editing.shape.dataStorage|The label of the data storage shape"
4818
+ shapeDataStorageLabel="Data Storage"
4819
+ i18n-shapeDatabaseLabel="kendo.diagram.editing.shape.database|The label of the database shape"
4820
+ shapeDatabaseLabel="Database"
4821
+ i18n-shapeDecisionLabel="kendo.diagram.editing.shape.decision|The label of the decision shape"
4822
+ shapeDecisionLabel="Decision"
4823
+ i18n-shapeDelayLabel="kendo.diagram.editing.shape.delay|The label of the delay shape"
4824
+ shapeDelayLabel="Delay"
4825
+ i18n-shapeDirectAccessStorageLabel="kendo.diagram.editing.shape.directAccessStorage|The label of the direct access storage shape"
4826
+ shapeDirectAccessStorageLabel="Direct Access Storage"
4827
+ i18n-shapeDisplayLabel="kendo.diagram.editing.shape.display|The label of the display shape"
4828
+ shapeDisplayLabel="Display"
4829
+ i18n-shapeDocumentLabel="kendo.diagram.editing.shape.document|The label of the document shape"
4830
+ shapeDocumentLabel="Document"
4831
+ i18n-shapeExtractLabel="kendo.diagram.editing.shape.extract|The label of the extract shape"
4832
+ shapeExtractLabel="Extract"
4833
+ i18n-shapeInputOutputLabel="kendo.diagram.editing.shape.inputOutput|The label of the input output shape"
4834
+ shapeInputOutputLabel="Input Output"
4835
+ i18n-shapeInternalStorageLabel="kendo.diagram.editing.shape.internalStorage|The label of the internal storage shape"
4836
+ shapeInternalStorageLabel="Internal Storage"
4837
+ i18n-shapeLogicalOrLabel="kendo.diagram.editing.shape.logicalOr|The label of the logical OR shape"
4838
+ shapeLogicalOrLabel="Logical OR"
4839
+ i18n-shapeManualInputOutputLabel="kendo.diagram.editing.shape.manualInputOutput|The label of the manual input output shape"
4840
+ shapeManualInputOutputLabel="Manual Input Output"
4841
+ i18n-shapeManualOperationLabel="kendo.diagram.editing.shape.manualOperation|The label of the manual operation shape"
4842
+ shapeManualOperationLabel="Manual Operation"
4843
+ i18n-shapeMergeLabel="kendo.diagram.editing.shape.merge|The label of the merge shape"
4844
+ shapeMergeLabel="Merge"
4845
+ i18n-shapeMultipleDocumentsLabel="kendo.diagram.editing.shape.multipleDocuments|The label of the multiple documents shape"
4846
+ shapeMultipleDocumentsLabel="Multiple Documents"
4847
+ i18n-shapeOffPageConnectorLabel="kendo.diagram.editing.shape.offPageConnector|The label of the off-page connector shape"
4848
+ shapeOffPageConnectorLabel="Off-page Connector"
4849
+ i18n-shapePredefinedProcessLabel="kendo.diagram.editing.shape.predefinedProcess|The label of the predefined process shape"
4850
+ shapePredefinedProcessLabel="Predefined Process"
4851
+ i18n-shapePreparationLabel="kendo.diagram.editing.shape.preparation|The label of the preparation shape"
4852
+ shapePreparationLabel="Preparation"
4853
+ i18n-shapeProcessLabel="kendo.diagram.editing.shape.process|The label of the process shape"
4854
+ shapeProcessLabel="Process"
4855
+ i18n-shapeSortLabel="kendo.diagram.editing.shape.sort|The label of the sort shape"
4856
+ shapeSortLabel="Sort"
4857
+ i18n-shapeSummingJunctionLabel="kendo.diagram.editing.shape.summingJunction|The label of the summing junction shape"
4858
+ shapeSummingJunctionLabel="Summing Junction (Logical AND)"
4859
+ i18n-shapeTerminatorLabel="kendo.diagram.editing.shape.terminator|The label of the terminator shape"
4860
+ shapeTerminatorLabel="Terminator"
4861
+ i18n-shapeTypeTitle="kendo.diagram.editing.shapeType|The title of the shape type tool"
4862
+ shapeTypeTitle="Shape Type"
4863
+ i18n-fillColorTitle="kendo.diagram.editing.fillColor|The title of the fill color tool"
4864
+ fillColorTitle="Fill Color"
4865
+ i18n-borderWidthTitle="kendo.diagram.editing.borderWidth|The title of the border width tool"
4866
+ borderWidthTitle="Border Width"
4867
+ i18n-borderColorTitle="kendo.diagram.editing.borderColor|The title of the border color tool"
4868
+ borderColorTitle="Border Color"
4869
+ i18n-borderStyleTitle="kendo.diagram.editing.borderStyle|The title of the border style tool"
4870
+ borderStyleTitle="Border Style"
4871
+ i18n-borderStyleSolidLabel="kendo.diagram.editing.borderStyle.solid|The label of the solid border style"
4872
+ borderStyleSolidLabel="Solid"
4873
+ i18n-borderStyleDottedLabel="kendo.diagram.editing.borderStyle.dotted|The label of the dotted border style"
4874
+ borderStyleDottedLabel="Dotted"
4875
+ i18n-borderStyleDashedLabel="kendo.diagram.editing.borderStyle.dashed|The label of the dashed border style"
4876
+ borderStyleDashedLabel="Dashed"
4877
+ i18n-borderStyleDashDotLabel="kendo.diagram.editing.borderStyle.dashDot|The label of the dash-dot border style"
4878
+ borderStyleDashDotLabel="Dash Dot"
4879
+ i18n-borderStyleLongDashLabel="kendo.diagram.editing.borderStyle.longDash|The label of the long dash border style"
4880
+ borderStyleLongDashLabel="Long Dash"
4881
+ i18n-borderStyleLongDashDotLabel="kendo.diagram.editing.borderStyle.longDashDot|The label of the long dash-dot border style"
4882
+ borderStyleLongDashDotLabel="Long Dash Dot"
4883
+ i18n-borderStyleLongDashDotDotLabel="kendo.diagram.editing.borderStyle.longDashDotDot|The label of the long dash-dot-dot border style"
4884
+ borderStyleLongDashDotDotLabel="Long Dash Dot Dot"
4885
+ i18n-toFrontTitle="kendo.diagram.editing.toFront|The title of the bring-to-front tool"
4886
+ toFrontTitle="To Front"
4887
+ i18n-toBackTitle="kendo.diagram.editing.toBack|The title of the send-to-back tool"
4888
+ toBackTitle="To Back"
4889
+ i18n-rotateLeftTitle="kendo.diagram.editing.rotateLeft|The title of the rotate-left tool"
4890
+ rotateLeftTitle="Rotate Left"
4891
+ i18n-rotateRightTitle="kendo.diagram.editing.rotateRight|The title of the rotate-right tool"
4892
+ rotateRightTitle="Rotate Right"
4893
+ i18n-duplicateTitle="kendo.diagram.editing.duplicate|The title of the duplicate tool"
4894
+ duplicateTitle="Duplicate"
4895
+ i18n-deleteTitle="kendo.diagram.editing.delete|The title of the delete tool"
4896
+ deleteTitle="Delete"
4897
+ i18n-connectionTypeTitle="kendo.diagram.editing.connectionType|The title of the connection type tool"
4898
+ connectionTypeTitle="Connection Type"
4899
+ i18n-connectionTypeCascadingLabel="kendo.diagram.editing.connectionType.cascading|The label of the cascading connection type"
4900
+ connectionTypeCascadingLabel="Cascading"
4901
+ i18n-connectionTypePolylineLabel="kendo.diagram.editing.connectionType.polyline|The label of the polyline connection type"
4902
+ connectionTypePolylineLabel="Polyline"
4903
+ i18n-startCapTitle="kendo.diagram.editing.startCap|The title of the connection start cap tool"
4904
+ startCapTitle="Start Cap"
4905
+ i18n-endCapTitle="kendo.diagram.editing.endCap|The title of the connection end cap tool"
4906
+ endCapTitle="End Cap"
4907
+ i18n-capNoneLabel="kendo.diagram.editing.cap.none|The label of the no connection cap"
4908
+ capNoneLabel="None"
4909
+ i18n-capArrowLabel="kendo.diagram.editing.cap.arrow|The label of the arrow connection cap"
4910
+ capArrowLabel="Arrow"
4911
+ i18n-capTriangleArrowLabel="kendo.diagram.editing.cap.triangleArrow|The label of the triangle arrow connection cap"
4912
+ capTriangleArrowLabel="Triangle Arrow"
4913
+ i18n-capLineArrowLabel="kendo.diagram.editing.cap.lineArrow|The label of the line arrow connection cap"
4914
+ capLineArrowLabel="Line Arrow"
4915
+ i18n-capFilledCircleLabel="kendo.diagram.editing.cap.filledCircle|The label of the filled circle connection cap"
4916
+ capFilledCircleLabel="Filled Circle"
4917
+ i18n-capFilledDiamondLabel="kendo.diagram.editing.cap.filledDiamond|The label of the filled diamond connection cap"
4918
+ capFilledDiamondLabel="Filled Diamond"
4919
+ i18n-connectionColorTitle="kendo.diagram.editing.connectionColor|The title of the connection color tool"
4920
+ connectionColorTitle="Connection Color"
4921
+ i18n-connectionWidthTitle="kendo.diagram.editing.connectionWidth|The title of the connection width tool"
4922
+ connectionWidthTitle="Connection Width"
4923
+ i18n-connectionStyleTitle="kendo.diagram.editing.connectionStyle|The title of the connection style tool"
4924
+ connectionStyleTitle="Connection Style"
4925
+ i18n-textColorTitle="kendo.diagram.editing.textColor|The title of the text color tool"
4926
+ textColorTitle="Text Color"
4927
+ i18n-fontSizeTitle="kendo.diagram.editing.fontSize|The title of the font size tool"
4928
+ fontSizeTitle="Font Size"
4929
+ i18n-fontTypeTitle="kendo.diagram.editing.fontType|The title of the font type tool"
4930
+ fontTypeTitle="Font Type"
4931
+ i18n-boldTitle="kendo.diagram.editing.bold|The title of the bold tool"
4932
+ boldTitle="Bold"
4933
+ i18n-italicTitle="kendo.diagram.editing.italic|The title of the italic tool"
4934
+ italicTitle="Italic"
4935
+ i18n-underlineTitle="kendo.diagram.editing.underline|The title of the underline tool"
4936
+ underlineTitle="Underline"
4937
+ i18n-alignHorizontalTitle="kendo.diagram.editing.alignHorizontal|The title of the horizontal text alignment tool"
4938
+ alignHorizontalTitle="Align Horizontal"
4939
+ i18n-alignVerticalTitle="kendo.diagram.editing.alignVertical|The title of the vertical text alignment tool"
4940
+ alignVerticalTitle="Align Vertical"
4941
+ i18n-alignLeftLabel="kendo.diagram.editing.alignLeft|The label of the left horizontal alignment option"
4942
+ alignLeftLabel="Left"
4943
+ i18n-alignCenterLabel="kendo.diagram.editing.alignCenter|The label of the center horizontal alignment option"
4944
+ alignCenterLabel="Center"
4945
+ i18n-alignRightLabel="kendo.diagram.editing.alignRight|The label of the right horizontal alignment option"
4946
+ alignRightLabel="Right"
4947
+ i18n-alignTopLabel="kendo.diagram.editing.alignTop|The label of the top vertical alignment option"
4948
+ alignTopLabel="Top"
4949
+ i18n-alignMiddleLabel="kendo.diagram.editing.alignMiddle|The label of the middle vertical alignment option"
4950
+ alignMiddleLabel="Middle"
4951
+ i18n-alignBottomLabel="kendo.diagram.editing.alignBottom|The label of the bottom vertical alignment option"
4952
+ alignBottomLabel="Bottom"
4953
+ i18n-editTextTitle="kendo.diagram.editing.editText|The title of the edit text tool"
4954
+ editTextTitle="Edit Text"
4955
+ i18n-textEditorPlaceholder="kendo.diagram.editing.textEditorPlaceholder|The placeholder text of the text editor"
4956
+ textEditorPlaceholder="Type something"
4957
+ >
4958
+ </ng-container>
4959
+
4960
+ @if (controller()) {
4961
+ <kendo-diagram-main-toolbar
4962
+ [controller]="controller()"
4963
+ [diagram]="resolvedDiagram()"
4964
+ [snapshot]="snapshot()"
4965
+ [tools]="mainToolbarOptions().tools"
4966
+ [position]="mainToolbarOptions().position ?? 'top'"
4967
+ [shapes]="mainToolbarOptions().shapes"
4968
+ [visible]="snapshot().visibility.main && mainToolbarOptions().tools.length > 0"
4969
+ >
4970
+ </kendo-diagram-main-toolbar>
4971
+
4972
+ <kendo-diagram-floating-toolbar-popup
4973
+ [controller]="controller()"
4974
+ [show]="activeContextToolbar() !== null"
4975
+ [baseAnchor]="activeContextToolbar()?.baseAnchor ?? null"
4976
+ [fallbackAnchor]="activeContextToolbar()?.fallbackAnchor ?? null"
4977
+ [boundaryElement]="resolvedDiagram()?.element"
4978
+ >
4979
+ @if (activeContextToolbar()) {
4980
+ <div [class]="toolbarPopupWrapClass">
4981
+ @if (activeContextToolbar()?.type === 'shape') {
4982
+ <kendo-diagram-shape-editing-toolbar
4983
+ [controller]="controller()"
4984
+ [shape]="snapshot().selectedShape"
4985
+ [stateVersion]="snapshot()"
4986
+ [tools]="shapeToolbarOptions().tools"
4987
+ [shapes]="shapeToolbarOptions().shapes"
4988
+ >
4989
+ </kendo-diagram-shape-editing-toolbar>
4990
+ } @else if (activeContextToolbar()?.type === 'connection') {
4991
+ <kendo-diagram-connection-editing-toolbar
4992
+ [controller]="controller()"
4993
+ [connection]="snapshot().selectedConnection"
4994
+ [stateVersion]="snapshot()"
4995
+ [tools]="connectionToolbarOptions().tools"
4996
+ ></kendo-diagram-connection-editing-toolbar>
4997
+ } @else if (activeContextToolbar()?.type === 'text') {
4998
+ <kendo-diagram-text-editing-toolbar
4999
+ [controller]="controller()"
5000
+ [editor]="textEditor"
5001
+ [tools]="textToolbarOptions().tools"
5002
+ [fontTypes]="textToolbarOptions().fontNames"
5003
+ [fontSizes]="textToolbarOptions().fontSizes"
5004
+ [fontSize]="textToolbarFontSize()"
5005
+ [fontType]="textToolbarFontType()"
5006
+ [color]="textToolbarColor()"
5007
+ [bold]="textToolbarBold()"
5008
+ [italic]="textToolbarItalic()"
5009
+ [underline]="textToolbarUnderline()"
5010
+ [alignment]="textToolbarAlignment()"
5011
+ (alignmentChange)="onTextEditorAlignmentChange($event)"
5012
+ (stateChange)="refreshTextEditorSelection()"
5013
+ [renderVerticalAlignment]="textToolbarRenderVerticalAlignment()"
5014
+ ></kendo-diagram-text-editing-toolbar>
5015
+ }
5016
+ </div>
5017
+ }
5018
+ </kendo-diagram-floating-toolbar-popup>
5019
+
5020
+ <kendo-editor
5021
+ class="k-diagram-rich-text-editor"
5022
+ [iframe]="false"
5023
+ [placeholder]="textEditorPlaceholder"
5024
+ [style.position]="'absolute'"
5025
+ [style.z-index]="1"
5026
+ [style.pointer-events]="'auto'"
5027
+ [style.background]="'transparent'"
5028
+ [style.display]="snapshot().editingSession ? null : 'none'"
5029
+ (valueChange)="onTextEditorValueChange()"
5030
+ ></kendo-editor>
5031
+ }
5032
+
5033
+ <ng-content></ng-content>
5034
+ `, isInline: true, dependencies: [{ kind: "component", type: MainToolbarComponent, selector: "kendo-diagram-main-toolbar", inputs: ["controller", "diagram", "snapshot", "tools", "position", "shapes", "visible", "ariaLabel"] }, { kind: "component", type: ShapeEditingToolbarComponent, selector: "kendo-diagram-shape-editing-toolbar", inputs: ["controller", "shape", "stateVersion", "tools", "shapes", "ariaLabel"] }, { kind: "component", type: ConnectionEditingToolbarComponent, selector: "kendo-diagram-connection-editing-toolbar", inputs: ["controller", "connection", "stateVersion", "tools", "ariaLabel"] }, { kind: "component", type: TextEditingToolbarComponent, selector: "kendo-diagram-text-editing-toolbar", inputs: ["controller", "editor", "tools", "fontTypes", "fontSizes", "fontSize", "fontType", "color", "bold", "italic", "underline", "renderVerticalAlignment", "ariaLabel", "alignment"], outputs: ["alignmentChange", "stateChange"] }, { kind: "component", type: FloatingToolbarPopupComponent, selector: "kendo-diagram-floating-toolbar-popup", inputs: ["controller", "show", "baseAnchor", "fallbackAnchor", "boundaryElement"] }, { kind: "directive", type: DiagramEditorLocalizedMessagesDirective, selector: "[kendoDiagramEditorLocalizedMessages]" }, { kind: "component", type: EditorComponent, selector: "kendo-editor", inputs: ["value", "disabled", "readonly", "iframe", "iframeCss", "applyToWord", "schema", "plugins", "placeholder", "preserveWhitespace", "pasteCleanupSettings", "resizable"], outputs: ["valueChange", "focus", "paste", "blur"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5035
+ }
5036
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramEditorComponent, decorators: [{
5037
+ type: Component,
5038
+ args: [{
5039
+ selector: 'kendo-diagram-editor',
5040
+ standalone: true,
5041
+ changeDetection: ChangeDetectionStrategy.OnPush,
5042
+ providers: [
5043
+ LocalizationService,
5044
+ {
5045
+ provide: L10N_PREFIX,
5046
+ useValue: 'kendo.diagram.editing'
5047
+ }
5048
+ ],
5049
+ imports: [
5050
+ MainToolbarComponent,
5051
+ ShapeEditingToolbarComponent,
5052
+ ConnectionEditingToolbarComponent,
5053
+ TextEditingToolbarComponent,
5054
+ FloatingToolbarPopupComponent,
5055
+ DiagramEditorLocalizedMessagesDirective,
5056
+ EditorComponent
5057
+ ],
5058
+ template: `
5059
+ <ng-container
5060
+ kendoDiagramEditorLocalizedMessages
5061
+ i18n-undoTitle="kendo.diagram.editing.undo|The title of the undo tool"
5062
+ undoTitle="Undo"
5063
+ i18n-redoTitle="kendo.diagram.editing.redo|The title of the redo tool"
5064
+ redoTitle="Redo"
5065
+ i18n-selectTitle="kendo.diagram.editing.select|The title of the select tool"
5066
+ selectTitle="Select"
5067
+ i18n-panTitle="kendo.diagram.editing.pan|The title of the pan tool"
5068
+ panTitle="Pan"
5069
+ i18n-textTitle="kendo.diagram.editing.text|The title of the text insertion tool"
5070
+ textTitle="Text"
5071
+ i18n-shapeTitle="kendo.diagram.editing.shape|The title of the shape insertion tool"
5072
+ shapeTitle="Shape"
5073
+ i18n-shapeCollateLabel="kendo.diagram.editing.shape.collate|The label of the collate shape"
5074
+ shapeCollateLabel="Collate"
5075
+ i18n-shapeConnectorLabel="kendo.diagram.editing.shape.connector|The label of the connector shape"
5076
+ shapeConnectorLabel="Connector"
5077
+ i18n-shapeDataStorageLabel="kendo.diagram.editing.shape.dataStorage|The label of the data storage shape"
5078
+ shapeDataStorageLabel="Data Storage"
5079
+ i18n-shapeDatabaseLabel="kendo.diagram.editing.shape.database|The label of the database shape"
5080
+ shapeDatabaseLabel="Database"
5081
+ i18n-shapeDecisionLabel="kendo.diagram.editing.shape.decision|The label of the decision shape"
5082
+ shapeDecisionLabel="Decision"
5083
+ i18n-shapeDelayLabel="kendo.diagram.editing.shape.delay|The label of the delay shape"
5084
+ shapeDelayLabel="Delay"
5085
+ i18n-shapeDirectAccessStorageLabel="kendo.diagram.editing.shape.directAccessStorage|The label of the direct access storage shape"
5086
+ shapeDirectAccessStorageLabel="Direct Access Storage"
5087
+ i18n-shapeDisplayLabel="kendo.diagram.editing.shape.display|The label of the display shape"
5088
+ shapeDisplayLabel="Display"
5089
+ i18n-shapeDocumentLabel="kendo.diagram.editing.shape.document|The label of the document shape"
5090
+ shapeDocumentLabel="Document"
5091
+ i18n-shapeExtractLabel="kendo.diagram.editing.shape.extract|The label of the extract shape"
5092
+ shapeExtractLabel="Extract"
5093
+ i18n-shapeInputOutputLabel="kendo.diagram.editing.shape.inputOutput|The label of the input output shape"
5094
+ shapeInputOutputLabel="Input Output"
5095
+ i18n-shapeInternalStorageLabel="kendo.diagram.editing.shape.internalStorage|The label of the internal storage shape"
5096
+ shapeInternalStorageLabel="Internal Storage"
5097
+ i18n-shapeLogicalOrLabel="kendo.diagram.editing.shape.logicalOr|The label of the logical OR shape"
5098
+ shapeLogicalOrLabel="Logical OR"
5099
+ i18n-shapeManualInputOutputLabel="kendo.diagram.editing.shape.manualInputOutput|The label of the manual input output shape"
5100
+ shapeManualInputOutputLabel="Manual Input Output"
5101
+ i18n-shapeManualOperationLabel="kendo.diagram.editing.shape.manualOperation|The label of the manual operation shape"
5102
+ shapeManualOperationLabel="Manual Operation"
5103
+ i18n-shapeMergeLabel="kendo.diagram.editing.shape.merge|The label of the merge shape"
5104
+ shapeMergeLabel="Merge"
5105
+ i18n-shapeMultipleDocumentsLabel="kendo.diagram.editing.shape.multipleDocuments|The label of the multiple documents shape"
5106
+ shapeMultipleDocumentsLabel="Multiple Documents"
5107
+ i18n-shapeOffPageConnectorLabel="kendo.diagram.editing.shape.offPageConnector|The label of the off-page connector shape"
5108
+ shapeOffPageConnectorLabel="Off-page Connector"
5109
+ i18n-shapePredefinedProcessLabel="kendo.diagram.editing.shape.predefinedProcess|The label of the predefined process shape"
5110
+ shapePredefinedProcessLabel="Predefined Process"
5111
+ i18n-shapePreparationLabel="kendo.diagram.editing.shape.preparation|The label of the preparation shape"
5112
+ shapePreparationLabel="Preparation"
5113
+ i18n-shapeProcessLabel="kendo.diagram.editing.shape.process|The label of the process shape"
5114
+ shapeProcessLabel="Process"
5115
+ i18n-shapeSortLabel="kendo.diagram.editing.shape.sort|The label of the sort shape"
5116
+ shapeSortLabel="Sort"
5117
+ i18n-shapeSummingJunctionLabel="kendo.diagram.editing.shape.summingJunction|The label of the summing junction shape"
5118
+ shapeSummingJunctionLabel="Summing Junction (Logical AND)"
5119
+ i18n-shapeTerminatorLabel="kendo.diagram.editing.shape.terminator|The label of the terminator shape"
5120
+ shapeTerminatorLabel="Terminator"
5121
+ i18n-shapeTypeTitle="kendo.diagram.editing.shapeType|The title of the shape type tool"
5122
+ shapeTypeTitle="Shape Type"
5123
+ i18n-fillColorTitle="kendo.diagram.editing.fillColor|The title of the fill color tool"
5124
+ fillColorTitle="Fill Color"
5125
+ i18n-borderWidthTitle="kendo.diagram.editing.borderWidth|The title of the border width tool"
5126
+ borderWidthTitle="Border Width"
5127
+ i18n-borderColorTitle="kendo.diagram.editing.borderColor|The title of the border color tool"
5128
+ borderColorTitle="Border Color"
5129
+ i18n-borderStyleTitle="kendo.diagram.editing.borderStyle|The title of the border style tool"
5130
+ borderStyleTitle="Border Style"
5131
+ i18n-borderStyleSolidLabel="kendo.diagram.editing.borderStyle.solid|The label of the solid border style"
5132
+ borderStyleSolidLabel="Solid"
5133
+ i18n-borderStyleDottedLabel="kendo.diagram.editing.borderStyle.dotted|The label of the dotted border style"
5134
+ borderStyleDottedLabel="Dotted"
5135
+ i18n-borderStyleDashedLabel="kendo.diagram.editing.borderStyle.dashed|The label of the dashed border style"
5136
+ borderStyleDashedLabel="Dashed"
5137
+ i18n-borderStyleDashDotLabel="kendo.diagram.editing.borderStyle.dashDot|The label of the dash-dot border style"
5138
+ borderStyleDashDotLabel="Dash Dot"
5139
+ i18n-borderStyleLongDashLabel="kendo.diagram.editing.borderStyle.longDash|The label of the long dash border style"
5140
+ borderStyleLongDashLabel="Long Dash"
5141
+ i18n-borderStyleLongDashDotLabel="kendo.diagram.editing.borderStyle.longDashDot|The label of the long dash-dot border style"
5142
+ borderStyleLongDashDotLabel="Long Dash Dot"
5143
+ i18n-borderStyleLongDashDotDotLabel="kendo.diagram.editing.borderStyle.longDashDotDot|The label of the long dash-dot-dot border style"
5144
+ borderStyleLongDashDotDotLabel="Long Dash Dot Dot"
5145
+ i18n-toFrontTitle="kendo.diagram.editing.toFront|The title of the bring-to-front tool"
5146
+ toFrontTitle="To Front"
5147
+ i18n-toBackTitle="kendo.diagram.editing.toBack|The title of the send-to-back tool"
5148
+ toBackTitle="To Back"
5149
+ i18n-rotateLeftTitle="kendo.diagram.editing.rotateLeft|The title of the rotate-left tool"
5150
+ rotateLeftTitle="Rotate Left"
5151
+ i18n-rotateRightTitle="kendo.diagram.editing.rotateRight|The title of the rotate-right tool"
5152
+ rotateRightTitle="Rotate Right"
5153
+ i18n-duplicateTitle="kendo.diagram.editing.duplicate|The title of the duplicate tool"
5154
+ duplicateTitle="Duplicate"
5155
+ i18n-deleteTitle="kendo.diagram.editing.delete|The title of the delete tool"
5156
+ deleteTitle="Delete"
5157
+ i18n-connectionTypeTitle="kendo.diagram.editing.connectionType|The title of the connection type tool"
5158
+ connectionTypeTitle="Connection Type"
5159
+ i18n-connectionTypeCascadingLabel="kendo.diagram.editing.connectionType.cascading|The label of the cascading connection type"
5160
+ connectionTypeCascadingLabel="Cascading"
5161
+ i18n-connectionTypePolylineLabel="kendo.diagram.editing.connectionType.polyline|The label of the polyline connection type"
5162
+ connectionTypePolylineLabel="Polyline"
5163
+ i18n-startCapTitle="kendo.diagram.editing.startCap|The title of the connection start cap tool"
5164
+ startCapTitle="Start Cap"
5165
+ i18n-endCapTitle="kendo.diagram.editing.endCap|The title of the connection end cap tool"
5166
+ endCapTitle="End Cap"
5167
+ i18n-capNoneLabel="kendo.diagram.editing.cap.none|The label of the no connection cap"
5168
+ capNoneLabel="None"
5169
+ i18n-capArrowLabel="kendo.diagram.editing.cap.arrow|The label of the arrow connection cap"
5170
+ capArrowLabel="Arrow"
5171
+ i18n-capTriangleArrowLabel="kendo.diagram.editing.cap.triangleArrow|The label of the triangle arrow connection cap"
5172
+ capTriangleArrowLabel="Triangle Arrow"
5173
+ i18n-capLineArrowLabel="kendo.diagram.editing.cap.lineArrow|The label of the line arrow connection cap"
5174
+ capLineArrowLabel="Line Arrow"
5175
+ i18n-capFilledCircleLabel="kendo.diagram.editing.cap.filledCircle|The label of the filled circle connection cap"
5176
+ capFilledCircleLabel="Filled Circle"
5177
+ i18n-capFilledDiamondLabel="kendo.diagram.editing.cap.filledDiamond|The label of the filled diamond connection cap"
5178
+ capFilledDiamondLabel="Filled Diamond"
5179
+ i18n-connectionColorTitle="kendo.diagram.editing.connectionColor|The title of the connection color tool"
5180
+ connectionColorTitle="Connection Color"
5181
+ i18n-connectionWidthTitle="kendo.diagram.editing.connectionWidth|The title of the connection width tool"
5182
+ connectionWidthTitle="Connection Width"
5183
+ i18n-connectionStyleTitle="kendo.diagram.editing.connectionStyle|The title of the connection style tool"
5184
+ connectionStyleTitle="Connection Style"
5185
+ i18n-textColorTitle="kendo.diagram.editing.textColor|The title of the text color tool"
5186
+ textColorTitle="Text Color"
5187
+ i18n-fontSizeTitle="kendo.diagram.editing.fontSize|The title of the font size tool"
5188
+ fontSizeTitle="Font Size"
5189
+ i18n-fontTypeTitle="kendo.diagram.editing.fontType|The title of the font type tool"
5190
+ fontTypeTitle="Font Type"
5191
+ i18n-boldTitle="kendo.diagram.editing.bold|The title of the bold tool"
5192
+ boldTitle="Bold"
5193
+ i18n-italicTitle="kendo.diagram.editing.italic|The title of the italic tool"
5194
+ italicTitle="Italic"
5195
+ i18n-underlineTitle="kendo.diagram.editing.underline|The title of the underline tool"
5196
+ underlineTitle="Underline"
5197
+ i18n-alignHorizontalTitle="kendo.diagram.editing.alignHorizontal|The title of the horizontal text alignment tool"
5198
+ alignHorizontalTitle="Align Horizontal"
5199
+ i18n-alignVerticalTitle="kendo.diagram.editing.alignVertical|The title of the vertical text alignment tool"
5200
+ alignVerticalTitle="Align Vertical"
5201
+ i18n-alignLeftLabel="kendo.diagram.editing.alignLeft|The label of the left horizontal alignment option"
5202
+ alignLeftLabel="Left"
5203
+ i18n-alignCenterLabel="kendo.diagram.editing.alignCenter|The label of the center horizontal alignment option"
5204
+ alignCenterLabel="Center"
5205
+ i18n-alignRightLabel="kendo.diagram.editing.alignRight|The label of the right horizontal alignment option"
5206
+ alignRightLabel="Right"
5207
+ i18n-alignTopLabel="kendo.diagram.editing.alignTop|The label of the top vertical alignment option"
5208
+ alignTopLabel="Top"
5209
+ i18n-alignMiddleLabel="kendo.diagram.editing.alignMiddle|The label of the middle vertical alignment option"
5210
+ alignMiddleLabel="Middle"
5211
+ i18n-alignBottomLabel="kendo.diagram.editing.alignBottom|The label of the bottom vertical alignment option"
5212
+ alignBottomLabel="Bottom"
5213
+ i18n-editTextTitle="kendo.diagram.editing.editText|The title of the edit text tool"
5214
+ editTextTitle="Edit Text"
5215
+ i18n-textEditorPlaceholder="kendo.diagram.editing.textEditorPlaceholder|The placeholder text of the text editor"
5216
+ textEditorPlaceholder="Type something"
5217
+ >
5218
+ </ng-container>
5219
+
5220
+ @if (controller()) {
5221
+ <kendo-diagram-main-toolbar
5222
+ [controller]="controller()"
5223
+ [diagram]="resolvedDiagram()"
5224
+ [snapshot]="snapshot()"
5225
+ [tools]="mainToolbarOptions().tools"
5226
+ [position]="mainToolbarOptions().position ?? 'top'"
5227
+ [shapes]="mainToolbarOptions().shapes"
5228
+ [visible]="snapshot().visibility.main && mainToolbarOptions().tools.length > 0"
5229
+ >
5230
+ </kendo-diagram-main-toolbar>
5231
+
5232
+ <kendo-diagram-floating-toolbar-popup
5233
+ [controller]="controller()"
5234
+ [show]="activeContextToolbar() !== null"
5235
+ [baseAnchor]="activeContextToolbar()?.baseAnchor ?? null"
5236
+ [fallbackAnchor]="activeContextToolbar()?.fallbackAnchor ?? null"
5237
+ [boundaryElement]="resolvedDiagram()?.element"
5238
+ >
5239
+ @if (activeContextToolbar()) {
5240
+ <div [class]="toolbarPopupWrapClass">
5241
+ @if (activeContextToolbar()?.type === 'shape') {
5242
+ <kendo-diagram-shape-editing-toolbar
5243
+ [controller]="controller()"
5244
+ [shape]="snapshot().selectedShape"
5245
+ [stateVersion]="snapshot()"
5246
+ [tools]="shapeToolbarOptions().tools"
5247
+ [shapes]="shapeToolbarOptions().shapes"
5248
+ >
5249
+ </kendo-diagram-shape-editing-toolbar>
5250
+ } @else if (activeContextToolbar()?.type === 'connection') {
5251
+ <kendo-diagram-connection-editing-toolbar
5252
+ [controller]="controller()"
5253
+ [connection]="snapshot().selectedConnection"
5254
+ [stateVersion]="snapshot()"
5255
+ [tools]="connectionToolbarOptions().tools"
5256
+ ></kendo-diagram-connection-editing-toolbar>
5257
+ } @else if (activeContextToolbar()?.type === 'text') {
5258
+ <kendo-diagram-text-editing-toolbar
5259
+ [controller]="controller()"
5260
+ [editor]="textEditor"
5261
+ [tools]="textToolbarOptions().tools"
5262
+ [fontTypes]="textToolbarOptions().fontNames"
5263
+ [fontSizes]="textToolbarOptions().fontSizes"
5264
+ [fontSize]="textToolbarFontSize()"
5265
+ [fontType]="textToolbarFontType()"
5266
+ [color]="textToolbarColor()"
5267
+ [bold]="textToolbarBold()"
5268
+ [italic]="textToolbarItalic()"
5269
+ [underline]="textToolbarUnderline()"
5270
+ [alignment]="textToolbarAlignment()"
5271
+ (alignmentChange)="onTextEditorAlignmentChange($event)"
5272
+ (stateChange)="refreshTextEditorSelection()"
5273
+ [renderVerticalAlignment]="textToolbarRenderVerticalAlignment()"
5274
+ ></kendo-diagram-text-editing-toolbar>
5275
+ }
5276
+ </div>
5277
+ }
5278
+ </kendo-diagram-floating-toolbar-popup>
5279
+
5280
+ <kendo-editor
5281
+ class="k-diagram-rich-text-editor"
5282
+ [iframe]="false"
5283
+ [placeholder]="textEditorPlaceholder"
5284
+ [style.position]="'absolute'"
5285
+ [style.z-index]="1"
5286
+ [style.pointer-events]="'auto'"
5287
+ [style.background]="'transparent'"
5288
+ [style.display]="snapshot().editingSession ? null : 'none'"
5289
+ (valueChange)="onTextEditorValueChange()"
5290
+ ></kendo-editor>
5291
+ }
5292
+
5293
+ <ng-content></ng-content>
5294
+ `
5295
+ }]
5296
+ }], ctorParameters: () => [{ type: DiagramComponent, decorators: [{
5297
+ type: Optional
5298
+ }] }, { type: i1$1.LocalizationService }, { type: i0.NgZone }, { type: i0.Renderer2 }], propDecorators: { editorComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => EditorComponent), { isSignal: true }] }], editorElementRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => EditorComponent), { ...{ read: ElementRef }, isSignal: true }] }], toolbars: [{
5299
+ type: Input
5300
+ }], shapes: [{
5301
+ type: Input
5302
+ }], fontTypes: [{
5303
+ type: Input
5304
+ }], fontSizes: [{
5305
+ type: Input
5306
+ }] } });
5307
+
5308
+ /**
5309
+ * Represents the Kendo UI Diagram Editor custom messages component for Angular.
5310
+ * Use this component to override the default Diagram Editor messages.
5311
+ *
5312
+ * @example
5313
+ * ```html
5314
+ * <kendo-diagram>
5315
+ * <kendo-diagram-editor>
5316
+ * <kendo-diagram-editor-messages undoTitle="Undo action" redoTitle="Redo action">
5317
+ * </kendo-diagram-editor-messages>
5318
+ * </kendo-diagram-editor>
5319
+ * </kendo-diagram>
5320
+ * ```
5321
+ */
5322
+ class DiagramEditorCustomMessagesComponent extends DiagramEditorMessages {
5323
+ service;
5324
+ constructor(service) {
5325
+ super();
5326
+ this.service = service;
5327
+ }
5328
+ get override() {
5329
+ return true;
5330
+ }
5331
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramEditorCustomMessagesComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
5332
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.32", type: DiagramEditorCustomMessagesComponent, isStandalone: true, selector: "kendo-diagram-editor-messages", providers: [
5333
+ {
5334
+ provide: DiagramEditorMessages,
5335
+ useExisting: forwardRef(() => DiagramEditorCustomMessagesComponent)
5336
+ }
5337
+ ], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
5338
+ }
5339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramEditorCustomMessagesComponent, decorators: [{
5340
+ type: Component,
5341
+ args: [{
5342
+ providers: [
5343
+ {
5344
+ provide: DiagramEditorMessages,
5345
+ useExisting: forwardRef(() => DiagramEditorCustomMessagesComponent)
5346
+ }
5347
+ ],
5348
+ selector: 'kendo-diagram-editor-messages',
5349
+ template: ``,
5350
+ standalone: true
5351
+ }]
5352
+ }], ctorParameters: () => [{ type: i1$1.LocalizationService }] });
5353
+
1170
5354
  /**
1171
5355
  * Represents the utility array that that contains all `Diagram`-related components and directives.
1172
5356
  *
@@ -1189,7 +5373,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
1189
5373
  const KENDO_DIAGRAM = [
1190
5374
  DiagramComponent,
1191
5375
  ShapeTooltipTemplateDirective,
1192
- ConnectionTooltipTemplateDirective
5376
+ ConnectionTooltipTemplateDirective,
5377
+ DiagramEditorComponent,
5378
+ DiagramEditorCustomMessagesComponent
1193
5379
  ];
1194
5380
 
1195
5381
  /**
@@ -1224,11 +5410,11 @@ const KENDO_DIAGRAM = [
1224
5410
  * ```
1225
5411
  */
1226
5412
  class DiagramModule {
1227
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: DiagramModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1228
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.30", ngImport: i0, type: DiagramModule, imports: [DiagramComponent, ShapeTooltipTemplateDirective, ConnectionTooltipTemplateDirective], exports: [DiagramComponent, ShapeTooltipTemplateDirective, ConnectionTooltipTemplateDirective] });
1229
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: DiagramModule, imports: [DiagramComponent] });
5413
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5414
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.32", ngImport: i0, type: DiagramModule, imports: [DiagramComponent, ShapeTooltipTemplateDirective, ConnectionTooltipTemplateDirective, DiagramEditorComponent, DiagramEditorCustomMessagesComponent], exports: [DiagramComponent, ShapeTooltipTemplateDirective, ConnectionTooltipTemplateDirective, DiagramEditorComponent, DiagramEditorCustomMessagesComponent] });
5415
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramModule, imports: [DiagramComponent, DiagramEditorComponent] });
1230
5416
  }
1231
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImport: i0, type: DiagramModule, decorators: [{
5417
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.32", ngImport: i0, type: DiagramModule, decorators: [{
1232
5418
  type: NgModule,
1233
5419
  args: [{
1234
5420
  imports: [...KENDO_DIAGRAM],
@@ -1243,5 +5429,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
1243
5429
  * Generated bundle index. Do not edit.
1244
5430
  */
1245
5431
 
1246
- export { ConnectionTooltipTemplateDirective, DiagramComponent, DiagramModule, KENDO_DIAGRAM, ShapeTooltipTemplateDirective };
5432
+ export { ConnectionTooltipTemplateDirective, DiagramComponent, DiagramEditorComponent, DiagramEditorCustomMessagesComponent, DiagramModule, KENDO_DIAGRAM, ShapeTooltipTemplateDirective, diagramEditingContentDefaults };
1247
5433