ngx-relationship-visualiser 2.1.2 → 2.1.5
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 +2 -5
- package/esm2022/projects/ngx-relationship-visualiser-lib/lib/ngx-relationship-visualiser.module.mjs +9 -17
- 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/icon-select.component.mjs +188 -0
- package/esm2022/projects/ngx-relationship-visualiser-lib/lib/visualiser/modals/modals.component.mjs +11 -41
- 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 +292 -136
- package/fesm2022/ngx-relationship-visualiser.mjs.map +1 -1
- package/package.json +1 -3
- package/projects/ngx-relationship-visualiser-lib/lib/ngx-relationship-visualiser.module.d.ts +5 -6
- 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/modals/icon-select.component.d.ts +47 -0
- package/projects/ngx-relationship-visualiser-lib/lib/visualiser/modals/modals.component.d.ts +0 -14
- package/projects/ngx-relationship-visualiser-lib/lib/visualiser/visualiser-graph/visualiser-graph.component.d.ts +2 -4
|
@@ -1,41 +1,58 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter,
|
|
2
|
+
import { EventEmitter, HostListener, Output, Component, Injectable, forwardRef, Input, ViewChild, 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, NG_VALUE_ACCESSOR, ReactiveFormsModule } 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
|
-
import * as i5 from '@ng-select/ng-select';
|
|
13
|
-
import { NgSelectModule } from '@ng-select/ng-select';
|
|
14
10
|
import Swal from 'sweetalert2';
|
|
15
11
|
import * as d3 from 'd3';
|
|
16
12
|
import { Subject, ReplaySubject } from 'rxjs';
|
|
17
13
|
import * as dagre from '@dagrejs/dagre';
|
|
18
14
|
|
|
19
15
|
class ContextMenusComponent {
|
|
20
|
-
editNodeContextMenu;
|
|
21
|
-
findCreateNodesContextMenu;
|
|
22
|
-
createEditLinkContextMenu;
|
|
23
|
-
editLinkLabelContextMenu;
|
|
24
16
|
editNodeContextMenuEvent = new EventEmitter();
|
|
25
17
|
findCreateNodesContextMenuEvent = new EventEmitter();
|
|
26
18
|
createLinkContextMenuEvent = new EventEmitter();
|
|
27
19
|
editLinkLabelContextMenuEvent = new EventEmitter();
|
|
28
20
|
editLinksContextMenuEvent = new EventEmitter();
|
|
21
|
+
menuType = null;
|
|
22
|
+
menuPosition = { left: 0, top: 0 };
|
|
23
|
+
menuItem = null;
|
|
24
|
+
openMenu(menuType, event, item) {
|
|
25
|
+
this.menuType = menuType;
|
|
26
|
+
this.menuItem = item ?? null;
|
|
27
|
+
this.menuPosition = {
|
|
28
|
+
left: Math.max(0, Math.min(event.clientX, window.innerWidth - 200)),
|
|
29
|
+
top: Math.max(0, Math.min(event.clientY, window.innerHeight - 120))
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
closeMenu() {
|
|
33
|
+
this.menuType = null;
|
|
34
|
+
this.menuItem = null;
|
|
35
|
+
}
|
|
36
|
+
onDocumentClick() {
|
|
37
|
+
this.closeMenu();
|
|
38
|
+
}
|
|
39
|
+
onEscape() {
|
|
40
|
+
this.closeMenu();
|
|
41
|
+
}
|
|
29
42
|
editNode() {
|
|
43
|
+
this.closeMenu();
|
|
30
44
|
this.editNodeContextMenuEvent.emit(true);
|
|
31
45
|
}
|
|
32
46
|
findNodes() {
|
|
47
|
+
this.closeMenu();
|
|
33
48
|
this.findCreateNodesContextMenuEvent.emit('findNodes');
|
|
34
49
|
}
|
|
35
50
|
createNode() {
|
|
51
|
+
this.closeMenu();
|
|
36
52
|
this.findCreateNodesContextMenuEvent.emit('createNode');
|
|
37
53
|
}
|
|
38
54
|
createLink(item) {
|
|
55
|
+
this.closeMenu();
|
|
39
56
|
if (!item || item.selectedNodes.length !== 2) {
|
|
40
57
|
console.error('Exactly two selected nodes are required to create a link.');
|
|
41
58
|
return;
|
|
@@ -47,9 +64,11 @@ class ContextMenusComponent {
|
|
|
47
64
|
this.createLinkContextMenuEvent.emit(payload);
|
|
48
65
|
}
|
|
49
66
|
editLinkLabel() {
|
|
67
|
+
this.closeMenu();
|
|
50
68
|
this.editLinkLabelContextMenuEvent.emit(true);
|
|
51
69
|
}
|
|
52
70
|
editLinks(item) {
|
|
71
|
+
this.closeMenu();
|
|
53
72
|
const matchingLink = this.checkLinkBetweenSelectedNodes(item);
|
|
54
73
|
if (matchingLink) {
|
|
55
74
|
this.editLinksContextMenuEvent.emit({
|
|
@@ -61,19 +80,12 @@ class ContextMenusComponent {
|
|
|
61
80
|
console.warn("No matching link to edit.");
|
|
62
81
|
}
|
|
63
82
|
}
|
|
64
|
-
linksExist
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (!matchingLink) {
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
83
|
+
linksExist() {
|
|
84
|
+
return this.checkLinkBetweenSelectedNodes(this.menuItem) !== null;
|
|
85
|
+
}
|
|
86
|
+
linksDoNotExist() {
|
|
87
|
+
return this.menuItem !== null && this.checkLinkBetweenSelectedNodes(this.menuItem) === null;
|
|
88
|
+
}
|
|
77
89
|
checkLinkBetweenSelectedNodes(payload) {
|
|
78
90
|
if (!payload || payload.selectedNodes.length !== 2) {
|
|
79
91
|
return null;
|
|
@@ -93,24 +105,12 @@ class ContextMenusComponent {
|
|
|
93
105
|
}
|
|
94
106
|
}
|
|
95
107
|
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: "
|
|
108
|
+
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
109
|
}
|
|
98
110
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ContextMenusComponent, decorators: [{
|
|
99
111
|
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: [{
|
|
112
|
+
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"] }]
|
|
113
|
+
}], propDecorators: { editNodeContextMenuEvent: [{
|
|
114
114
|
type: Output
|
|
115
115
|
}], findCreateNodesContextMenuEvent: [{
|
|
116
116
|
type: Output
|
|
@@ -120,6 +120,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
120
120
|
type: Output
|
|
121
121
|
}], editLinksContextMenuEvent: [{
|
|
122
122
|
type: Output
|
|
123
|
+
}], onDocumentClick: [{
|
|
124
|
+
type: HostListener,
|
|
125
|
+
args: ['document:click']
|
|
126
|
+
}], onEscape: [{
|
|
127
|
+
type: HostListener,
|
|
128
|
+
args: ['document:keydown.escape']
|
|
123
129
|
}] } });
|
|
124
130
|
|
|
125
131
|
var fontAwesomeIcons = [
|
|
@@ -342,11 +348,11 @@ class AbstractModalFormHandler {
|
|
|
342
348
|
lineStyle: ['Dotted', Validators.required],
|
|
343
349
|
sourceArrow: [false],
|
|
344
350
|
targetArrow: [false],
|
|
345
|
-
label: this.fb.array([]
|
|
351
|
+
label: this.fb.array([]),
|
|
346
352
|
});
|
|
347
353
|
this.createNodeForm = this.fb.group({
|
|
348
354
|
id: '',
|
|
349
|
-
label: this.fb.array([]
|
|
355
|
+
label: this.fb.array([]),
|
|
350
356
|
imageUrl: [''],
|
|
351
357
|
icon: [''],
|
|
352
358
|
fx: [null],
|
|
@@ -363,7 +369,7 @@ class AbstractModalFormHandler {
|
|
|
363
369
|
}
|
|
364
370
|
addLabel() {
|
|
365
371
|
const labelGroup = this.fb.group({
|
|
366
|
-
label: [''
|
|
372
|
+
label: [''],
|
|
367
373
|
linkIcon: [''],
|
|
368
374
|
});
|
|
369
375
|
this.labelArray.push(labelGroup);
|
|
@@ -375,12 +381,12 @@ class AbstractModalFormHandler {
|
|
|
375
381
|
this.nodeLabelArray.push(labelGroup);
|
|
376
382
|
}
|
|
377
383
|
removeLabel(index) {
|
|
378
|
-
if (this.labelArray.length
|
|
384
|
+
if (index >= 0 && index < this.labelArray.length) {
|
|
379
385
|
this.labelArray.removeAt(index);
|
|
380
386
|
}
|
|
381
387
|
}
|
|
382
388
|
removeNodeLabel(index) {
|
|
383
|
-
if (this.nodeLabelArray.length
|
|
389
|
+
if (index >= 0 && index < this.nodeLabelArray.length) {
|
|
384
390
|
this.nodeLabelArray.removeAt(index);
|
|
385
391
|
}
|
|
386
392
|
}
|
|
@@ -413,7 +419,7 @@ class AbstractModalFormHandler {
|
|
|
413
419
|
data.relationships.forEach((relationship) => {
|
|
414
420
|
const labelGroup = this.fb.group({
|
|
415
421
|
labelIndex: [relationship.labelIndex, Validators.required],
|
|
416
|
-
label: [relationship.label
|
|
422
|
+
label: [relationship.label],
|
|
417
423
|
linkIcon: [
|
|
418
424
|
typeof relationship.linkIcon === 'string'
|
|
419
425
|
? relationship.linkIcon
|
|
@@ -444,14 +450,6 @@ class AbstractModalFormHandler {
|
|
|
444
450
|
}
|
|
445
451
|
return null;
|
|
446
452
|
}
|
|
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
453
|
}
|
|
456
454
|
|
|
457
455
|
class DexieService extends Dexie {
|
|
@@ -489,6 +487,191 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
489
487
|
}]
|
|
490
488
|
}], ctorParameters: () => [] });
|
|
491
489
|
|
|
490
|
+
class IconSelectComponent {
|
|
491
|
+
elementRef;
|
|
492
|
+
static nextId = 0;
|
|
493
|
+
items = [];
|
|
494
|
+
placeholder = 'Select icon';
|
|
495
|
+
inputId = '';
|
|
496
|
+
ariaLabel = '';
|
|
497
|
+
listId = `icon-select-list-${IconSelectComponent.nextId++}`;
|
|
498
|
+
pageSize = 50;
|
|
499
|
+
searchTerm = '';
|
|
500
|
+
value = null;
|
|
501
|
+
isOpen = false;
|
|
502
|
+
isDisabled = false;
|
|
503
|
+
activeIndex = 0;
|
|
504
|
+
visibleItemCount = this.pageSize;
|
|
505
|
+
onChange = () => { };
|
|
506
|
+
onTouched = () => { };
|
|
507
|
+
constructor(elementRef) {
|
|
508
|
+
this.elementRef = elementRef;
|
|
509
|
+
}
|
|
510
|
+
get selectedItem() {
|
|
511
|
+
return this.items.find(item => item.icon === this.value);
|
|
512
|
+
}
|
|
513
|
+
get filteredItems() {
|
|
514
|
+
const query = this.searchTerm.trim().toLocaleLowerCase();
|
|
515
|
+
return query
|
|
516
|
+
? this.items.filter(item => item.name.toLocaleLowerCase().includes(query))
|
|
517
|
+
: this.items;
|
|
518
|
+
}
|
|
519
|
+
get visibleItems() {
|
|
520
|
+
return this.filteredItems.slice(0, this.visibleItemCount);
|
|
521
|
+
}
|
|
522
|
+
get activeOptionId() {
|
|
523
|
+
const item = this.visibleItems[this.activeIndex];
|
|
524
|
+
return this.isOpen && item ? this.optionId(item) : null;
|
|
525
|
+
}
|
|
526
|
+
writeValue(value) {
|
|
527
|
+
this.value = value;
|
|
528
|
+
}
|
|
529
|
+
registerOnChange(fn) {
|
|
530
|
+
this.onChange = fn;
|
|
531
|
+
}
|
|
532
|
+
registerOnTouched(fn) {
|
|
533
|
+
this.onTouched = fn;
|
|
534
|
+
}
|
|
535
|
+
setDisabledState(disabled) {
|
|
536
|
+
this.isDisabled = disabled;
|
|
537
|
+
if (disabled) {
|
|
538
|
+
this.close();
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
open() {
|
|
542
|
+
if (this.isDisabled || this.isOpen) {
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
this.searchTerm = '';
|
|
546
|
+
this.activeIndex = Math.max(0, this.items.findIndex(item => item.icon === this.value));
|
|
547
|
+
this.visibleItemCount = Math.min(Math.max(this.pageSize, this.activeIndex + 1), this.items.length);
|
|
548
|
+
this.isOpen = true;
|
|
549
|
+
}
|
|
550
|
+
onSearchInput(event) {
|
|
551
|
+
const input = event.target;
|
|
552
|
+
if (!(input instanceof HTMLInputElement)) {
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
if (!this.isOpen) {
|
|
556
|
+
this.open();
|
|
557
|
+
}
|
|
558
|
+
this.searchTerm = input.value;
|
|
559
|
+
this.visibleItemCount = this.pageSize;
|
|
560
|
+
this.activeIndex = 0;
|
|
561
|
+
}
|
|
562
|
+
onKeydown(event) {
|
|
563
|
+
if (event.key === 'ArrowDown') {
|
|
564
|
+
event.preventDefault();
|
|
565
|
+
if (!this.isOpen) {
|
|
566
|
+
this.open();
|
|
567
|
+
}
|
|
568
|
+
else if (this.filteredItems.length) {
|
|
569
|
+
this.activeIndex = (this.activeIndex + 1) % this.filteredItems.length;
|
|
570
|
+
this.revealActiveItem();
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
else if (event.key === 'ArrowUp') {
|
|
574
|
+
event.preventDefault();
|
|
575
|
+
if (!this.isOpen) {
|
|
576
|
+
this.open();
|
|
577
|
+
}
|
|
578
|
+
else if (this.filteredItems.length) {
|
|
579
|
+
this.activeIndex = (this.activeIndex - 1 + this.filteredItems.length) % this.filteredItems.length;
|
|
580
|
+
this.revealActiveItem();
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
else if (event.key === 'Enter' && this.isOpen) {
|
|
584
|
+
event.preventDefault();
|
|
585
|
+
const item = this.filteredItems[this.activeIndex];
|
|
586
|
+
if (item) {
|
|
587
|
+
this.select(item);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
else if (event.key === 'Escape' && this.isOpen) {
|
|
591
|
+
event.preventDefault();
|
|
592
|
+
this.close();
|
|
593
|
+
}
|
|
594
|
+
else if (event.key === 'Tab' && this.isOpen) {
|
|
595
|
+
this.close();
|
|
596
|
+
this.onTouched();
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
onListScroll(event) {
|
|
600
|
+
const list = event.target;
|
|
601
|
+
if (!(list instanceof HTMLElement)) {
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
if (list.scrollTop + list.clientHeight >= list.scrollHeight - 24) {
|
|
605
|
+
this.visibleItemCount = Math.min(this.visibleItemCount + this.pageSize, this.filteredItems.length);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
select(item) {
|
|
609
|
+
this.value = item.icon;
|
|
610
|
+
this.onChange(item.icon);
|
|
611
|
+
this.onTouched();
|
|
612
|
+
this.close();
|
|
613
|
+
}
|
|
614
|
+
clearSelection(event) {
|
|
615
|
+
event.preventDefault();
|
|
616
|
+
event.stopPropagation();
|
|
617
|
+
this.value = null;
|
|
618
|
+
this.onChange(null);
|
|
619
|
+
this.onTouched();
|
|
620
|
+
this.close();
|
|
621
|
+
}
|
|
622
|
+
optionId(item) {
|
|
623
|
+
return `${this.listId}-option-${item.id}`;
|
|
624
|
+
}
|
|
625
|
+
closeOnOutsideClick(event) {
|
|
626
|
+
if (this.isOpen &&
|
|
627
|
+
event.target instanceof Node &&
|
|
628
|
+
!this.elementRef.nativeElement.contains(event.target)) {
|
|
629
|
+
this.close();
|
|
630
|
+
this.onTouched();
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
close() {
|
|
634
|
+
this.isOpen = false;
|
|
635
|
+
this.searchTerm = '';
|
|
636
|
+
}
|
|
637
|
+
revealActiveItem() {
|
|
638
|
+
if (this.activeIndex >= this.visibleItemCount) {
|
|
639
|
+
this.visibleItemCount = Math.min(this.activeIndex + 1, this.filteredItems.length);
|
|
640
|
+
}
|
|
641
|
+
const activeItem = this.filteredItems[this.activeIndex];
|
|
642
|
+
if (activeItem) {
|
|
643
|
+
this.elementRef.nativeElement
|
|
644
|
+
.querySelector(`#${this.optionId(activeItem)}`)
|
|
645
|
+
?.scrollIntoView({ block: 'nearest' });
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IconSelectComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
649
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: IconSelectComponent, selector: "app-icon-select", inputs: { items: "items", placeholder: "placeholder", inputId: "inputId", ariaLabel: "ariaLabel" }, host: { listeners: { "document:click": "closeOnOutsideClick($event)" } }, providers: [{
|
|
650
|
+
provide: NG_VALUE_ACCESSOR,
|
|
651
|
+
useExisting: forwardRef(() => IconSelectComponent),
|
|
652
|
+
multi: true
|
|
653
|
+
}], ngImport: i0, template: "<div class=\"icon-select\">\n <div class=\"icon-select__field\">\n @if (selectedItem; as selected) {\n <span class=\"icon-select__preview fa fa-light\" aria-hidden=\"true\">{{ selected.icon }}</span>\n }\n @if (selectedItem && !isDisabled) {\n <button\n type=\"button\"\n class=\"icon-select__clear\"\n aria-label=\"Clear selected icon\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"clearSelection($event)\">\n ×\n </button>\n }\n <input\n [id]=\"inputId || null\"\n class=\"form-control\"\n [class.icon-select__input--with-icon]=\"selectedItem\"\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeOptionId\"\n [value]=\"isOpen ? searchTerm : (selectedItem?.name || '')\"\n [placeholder]=\"placeholder\"\n [disabled]=\"isDisabled\"\n [class.icon-select__input--with-clear]=\"selectedItem && !isDisabled\"\n (focus)=\"open()\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onKeydown($event)\">\n </div>\n\n @if (isOpen) {\n <div class=\"icon-select__panel\">\n <small class=\"icon-select__count\">\n Loaded {{ visibleItems.length }} of {{ filteredItems.length }}\n </small>\n <div\n class=\"icon-select__options\"\n [id]=\"listId\"\n role=\"listbox\"\n (scroll)=\"onListScroll($event)\">\n @for (item of visibleItems; track item.id; let i = $index) {\n <button\n type=\"button\"\n class=\"icon-select__option\"\n [class.icon-select__option--active]=\"i === activeIndex\"\n [id]=\"optionId(item)\"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"item.icon === value\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"select(item)\">\n <i class=\"fa fa-light\" aria-hidden=\"true\">{{ item.icon }}</i>\n <span>{{ item.name }}</span>\n </button>\n } @empty {\n <div class=\"icon-select__empty\">No icons found</div>\n }\n </div>\n </div>\n }\n</div>\n", styles: [":host{display:block;width:100%}.icon-select{position:relative;width:100%}.icon-select__field{position:relative}.icon-select__preview{position:absolute;top:50%;left:.75rem;z-index:1;transform:translateY(-50%)}.icon-select__input--with-icon{padding-left:2rem}.icon-select__input--with-clear{padding-right:2rem}.icon-select__clear{position:absolute;top:50%;right:.5rem;z-index:1;padding:0 .25rem;border:0;background:transparent;color:#6c757d;font-size:1.25rem;line-height:1;transform:translateY(-50%)}.icon-select__panel{position:absolute;top:calc(100% + 2px);right:0;left:0;z-index:1060;overflow:hidden;border:1px solid #ced4da;border-radius:.25rem;background:#fff;box-shadow:0 .25rem .5rem #00000026}.icon-select__count{display:block;padding:.5rem .75rem;color:#6c757d}.icon-select__options{max-height:15rem;overflow-y:auto}.icon-select__option{display:flex;align-items:center;gap:.75rem;width:100%;padding:.375rem .75rem;border:0;background:#fff;color:inherit;text-align:left}.icon-select__option:hover,.icon-select__option--active{background:#f1f3f5}.icon-select__empty{padding:.75rem;color:#6c757d}\n"] });
|
|
654
|
+
}
|
|
655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: IconSelectComponent, decorators: [{
|
|
656
|
+
type: Component,
|
|
657
|
+
args: [{ selector: 'app-icon-select', providers: [{
|
|
658
|
+
provide: NG_VALUE_ACCESSOR,
|
|
659
|
+
useExisting: forwardRef(() => IconSelectComponent),
|
|
660
|
+
multi: true
|
|
661
|
+
}], template: "<div class=\"icon-select\">\n <div class=\"icon-select__field\">\n @if (selectedItem; as selected) {\n <span class=\"icon-select__preview fa fa-light\" aria-hidden=\"true\">{{ selected.icon }}</span>\n }\n @if (selectedItem && !isDisabled) {\n <button\n type=\"button\"\n class=\"icon-select__clear\"\n aria-label=\"Clear selected icon\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"clearSelection($event)\">\n ×\n </button>\n }\n <input\n [id]=\"inputId || null\"\n class=\"form-control\"\n [class.icon-select__input--with-icon]=\"selectedItem\"\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"activeOptionId\"\n [value]=\"isOpen ? searchTerm : (selectedItem?.name || '')\"\n [placeholder]=\"placeholder\"\n [disabled]=\"isDisabled\"\n [class.icon-select__input--with-clear]=\"selectedItem && !isDisabled\"\n (focus)=\"open()\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onKeydown($event)\">\n </div>\n\n @if (isOpen) {\n <div class=\"icon-select__panel\">\n <small class=\"icon-select__count\">\n Loaded {{ visibleItems.length }} of {{ filteredItems.length }}\n </small>\n <div\n class=\"icon-select__options\"\n [id]=\"listId\"\n role=\"listbox\"\n (scroll)=\"onListScroll($event)\">\n @for (item of visibleItems; track item.id; let i = $index) {\n <button\n type=\"button\"\n class=\"icon-select__option\"\n [class.icon-select__option--active]=\"i === activeIndex\"\n [id]=\"optionId(item)\"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"item.icon === value\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"select(item)\">\n <i class=\"fa fa-light\" aria-hidden=\"true\">{{ item.icon }}</i>\n <span>{{ item.name }}</span>\n </button>\n } @empty {\n <div class=\"icon-select__empty\">No icons found</div>\n }\n </div>\n </div>\n }\n</div>\n", styles: [":host{display:block;width:100%}.icon-select{position:relative;width:100%}.icon-select__field{position:relative}.icon-select__preview{position:absolute;top:50%;left:.75rem;z-index:1;transform:translateY(-50%)}.icon-select__input--with-icon{padding-left:2rem}.icon-select__input--with-clear{padding-right:2rem}.icon-select__clear{position:absolute;top:50%;right:.5rem;z-index:1;padding:0 .25rem;border:0;background:transparent;color:#6c757d;font-size:1.25rem;line-height:1;transform:translateY(-50%)}.icon-select__panel{position:absolute;top:calc(100% + 2px);right:0;left:0;z-index:1060;overflow:hidden;border:1px solid #ced4da;border-radius:.25rem;background:#fff;box-shadow:0 .25rem .5rem #00000026}.icon-select__count{display:block;padding:.5rem .75rem;color:#6c757d}.icon-select__options{max-height:15rem;overflow-y:auto}.icon-select__option{display:flex;align-items:center;gap:.75rem;width:100%;padding:.375rem .75rem;border:0;background:#fff;color:inherit;text-align:left}.icon-select__option:hover,.icon-select__option--active{background:#f1f3f5}.icon-select__empty{padding:.75rem;color:#6c757d}\n"] }]
|
|
662
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { items: [{
|
|
663
|
+
type: Input
|
|
664
|
+
}], placeholder: [{
|
|
665
|
+
type: Input
|
|
666
|
+
}], inputId: [{
|
|
667
|
+
type: Input
|
|
668
|
+
}], ariaLabel: [{
|
|
669
|
+
type: Input
|
|
670
|
+
}], closeOnOutsideClick: [{
|
|
671
|
+
type: HostListener,
|
|
672
|
+
args: ['document:click', ['$event']]
|
|
673
|
+
}] } });
|
|
674
|
+
|
|
492
675
|
class ModalsComponent extends AbstractModalFormHandler {
|
|
493
676
|
modalService;
|
|
494
677
|
dexieService;
|
|
@@ -512,11 +695,6 @@ class ModalsComponent extends AbstractModalFormHandler {
|
|
|
512
695
|
targetImageUrl = '';
|
|
513
696
|
sourceIcon = '';
|
|
514
697
|
targetIcon = '';
|
|
515
|
-
// virtual scroll
|
|
516
|
-
loading = false;
|
|
517
|
-
iconsBuffer = [];
|
|
518
|
-
numberOfItemsFromEndBeforeFetchingMore = 10;
|
|
519
|
-
bufferSize = 50;
|
|
520
698
|
constructor(modalService, fb, dexieService) {
|
|
521
699
|
super(fb);
|
|
522
700
|
this.modalService = modalService;
|
|
@@ -530,7 +708,6 @@ class ModalsComponent extends AbstractModalFormHandler {
|
|
|
530
708
|
}
|
|
531
709
|
if (changes.editNodeData && this.editNodeData) {
|
|
532
710
|
this.resetNodeForm();
|
|
533
|
-
this.loadSelectedNodeIcons(this.editNodeData);
|
|
534
711
|
this.populateEditNodeForm(this.editNodeData);
|
|
535
712
|
}
|
|
536
713
|
}
|
|
@@ -551,7 +728,6 @@ class ModalsComponent extends AbstractModalFormHandler {
|
|
|
551
728
|
}
|
|
552
729
|
if (template === this.createLinkModal) {
|
|
553
730
|
this.resetLinksForm();
|
|
554
|
-
this.addLabel();
|
|
555
731
|
void this.findEditLabelsAndImagesfromIDs();
|
|
556
732
|
}
|
|
557
733
|
if (template === this.createNodeModal) {
|
|
@@ -609,7 +785,13 @@ class ModalsComponent extends AbstractModalFormHandler {
|
|
|
609
785
|
}
|
|
610
786
|
createEditLink(source) {
|
|
611
787
|
if (this.createLinkForm.valid) {
|
|
612
|
-
const
|
|
788
|
+
const formData = this.createLinkForm.value;
|
|
789
|
+
const createLinkData = {
|
|
790
|
+
...formData,
|
|
791
|
+
label: formData.label.filter(({ label }) => Array.isArray(label)
|
|
792
|
+
? label.some(value => value.trim().length > 0)
|
|
793
|
+
: label.trim().length > 0)
|
|
794
|
+
};
|
|
613
795
|
this.createEditLinkEvent.emit({ payload: createLinkData, source });
|
|
614
796
|
this.resetLinksForm();
|
|
615
797
|
this.closeModal('modalRef');
|
|
@@ -665,42 +847,13 @@ class ModalsComponent extends AbstractModalFormHandler {
|
|
|
665
847
|
const controlToClear = iconType === 'url' ? 'icon' : 'imageUrl';
|
|
666
848
|
this.createNodeForm.get(controlToClear)?.setValue('');
|
|
667
849
|
}
|
|
668
|
-
|
|
669
|
-
return item.id;
|
|
670
|
-
}
|
|
671
|
-
loadSelectedNodeIcons(node) {
|
|
672
|
-
const lastSelectedIconIndex = [node.icon, node.additionalIcon].reduce((lastIndex, selectedIcon) => Math.max(lastIndex, this.fontAwesomeIcons.findIndex(({ icon }) => icon === selectedIcon)), -1);
|
|
673
|
-
const requiredLength = lastSelectedIconIndex + 1;
|
|
674
|
-
if (requiredLength > this.iconsBuffer.length) {
|
|
675
|
-
this.iconsBuffer = this.fontAwesomeIcons.slice(0, requiredLength);
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
onScrollToEnd() {
|
|
679
|
-
this.fetchMore();
|
|
680
|
-
}
|
|
681
|
-
onScroll({ end }) {
|
|
682
|
-
if (this.loading || this.fontAwesomeIcons.length <= this.iconsBuffer.length) {
|
|
683
|
-
return;
|
|
684
|
-
}
|
|
685
|
-
if (end + this.numberOfItemsFromEndBeforeFetchingMore >=
|
|
686
|
-
this.iconsBuffer.length) {
|
|
687
|
-
this.fetchMore();
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
fetchMore() {
|
|
691
|
-
const len = this.iconsBuffer.length;
|
|
692
|
-
const more = this.fontAwesomeIcons.slice(len, this.bufferSize + len);
|
|
693
|
-
this.loading = true;
|
|
694
|
-
this.loading = false;
|
|
695
|
-
this.iconsBuffer = this.iconsBuffer.concat(more);
|
|
696
|
-
}
|
|
697
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalsComponent, deps: [{ token: i1.BsModalService }, { token: i2$1.FormBuilder }, { token: DexieService }], target: i0.ɵɵFactoryTarget.Component });
|
|
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]" }] });
|
|
850
|
+
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 });
|
|
851
|
+
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 <app-icon-select\n formControlName=\"icon\"\n [items]=\"fontAwesomeIcons\"\n inputId=\"nodeIcon\"\n placeholder=\"Select icon\">\n </app-icon-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 <app-icon-select\n formControlName=\"additionalIcon\"\n [items]=\"fontAwesomeIcons\"\n inputId=\"nodeAdditionalIcon\"\n placeholder=\"Select icon\">\n </app-icon-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 <app-icon-select\n formControlName=\"icon\"\n [items]=\"fontAwesomeIcons\"\n inputId=\"nodeIcon\"\n placeholder=\"Select icon\">\n </app-icon-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 <app-icon-select\n formControlName=\"additionalIcon\"\n [items]=\"fontAwesomeIcons\"\n inputId=\"nodeAdditionalIcon\"\n placeholder=\"Select icon\">\n </app-icon-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 <app-icon-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n ariaLabel=\"Select link icon\"\n placeholder=\"Select link icon\">\n </app-icon-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 <app-icon-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n ariaLabel=\"Select link icon\"\n placeholder=\"Select link icon\">\n </app-icon-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: IconSelectComponent, selector: "app-icon-select", inputs: ["items", "placeholder", "inputId", "ariaLabel"] }] });
|
|
699
852
|
}
|
|
700
853
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalsComponent, decorators: [{
|
|
701
854
|
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
|
|
855
|
+
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 <app-icon-select\n formControlName=\"icon\"\n [items]=\"fontAwesomeIcons\"\n inputId=\"nodeIcon\"\n placeholder=\"Select icon\">\n </app-icon-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 <app-icon-select\n formControlName=\"additionalIcon\"\n [items]=\"fontAwesomeIcons\"\n inputId=\"nodeAdditionalIcon\"\n placeholder=\"Select icon\">\n </app-icon-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 <app-icon-select\n formControlName=\"icon\"\n [items]=\"fontAwesomeIcons\"\n inputId=\"nodeIcon\"\n placeholder=\"Select icon\">\n </app-icon-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 <app-icon-select\n formControlName=\"additionalIcon\"\n [items]=\"fontAwesomeIcons\"\n inputId=\"nodeAdditionalIcon\"\n placeholder=\"Select icon\">\n </app-icon-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 <app-icon-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n ariaLabel=\"Select link icon\"\n placeholder=\"Select link icon\">\n </app-icon-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 <app-icon-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n ariaLabel=\"Select link icon\"\n placeholder=\"Select link icon\">\n </app-icon-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"] }]
|
|
856
|
+
}], ctorParameters: () => [{ type: i1.BsModalService }, { type: i2.FormBuilder }, { type: DexieService }], propDecorators: { editNodeData: [{
|
|
704
857
|
type: Input
|
|
705
858
|
}], editLinksData: [{
|
|
706
859
|
type: Input
|
|
@@ -967,12 +1120,24 @@ class VisualiserGraphService {
|
|
|
967
1120
|
// 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
1121
|
this.nodes = this.randomiseNodePositions(this.nodes, parentWidth, parentHeight);
|
|
969
1122
|
// Getting parents lineStyle and adding it to child objects
|
|
970
|
-
const relationshipsArray = this.links.map(({ lineStyle, targetArrow, sourceArrow, relationships }) =>
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
1123
|
+
const relationshipsArray = this.links.map(({ source, target, linkId, lineStyle, targetArrow, sourceArrow, relationships }) => {
|
|
1124
|
+
const relationshipLinks = (relationships ?? []).map((r) => ({
|
|
1125
|
+
parentLineStyle: lineStyle,
|
|
1126
|
+
parentSourceArrow: sourceArrow,
|
|
1127
|
+
parentTargetArrow: targetArrow,
|
|
1128
|
+
...r,
|
|
1129
|
+
}));
|
|
1130
|
+
return relationshipLinks.length
|
|
1131
|
+
? relationshipLinks
|
|
1132
|
+
: [{
|
|
1133
|
+
source,
|
|
1134
|
+
target,
|
|
1135
|
+
linkId,
|
|
1136
|
+
parentLineStyle: lineStyle,
|
|
1137
|
+
parentSourceArrow: sourceArrow,
|
|
1138
|
+
parentTargetArrow: targetArrow,
|
|
1139
|
+
}];
|
|
1140
|
+
});
|
|
976
1141
|
// Adding dy value based on link number and position in parent
|
|
977
1142
|
relationshipsArray.map((linkRelationship) => {
|
|
978
1143
|
linkRelationship.map((linkObject, i) => {
|
|
@@ -1599,7 +1764,7 @@ class VisualiserGraphService {
|
|
|
1599
1764
|
.text((d) => Array.isArray(d.label) ? d.label.join(', ') : d.label ?? '');
|
|
1600
1765
|
const edgepaths = zoomContainer
|
|
1601
1766
|
.selectAll('path.edgepath')
|
|
1602
|
-
.data(this.links, linkKey);
|
|
1767
|
+
.data(this.links.filter(({ labelIndex }) => labelIndex !== undefined), linkKey);
|
|
1603
1768
|
const edgepathsEnter = edgepaths
|
|
1604
1769
|
.join('svg:path')
|
|
1605
1770
|
.attr('class', 'edgepath')
|
|
@@ -1608,7 +1773,7 @@ class VisualiserGraphService {
|
|
|
1608
1773
|
.attr('id', (d) => `edgepath_${linkKey(d)}`);
|
|
1609
1774
|
const edgelabels = zoomContainer
|
|
1610
1775
|
.selectAll('text.edgelabel')
|
|
1611
|
-
.data(this.links, linkKey);
|
|
1776
|
+
.data(this.links.filter(({ labelIndex }) => labelIndex !== undefined), linkKey);
|
|
1612
1777
|
const edgelabelsEnter = edgelabels
|
|
1613
1778
|
.enter()
|
|
1614
1779
|
.append('text')
|
|
@@ -2230,7 +2395,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2230
2395
|
|
|
2231
2396
|
class VisualiserGraphComponent {
|
|
2232
2397
|
visualiserGraphService;
|
|
2233
|
-
contextMenuService;
|
|
2234
2398
|
dagreNodesOnlyLayout;
|
|
2235
2399
|
dexieService;
|
|
2236
2400
|
graphElement;
|
|
@@ -2253,9 +2417,8 @@ class VisualiserGraphComponent {
|
|
|
2253
2417
|
controls = true;
|
|
2254
2418
|
zoomToFit = false;
|
|
2255
2419
|
modalsComponent;
|
|
2256
|
-
constructor(visualiserGraphService,
|
|
2420
|
+
constructor(visualiserGraphService, dagreNodesOnlyLayout, dexieService) {
|
|
2257
2421
|
this.visualiserGraphService = visualiserGraphService;
|
|
2258
|
-
this.contextMenuService = contextMenuService;
|
|
2259
2422
|
this.dagreNodesOnlyLayout = dagreNodesOnlyLayout;
|
|
2260
2423
|
this.dexieService = dexieService;
|
|
2261
2424
|
}
|
|
@@ -2341,7 +2504,7 @@ class VisualiserGraphComponent {
|
|
|
2341
2504
|
console.error('savedGraphData is not set');
|
|
2342
2505
|
return;
|
|
2343
2506
|
}
|
|
2344
|
-
let
|
|
2507
|
+
let contextMenuType = null;
|
|
2345
2508
|
let item;
|
|
2346
2509
|
const targetEl = event.target;
|
|
2347
2510
|
if (!(targetEl instanceof Element)) {
|
|
@@ -2354,7 +2517,7 @@ class VisualiserGraphComponent {
|
|
|
2354
2517
|
this.selectedNodeId = targetEl.id || data?.id || null;
|
|
2355
2518
|
let selectedNodesContext;
|
|
2356
2519
|
if (this.selectedNodesArray.length === 2) {
|
|
2357
|
-
|
|
2520
|
+
contextMenuType = 'links';
|
|
2358
2521
|
selectedNodesContext = {
|
|
2359
2522
|
graphData: this.savedGraphData,
|
|
2360
2523
|
selectedNodes: this.selectedNodesArray
|
|
@@ -2363,33 +2526,31 @@ class VisualiserGraphComponent {
|
|
|
2363
2526
|
}
|
|
2364
2527
|
else {
|
|
2365
2528
|
if (localName === 'text' || localName === 'image' || parentNodeId === 'nodeText') {
|
|
2366
|
-
|
|
2367
|
-
item = this.selectedNodeId;
|
|
2529
|
+
contextMenuType = 'node';
|
|
2368
2530
|
}
|
|
2369
2531
|
else if (localName === 'textPath') {
|
|
2370
|
-
|
|
2371
|
-
item = this.selectedLinkArray;
|
|
2532
|
+
contextMenuType = 'link-label';
|
|
2372
2533
|
}
|
|
2373
2534
|
else if (localName === 'svg') {
|
|
2374
|
-
|
|
2375
|
-
item = 'item';
|
|
2535
|
+
contextMenuType = 'background';
|
|
2376
2536
|
}
|
|
2377
2537
|
}
|
|
2378
|
-
this.contextMenuService.show.next({
|
|
2379
|
-
contextMenu,
|
|
2380
|
-
event,
|
|
2381
|
-
item,
|
|
2382
|
-
});
|
|
2383
2538
|
event.stopPropagation();
|
|
2384
2539
|
event.preventDefault();
|
|
2540
|
+
if (contextMenuType) {
|
|
2541
|
+
this.contextMenu.openMenu(contextMenuType, event, item);
|
|
2542
|
+
}
|
|
2543
|
+
else {
|
|
2544
|
+
this.contextMenu.closeMenu();
|
|
2545
|
+
}
|
|
2385
2546
|
// Update context menu items based on data from Dexie
|
|
2386
2547
|
const updatedData = await this.dexieService.getGraphData(this.dataId);
|
|
2387
2548
|
if (selectedNodesContext) {
|
|
2388
2549
|
selectedNodesContext.graphData = updatedData;
|
|
2389
2550
|
}
|
|
2390
2551
|
}
|
|
2391
|
-
dismissContextMenu(
|
|
2392
|
-
this.
|
|
2552
|
+
dismissContextMenu() {
|
|
2553
|
+
this.contextMenu.closeMenu();
|
|
2393
2554
|
}
|
|
2394
2555
|
findCreateNodesEvent(action) {
|
|
2395
2556
|
if (action === 'findNodes') {
|
|
@@ -2793,13 +2954,13 @@ class VisualiserGraphComponent {
|
|
|
2793
2954
|
console.error(`Modal template ${modal} is not available.`);
|
|
2794
2955
|
}
|
|
2795
2956
|
}
|
|
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(
|
|
2957
|
+
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 });
|
|
2958
|
+
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
2959
|
}
|
|
2799
2960
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: VisualiserGraphComponent, decorators: [{
|
|
2800
2961
|
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:
|
|
2962
|
+
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"] }]
|
|
2963
|
+
}], ctorParameters: () => [{ type: VisualiserGraphService }, { type: DagreNodesOnlyLayout }, { type: DexieService }], propDecorators: { graphElement: [{
|
|
2803
2964
|
type: ViewChild,
|
|
2804
2965
|
args: ['svgId']
|
|
2805
2966
|
}], contextMenu: [{
|
|
@@ -2826,15 +2987,12 @@ class NgxRelationshipVisualiserModule {
|
|
|
2826
2987
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NgxRelationshipVisualiserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2827
2988
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: NgxRelationshipVisualiserModule, declarations: [VisualiserGraphComponent,
|
|
2828
2989
|
ContextMenusComponent,
|
|
2829
|
-
ModalsComponent
|
|
2830
|
-
|
|
2831
|
-
|
|
2990
|
+
ModalsComponent,
|
|
2991
|
+
IconSelectComponent], imports: [BrowserModule,
|
|
2992
|
+
ReactiveFormsModule, i1.ModalModule], exports: [VisualiserGraphComponent] });
|
|
2832
2993
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NgxRelationshipVisualiserModule, imports: [BrowserModule,
|
|
2833
2994
|
ReactiveFormsModule,
|
|
2834
|
-
ModalModule.forRoot()
|
|
2835
|
-
ContextMenuModule.forRoot({ useBootstrap4: true }),
|
|
2836
|
-
NgSelectModule,
|
|
2837
|
-
FormsModule] });
|
|
2995
|
+
ModalModule.forRoot()] });
|
|
2838
2996
|
}
|
|
2839
2997
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NgxRelationshipVisualiserModule, decorators: [{
|
|
2840
2998
|
type: NgModule,
|
|
@@ -2842,15 +3000,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2842
3000
|
declarations: [
|
|
2843
3001
|
VisualiserGraphComponent,
|
|
2844
3002
|
ContextMenusComponent,
|
|
2845
|
-
ModalsComponent
|
|
3003
|
+
ModalsComponent,
|
|
3004
|
+
IconSelectComponent
|
|
2846
3005
|
],
|
|
2847
3006
|
imports: [
|
|
2848
3007
|
BrowserModule,
|
|
2849
3008
|
ReactiveFormsModule,
|
|
2850
|
-
ModalModule.forRoot()
|
|
2851
|
-
ContextMenuModule.forRoot({ useBootstrap4: true }),
|
|
2852
|
-
NgSelectModule,
|
|
2853
|
-
FormsModule
|
|
3009
|
+
ModalModule.forRoot()
|
|
2854
3010
|
],
|
|
2855
3011
|
exports: [VisualiserGraphComponent]
|
|
2856
3012
|
}]
|