ngx-relationship-visualiser 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/esm2022/projects/ngx-relationship-visualiser-lib/lib/ngx-relationship-visualiser.module.mjs +2 -6
- package/esm2022/projects/ngx-relationship-visualiser-lib/lib/visualiser/context-menus/context-menus.component.mjs +44 -35
- package/esm2022/projects/ngx-relationship-visualiser-lib/lib/visualiser/modals/abstract-modal-form-handler.mjs +8 -16
- package/esm2022/projects/ngx-relationship-visualiser-lib/lib/visualiser/modals/modals.component.mjs +10 -5
- package/esm2022/projects/ngx-relationship-visualiser-lib/lib/visualiser/services/visualiser-graph.service.mjs +21 -9
- package/esm2022/projects/ngx-relationship-visualiser-lib/lib/visualiser/visualiser-graph/visualiser-graph.component.mjs +24 -29
- package/fesm2022/ngx-relationship-visualiser.mjs +101 -90
- package/fesm2022/ngx-relationship-visualiser.mjs.map +1 -1
- package/package.json +1 -2
- package/projects/ngx-relationship-visualiser-lib/lib/ngx-relationship-visualiser.module.d.ts +2 -3
- package/projects/ngx-relationship-visualiser-lib/lib/visualiser/context-menus/context-menus.component.d.ts +15 -9
- package/projects/ngx-relationship-visualiser-lib/lib/visualiser/modals/abstract-modal-form-handler.d.ts +0 -1
- package/projects/ngx-relationship-visualiser-lib/lib/visualiser/visualiser-graph/visualiser-graph.component.d.ts +2 -4
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter,
|
|
2
|
+
import { EventEmitter, HostListener, Output, Component, Injectable, ViewChild, Input, NgModule } from '@angular/core';
|
|
3
3
|
import { BrowserModule } from '@angular/platform-browser';
|
|
4
|
-
import * as i2
|
|
5
|
-
import { Validators,
|
|
4
|
+
import * as i2 from '@angular/forms';
|
|
5
|
+
import { Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
6
6
|
import * as i1 from 'ngx-bootstrap/modal';
|
|
7
7
|
import { ModalModule } from 'ngx-bootstrap/modal';
|
|
8
|
-
import * as i2 from '@kreash/ngx-contextmenu';
|
|
9
|
-
import { ContextMenuModule } from '@kreash/ngx-contextmenu';
|
|
10
8
|
import Dexie from 'dexie';
|
|
11
9
|
import * as i4 from '@angular/common';
|
|
12
10
|
import * as i5 from '@ng-select/ng-select';
|
|
@@ -17,25 +15,46 @@ import { Subject, ReplaySubject } from 'rxjs';
|
|
|
17
15
|
import * as dagre from '@dagrejs/dagre';
|
|
18
16
|
|
|
19
17
|
class ContextMenusComponent {
|
|
20
|
-
editNodeContextMenu;
|
|
21
|
-
findCreateNodesContextMenu;
|
|
22
|
-
createEditLinkContextMenu;
|
|
23
|
-
editLinkLabelContextMenu;
|
|
24
18
|
editNodeContextMenuEvent = new EventEmitter();
|
|
25
19
|
findCreateNodesContextMenuEvent = new EventEmitter();
|
|
26
20
|
createLinkContextMenuEvent = new EventEmitter();
|
|
27
21
|
editLinkLabelContextMenuEvent = new EventEmitter();
|
|
28
22
|
editLinksContextMenuEvent = new EventEmitter();
|
|
23
|
+
menuType = null;
|
|
24
|
+
menuPosition = { left: 0, top: 0 };
|
|
25
|
+
menuItem = null;
|
|
26
|
+
openMenu(menuType, event, item) {
|
|
27
|
+
this.menuType = menuType;
|
|
28
|
+
this.menuItem = item ?? null;
|
|
29
|
+
this.menuPosition = {
|
|
30
|
+
left: Math.max(0, Math.min(event.clientX, window.innerWidth - 200)),
|
|
31
|
+
top: Math.max(0, Math.min(event.clientY, window.innerHeight - 120))
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
closeMenu() {
|
|
35
|
+
this.menuType = null;
|
|
36
|
+
this.menuItem = null;
|
|
37
|
+
}
|
|
38
|
+
onDocumentClick() {
|
|
39
|
+
this.closeMenu();
|
|
40
|
+
}
|
|
41
|
+
onEscape() {
|
|
42
|
+
this.closeMenu();
|
|
43
|
+
}
|
|
29
44
|
editNode() {
|
|
45
|
+
this.closeMenu();
|
|
30
46
|
this.editNodeContextMenuEvent.emit(true);
|
|
31
47
|
}
|
|
32
48
|
findNodes() {
|
|
49
|
+
this.closeMenu();
|
|
33
50
|
this.findCreateNodesContextMenuEvent.emit('findNodes');
|
|
34
51
|
}
|
|
35
52
|
createNode() {
|
|
53
|
+
this.closeMenu();
|
|
36
54
|
this.findCreateNodesContextMenuEvent.emit('createNode');
|
|
37
55
|
}
|
|
38
56
|
createLink(item) {
|
|
57
|
+
this.closeMenu();
|
|
39
58
|
if (!item || item.selectedNodes.length !== 2) {
|
|
40
59
|
console.error('Exactly two selected nodes are required to create a link.');
|
|
41
60
|
return;
|
|
@@ -47,9 +66,11 @@ class ContextMenusComponent {
|
|
|
47
66
|
this.createLinkContextMenuEvent.emit(payload);
|
|
48
67
|
}
|
|
49
68
|
editLinkLabel() {
|
|
69
|
+
this.closeMenu();
|
|
50
70
|
this.editLinkLabelContextMenuEvent.emit(true);
|
|
51
71
|
}
|
|
52
72
|
editLinks(item) {
|
|
73
|
+
this.closeMenu();
|
|
53
74
|
const matchingLink = this.checkLinkBetweenSelectedNodes(item);
|
|
54
75
|
if (matchingLink) {
|
|
55
76
|
this.editLinksContextMenuEvent.emit({
|
|
@@ -61,19 +82,12 @@ class ContextMenusComponent {
|
|
|
61
82
|
console.warn("No matching link to edit.");
|
|
62
83
|
}
|
|
63
84
|
}
|
|
64
|
-
linksExist
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (!matchingLink) {
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
85
|
+
linksExist() {
|
|
86
|
+
return this.checkLinkBetweenSelectedNodes(this.menuItem) !== null;
|
|
87
|
+
}
|
|
88
|
+
linksDoNotExist() {
|
|
89
|
+
return this.menuItem !== null && this.checkLinkBetweenSelectedNodes(this.menuItem) === null;
|
|
90
|
+
}
|
|
77
91
|
checkLinkBetweenSelectedNodes(payload) {
|
|
78
92
|
if (!payload || payload.selectedNodes.length !== 2) {
|
|
79
93
|
return null;
|
|
@@ -93,24 +107,12 @@ class ContextMenusComponent {
|
|
|
93
107
|
}
|
|
94
108
|
}
|
|
95
109
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ContextMenusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
96
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
110
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ContextMenusComponent, selector: "app-context-menus", outputs: { editNodeContextMenuEvent: "editNodeContextMenuEvent", findCreateNodesContextMenuEvent: "findCreateNodesContextMenuEvent", createLinkContextMenuEvent: "createLinkContextMenuEvent", editLinkLabelContextMenuEvent: "editLinkLabelContextMenuEvent", editLinksContextMenuEvent: "editLinksContextMenuEvent" }, host: { listeners: { "document:click": "onDocumentClick()", "document:keydown.escape": "onEscape()" } }, ngImport: i0, template: "@if (menuType) {\n <div\n class=\"graph-context-menu\"\n role=\"menu\"\n aria-label=\"Graph actions\"\n [style.left.px]=\"menuPosition.left\"\n [style.top.px]=\"menuPosition.top\">\n @if (menuType === 'node') {\n <button type=\"button\" role=\"menuitem\" (click)=\"editNode()\">Edit Node...</button>\n }\n @if (menuType === 'background') {\n <button type=\"button\" role=\"menuitem\" (click)=\"findNodes()\">Search Nodes...</button>\n <button type=\"button\" role=\"menuitem\" (click)=\"createNode()\">Create Node...</button>\n }\n @if (menuType === 'links') {\n @if (linksDoNotExist()) {\n <button type=\"button\" role=\"menuitem\" (click)=\"createLink(menuItem)\">Create Link...</button>\n }\n @if (linksExist()) {\n <button type=\"button\" role=\"menuitem\" (click)=\"editLinks(menuItem)\">Edit Links...</button>\n }\n }\n @if (menuType === 'link-label') {\n <button type=\"button\" role=\"menuitem\" (click)=\"editLinkLabel()\">Edit Link label...</button>\n }\n </div>\n}", styles: [".graph-context-menu{position:fixed;z-index:1050;display:flex;min-width:190px;max-height:calc(100vh - 16px);flex-direction:column;overflow-y:auto;padding:4px 0;border:1px solid #d5d5d5;border-radius:4px;background:#fff;box-shadow:0 4px 12px #0000002e}.graph-context-menu button{padding:7px 14px;border:0;background:transparent;color:#212529;font:inherit;text-align:left;white-space:nowrap}.graph-context-menu button:hover,.graph-context-menu button:focus-visible{outline:0;background:#f0f0f0}\n"] });
|
|
97
111
|
}
|
|
98
112
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ContextMenusComponent, decorators: [{
|
|
99
113
|
type: Component,
|
|
100
|
-
args: [{ selector: 'app-context-menus', template: "<context-menu
|
|
101
|
-
}], propDecorators: {
|
|
102
|
-
type: ViewChild,
|
|
103
|
-
args: ['editNodeContextMenu']
|
|
104
|
-
}], findCreateNodesContextMenu: [{
|
|
105
|
-
type: ViewChild,
|
|
106
|
-
args: ['findCreateNodesContextMenu']
|
|
107
|
-
}], createEditLinkContextMenu: [{
|
|
108
|
-
type: ViewChild,
|
|
109
|
-
args: ['createEditLinkContextMenu']
|
|
110
|
-
}], editLinkLabelContextMenu: [{
|
|
111
|
-
type: ViewChild,
|
|
112
|
-
args: ['editLinkLabelContextMenu']
|
|
113
|
-
}], editNodeContextMenuEvent: [{
|
|
114
|
+
args: [{ selector: 'app-context-menus', template: "@if (menuType) {\n <div\n class=\"graph-context-menu\"\n role=\"menu\"\n aria-label=\"Graph actions\"\n [style.left.px]=\"menuPosition.left\"\n [style.top.px]=\"menuPosition.top\">\n @if (menuType === 'node') {\n <button type=\"button\" role=\"menuitem\" (click)=\"editNode()\">Edit Node...</button>\n }\n @if (menuType === 'background') {\n <button type=\"button\" role=\"menuitem\" (click)=\"findNodes()\">Search Nodes...</button>\n <button type=\"button\" role=\"menuitem\" (click)=\"createNode()\">Create Node...</button>\n }\n @if (menuType === 'links') {\n @if (linksDoNotExist()) {\n <button type=\"button\" role=\"menuitem\" (click)=\"createLink(menuItem)\">Create Link...</button>\n }\n @if (linksExist()) {\n <button type=\"button\" role=\"menuitem\" (click)=\"editLinks(menuItem)\">Edit Links...</button>\n }\n }\n @if (menuType === 'link-label') {\n <button type=\"button\" role=\"menuitem\" (click)=\"editLinkLabel()\">Edit Link label...</button>\n }\n </div>\n}", styles: [".graph-context-menu{position:fixed;z-index:1050;display:flex;min-width:190px;max-height:calc(100vh - 16px);flex-direction:column;overflow-y:auto;padding:4px 0;border:1px solid #d5d5d5;border-radius:4px;background:#fff;box-shadow:0 4px 12px #0000002e}.graph-context-menu button{padding:7px 14px;border:0;background:transparent;color:#212529;font:inherit;text-align:left;white-space:nowrap}.graph-context-menu button:hover,.graph-context-menu button:focus-visible{outline:0;background:#f0f0f0}\n"] }]
|
|
115
|
+
}], propDecorators: { editNodeContextMenuEvent: [{
|
|
114
116
|
type: Output
|
|
115
117
|
}], findCreateNodesContextMenuEvent: [{
|
|
116
118
|
type: Output
|
|
@@ -120,6 +122,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
120
122
|
type: Output
|
|
121
123
|
}], editLinksContextMenuEvent: [{
|
|
122
124
|
type: Output
|
|
125
|
+
}], onDocumentClick: [{
|
|
126
|
+
type: HostListener,
|
|
127
|
+
args: ['document:click']
|
|
128
|
+
}], onEscape: [{
|
|
129
|
+
type: HostListener,
|
|
130
|
+
args: ['document:keydown.escape']
|
|
123
131
|
}] } });
|
|
124
132
|
|
|
125
133
|
var fontAwesomeIcons = [
|
|
@@ -342,11 +350,11 @@ class AbstractModalFormHandler {
|
|
|
342
350
|
lineStyle: ['Dotted', Validators.required],
|
|
343
351
|
sourceArrow: [false],
|
|
344
352
|
targetArrow: [false],
|
|
345
|
-
label: this.fb.array([]
|
|
353
|
+
label: this.fb.array([]),
|
|
346
354
|
});
|
|
347
355
|
this.createNodeForm = this.fb.group({
|
|
348
356
|
id: '',
|
|
349
|
-
label: this.fb.array([]
|
|
357
|
+
label: this.fb.array([]),
|
|
350
358
|
imageUrl: [''],
|
|
351
359
|
icon: [''],
|
|
352
360
|
fx: [null],
|
|
@@ -363,7 +371,7 @@ class AbstractModalFormHandler {
|
|
|
363
371
|
}
|
|
364
372
|
addLabel() {
|
|
365
373
|
const labelGroup = this.fb.group({
|
|
366
|
-
label: [''
|
|
374
|
+
label: [''],
|
|
367
375
|
linkIcon: [''],
|
|
368
376
|
});
|
|
369
377
|
this.labelArray.push(labelGroup);
|
|
@@ -375,12 +383,12 @@ class AbstractModalFormHandler {
|
|
|
375
383
|
this.nodeLabelArray.push(labelGroup);
|
|
376
384
|
}
|
|
377
385
|
removeLabel(index) {
|
|
378
|
-
if (this.labelArray.length
|
|
386
|
+
if (index >= 0 && index < this.labelArray.length) {
|
|
379
387
|
this.labelArray.removeAt(index);
|
|
380
388
|
}
|
|
381
389
|
}
|
|
382
390
|
removeNodeLabel(index) {
|
|
383
|
-
if (this.nodeLabelArray.length
|
|
391
|
+
if (index >= 0 && index < this.nodeLabelArray.length) {
|
|
384
392
|
this.nodeLabelArray.removeAt(index);
|
|
385
393
|
}
|
|
386
394
|
}
|
|
@@ -413,7 +421,7 @@ class AbstractModalFormHandler {
|
|
|
413
421
|
data.relationships.forEach((relationship) => {
|
|
414
422
|
const labelGroup = this.fb.group({
|
|
415
423
|
labelIndex: [relationship.labelIndex, Validators.required],
|
|
416
|
-
label: [relationship.label
|
|
424
|
+
label: [relationship.label],
|
|
417
425
|
linkIcon: [
|
|
418
426
|
typeof relationship.linkIcon === 'string'
|
|
419
427
|
? relationship.linkIcon
|
|
@@ -444,14 +452,6 @@ class AbstractModalFormHandler {
|
|
|
444
452
|
}
|
|
445
453
|
return null;
|
|
446
454
|
}
|
|
447
|
-
minLengthArray(min) {
|
|
448
|
-
return (control) => {
|
|
449
|
-
if (control instanceof FormArray) {
|
|
450
|
-
return control.length >= min ? null : { minLengthArray: true };
|
|
451
|
-
}
|
|
452
|
-
return null;
|
|
453
|
-
};
|
|
454
|
-
}
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
class DexieService extends Dexie {
|
|
@@ -551,7 +551,6 @@ class ModalsComponent extends AbstractModalFormHandler {
|
|
|
551
551
|
}
|
|
552
552
|
if (template === this.createLinkModal) {
|
|
553
553
|
this.resetLinksForm();
|
|
554
|
-
this.addLabel();
|
|
555
554
|
void this.findEditLabelsAndImagesfromIDs();
|
|
556
555
|
}
|
|
557
556
|
if (template === this.createNodeModal) {
|
|
@@ -609,7 +608,13 @@ class ModalsComponent extends AbstractModalFormHandler {
|
|
|
609
608
|
}
|
|
610
609
|
createEditLink(source) {
|
|
611
610
|
if (this.createLinkForm.valid) {
|
|
612
|
-
const
|
|
611
|
+
const formData = this.createLinkForm.value;
|
|
612
|
+
const createLinkData = {
|
|
613
|
+
...formData,
|
|
614
|
+
label: formData.label.filter(({ label }) => Array.isArray(label)
|
|
615
|
+
? label.some(value => value.trim().length > 0)
|
|
616
|
+
: label.trim().length > 0)
|
|
617
|
+
};
|
|
613
618
|
this.createEditLinkEvent.emit({ payload: createLinkData, source });
|
|
614
619
|
this.resetLinksForm();
|
|
615
620
|
this.closeModal('modalRef');
|
|
@@ -694,13 +699,13 @@ class ModalsComponent extends AbstractModalFormHandler {
|
|
|
694
699
|
this.loading = false;
|
|
695
700
|
this.iconsBuffer = this.iconsBuffer.concat(more);
|
|
696
701
|
}
|
|
697
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalsComponent, deps: [{ token: i1.BsModalService }, { token: i2
|
|
698
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ModalsComponent, selector: "app-modals", inputs: { editNodeData: "editNodeData", editLinksData: "editLinksData" }, outputs: { closeModalEvent: "closeModalEvent", createEditLinkEvent: "createEditLinkEvent", createEditNodeEvent: "createEditNodeEvent", deleteLinkEvent: "deleteLinkEvent", deleteNodeEvent: "deleteNodeEvent" }, viewQueries: [{ propertyName: "editNodeModal", first: true, predicate: ["editNodeModal"], descendants: true }, { propertyName: "createNodeModal", first: true, predicate: ["createNodeModal"], descendants: true }, { propertyName: "createLinkModal", first: true, predicate: ["createLinkModal"], descendants: true }, { propertyName: "editLinksModal", first: true, predicate: ["editLinksModal"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<!--EDIT NODE MODAL-->\n<ng-template #editNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\" (change)=\"onIconTypeChange('url')\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\" (change)=\"onIconTypeChange('select')\"> Choose Icon\n </div>\n </div>\n @if (createNodeForm.get('iconType')?.value === 'url') {\n <div class=\"form-group\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n }\n @if (createNodeForm.get('iconType')?.value === 'select') {\n <div class=\"form-group\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n }\n @if (createNodeForm.errors?.iconOrImage) {\n <div class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n }\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of nodeLabelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\" [disabled]=\"nodeLabelArray.length <= 1\">Remove</button>\n </div>\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('editNodeModal')\" [disabled]=\"!createNodeForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteNode()\">Delete Node</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n <!--CREATE NODE MODAL-->\n <ng-template #createNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\" (change)=\"onIconTypeChange('url')\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\" (change)=\"onIconTypeChange('select')\"> Choose Icon\n </div>\n </div>\n @if (createNodeForm.get('iconType')?.value === 'url') {\n <div class=\"form-group\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n }\n @if (createNodeForm.get('iconType')?.value === 'select') {\n <div class=\"form-group\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n }\n @if (createNodeForm.errors?.iconOrImage) {\n <div class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n }\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of nodeLabelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\" [disabled]=\"nodeLabelArray.length <= 1\">Remove</button>\n </div>\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('createNodeModal')\" [disabled]=\"!createNodeForm.valid\">Create Node</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n <!--EDIT LINKS MODAL-->\n <ng-template #editLinksModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Links</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n @if (targetImageUrl) {\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n }\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n @if (sourceImageUrl) {\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n }\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of targetLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of sourceLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n </div>\n @if (createLinkForm.get('label')?.value?.length) {\n <div class=\"labelPosition text-center\">\n @for (label of createLinkForm.get('label')?.value; track label) {\n <span>\n <span class=\"d-block\">{{ label.label }} @if (label.linkIcon) {\n <span style=\"color: #856404;\"><i class=\"fa fa-light\">{{ getRelationshipIcon(label.linkIcon) }}</i></span>\n }</span>\n </span>\n }\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of labelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\" [disabled]=\"labelArray.length <= 1\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\" [checked]=\"!!label.get('linkIcon')?.value\" (change)=\"toggleLinkIcon(i, $event)\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n @if (label.get('linkIcon')?.value) {\n <ng-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select link icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\">\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{ item.icon }}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">Add another label</button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('editLinkModal')\" [disabled]=\"!createLinkForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteLink()\">Delete Link</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n\n <!--CREATE LINK MODAL-->\n <ng-template #createLinkModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Link</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n @if (targetImageUrl) {\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n }\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n @if (sourceImageUrl) {\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n }\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of targetLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of sourceLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n </div>\n @if (createLinkForm.get('label')?.value?.length) {\n <div class=\"labelPosition text-center\">\n @for (label of createLinkForm.get('label')?.value; track label) {\n <span>\n <span class=\"d-block\">{{ label.label }} @if (label.linkIcon) {\n <span style=\"color: #856404;\"><i class=\"fa fa-light\">{{ getRelationshipIcon(label.linkIcon) }}</i></span>\n }</span>\n </span>\n }\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of labelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\" [disabled]=\"labelArray.length <= 1\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\" [checked]=\"!!label.get('linkIcon')?.value\" (change)=\"toggleLinkIcon(i, $event)\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n @if (label.get('linkIcon')?.value) {\n <ng-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select link icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\">\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{ item.icon }}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">Add another label</button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('createLinkModal')\" [disabled]=\"!createLinkForm.valid\">Create Link</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->", styles: [".imageUrl{max-width:30px}.labelPosition{position:relative;top:-55px;margin-right:30px;margin-left:30px}.link-line-solid{width:100%;position:relative;margin:15px;border-top:2px solid #777}.link-line-dotted{width:100%;position:relative;margin:15px;background-image:repeating-linear-gradient(to right,#cacaca,#cacaca 7px,transparent 7px,transparent 15px);height:2px}.iconImage{position:relative;top:4px}.link-icon-select{width:250px}.arrow{position:absolute;top:20px;left:20px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i5.NgHeaderTemplateDirective, selector: "[ng-header-tmp]" }] });
|
|
702
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalsComponent, deps: [{ token: i1.BsModalService }, { token: i2.FormBuilder }, { token: DexieService }], target: i0.ɵɵFactoryTarget.Component });
|
|
703
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ModalsComponent, selector: "app-modals", inputs: { editNodeData: "editNodeData", editLinksData: "editLinksData" }, outputs: { closeModalEvent: "closeModalEvent", createEditLinkEvent: "createEditLinkEvent", createEditNodeEvent: "createEditNodeEvent", deleteLinkEvent: "deleteLinkEvent", deleteNodeEvent: "deleteNodeEvent" }, viewQueries: [{ propertyName: "editNodeModal", first: true, predicate: ["editNodeModal"], descendants: true }, { propertyName: "createNodeModal", first: true, predicate: ["createNodeModal"], descendants: true }, { propertyName: "createLinkModal", first: true, predicate: ["createLinkModal"], descendants: true }, { propertyName: "editLinksModal", first: true, predicate: ["editLinksModal"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<!--EDIT NODE MODAL-->\n<ng-template #editNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\" (change)=\"onIconTypeChange('url')\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\" (change)=\"onIconTypeChange('select')\"> Choose Icon\n </div>\n </div>\n @if (createNodeForm.get('iconType')?.value === 'url') {\n <div class=\"form-group\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n }\n @if (createNodeForm.get('iconType')?.value === 'select') {\n <div class=\"form-group\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n }\n @if (createNodeForm.errors?.iconOrImage) {\n <div class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n }\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of nodeLabelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\">Remove</button>\n </div>\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('editNodeModal')\" [disabled]=\"!createNodeForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteNode()\">Delete Node</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n <!--CREATE NODE MODAL-->\n <ng-template #createNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\" (change)=\"onIconTypeChange('url')\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\" (change)=\"onIconTypeChange('select')\"> Choose Icon\n </div>\n </div>\n @if (createNodeForm.get('iconType')?.value === 'url') {\n <div class=\"form-group\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n }\n @if (createNodeForm.get('iconType')?.value === 'select') {\n <div class=\"form-group\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n }\n @if (createNodeForm.errors?.iconOrImage) {\n <div class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n }\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of nodeLabelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\">Remove</button>\n </div>\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('createNodeModal')\" [disabled]=\"!createNodeForm.valid\">Create Node</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n <!--EDIT LINKS MODAL-->\n <ng-template #editLinksModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Links</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n @if (targetImageUrl) {\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n }\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n @if (sourceImageUrl) {\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n }\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of targetLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of sourceLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n </div>\n @if (createLinkForm.get('label')?.value?.length) {\n <div class=\"labelPosition text-center\">\n @for (label of createLinkForm.get('label')?.value; track label) {\n <span>\n <span class=\"d-block\">{{ label.label }} @if (label.linkIcon) {\n <span style=\"color: #856404;\"><i class=\"fa fa-light\">{{ getRelationshipIcon(label.linkIcon) }}</i></span>\n }</span>\n </span>\n }\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of labelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\" [checked]=\"!!label.get('linkIcon')?.value\" (change)=\"toggleLinkIcon(i, $event)\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n @if (label.get('linkIcon')?.value) {\n <ng-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select link icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\">\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{ item.icon }}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">\n {{ labelArray.length > 0 ? 'Add another label' : 'Add label' }}\n </button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('editLinkModal')\" [disabled]=\"!createLinkForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteLink()\">Delete Link</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n\n <!--CREATE LINK MODAL-->\n <ng-template #createLinkModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Link</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n @if (targetImageUrl) {\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n }\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n @if (sourceImageUrl) {\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n }\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of targetLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of sourceLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n </div>\n @if (createLinkForm.get('label')?.value?.length) {\n <div class=\"labelPosition text-center\">\n @for (label of createLinkForm.get('label')?.value; track label) {\n <span>\n <span class=\"d-block\">{{ label.label }} @if (label.linkIcon) {\n <span style=\"color: #856404;\"><i class=\"fa fa-light\">{{ getRelationshipIcon(label.linkIcon) }}</i></span>\n }</span>\n </span>\n }\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of labelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\" [checked]=\"!!label.get('linkIcon')?.value\" (change)=\"toggleLinkIcon(i, $event)\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n @if (label.get('linkIcon')?.value) {\n <ng-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select link icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\">\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{ item.icon }}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">\n {{ labelArray.length > 0 ? 'Add another label' : 'Add label' }}\n </button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('createLinkModal')\" [disabled]=\"!createLinkForm.valid\">Create Link</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->", styles: [".imageUrl{max-width:30px}.labelPosition{position:relative;top:-55px;margin-right:30px;margin-left:30px}.link-line-solid{width:100%;position:relative;margin:15px;border-top:2px solid #777}.link-line-dotted{width:100%;position:relative;margin:15px;background-image:repeating-linear-gradient(to right,#cacaca,#cacaca 7px,transparent 7px,transparent 15px);height:2px}.iconImage{position:relative;top:4px}.link-icon-select{width:250px}.arrow{position:absolute;top:20px;left:20px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i5.NgHeaderTemplateDirective, selector: "[ng-header-tmp]" }] });
|
|
699
704
|
}
|
|
700
705
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalsComponent, decorators: [{
|
|
701
706
|
type: Component,
|
|
702
|
-
args: [{ selector: 'app-modals', template: "<!--EDIT NODE MODAL-->\n<ng-template #editNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\" (change)=\"onIconTypeChange('url')\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\" (change)=\"onIconTypeChange('select')\"> Choose Icon\n </div>\n </div>\n @if (createNodeForm.get('iconType')?.value === 'url') {\n <div class=\"form-group\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n }\n @if (createNodeForm.get('iconType')?.value === 'select') {\n <div class=\"form-group\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n }\n @if (createNodeForm.errors?.iconOrImage) {\n <div class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n }\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of nodeLabelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\" [disabled]=\"nodeLabelArray.length <= 1\">Remove</button>\n </div>\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('editNodeModal')\" [disabled]=\"!createNodeForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteNode()\">Delete Node</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n <!--CREATE NODE MODAL-->\n <ng-template #createNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\" (change)=\"onIconTypeChange('url')\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\" (change)=\"onIconTypeChange('select')\"> Choose Icon\n </div>\n </div>\n @if (createNodeForm.get('iconType')?.value === 'url') {\n <div class=\"form-group\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n }\n @if (createNodeForm.get('iconType')?.value === 'select') {\n <div class=\"form-group\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n }\n @if (createNodeForm.errors?.iconOrImage) {\n <div class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n }\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of nodeLabelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\" [disabled]=\"nodeLabelArray.length <= 1\">Remove</button>\n </div>\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('createNodeModal')\" [disabled]=\"!createNodeForm.valid\">Create Node</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n <!--EDIT LINKS MODAL-->\n <ng-template #editLinksModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Links</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n @if (targetImageUrl) {\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n }\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n @if (sourceImageUrl) {\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n }\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of targetLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of sourceLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n </div>\n @if (createLinkForm.get('label')?.value?.length) {\n <div class=\"labelPosition text-center\">\n @for (label of createLinkForm.get('label')?.value; track label) {\n <span>\n <span class=\"d-block\">{{ label.label }} @if (label.linkIcon) {\n <span style=\"color: #856404;\"><i class=\"fa fa-light\">{{ getRelationshipIcon(label.linkIcon) }}</i></span>\n }</span>\n </span>\n }\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of labelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\" [disabled]=\"labelArray.length <= 1\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\" [checked]=\"!!label.get('linkIcon')?.value\" (change)=\"toggleLinkIcon(i, $event)\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n @if (label.get('linkIcon')?.value) {\n <ng-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select link icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\">\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{ item.icon }}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">Add another label</button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('editLinkModal')\" [disabled]=\"!createLinkForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteLink()\">Delete Link</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n\n <!--CREATE LINK MODAL-->\n <ng-template #createLinkModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Link</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n @if (targetImageUrl) {\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n }\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n @if (sourceImageUrl) {\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n }\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of targetLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of sourceLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n </div>\n @if (createLinkForm.get('label')?.value?.length) {\n <div class=\"labelPosition text-center\">\n @for (label of createLinkForm.get('label')?.value; track label) {\n <span>\n <span class=\"d-block\">{{ label.label }} @if (label.linkIcon) {\n <span style=\"color: #856404;\"><i class=\"fa fa-light\">{{ getRelationshipIcon(label.linkIcon) }}</i></span>\n }</span>\n </span>\n }\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of labelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\" [disabled]=\"labelArray.length <= 1\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\" [checked]=\"!!label.get('linkIcon')?.value\" (change)=\"toggleLinkIcon(i, $event)\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n @if (label.get('linkIcon')?.value) {\n <ng-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select link icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\">\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{ item.icon }}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">Add another label</button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('createLinkModal')\" [disabled]=\"!createLinkForm.valid\">Create Link</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->", styles: [".imageUrl{max-width:30px}.labelPosition{position:relative;top:-55px;margin-right:30px;margin-left:30px}.link-line-solid{width:100%;position:relative;margin:15px;border-top:2px solid #777}.link-line-dotted{width:100%;position:relative;margin:15px;background-image:repeating-linear-gradient(to right,#cacaca,#cacaca 7px,transparent 7px,transparent 15px);height:2px}.iconImage{position:relative;top:4px}.link-icon-select{width:250px}.arrow{position:absolute;top:20px;left:20px}\n"] }]
|
|
703
|
-
}], ctorParameters: () => [{ type: i1.BsModalService }, { type: i2
|
|
707
|
+
args: [{ selector: 'app-modals', template: "<!--EDIT NODE MODAL-->\n<ng-template #editNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\" (change)=\"onIconTypeChange('url')\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\" (change)=\"onIconTypeChange('select')\"> Choose Icon\n </div>\n </div>\n @if (createNodeForm.get('iconType')?.value === 'url') {\n <div class=\"form-group\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n }\n @if (createNodeForm.get('iconType')?.value === 'select') {\n <div class=\"form-group\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n }\n @if (createNodeForm.errors?.iconOrImage) {\n <div class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n }\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of nodeLabelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\">Remove</button>\n </div>\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('editNodeModal')\" [disabled]=\"!createNodeForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteNode()\">Delete Node</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n <!--CREATE NODE MODAL-->\n <ng-template #createNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\" (change)=\"onIconTypeChange('url')\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\" (change)=\"onIconTypeChange('select')\"> Choose Icon\n </div>\n </div>\n @if (createNodeForm.get('iconType')?.value === 'url') {\n <div class=\"form-group\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n }\n @if (createNodeForm.get('iconType')?.value === 'select') {\n <div class=\"form-group\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n }\n @if (createNodeForm.errors?.iconOrImage) {\n <div class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n }\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of nodeLabelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\">Remove</button>\n </div>\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('createNodeModal')\" [disabled]=\"!createNodeForm.valid\">Create Node</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n <!--EDIT LINKS MODAL-->\n <ng-template #editLinksModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Links</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n @if (targetImageUrl) {\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n }\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n @if (sourceImageUrl) {\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n }\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of targetLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of sourceLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n </div>\n @if (createLinkForm.get('label')?.value?.length) {\n <div class=\"labelPosition text-center\">\n @for (label of createLinkForm.get('label')?.value; track label) {\n <span>\n <span class=\"d-block\">{{ label.label }} @if (label.linkIcon) {\n <span style=\"color: #856404;\"><i class=\"fa fa-light\">{{ getRelationshipIcon(label.linkIcon) }}</i></span>\n }</span>\n </span>\n }\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of labelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\" [checked]=\"!!label.get('linkIcon')?.value\" (change)=\"toggleLinkIcon(i, $event)\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n @if (label.get('linkIcon')?.value) {\n <ng-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select link icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\">\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{ item.icon }}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">\n {{ labelArray.length > 0 ? 'Add another label' : 'Add label' }}\n </button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('editLinkModal')\" [disabled]=\"!createLinkForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteLink()\">Delete Link</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n\n <!--CREATE LINK MODAL-->\n <ng-template #createLinkModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Link</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n @if (targetImageUrl) {\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n }\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n @if (sourceImageUrl) {\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n }\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of targetLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of sourceLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n </div>\n @if (createLinkForm.get('label')?.value?.length) {\n <div class=\"labelPosition text-center\">\n @for (label of createLinkForm.get('label')?.value; track label) {\n <span>\n <span class=\"d-block\">{{ label.label }} @if (label.linkIcon) {\n <span style=\"color: #856404;\"><i class=\"fa fa-light\">{{ getRelationshipIcon(label.linkIcon) }}</i></span>\n }</span>\n </span>\n }\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of labelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\" [checked]=\"!!label.get('linkIcon')?.value\" (change)=\"toggleLinkIcon(i, $event)\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n @if (label.get('linkIcon')?.value) {\n <ng-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select link icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\">\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{ item.icon }}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">\n {{ labelArray.length > 0 ? 'Add another label' : 'Add label' }}\n </button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('createLinkModal')\" [disabled]=\"!createLinkForm.valid\">Create Link</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->", styles: [".imageUrl{max-width:30px}.labelPosition{position:relative;top:-55px;margin-right:30px;margin-left:30px}.link-line-solid{width:100%;position:relative;margin:15px;border-top:2px solid #777}.link-line-dotted{width:100%;position:relative;margin:15px;background-image:repeating-linear-gradient(to right,#cacaca,#cacaca 7px,transparent 7px,transparent 15px);height:2px}.iconImage{position:relative;top:4px}.link-icon-select{width:250px}.arrow{position:absolute;top:20px;left:20px}\n"] }]
|
|
708
|
+
}], ctorParameters: () => [{ type: i1.BsModalService }, { type: i2.FormBuilder }, { type: DexieService }], propDecorators: { editNodeData: [{
|
|
704
709
|
type: Input
|
|
705
710
|
}], editLinksData: [{
|
|
706
711
|
type: Input
|
|
@@ -967,12 +972,24 @@ class VisualiserGraphService {
|
|
|
967
972
|
// If nodes don't have a fx/fy coordinate we generate a random one - dagre nodes without links and new nodes added to canvas have null coordinates by design
|
|
968
973
|
this.nodes = this.randomiseNodePositions(this.nodes, parentWidth, parentHeight);
|
|
969
974
|
// Getting parents lineStyle and adding it to child objects
|
|
970
|
-
const relationshipsArray = this.links.map(({ lineStyle, targetArrow, sourceArrow, relationships }) =>
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
975
|
+
const relationshipsArray = this.links.map(({ source, target, linkId, lineStyle, targetArrow, sourceArrow, relationships }) => {
|
|
976
|
+
const relationshipLinks = (relationships ?? []).map((r) => ({
|
|
977
|
+
parentLineStyle: lineStyle,
|
|
978
|
+
parentSourceArrow: sourceArrow,
|
|
979
|
+
parentTargetArrow: targetArrow,
|
|
980
|
+
...r,
|
|
981
|
+
}));
|
|
982
|
+
return relationshipLinks.length
|
|
983
|
+
? relationshipLinks
|
|
984
|
+
: [{
|
|
985
|
+
source,
|
|
986
|
+
target,
|
|
987
|
+
linkId,
|
|
988
|
+
parentLineStyle: lineStyle,
|
|
989
|
+
parentSourceArrow: sourceArrow,
|
|
990
|
+
parentTargetArrow: targetArrow,
|
|
991
|
+
}];
|
|
992
|
+
});
|
|
976
993
|
// Adding dy value based on link number and position in parent
|
|
977
994
|
relationshipsArray.map((linkRelationship) => {
|
|
978
995
|
linkRelationship.map((linkObject, i) => {
|
|
@@ -1599,7 +1616,7 @@ class VisualiserGraphService {
|
|
|
1599
1616
|
.text((d) => Array.isArray(d.label) ? d.label.join(', ') : d.label ?? '');
|
|
1600
1617
|
const edgepaths = zoomContainer
|
|
1601
1618
|
.selectAll('path.edgepath')
|
|
1602
|
-
.data(this.links, linkKey);
|
|
1619
|
+
.data(this.links.filter(({ labelIndex }) => labelIndex !== undefined), linkKey);
|
|
1603
1620
|
const edgepathsEnter = edgepaths
|
|
1604
1621
|
.join('svg:path')
|
|
1605
1622
|
.attr('class', 'edgepath')
|
|
@@ -1608,7 +1625,7 @@ class VisualiserGraphService {
|
|
|
1608
1625
|
.attr('id', (d) => `edgepath_${linkKey(d)}`);
|
|
1609
1626
|
const edgelabels = zoomContainer
|
|
1610
1627
|
.selectAll('text.edgelabel')
|
|
1611
|
-
.data(this.links, linkKey);
|
|
1628
|
+
.data(this.links.filter(({ labelIndex }) => labelIndex !== undefined), linkKey);
|
|
1612
1629
|
const edgelabelsEnter = edgelabels
|
|
1613
1630
|
.enter()
|
|
1614
1631
|
.append('text')
|
|
@@ -2230,7 +2247,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2230
2247
|
|
|
2231
2248
|
class VisualiserGraphComponent {
|
|
2232
2249
|
visualiserGraphService;
|
|
2233
|
-
contextMenuService;
|
|
2234
2250
|
dagreNodesOnlyLayout;
|
|
2235
2251
|
dexieService;
|
|
2236
2252
|
graphElement;
|
|
@@ -2253,9 +2269,8 @@ class VisualiserGraphComponent {
|
|
|
2253
2269
|
controls = true;
|
|
2254
2270
|
zoomToFit = false;
|
|
2255
2271
|
modalsComponent;
|
|
2256
|
-
constructor(visualiserGraphService,
|
|
2272
|
+
constructor(visualiserGraphService, dagreNodesOnlyLayout, dexieService) {
|
|
2257
2273
|
this.visualiserGraphService = visualiserGraphService;
|
|
2258
|
-
this.contextMenuService = contextMenuService;
|
|
2259
2274
|
this.dagreNodesOnlyLayout = dagreNodesOnlyLayout;
|
|
2260
2275
|
this.dexieService = dexieService;
|
|
2261
2276
|
}
|
|
@@ -2341,7 +2356,7 @@ class VisualiserGraphComponent {
|
|
|
2341
2356
|
console.error('savedGraphData is not set');
|
|
2342
2357
|
return;
|
|
2343
2358
|
}
|
|
2344
|
-
let
|
|
2359
|
+
let contextMenuType = null;
|
|
2345
2360
|
let item;
|
|
2346
2361
|
const targetEl = event.target;
|
|
2347
2362
|
if (!(targetEl instanceof Element)) {
|
|
@@ -2354,7 +2369,7 @@ class VisualiserGraphComponent {
|
|
|
2354
2369
|
this.selectedNodeId = targetEl.id || data?.id || null;
|
|
2355
2370
|
let selectedNodesContext;
|
|
2356
2371
|
if (this.selectedNodesArray.length === 2) {
|
|
2357
|
-
|
|
2372
|
+
contextMenuType = 'links';
|
|
2358
2373
|
selectedNodesContext = {
|
|
2359
2374
|
graphData: this.savedGraphData,
|
|
2360
2375
|
selectedNodes: this.selectedNodesArray
|
|
@@ -2363,33 +2378,31 @@ class VisualiserGraphComponent {
|
|
|
2363
2378
|
}
|
|
2364
2379
|
else {
|
|
2365
2380
|
if (localName === 'text' || localName === 'image' || parentNodeId === 'nodeText') {
|
|
2366
|
-
|
|
2367
|
-
item = this.selectedNodeId;
|
|
2381
|
+
contextMenuType = 'node';
|
|
2368
2382
|
}
|
|
2369
2383
|
else if (localName === 'textPath') {
|
|
2370
|
-
|
|
2371
|
-
item = this.selectedLinkArray;
|
|
2384
|
+
contextMenuType = 'link-label';
|
|
2372
2385
|
}
|
|
2373
2386
|
else if (localName === 'svg') {
|
|
2374
|
-
|
|
2375
|
-
item = 'item';
|
|
2387
|
+
contextMenuType = 'background';
|
|
2376
2388
|
}
|
|
2377
2389
|
}
|
|
2378
|
-
this.contextMenuService.show.next({
|
|
2379
|
-
contextMenu,
|
|
2380
|
-
event,
|
|
2381
|
-
item,
|
|
2382
|
-
});
|
|
2383
2390
|
event.stopPropagation();
|
|
2384
2391
|
event.preventDefault();
|
|
2392
|
+
if (contextMenuType) {
|
|
2393
|
+
this.contextMenu.openMenu(contextMenuType, event, item);
|
|
2394
|
+
}
|
|
2395
|
+
else {
|
|
2396
|
+
this.contextMenu.closeMenu();
|
|
2397
|
+
}
|
|
2385
2398
|
// Update context menu items based on data from Dexie
|
|
2386
2399
|
const updatedData = await this.dexieService.getGraphData(this.dataId);
|
|
2387
2400
|
if (selectedNodesContext) {
|
|
2388
2401
|
selectedNodesContext.graphData = updatedData;
|
|
2389
2402
|
}
|
|
2390
2403
|
}
|
|
2391
|
-
dismissContextMenu(
|
|
2392
|
-
this.
|
|
2404
|
+
dismissContextMenu() {
|
|
2405
|
+
this.contextMenu.closeMenu();
|
|
2393
2406
|
}
|
|
2394
2407
|
findCreateNodesEvent(action) {
|
|
2395
2408
|
if (action === 'findNodes') {
|
|
@@ -2793,13 +2806,13 @@ class VisualiserGraphComponent {
|
|
|
2793
2806
|
console.error(`Modal template ${modal} is not available.`);
|
|
2794
2807
|
}
|
|
2795
2808
|
}
|
|
2796
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: VisualiserGraphComponent, deps: [{ token: VisualiserGraphService }, { token:
|
|
2797
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: VisualiserGraphComponent, selector: "visualiser-graph", inputs: { readOnly: "readOnly", zoom: "zoom", controls: "controls", zoomToFit: "zoomToFit", data: "data" }, outputs: { saveGraphDataEvent: "saveGraphDataEvent" }, viewQueries: [{ propertyName: "graphElement", first: true, predicate: ["svgId"], descendants: true }, { propertyName: "contextMenu", first: true, predicate: ContextMenusComponent, descendants: true }, { propertyName: "modalsComponent", first: true, predicate: ModalsComponent, descendants: true }], ngImport: i0, template: "<div class=\"page\" id=\"pageId\" (window:resize)=\"onResize()\">\n <div id=\"draggable\" class=\"buttonBar\" [style.right]=\"buttonBarRightPosition\">\n @if (controls) {\n <div>\n <div class=\"d-flex justify-content-end\">\n <div class=\"btn-group\" role=\"group\" aria-label=\"Controls\">\n <button type=\"button\" id=\"draggableHandle\" class=\"btn btn-light\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Move toolbar\">\n <i class=\"bi bi-grip-vertical\"></i>\n </button>\n <button type=\"button\" id=\"dagre_layout\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Dagre layout\" (click)=\"applyLayout()\">\n <i class=\"bi bi-diagram-3\"></i>\n </button>\n <button type=\"button\" id=\"save_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Save data\" (click)=\"onConfirmSave()\">\n <i class=\"bi bi-save\"></i>\n </button>\n <button type=\"button\" id=\"reset_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Reset data\" (click)=\"resetGraph()\">\n <i class=\"bi bi-skip-backward\"></i>\n </button>\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom in\" id=\"zoom_in\">\n <i class=\"bi bi-zoom-in\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom out\" id=\"zoom_out\">\n <i class=\"bi bi-zoom-out\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom reset\" id=\"zoom_reset\" disabled=\"true\">\n <i class=\"bi bi-arrow-counterclockwise\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom to fit\" id=\"zoom_to_fit\">\n <i class=\"bi bi-arrows-fullscreen\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Select all\" id=\"select_all\">\n <i class=\"bi bi-grid-fill\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Invert selection\" id=\"toggle_selection\">\n <i class=\"bi bi-ui-checks-grid\"></i>\n </button>\n }\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Toggle search\" id=\"toggle_search\"\n [ngClass]=\"{'searchButtonActive': showSearch, 'searchButtonInactive': !showSearch}\"\n (click)=\"toggleSearch()\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n </div>\n <div class=\"search float-right input-group mt-3 pr-0\" [hidden]=\"!showSearch\">\n <div class=\"input-group-prepend\">\n <button type=\"button\" id=\"prevButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Previous\" disabled>\n <i class=\"bi bi-arrow-left-square\"></i>\n </button>\n <button type=\"button\" id=\"nextButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Next\" disabled>\n <i class=\"bi bi-arrow-right-square\"></i>\n </button>\n </div>\n <input type=\"text\" id=\"searchInput\" class=\"form-control\" placeholder=\"Search\" aria-label=\"Search\"\n aria-describedby=\"search\" />\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"searchButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Search\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"clearButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Clear\" disabled>\n clear\n </button>\n </div>\n </div>\n </div>\n }\n <div [hidden]=\"!showSearch\" id=\"noMatchesText\" class=\"noMatchesText float-right\">No matches found</div>\n </div>\n <!-- Zoom indicator-->\n @if (zoom) {\n <div class=\"zoomIndicator\">\n <span id=\"zoom_level\"></span>\n </div>\n }\n\n <app-context-menus\n (editNodeContextMenuEvent)=\"handleEditNodesEvent($event)\"\n (findCreateNodesContextMenuEvent)=\"findCreateNodesEvent($event)\"\n (createLinkContextMenuEvent)=\"handleCreateLinksEvent($event)\"\n (editLinkLabelContextMenuEvent)=\"onEditLinkLabel()\"\n (editLinksContextMenuEvent)=\"handleEditLinksEvent($event)\">\n </app-context-menus>\n\n <app-modals\n [editNodeData]=\"editNodeData\"\n [editLinksData]=\"editLinksData\"\n (createEditLinkEvent)=\"onCreateEditLink($event)\"\n (createEditNodeEvent)=\"onCreateEditNode($event)\"\n (deleteLinkEvent)=\"onDeleteLink($event)\"\n (deleteNodeEvent)=\"onDeleteNode()\">\n </app-modals>\n\n <svg #svgId [attr.width]=\"width\" height=\"780\" (click)=\"dismissContextMenu(
|
|
2809
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: VisualiserGraphComponent, deps: [{ token: VisualiserGraphService }, { token: DagreNodesOnlyLayout }, { token: DexieService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2810
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: VisualiserGraphComponent, selector: "visualiser-graph", inputs: { readOnly: "readOnly", zoom: "zoom", controls: "controls", zoomToFit: "zoomToFit", data: "data" }, outputs: { saveGraphDataEvent: "saveGraphDataEvent" }, viewQueries: [{ propertyName: "graphElement", first: true, predicate: ["svgId"], descendants: true }, { propertyName: "contextMenu", first: true, predicate: ContextMenusComponent, descendants: true }, { propertyName: "modalsComponent", first: true, predicate: ModalsComponent, descendants: true }], ngImport: i0, template: "<div class=\"page\" id=\"pageId\" (window:resize)=\"onResize()\">\n <div id=\"draggable\" class=\"buttonBar\" [style.right]=\"buttonBarRightPosition\">\n @if (controls) {\n <div>\n <div class=\"d-flex justify-content-end\">\n <div class=\"btn-group\" role=\"group\" aria-label=\"Controls\">\n <button type=\"button\" id=\"draggableHandle\" class=\"btn btn-light\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Move toolbar\">\n <i class=\"bi bi-grip-vertical\"></i>\n </button>\n <button type=\"button\" id=\"dagre_layout\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Dagre layout\" (click)=\"applyLayout()\">\n <i class=\"bi bi-diagram-3\"></i>\n </button>\n <button type=\"button\" id=\"save_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Save data\" (click)=\"onConfirmSave()\">\n <i class=\"bi bi-save\"></i>\n </button>\n <button type=\"button\" id=\"reset_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Reset data\" (click)=\"resetGraph()\">\n <i class=\"bi bi-skip-backward\"></i>\n </button>\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom in\" id=\"zoom_in\">\n <i class=\"bi bi-zoom-in\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom out\" id=\"zoom_out\">\n <i class=\"bi bi-zoom-out\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom reset\" id=\"zoom_reset\" disabled=\"true\">\n <i class=\"bi bi-arrow-counterclockwise\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom to fit\" id=\"zoom_to_fit\">\n <i class=\"bi bi-arrows-fullscreen\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Select all\" id=\"select_all\">\n <i class=\"bi bi-grid-fill\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Invert selection\" id=\"toggle_selection\">\n <i class=\"bi bi-ui-checks-grid\"></i>\n </button>\n }\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Toggle search\" id=\"toggle_search\"\n [ngClass]=\"{'searchButtonActive': showSearch, 'searchButtonInactive': !showSearch}\"\n (click)=\"toggleSearch()\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n </div>\n <div class=\"search float-right input-group mt-3 pr-0\" [hidden]=\"!showSearch\">\n <div class=\"input-group-prepend\">\n <button type=\"button\" id=\"prevButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Previous\" disabled>\n <i class=\"bi bi-arrow-left-square\"></i>\n </button>\n <button type=\"button\" id=\"nextButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Next\" disabled>\n <i class=\"bi bi-arrow-right-square\"></i>\n </button>\n </div>\n <input type=\"text\" id=\"searchInput\" class=\"form-control\" placeholder=\"Search\" aria-label=\"Search\"\n aria-describedby=\"search\" />\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"searchButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Search\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"clearButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Clear\" disabled>\n clear\n </button>\n </div>\n </div>\n </div>\n }\n <div [hidden]=\"!showSearch\" id=\"noMatchesText\" class=\"noMatchesText float-right\">No matches found</div>\n </div>\n <!-- Zoom indicator-->\n @if (zoom) {\n <div class=\"zoomIndicator\">\n <span id=\"zoom_level\"></span>\n </div>\n }\n\n <app-context-menus\n (editNodeContextMenuEvent)=\"handleEditNodesEvent($event)\"\n (findCreateNodesContextMenuEvent)=\"findCreateNodesEvent($event)\"\n (createLinkContextMenuEvent)=\"handleCreateLinksEvent($event)\"\n (editLinkLabelContextMenuEvent)=\"onEditLinkLabel()\"\n (editLinksContextMenuEvent)=\"handleEditLinksEvent($event)\">\n </app-context-menus>\n\n <app-modals\n [editNodeData]=\"editNodeData\"\n [editLinksData]=\"editLinksData\"\n (createEditLinkEvent)=\"onCreateEditLink($event)\"\n (createEditNodeEvent)=\"onCreateEditNode($event)\"\n (deleteLinkEvent)=\"onDeleteLink($event)\"\n (deleteNodeEvent)=\"onDeleteNode()\">\n </app-modals>\n\n <svg #svgId [attr.width]=\"width\" height=\"780\" (click)=\"dismissContextMenu()\" (contextmenu)=\"visualiserContextMenus($event)\"></svg>\n</div>", styles: ["@import\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css\";@import\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css\";@import\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css\";#zoom_level{position:relative;background-color:#000c;color:#fff;padding:5px;border-radius:5px;opacity:0;transition:opacity 1s ease-in-out}.buttonBar{position:absolute;padding:10px}.zoomIndicator{position:absolute;left:0;padding:10px}.noMatchesText{opacity:0;transition:opacity .5s;color:red}.noMatchesText.show{opacity:1}@keyframes floatInFromTop{0%{opacity:0;transform:translateY(-100%)}to{opacity:1;transform:translateY(0)}}.input-group{animation-name:floatInFromTop;animation-duration:.3s;animation-fill-mode:forwards;position:relative;width:407px}.searchButtonActive{outline:none;-webkit-box-shadow:inset 0px 0px 5px #323232;-moz-box-shadow:inset 0px 0px 5px #323232;box-shadow:inset 0 0 5px #323232}.searchButtonActive:focus,.searchButtonActive:active{outline:none;-webkit-box-shadow:inset 0px 0px 5px #323232;-moz-box-shadow:inset 0px 0px 5px #323232;box-shadow:inset 0 0 5px #323232}.searchButtonInactive{opacity:1;outline:none;box-shadow:none;background-color:#6c757d!important;border-color:#6c757d!important}#draggableHandle{cursor:move}@media (max-width: 768px){.buttonBar{flex-direction:column;align-items:flex-start}.btn-group{flex-direction:column}.btn-group .btn{width:100%;margin-bottom:5px}}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ContextMenusComponent, selector: "app-context-menus", outputs: ["editNodeContextMenuEvent", "findCreateNodesContextMenuEvent", "createLinkContextMenuEvent", "editLinkLabelContextMenuEvent", "editLinksContextMenuEvent"] }, { kind: "component", type: ModalsComponent, selector: "app-modals", inputs: ["editNodeData", "editLinksData"], outputs: ["closeModalEvent", "createEditLinkEvent", "createEditNodeEvent", "deleteLinkEvent", "deleteNodeEvent"] }] });
|
|
2798
2811
|
}
|
|
2799
2812
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: VisualiserGraphComponent, decorators: [{
|
|
2800
2813
|
type: Component,
|
|
2801
|
-
args: [{ selector: 'visualiser-graph', template: "<div class=\"page\" id=\"pageId\" (window:resize)=\"onResize()\">\n <div id=\"draggable\" class=\"buttonBar\" [style.right]=\"buttonBarRightPosition\">\n @if (controls) {\n <div>\n <div class=\"d-flex justify-content-end\">\n <div class=\"btn-group\" role=\"group\" aria-label=\"Controls\">\n <button type=\"button\" id=\"draggableHandle\" class=\"btn btn-light\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Move toolbar\">\n <i class=\"bi bi-grip-vertical\"></i>\n </button>\n <button type=\"button\" id=\"dagre_layout\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Dagre layout\" (click)=\"applyLayout()\">\n <i class=\"bi bi-diagram-3\"></i>\n </button>\n <button type=\"button\" id=\"save_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Save data\" (click)=\"onConfirmSave()\">\n <i class=\"bi bi-save\"></i>\n </button>\n <button type=\"button\" id=\"reset_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Reset data\" (click)=\"resetGraph()\">\n <i class=\"bi bi-skip-backward\"></i>\n </button>\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom in\" id=\"zoom_in\">\n <i class=\"bi bi-zoom-in\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom out\" id=\"zoom_out\">\n <i class=\"bi bi-zoom-out\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom reset\" id=\"zoom_reset\" disabled=\"true\">\n <i class=\"bi bi-arrow-counterclockwise\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom to fit\" id=\"zoom_to_fit\">\n <i class=\"bi bi-arrows-fullscreen\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Select all\" id=\"select_all\">\n <i class=\"bi bi-grid-fill\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Invert selection\" id=\"toggle_selection\">\n <i class=\"bi bi-ui-checks-grid\"></i>\n </button>\n }\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Toggle search\" id=\"toggle_search\"\n [ngClass]=\"{'searchButtonActive': showSearch, 'searchButtonInactive': !showSearch}\"\n (click)=\"toggleSearch()\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n </div>\n <div class=\"search float-right input-group mt-3 pr-0\" [hidden]=\"!showSearch\">\n <div class=\"input-group-prepend\">\n <button type=\"button\" id=\"prevButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Previous\" disabled>\n <i class=\"bi bi-arrow-left-square\"></i>\n </button>\n <button type=\"button\" id=\"nextButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Next\" disabled>\n <i class=\"bi bi-arrow-right-square\"></i>\n </button>\n </div>\n <input type=\"text\" id=\"searchInput\" class=\"form-control\" placeholder=\"Search\" aria-label=\"Search\"\n aria-describedby=\"search\" />\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"searchButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Search\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"clearButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Clear\" disabled>\n clear\n </button>\n </div>\n </div>\n </div>\n }\n <div [hidden]=\"!showSearch\" id=\"noMatchesText\" class=\"noMatchesText float-right\">No matches found</div>\n </div>\n <!-- Zoom indicator-->\n @if (zoom) {\n <div class=\"zoomIndicator\">\n <span id=\"zoom_level\"></span>\n </div>\n }\n\n <app-context-menus\n (editNodeContextMenuEvent)=\"handleEditNodesEvent($event)\"\n (findCreateNodesContextMenuEvent)=\"findCreateNodesEvent($event)\"\n (createLinkContextMenuEvent)=\"handleCreateLinksEvent($event)\"\n (editLinkLabelContextMenuEvent)=\"onEditLinkLabel()\"\n (editLinksContextMenuEvent)=\"handleEditLinksEvent($event)\">\n </app-context-menus>\n\n <app-modals\n [editNodeData]=\"editNodeData\"\n [editLinksData]=\"editLinksData\"\n (createEditLinkEvent)=\"onCreateEditLink($event)\"\n (createEditNodeEvent)=\"onCreateEditNode($event)\"\n (deleteLinkEvent)=\"onDeleteLink($event)\"\n (deleteNodeEvent)=\"onDeleteNode()\">\n </app-modals>\n\n <svg #svgId [attr.width]=\"width\" height=\"780\" (click)=\"dismissContextMenu(
|
|
2802
|
-
}], ctorParameters: () => [{ type: VisualiserGraphService }, { type:
|
|
2814
|
+
args: [{ selector: 'visualiser-graph', template: "<div class=\"page\" id=\"pageId\" (window:resize)=\"onResize()\">\n <div id=\"draggable\" class=\"buttonBar\" [style.right]=\"buttonBarRightPosition\">\n @if (controls) {\n <div>\n <div class=\"d-flex justify-content-end\">\n <div class=\"btn-group\" role=\"group\" aria-label=\"Controls\">\n <button type=\"button\" id=\"draggableHandle\" class=\"btn btn-light\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Move toolbar\">\n <i class=\"bi bi-grip-vertical\"></i>\n </button>\n <button type=\"button\" id=\"dagre_layout\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Dagre layout\" (click)=\"applyLayout()\">\n <i class=\"bi bi-diagram-3\"></i>\n </button>\n <button type=\"button\" id=\"save_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Save data\" (click)=\"onConfirmSave()\">\n <i class=\"bi bi-save\"></i>\n </button>\n <button type=\"button\" id=\"reset_graph\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Reset data\" (click)=\"resetGraph()\">\n <i class=\"bi bi-skip-backward\"></i>\n </button>\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom in\" id=\"zoom_in\">\n <i class=\"bi bi-zoom-in\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom out\" id=\"zoom_out\">\n <i class=\"bi bi-zoom-out\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom reset\" id=\"zoom_reset\" disabled=\"true\">\n <i class=\"bi bi-arrow-counterclockwise\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Zoom to fit\" id=\"zoom_to_fit\">\n <i class=\"bi bi-arrows-fullscreen\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Select all\" id=\"select_all\">\n <i class=\"bi bi-grid-fill\"></i>\n </button>\n }\n @if (zoom) {\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Invert selection\" id=\"toggle_selection\">\n <i class=\"bi bi-ui-checks-grid\"></i>\n </button>\n }\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Toggle search\" id=\"toggle_search\"\n [ngClass]=\"{'searchButtonActive': showSearch, 'searchButtonInactive': !showSearch}\"\n (click)=\"toggleSearch()\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n </div>\n <div class=\"search float-right input-group mt-3 pr-0\" [hidden]=\"!showSearch\">\n <div class=\"input-group-prepend\">\n <button type=\"button\" id=\"prevButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Previous\" disabled>\n <i class=\"bi bi-arrow-left-square\"></i>\n </button>\n <button type=\"button\" id=\"nextButton\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"top\"\n title=\"Next\" disabled>\n <i class=\"bi bi-arrow-right-square\"></i>\n </button>\n </div>\n <input type=\"text\" id=\"searchInput\" class=\"form-control\" placeholder=\"Search\" aria-label=\"Search\"\n aria-describedby=\"search\" />\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"searchButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Search\">\n <i class=\"bi bi-search\"></i>\n </button>\n </div>\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"button\" id=\"clearButton\" data-toggle=\"tooltip\"\n data-placement=\"top\" title=\"Clear\" disabled>\n clear\n </button>\n </div>\n </div>\n </div>\n }\n <div [hidden]=\"!showSearch\" id=\"noMatchesText\" class=\"noMatchesText float-right\">No matches found</div>\n </div>\n <!-- Zoom indicator-->\n @if (zoom) {\n <div class=\"zoomIndicator\">\n <span id=\"zoom_level\"></span>\n </div>\n }\n\n <app-context-menus\n (editNodeContextMenuEvent)=\"handleEditNodesEvent($event)\"\n (findCreateNodesContextMenuEvent)=\"findCreateNodesEvent($event)\"\n (createLinkContextMenuEvent)=\"handleCreateLinksEvent($event)\"\n (editLinkLabelContextMenuEvent)=\"onEditLinkLabel()\"\n (editLinksContextMenuEvent)=\"handleEditLinksEvent($event)\">\n </app-context-menus>\n\n <app-modals\n [editNodeData]=\"editNodeData\"\n [editLinksData]=\"editLinksData\"\n (createEditLinkEvent)=\"onCreateEditLink($event)\"\n (createEditNodeEvent)=\"onCreateEditNode($event)\"\n (deleteLinkEvent)=\"onDeleteLink($event)\"\n (deleteNodeEvent)=\"onDeleteNode()\">\n </app-modals>\n\n <svg #svgId [attr.width]=\"width\" height=\"780\" (click)=\"dismissContextMenu()\" (contextmenu)=\"visualiserContextMenus($event)\"></svg>\n</div>", styles: ["@import\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css\";@import\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css\";@import\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css\";#zoom_level{position:relative;background-color:#000c;color:#fff;padding:5px;border-radius:5px;opacity:0;transition:opacity 1s ease-in-out}.buttonBar{position:absolute;padding:10px}.zoomIndicator{position:absolute;left:0;padding:10px}.noMatchesText{opacity:0;transition:opacity .5s;color:red}.noMatchesText.show{opacity:1}@keyframes floatInFromTop{0%{opacity:0;transform:translateY(-100%)}to{opacity:1;transform:translateY(0)}}.input-group{animation-name:floatInFromTop;animation-duration:.3s;animation-fill-mode:forwards;position:relative;width:407px}.searchButtonActive{outline:none;-webkit-box-shadow:inset 0px 0px 5px #323232;-moz-box-shadow:inset 0px 0px 5px #323232;box-shadow:inset 0 0 5px #323232}.searchButtonActive:focus,.searchButtonActive:active{outline:none;-webkit-box-shadow:inset 0px 0px 5px #323232;-moz-box-shadow:inset 0px 0px 5px #323232;box-shadow:inset 0 0 5px #323232}.searchButtonInactive{opacity:1;outline:none;box-shadow:none;background-color:#6c757d!important;border-color:#6c757d!important}#draggableHandle{cursor:move}@media (max-width: 768px){.buttonBar{flex-direction:column;align-items:flex-start}.btn-group{flex-direction:column}.btn-group .btn{width:100%;margin-bottom:5px}}\n"] }]
|
|
2815
|
+
}], ctorParameters: () => [{ type: VisualiserGraphService }, { type: DagreNodesOnlyLayout }, { type: DexieService }], propDecorators: { graphElement: [{
|
|
2803
2816
|
type: ViewChild,
|
|
2804
2817
|
args: ['svgId']
|
|
2805
2818
|
}], contextMenu: [{
|
|
@@ -2827,12 +2840,11 @@ class NgxRelationshipVisualiserModule {
|
|
|
2827
2840
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: NgxRelationshipVisualiserModule, declarations: [VisualiserGraphComponent,
|
|
2828
2841
|
ContextMenusComponent,
|
|
2829
2842
|
ModalsComponent], imports: [BrowserModule,
|
|
2830
|
-
ReactiveFormsModule, i1.ModalModule,
|
|
2843
|
+
ReactiveFormsModule, i1.ModalModule, NgSelectModule,
|
|
2831
2844
|
FormsModule], exports: [VisualiserGraphComponent] });
|
|
2832
2845
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NgxRelationshipVisualiserModule, imports: [BrowserModule,
|
|
2833
2846
|
ReactiveFormsModule,
|
|
2834
2847
|
ModalModule.forRoot(),
|
|
2835
|
-
ContextMenuModule.forRoot({ useBootstrap4: true }),
|
|
2836
2848
|
NgSelectModule,
|
|
2837
2849
|
FormsModule] });
|
|
2838
2850
|
}
|
|
@@ -2848,7 +2860,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2848
2860
|
BrowserModule,
|
|
2849
2861
|
ReactiveFormsModule,
|
|
2850
2862
|
ModalModule.forRoot(),
|
|
2851
|
-
ContextMenuModule.forRoot({ useBootstrap4: true }),
|
|
2852
2863
|
NgSelectModule,
|
|
2853
2864
|
FormsModule
|
|
2854
2865
|
],
|