ngx-relationship-visualiser 2.1.3 → 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 +1 -4
- package/esm2022/projects/ngx-relationship-visualiser-lib/lib/ngx-relationship-visualiser.module.mjs +9 -13
- 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 +4 -39
- package/fesm2022/ngx-relationship-visualiser.mjs +196 -51
- package/fesm2022/ngx-relationship-visualiser.mjs.map +1 -1
- package/package.json +1 -2
- package/projects/ngx-relationship-visualiser-lib/lib/ngx-relationship-visualiser.module.d.ts +5 -5
- 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
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, HostListener, Output, Component, Injectable,
|
|
2
|
+
import { EventEmitter, HostListener, Output, Component, Injectable, forwardRef, Input, ViewChild, NgModule } from '@angular/core';
|
|
3
3
|
import { BrowserModule } from '@angular/platform-browser';
|
|
4
4
|
import * as i2 from '@angular/forms';
|
|
5
|
-
import { Validators,
|
|
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
8
|
import Dexie from 'dexie';
|
|
9
9
|
import * as i4 from '@angular/common';
|
|
10
|
-
import * as i5 from '@ng-select/ng-select';
|
|
11
|
-
import { NgSelectModule } from '@ng-select/ng-select';
|
|
12
10
|
import Swal from 'sweetalert2';
|
|
13
11
|
import * as d3 from 'd3';
|
|
14
12
|
import { Subject, ReplaySubject } from 'rxjs';
|
|
@@ -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
|
}
|
|
@@ -670,41 +847,12 @@ class ModalsComponent extends AbstractModalFormHandler {
|
|
|
670
847
|
const controlToClear = iconType === 'url' ? 'icon' : 'imageUrl';
|
|
671
848
|
this.createNodeForm.get(controlToClear)?.setValue('');
|
|
672
849
|
}
|
|
673
|
-
trackByFn(item) {
|
|
674
|
-
return item.id;
|
|
675
|
-
}
|
|
676
|
-
loadSelectedNodeIcons(node) {
|
|
677
|
-
const lastSelectedIconIndex = [node.icon, node.additionalIcon].reduce((lastIndex, selectedIcon) => Math.max(lastIndex, this.fontAwesomeIcons.findIndex(({ icon }) => icon === selectedIcon)), -1);
|
|
678
|
-
const requiredLength = lastSelectedIconIndex + 1;
|
|
679
|
-
if (requiredLength > this.iconsBuffer.length) {
|
|
680
|
-
this.iconsBuffer = this.fontAwesomeIcons.slice(0, requiredLength);
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
onScrollToEnd() {
|
|
684
|
-
this.fetchMore();
|
|
685
|
-
}
|
|
686
|
-
onScroll({ end }) {
|
|
687
|
-
if (this.loading || this.fontAwesomeIcons.length <= this.iconsBuffer.length) {
|
|
688
|
-
return;
|
|
689
|
-
}
|
|
690
|
-
if (end + this.numberOfItemsFromEndBeforeFetchingMore >=
|
|
691
|
-
this.iconsBuffer.length) {
|
|
692
|
-
this.fetchMore();
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
fetchMore() {
|
|
696
|
-
const len = this.iconsBuffer.length;
|
|
697
|
-
const more = this.fontAwesomeIcons.slice(len, this.bufferSize + len);
|
|
698
|
-
this.loading = true;
|
|
699
|
-
this.loading = false;
|
|
700
|
-
this.iconsBuffer = this.iconsBuffer.concat(more);
|
|
701
|
-
}
|
|
702
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 });
|
|
703
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ModalsComponent, selector: "app-modals", inputs: { editNodeData: "editNodeData", editLinksData: "editLinksData" }, outputs: { closeModalEvent: "closeModalEvent", createEditLinkEvent: "createEditLinkEvent", createEditNodeEvent: "createEditNodeEvent", deleteLinkEvent: "deleteLinkEvent", deleteNodeEvent: "deleteNodeEvent" }, viewQueries: [{ propertyName: "editNodeModal", first: true, predicate: ["editNodeModal"], descendants: true }, { propertyName: "createNodeModal", first: true, predicate: ["createNodeModal"], descendants: true }, { propertyName: "createLinkModal", first: true, predicate: ["createLinkModal"], descendants: true }, { propertyName: "editLinksModal", first: true, predicate: ["editLinksModal"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<!--EDIT NODE MODAL-->\n<ng-template #editNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\" (change)=\"onIconTypeChange('url')\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\" (change)=\"onIconTypeChange('select')\"> Choose Icon\n </div>\n </div>\n @if (createNodeForm.get('iconType')?.value === 'url') {\n <div class=\"form-group\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n }\n @if (createNodeForm.get('iconType')?.value === 'select') {\n <div class=\"form-group\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n }\n @if (createNodeForm.errors?.iconOrImage) {\n <div class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n }\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of nodeLabelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\">Remove</button>\n </div>\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('editNodeModal')\" [disabled]=\"!createNodeForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteNode()\">Delete Node</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n <!--CREATE NODE MODAL-->\n <ng-template #createNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\" (change)=\"onIconTypeChange('url')\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\" (change)=\"onIconTypeChange('select')\"> Choose Icon\n </div>\n </div>\n @if (createNodeForm.get('iconType')?.value === 'url') {\n <div class=\"form-group\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n }\n @if (createNodeForm.get('iconType')?.value === 'select') {\n <div class=\"form-group\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n }\n @if (createNodeForm.errors?.iconOrImage) {\n <div class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n }\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of nodeLabelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\">Remove</button>\n </div>\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('createNodeModal')\" [disabled]=\"!createNodeForm.valid\">Create Node</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n <!--EDIT LINKS MODAL-->\n <ng-template #editLinksModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Links</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n @if (targetImageUrl) {\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n }\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n @if (sourceImageUrl) {\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n }\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of targetLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of sourceLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n </div>\n @if (createLinkForm.get('label')?.value?.length) {\n <div class=\"labelPosition text-center\">\n @for (label of createLinkForm.get('label')?.value; track label) {\n <span>\n <span class=\"d-block\">{{ label.label }} @if (label.linkIcon) {\n <span style=\"color: #856404;\"><i class=\"fa fa-light\">{{ getRelationshipIcon(label.linkIcon) }}</i></span>\n }</span>\n </span>\n }\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of labelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\" [checked]=\"!!label.get('linkIcon')?.value\" (change)=\"toggleLinkIcon(i, $event)\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n @if (label.get('linkIcon')?.value) {\n <ng-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select link icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\">\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{ item.icon }}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">\n {{ labelArray.length > 0 ? 'Add another label' : 'Add label' }}\n </button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('editLinkModal')\" [disabled]=\"!createLinkForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteLink()\">Delete Link</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n\n <!--CREATE LINK MODAL-->\n <ng-template #createLinkModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Link</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n @if (targetImageUrl) {\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n }\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n @if (sourceImageUrl) {\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n }\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of targetLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of sourceLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n </div>\n @if (createLinkForm.get('label')?.value?.length) {\n <div class=\"labelPosition text-center\">\n @for (label of createLinkForm.get('label')?.value; track label) {\n <span>\n <span class=\"d-block\">{{ label.label }} @if (label.linkIcon) {\n <span style=\"color: #856404;\"><i class=\"fa fa-light\">{{ getRelationshipIcon(label.linkIcon) }}</i></span>\n }</span>\n </span>\n }\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of labelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\" [checked]=\"!!label.get('linkIcon')?.value\" (change)=\"toggleLinkIcon(i, $event)\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n @if (label.get('linkIcon')?.value) {\n <ng-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select link icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\">\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{ item.icon }}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">\n {{ labelArray.length > 0 ? 'Add another label' : 'Add label' }}\n </button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('createLinkModal')\" [disabled]=\"!createLinkForm.valid\">Create Link</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->", styles: [".imageUrl{max-width:30px}.labelPosition{position:relative;top:-55px;margin-right:30px;margin-left:30px}.link-line-solid{width:100%;position:relative;margin:15px;border-top:2px solid #777}.link-line-dotted{width:100%;position:relative;margin:15px;background-image:repeating-linear-gradient(to right,#cacaca,#cacaca 7px,transparent 7px,transparent 15px);height:2px}.iconImage{position:relative;top:4px}.link-icon-select{width:250px}.arrow{position:absolute;top:20px;left:20px}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick", "keyDownFn"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i5.NgHeaderTemplateDirective, selector: "[ng-header-tmp]" }] });
|
|
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"] }] });
|
|
704
852
|
}
|
|
705
853
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalsComponent, decorators: [{
|
|
706
854
|
type: Component,
|
|
707
|
-
args: [{ selector: 'app-modals', template: "<!--EDIT NODE MODAL-->\n<ng-template #editNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\" (change)=\"onIconTypeChange('url')\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\" (change)=\"onIconTypeChange('select')\"> Choose Icon\n </div>\n </div>\n @if (createNodeForm.get('iconType')?.value === 'url') {\n <div class=\"form-group\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n }\n @if (createNodeForm.get('iconType')?.value === 'select') {\n <div class=\"form-group\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n }\n @if (createNodeForm.errors?.iconOrImage) {\n <div class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n }\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of nodeLabelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\">Remove</button>\n </div>\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('editNodeModal')\" [disabled]=\"!createNodeForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteNode()\">Delete Node</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n <!--CREATE NODE MODAL-->\n <ng-template #createNodeModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Node</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createNodeForm\">\n <div class=\"form-group\">\n <label for=\"iconType\">Icon Type</label>\n <div>\n <input type=\"radio\" id=\"imageUrl\" formControlName=\"iconType\" value=\"url\" (change)=\"onIconTypeChange('url')\"> Image URL\n <input class=\"ml-5\" type=\"radio\" id=\"iconTypeSelect\" formControlName=\"iconType\" value=\"select\" (change)=\"onIconTypeChange('select')\"> Choose Icon\n </div>\n </div>\n @if (createNodeForm.get('iconType')?.value === 'url') {\n <div class=\"form-group\">\n <label for=\"imageUrl\">Image URL</label>\n <div class=\"input-group\">\n <input type=\"text\" id=\"imageUrl\" formControlName=\"imageUrl\" class=\"form-control\" placeholder=\"Image URL\">\n <button type=\"button\" class=\"btn btn-outline-secondary\" (click)=\"clearImageUrl()\">Clear</button>\n </div>\n </div>\n }\n @if (createNodeForm.get('iconType')?.value === 'select') {\n <div class=\"form-group\">\n <label for=\"nodeIcon\">Choose Icon</label>\n <ng-select\n formControlName=\"icon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n }\n @if (createNodeForm.errors?.iconOrImage) {\n <div class=\"text-danger\">\n Please provide either an Image URL or choose an Icon, but not both.\n </div>\n }\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of nodeLabelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control mb-2\" placeholder=\"Label\" [id]=\"'node-label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeNodeLabel(i)\">Remove</button>\n </div>\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addNodeLabel()\">Add Label</button>\n </div>\n <div class=\"form-group\">\n <label for=\"nodeAdditionalIcon\">Additional icon</label>\n <ng-select\n formControlName=\"additionalIcon\"\n [items]=\"iconsBuffer\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\"\n >Loaded {{ iconsBuffer.length }} of {{ fontAwesomeIcons.length }}</small\n >\n </ng-template>\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{item.icon}}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditNode('createNodeModal')\" [disabled]=\"!createNodeForm.valid\">Create Node</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n <!--EDIT LINKS MODAL-->\n <ng-template #editLinksModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Edit Links</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n @if (targetImageUrl) {\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n }\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n @if (sourceImageUrl) {\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n }\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of targetLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of sourceLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n </div>\n @if (createLinkForm.get('label')?.value?.length) {\n <div class=\"labelPosition text-center\">\n @for (label of createLinkForm.get('label')?.value; track label) {\n <span>\n <span class=\"d-block\">{{ label.label }} @if (label.linkIcon) {\n <span style=\"color: #856404;\"><i class=\"fa fa-light\">{{ getRelationshipIcon(label.linkIcon) }}</i></span>\n }</span>\n </span>\n }\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of labelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\" [checked]=\"!!label.get('linkIcon')?.value\" (change)=\"toggleLinkIcon(i, $event)\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n @if (label.get('linkIcon')?.value) {\n <ng-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select link icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\">\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{ item.icon }}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">\n {{ labelArray.length > 0 ? 'Add another label' : 'Add label' }}\n </button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('editLinkModal')\" [disabled]=\"!createLinkForm.valid\">Save Changes</button>\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"deleteLink()\">Delete Link</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->\n\n\n <!--CREATE LINK MODAL-->\n <ng-template #createLinkModal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\">Create Link</h4>\n <button type=\"button\" class=\"btn-close close pull-right\" aria-label=\"Close\" (click)=\"closeModal('modalRef')\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <form [formGroup]=\"createLinkForm\">\n <div class=\"col-sm-12 d-flex flex-column\">\n <div class=\"d-flex mb-3\">\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-left\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"sourceArrow\" formControlName=\"sourceArrow\" class=\"form-check-input\">\n <label class=\"d-none form-check-label\" for=\"leftArrow\"></label>\n </span>\n </div>\n <div class=\"iconImage ml-3\">\n @if (targetImageUrl) {\n <img class=\"imageUrl\" [src]=\"targetImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{targetIcon}}</i>\n }\n </div>\n <div\n [ngClass]=\"{\n 'link-line-solid': createLinkForm.get('lineStyle')?.value === 'Solid',\n 'link-line-dotted': createLinkForm.get('lineStyle')?.value === 'Dotted'\n }\"\n >\n </div>\n <div class=\"iconImage mr-3\">\n @if (sourceImageUrl) {\n <img class=\"imageUrl\" [src]=\"sourceImageUrl\" />\n } @else {\n <i class=\"fa-solid fa-2x\">{{sourceIcon}}</i>\n }\n </div>\n <div class=\"iconImage\">\n <span><i class=\"fas fa-arrow-right\"></i></span>\n <span class=\"arrow\">\n <input type=\"checkbox\" id=\"targetArrow\" formControlName=\"targetArrow\" class=\"form-check-input\">\n <label class=\"form-check-label\" for=\"rightArrow\"></label>\n </span>\n </div>\n </div>\n <div class=\"d-flex justify-content-between mb-3\">\n <div class=\"text-left d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of targetLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n <div class=\"text-right d-block font-weight-bold\" style=\"font-size: 12px\">\n @for (label of sourceLabels; track $index) {\n <span class=\"d-block\">{{ label }}</span>\n }\n </div>\n </div>\n @if (createLinkForm.get('label')?.value?.length) {\n <div class=\"labelPosition text-center\">\n @for (label of createLinkForm.get('label')?.value; track label) {\n <span>\n <span class=\"d-block\">{{ label.label }} @if (label.linkIcon) {\n <span style=\"color: #856404;\"><i class=\"fa fa-light\">{{ getRelationshipIcon(label.linkIcon) }}</i></span>\n }</span>\n </span>\n }\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"lineStyle\">Line Style</label>\n <select id=\"lineStyle\" formControlName=\"lineStyle\" class=\"form-control\">\n <option value=\"Solid\">Solid</option>\n <option value=\"Dotted\">Dotted</option>\n </select>\n </div>\n\n <div class=\"form-group\">\n <label for=\"label\">Labels</label>\n <div formArrayName=\"label\">\n @for (label of labelArray.controls; track label; let i = $index) {\n <div [formGroupName]=\"i\"\n class=\"d-flex flex-column align-items-start\">\n <div class=\"d-flex align-items-center w-100\">\n <input formControlName=\"label\" class=\"form-control\" placeholder=\"Label\" [id]=\"'label-' + i\">\n <button type=\"button\" class=\"btn btn-danger ml-2\" (click)=\"removeLabel(i)\">Remove</button>\n </div>\n <div class=\"form-group form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [id]=\"'linkIcon-' + i\" [checked]=\"!!label.get('linkIcon')?.value\" (change)=\"toggleLinkIcon(i, $event)\">\n <label [for]=\"'linkIcon-' + i\">Link Icon?</label>\n </div>\n @if (label.get('linkIcon')?.value) {\n <ng-select\n class=\"link-icon-select\"\n formControlName=\"linkIcon\"\n [items]=\"fontAwesomeIcons\"\n bindLabel=\"name\"\n bindValue=\"icon\"\n placeholder=\"Select link icon\"\n appendTo=\"body\"\n [trackByFn]=\"trackByFn\">\n <ng-template ng-option-tmp let-item=\"item\">\n <i class=\"fa fa-light\">{{ item.icon }}</i>\n <span class=\"ml-3\">{{ item.name }}</span>\n </ng-template>\n </ng-select>\n }\n </div>\n }\n </div>\n <button type=\"button\" class=\"btn btn-secondary mt-2\" (click)=\"addLabel()\">\n {{ labelArray.length > 0 ? 'Add another label' : 'Add label' }}\n </button>\n </div>\n </form>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"closeModal('modalRef')\">Cancel</button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"createEditLink('createLinkModal')\" [disabled]=\"!createLinkForm.valid\">Create Link</button>\n </div>\n </ng-template>\n <!-- ./MODAL-->", styles: [".imageUrl{max-width:30px}.labelPosition{position:relative;top:-55px;margin-right:30px;margin-left:30px}.link-line-solid{width:100%;position:relative;margin:15px;border-top:2px solid #777}.link-line-dotted{width:100%;position:relative;margin:15px;background-image:repeating-linear-gradient(to right,#cacaca,#cacaca 7px,transparent 7px,transparent 15px);height:2px}.iconImage{position:relative;top:4px}.link-icon-select{width:250px}.arrow{position:absolute;top:20px;left:20px}\n"] }]
|
|
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"] }]
|
|
708
856
|
}], ctorParameters: () => [{ type: i1.BsModalService }, { type: i2.FormBuilder }, { type: DexieService }], propDecorators: { editNodeData: [{
|
|
709
857
|
type: Input
|
|
710
858
|
}], editLinksData: [{
|
|
@@ -2839,14 +2987,12 @@ class NgxRelationshipVisualiserModule {
|
|
|
2839
2987
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NgxRelationshipVisualiserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2840
2988
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: NgxRelationshipVisualiserModule, declarations: [VisualiserGraphComponent,
|
|
2841
2989
|
ContextMenusComponent,
|
|
2842
|
-
ModalsComponent
|
|
2843
|
-
|
|
2844
|
-
|
|
2990
|
+
ModalsComponent,
|
|
2991
|
+
IconSelectComponent], imports: [BrowserModule,
|
|
2992
|
+
ReactiveFormsModule, i1.ModalModule], exports: [VisualiserGraphComponent] });
|
|
2845
2993
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NgxRelationshipVisualiserModule, imports: [BrowserModule,
|
|
2846
2994
|
ReactiveFormsModule,
|
|
2847
|
-
ModalModule.forRoot()
|
|
2848
|
-
NgSelectModule,
|
|
2849
|
-
FormsModule] });
|
|
2995
|
+
ModalModule.forRoot()] });
|
|
2850
2996
|
}
|
|
2851
2997
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NgxRelationshipVisualiserModule, decorators: [{
|
|
2852
2998
|
type: NgModule,
|
|
@@ -2854,14 +3000,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2854
3000
|
declarations: [
|
|
2855
3001
|
VisualiserGraphComponent,
|
|
2856
3002
|
ContextMenusComponent,
|
|
2857
|
-
ModalsComponent
|
|
3003
|
+
ModalsComponent,
|
|
3004
|
+
IconSelectComponent
|
|
2858
3005
|
],
|
|
2859
3006
|
imports: [
|
|
2860
3007
|
BrowserModule,
|
|
2861
3008
|
ReactiveFormsModule,
|
|
2862
|
-
ModalModule.forRoot()
|
|
2863
|
-
NgSelectModule,
|
|
2864
|
-
FormsModule
|
|
3009
|
+
ModalModule.forRoot()
|
|
2865
3010
|
],
|
|
2866
3011
|
exports: [VisualiserGraphComponent]
|
|
2867
3012
|
}]
|