@eo4geo/ngx-bok-visualization 1.4.5 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/eo4geo-ngx-bok-visualization.mjs +593 -552
- package/fesm2022/eo4geo-ngx-bok-visualization.mjs.map +1 -1
- package/lib/components/description/description.component.d.ts +1 -0
- package/lib/components/skillsTree/skillsTree.component.d.ts +10 -0
- package/lib/components/versions/versions.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Output, Input, Component,
|
|
2
|
+
import { EventEmitter, Output, Input, Component, Injectable, inject, signal, Pipe, ViewContainerRef, ViewChild } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { select } from 'd3-selection';
|
|
@@ -10,6 +10,9 @@ import { transition } from 'd3-transition';
|
|
|
10
10
|
import { schemeCategory10 } from 'd3';
|
|
11
11
|
import * as i2 from 'primeng/tree';
|
|
12
12
|
import { TreeModule } from 'primeng/tree';
|
|
13
|
+
import { BehaviorSubject, concatMap, of, tap, filter, map, forkJoin, catchError, from, take, switchMap, expand, takeWhile } from 'rxjs';
|
|
14
|
+
import { Firestore, collection, doc, getDoc } from '@angular/fire/firestore';
|
|
15
|
+
import * as i1$1 from '@angular/common/http';
|
|
13
16
|
import * as i3 from 'primeng/api';
|
|
14
17
|
import * as i3$2 from 'primeng/progressspinner';
|
|
15
18
|
import { ProgressSpinnerModule } from 'primeng/progressspinner';
|
|
@@ -27,12 +30,9 @@ import { ButtonModule } from 'primeng/button';
|
|
|
27
30
|
import * as i7 from 'primeng/divider';
|
|
28
31
|
import { DividerModule } from 'primeng/divider';
|
|
29
32
|
import { DataView } from 'primeng/dataview';
|
|
30
|
-
import * as i1$
|
|
33
|
+
import * as i1$2 from '@angular/cdk/layout';
|
|
31
34
|
import * as i4$1 from 'primeng/scrolltop';
|
|
32
35
|
import { ScrollTopModule } from 'primeng/scrolltop';
|
|
33
|
-
import { BehaviorSubject, concatMap, of, tap, filter, map, forkJoin, catchError, from, take, expand, takeWhile, switchMap } from 'rxjs';
|
|
34
|
-
import { Firestore, collection, doc, getDoc } from '@angular/fire/firestore';
|
|
35
|
-
import * as i1$2 from '@angular/common/http';
|
|
36
36
|
|
|
37
37
|
class CustomD3NodeCollection {
|
|
38
38
|
nodes = [];
|
|
@@ -504,7 +504,7 @@ class VersionsComponent {
|
|
|
504
504
|
bokVersion = '';
|
|
505
505
|
bokVersions = new Map();
|
|
506
506
|
bokVersionChange = new EventEmitter();
|
|
507
|
-
descendingOrder = (a, b) => b.
|
|
507
|
+
descendingOrder = (a, b) => b.key.localeCompare(a.key, undefined, { numeric: true });
|
|
508
508
|
loadOldBokVersion(version) {
|
|
509
509
|
this.bokVersionChange.emit(version);
|
|
510
510
|
}
|
|
@@ -524,339 +524,163 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
524
524
|
type: Output
|
|
525
525
|
}] } });
|
|
526
526
|
|
|
527
|
-
class
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
return;
|
|
589
|
-
levelNode.children ??= [];
|
|
590
|
-
levelNode.children.push({
|
|
591
|
-
key: `${element.bloomLevel}-${element.bloomVerb}-${levelNode.children.length}`,
|
|
592
|
-
label: element.name,
|
|
593
|
-
children: [],
|
|
594
|
-
leaf: true,
|
|
595
|
-
expanded: false,
|
|
596
|
-
type: 'leaf',
|
|
597
|
-
data: element.bloomVerb
|
|
598
|
-
});
|
|
599
|
-
});
|
|
600
|
-
tempTree.forEach(levelNode => {
|
|
601
|
-
levelNode.children = this.getSortedArray(levelNode.children ?? []);
|
|
527
|
+
class BokDataService {
|
|
528
|
+
Relationtype = {
|
|
529
|
+
SIMILAR: 'similarTo',
|
|
530
|
+
PREREQUISITE: 'prerequisites',
|
|
531
|
+
POSTREQUISITE: 'postrequisites',
|
|
532
|
+
BROADER: 'broader',
|
|
533
|
+
NARROWER: 'narrower',
|
|
534
|
+
DEMONSTRATES: 'demonstrates',
|
|
535
|
+
SUBCONCEPT: 'is subconcept of',
|
|
536
|
+
SIMILARTO: 'is similar to',
|
|
537
|
+
PREREQUISITEOF: 'is prerequisite of',
|
|
538
|
+
};
|
|
539
|
+
colorhash = {
|
|
540
|
+
GI: '#cef4ff',
|
|
541
|
+
IP: '#1f77b4',
|
|
542
|
+
CF: '#aec7e8',
|
|
543
|
+
CV: '#ff7f0e',
|
|
544
|
+
DA: '#ffbb78',
|
|
545
|
+
DM: '#2ca02c',
|
|
546
|
+
DN: '#98df8a',
|
|
547
|
+
PS: '#d62728',
|
|
548
|
+
GD: '#cc5b59',
|
|
549
|
+
GS: '#9467bd',
|
|
550
|
+
AM: '#8c564b',
|
|
551
|
+
MD: '#8c564b',
|
|
552
|
+
OI: '#c49c94',
|
|
553
|
+
GC: '#e377c2',
|
|
554
|
+
PP: '#f7b6d2',
|
|
555
|
+
SD: '#7f7f7f',
|
|
556
|
+
SH: '#c7c7c7',
|
|
557
|
+
TA: '#bcbd22',
|
|
558
|
+
WB: '#07561e',
|
|
559
|
+
GN: '#1ca8dd',
|
|
560
|
+
SC: '#ffcc00',
|
|
561
|
+
SA: '#ff9f4a',
|
|
562
|
+
no: '#17becf',
|
|
563
|
+
};
|
|
564
|
+
parsedBokData$ = new BehaviorSubject(undefined);
|
|
565
|
+
getParsedBokData() {
|
|
566
|
+
return this.parsedBokData$;
|
|
567
|
+
}
|
|
568
|
+
parseBOKData(bokJSON) {
|
|
569
|
+
const allNodes = [];
|
|
570
|
+
const namehash = {};
|
|
571
|
+
// Loop all nodes
|
|
572
|
+
for (let n = 0; n < bokJSON.concepts.length; n++) {
|
|
573
|
+
const newNode = new CustomD3Node({
|
|
574
|
+
name: bokJSON.concepts[n].name,
|
|
575
|
+
nameShort: bokJSON.concepts[n].code,
|
|
576
|
+
description: bokJSON.concepts[n].description,
|
|
577
|
+
selfAssesment: bokJSON.concepts[n].selfAssesment,
|
|
578
|
+
uri: n.toString(),
|
|
579
|
+
id: n.toString(),
|
|
580
|
+
children: [],
|
|
581
|
+
classifiedSkills: [],
|
|
582
|
+
skills: [],
|
|
583
|
+
sourceDocuments: [],
|
|
584
|
+
contributors: [],
|
|
585
|
+
parent: null,
|
|
586
|
+
otherParents: [],
|
|
587
|
+
similarConcepts: [],
|
|
602
588
|
});
|
|
603
|
-
|
|
589
|
+
namehash[bokJSON.concepts[n].code] = newNode.name || '';
|
|
590
|
+
allNodes.push(newNode);
|
|
604
591
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
592
|
+
// Handle relations
|
|
593
|
+
for (const relation of bokJSON.relations) {
|
|
594
|
+
const sourceNode = allNodes[relation.source];
|
|
595
|
+
const targetNode = allNodes[relation.target];
|
|
596
|
+
if (relation.name === this.Relationtype.SUBCONCEPT) {
|
|
597
|
+
if (sourceNode.parent) {
|
|
598
|
+
sourceNode.otherParents.push(targetNode);
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
sourceNode.parent = targetNode;
|
|
602
|
+
}
|
|
603
|
+
targetNode.children.push(sourceNode);
|
|
604
|
+
}
|
|
605
|
+
if (relation.name === this.Relationtype.SIMILARTO) {
|
|
606
|
+
targetNode.similarConcepts.push(sourceNode);
|
|
607
|
+
sourceNode.similarConcepts.push(targetNode);
|
|
608
|
+
}
|
|
609
|
+
if (relation.name === this.Relationtype.PREREQUISITEOF) {
|
|
610
|
+
targetNode.prerequisites.push(sourceNode);
|
|
611
|
+
}
|
|
609
612
|
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
613
|
+
// Handle skills
|
|
614
|
+
for (const skill of (bokJSON.classifiedSkills || [])) {
|
|
615
|
+
for (const conceptIndex of skill.concepts) {
|
|
616
|
+
const node = allNodes[conceptIndex];
|
|
617
|
+
node.classifiedSkills.push({
|
|
618
|
+
name: skill.name,
|
|
619
|
+
bloomLevel: skill.bloomLevel,
|
|
620
|
+
bloomVerb: skill.bloomVerb,
|
|
621
|
+
});
|
|
622
|
+
}
|
|
616
623
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
const partA = partsA[i];
|
|
626
|
-
const partB = partsB[i];
|
|
627
|
-
if (!isNaN(Number(partA)) && !isNaN(Number(partB))) {
|
|
628
|
-
const numA = parseInt(partA, 10);
|
|
629
|
-
const numB = parseInt(partB, 10);
|
|
630
|
-
if (numA !== numB)
|
|
631
|
-
return numA - numB;
|
|
624
|
+
for (const skill of bokJSON.skills) {
|
|
625
|
+
for (const conceptIndex of skill.concepts) {
|
|
626
|
+
const node = allNodes[conceptIndex];
|
|
627
|
+
node.skills.push({
|
|
628
|
+
description: skill.name,
|
|
629
|
+
nameShort: skill.name,
|
|
630
|
+
url: skill.name,
|
|
631
|
+
});
|
|
632
632
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
633
|
+
}
|
|
634
|
+
// Handle references
|
|
635
|
+
for (const reference of bokJSON.references) {
|
|
636
|
+
for (const conceptIndex of reference.concepts) {
|
|
637
|
+
const node = allNodes[conceptIndex];
|
|
638
|
+
node.sourceDocuments.push({
|
|
639
|
+
description: reference.description,
|
|
640
|
+
nameShort: reference.name,
|
|
641
|
+
url: reference.url,
|
|
642
|
+
});
|
|
637
643
|
}
|
|
638
644
|
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
645
|
+
// Handle contributors
|
|
646
|
+
if (Array.isArray(bokJSON.contributors)) {
|
|
647
|
+
for (const contributor of bokJSON.contributors) {
|
|
648
|
+
for (const conceptIndex of contributor.concepts) {
|
|
649
|
+
const node = allNodes[conceptIndex];
|
|
650
|
+
node.contributors.push({
|
|
651
|
+
description: contributor.description,
|
|
652
|
+
nameShort: contributor.name,
|
|
653
|
+
url: contributor.url,
|
|
654
|
+
});
|
|
655
|
+
node.contributors.sort((a, b) => a.nameShort.localeCompare(b.nameShort));
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
// Create and return the collection
|
|
660
|
+
const conceptNodeCollection = new CustomD3NodeCollection();
|
|
661
|
+
for (const node of allNodes) {
|
|
662
|
+
conceptNodeCollection.add(node);
|
|
663
|
+
}
|
|
664
|
+
const parsedData = new ParsedBokData({
|
|
665
|
+
nodes: allNodes[0],
|
|
666
|
+
relations: bokJSON.relations,
|
|
667
|
+
namehash,
|
|
668
|
+
conceptNodeCollection,
|
|
669
|
+
colors: this.colorhash,
|
|
670
|
+
});
|
|
671
|
+
this.parsedBokData$.next(parsedData);
|
|
672
|
+
return parsedData;
|
|
673
|
+
}
|
|
674
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
675
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokDataService, providedIn: 'root' });
|
|
643
676
|
}
|
|
644
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type:
|
|
645
|
-
type:
|
|
646
|
-
args: [{ standalone: true, selector: 'skillsTree', imports: [CommonModule, TreeModule], template: "<div *ngIf=\"array && array.length > 0\">\n <h3>{{ headline }} [{{ array.length }}]</h3>\n <p-tree [value]=\"formattedTree()\" class=\"w-full custom-tree ml-0\" >\n <ng-template let-node pTemplate=\"leaf\">\n @if(node.data != '') {\n <div [style.display]=\"'list-item'\" [style.list-style-type]=\"'disc'\"><b>{{node.data}}:</b> {{ node.label }}</div>\n }\n @else {\n <div [style.display]=\"'list-item'\" [style.list-style-type]=\"'disc'\">{{ node.label }}</div>\n }\n </ng-template>\n <ng-template let-node pTemplate=\"default\">\n <a (click)=\"node.expanded = !node.expanded\">{{ node.label }} ({{countChildren(node)}})</a>\n </ng-template>\n </p-tree>\n</div>", styles: [".custom-tree{--p-tree-node-color: var(--primary-color);--p-tree-node-icon-color: var(--primary-color);--p-tree-indent: 2rem;--p-tree-padding: 0rem;--p-tree-gap: 0rem;--p-tree-node-padding: 0rem}::ng-deep .p-tree{padding-bottom:0rem;padding-left:0rem}::ng-deep .p-tree-node-content{margin-top:.25rem}::ng-deep .p-tree-node-content.p-tree-node-selected .p-tree-node-label{font-weight:700}a{cursor:pointer;text-decoration:none;color:var(--secondary-color)}a:hover{color:var(--hover-color)}\n"] }]
|
|
647
|
-
}], propDecorators: { array: [{
|
|
648
|
-
type: Input
|
|
649
|
-
}], headline: [{
|
|
650
|
-
type: Input
|
|
651
|
-
}] } });
|
|
652
|
-
|
|
653
|
-
class DescriptionComponent {
|
|
654
|
-
bokNode = new CustomD3Node();
|
|
655
|
-
isAnOldVersion = false;
|
|
656
|
-
isAnObsoleteId = false;
|
|
657
|
-
showVersions = true;
|
|
658
|
-
versionMap;
|
|
659
|
-
currentVersion;
|
|
660
|
-
bokVersion;
|
|
661
|
-
codSelectedChange = new EventEmitter();
|
|
662
|
-
bokVersionChange = new EventEmitter();
|
|
663
|
-
unifiedSkills = signal([]);
|
|
664
|
-
ngOnChanges(changes) {
|
|
665
|
-
if (changes['bokNode']) {
|
|
666
|
-
const newValue = changes['bokNode'].currentValue;
|
|
667
|
-
this.unifiedSkills.set([
|
|
668
|
-
...(newValue.classifiedSkills || []),
|
|
669
|
-
...newValue.skills.map(skill => ({
|
|
670
|
-
name: skill.description,
|
|
671
|
-
bloomLevel: 0,
|
|
672
|
-
bloomVerb: ''
|
|
673
|
-
}))
|
|
674
|
-
]);
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
get permalink() {
|
|
678
|
-
return `https://geospacebok.eu/${this.bokNode.nameShort}`;
|
|
679
|
-
}
|
|
680
|
-
get statusText() {
|
|
681
|
-
if (this.bokNode.selfAssesment) {
|
|
682
|
-
return `Status: ${this.removeHtmlTags(this.bokNode.selfAssesment)}`;
|
|
683
|
-
}
|
|
684
|
-
return null;
|
|
685
|
-
}
|
|
686
|
-
get formattedTimestamp() {
|
|
687
|
-
if (this.bokNode.timestamp) {
|
|
688
|
-
return `Last Updated: ${new Date(this.bokNode.timestamp).toUTCString()}`;
|
|
689
|
-
}
|
|
690
|
-
return '';
|
|
691
|
-
}
|
|
692
|
-
get parentHierarchy() {
|
|
693
|
-
const parents = [];
|
|
694
|
-
let p = this.bokNode.parent;
|
|
695
|
-
while (p) {
|
|
696
|
-
parents.push(p);
|
|
697
|
-
p = p.parent;
|
|
698
|
-
}
|
|
699
|
-
return parents.reverse();
|
|
700
|
-
}
|
|
701
|
-
get otherParentHierarchies() {
|
|
702
|
-
return this.bokNode.otherParents.map((op) => {
|
|
703
|
-
const hierarchy = [];
|
|
704
|
-
while (op) {
|
|
705
|
-
hierarchy.push(op);
|
|
706
|
-
op = op.parent;
|
|
707
|
-
}
|
|
708
|
-
return hierarchy.reverse();
|
|
709
|
-
});
|
|
710
|
-
}
|
|
711
|
-
browseToConcept(nameShort) {
|
|
712
|
-
this.codSelectedChange.emit(nameShort);
|
|
713
|
-
}
|
|
714
|
-
loadOldBokVersion(version) {
|
|
715
|
-
this.bokVersion = version;
|
|
716
|
-
this.bokVersionChange.emit(version);
|
|
717
|
-
}
|
|
718
|
-
removeHtmlTags(text) {
|
|
719
|
-
return text.replace(/<\/?[^>]+(>|$)/g, "");
|
|
720
|
-
}
|
|
721
|
-
get useBloomSkills() {
|
|
722
|
-
return parseInt(this.bokVersion?.slice(1) ?? '') >= 11;
|
|
723
|
-
}
|
|
724
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DescriptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
725
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DescriptionComponent, isStandalone: true, selector: "description", inputs: { bokNode: "bokNode", isAnOldVersion: "isAnOldVersion", isAnObsoleteId: "isAnObsoleteId", showVersions: "showVersions", versionMap: "versionMap", currentVersion: "currentVersion", bokVersion: "bokVersion" }, outputs: { codSelectedChange: "codSelectedChange", bokVersionChange: "bokVersionChange" }, usesOnChanges: true, ngImport: i0, template: "<div>\n <!-- Permalink -->\n <p>\n Permalink: \n <a style=\"text-decoration: none;\" [href]=\"permalink\">{{ permalink }}</a>\n </p>\n\n <!-- Title -->\n <h2 id=\"boktitle\" style=\"margin-bottom: 0px;\">\n [{{ bokNode.nameShort }}] {{ bokNode.name }}\n </h2>\n\n <!-- Status -->\n <div *ngIf=\"statusText\" style=\"margin-bottom: 1em;\">\n {{ statusText }}\n </div>\n\n <!-- Warning for obsolete BoK concept -->\n <p *ngIf=\"isAnObsoleteId && currentVersion\">\n <span style=\"color: var(--danger-color); font-weight: normal;\">\n warning: this is an obsolete BoK concept - this concept is no longer present in \n <a \n style=\"color: var(--danger-color); font-weight: normal; cursor: pointer; text-decoration: underline;\"\n (click)=\"loadOldBokVersion(currentVersion)\">\n the current version of the BoK\n </a>\n </span>\n </p>\n \n <!-- Warning for old version -->\n <p *ngIf=\"isAnOldVersion && !isAnObsoleteId\">\n <span style=\"color: var(--warning-color); font-weight: normal;\">\n warning: this is an old version of this BoK concept; see \"Versioning\" below for more recent version(s)\n </span>\n </p>\n\n <!-- Last Updated -->\n <small *ngIf=\"formattedTimestamp\">{{ formattedTimestamp }}</small>\n \n <!-- Description -->\n <h3>Description:</h3>\n <div id=\"currentDescription\" class=\"hideContent\">\n {{ bokNode.description }}\n </div>\n\n <!-- Superconcepts -->\n <div *ngIf=\"parentHierarchy.length > 0\">\n <h3>Superconcepts [{{ 1 + bokNode.otherParents.length }}]</h3>\n <div style=\"padding-left: 1em;\">\n <dl>\n <ng-container *ngFor=\"let parent of parentHierarchy; let i = index\">\n <dt *ngIf=\"parent === parentHierarchy[0]\" class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(parent.nameShort)\">\n <b>-</b> [{{ parent.nameShort }}] {{ parent.name }}\n </dt>\n <dd *ngIf=\"parent !== parentHierarchy[0]\"\n [style.marginLeft.em]=\"i * 0.8\"\n style=\"margin-top: 0.25em;\">\n <dl>\n <dt class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(parent.nameShort)\">\n <b>-</b> [{{ parent.nameShort }}] {{ parent.name }}\n </dt>\n </dl>\n </dd>\n </ng-container>\n </dl>\n </div>\n </div>\n\n <!-- Other Superconcepts -->\n <div *ngFor=\"let hierarchy of otherParentHierarchies\">\n <div style=\"margin-top: 1em; padding-left: 1em;\">\n <dl>\n <ng-container *ngFor=\"let other of hierarchy; let i = index\">\n <dt *ngIf=\"other === hierarchy[0]\" class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(other.nameShort)\">\n <b>-</b> [{{ other.nameShort }}] {{ other.name }}\n </dt>\n <dd *ngIf=\"other !== hierarchy[0]\"\n [style.marginLeft.px]=\"i * 8\"\n style=\"margin-top: 0.25em;\">\n <dl>\n <dt class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(other.nameShort)\">\n <b>-</b> [{{ other.nameShort }}] {{ other.name }}\n </dt>\n </dl>\n </dd>\n </ng-container>\n </dl>\n </div>\n </div>\n\n <!-- Subconcepts -->\n <list [array]=\"bokNode.children\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Subconcepts'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- Prerequisites -->\n <list [array]=\"bokNode.prerequisites\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Prerequisites'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- postrequisites -->\n <list [array]=\"bokNode.postrequisites\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Postrequisites'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- Similar concepts -->\n <list [array]=\"bokNode.similarConcepts\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Similar concepts'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- Skills -->\n @if (useBloomSkills) {\n <skillsTree [array]=\"unifiedSkills()\" [headline]=\"'Skills'\"></skillsTree>\n }\n @else {\n <list [array]=\"bokNode.skills\" [propertyname]=\"'description'\" [headline]=\"'Skills'\" [isConcept]=\"false\"></list>\n }\n\n <!-- Contributors -->\n <list [array]=\"bokNode.contributors\" [propertyname]=\"'nameShort'\" [propertyname2]=\"'url'\" \n [headline]=\"'Contributors'\" [isConcept]=\"false\"></list>\n\n <!-- Source Documents -->\n <list [array]=\"bokNode.sourceDocuments\" [propertyname]=\"'nameShort'\" [propertyname2]=\"'url'\" \n [headline]=\"'Source documents'\" [isConcept]=\"false\"></list>\n\n <!-- Versions -->\n <div *ngIf=\"showVersions && bokVersion && currentVersion && versionMap\">\n <versions (bokVersionChange)=\"loadOldBokVersion($event)\" [bokVersion]=\"bokVersion\" [currentVersion]=\"currentVersion\" [bokVersions]=\"versionMap\"></versions>\n </div>\n\n</div>\n ", styles: [".dt-link{color:var(--secondary-color)}.dt-link:hover{color:var(--hover-color)}a{color:var(--secondary-color)}a:hover{color:var(--hover-color)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ListComponent, selector: "list", inputs: ["array", "propertyname", "propertyname2", "headline", "isConcept"], outputs: ["codSelectedChange"] }, { kind: "component", type: VersionsComponent, selector: "versions", inputs: ["currentVersion", "bokVersion", "bokVersions"], outputs: ["bokVersionChange"] }, { kind: "component", type: SkillsTreeComponent, selector: "skillsTree", inputs: ["array", "headline"] }] });
|
|
726
|
-
}
|
|
727
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DescriptionComponent, decorators: [{
|
|
728
|
-
type: Component,
|
|
729
|
-
args: [{ standalone: true, selector: 'description', imports: [CommonModule, ListComponent, VersionsComponent, SkillsTreeComponent], template: "<div>\n <!-- Permalink -->\n <p>\n Permalink: \n <a style=\"text-decoration: none;\" [href]=\"permalink\">{{ permalink }}</a>\n </p>\n\n <!-- Title -->\n <h2 id=\"boktitle\" style=\"margin-bottom: 0px;\">\n [{{ bokNode.nameShort }}] {{ bokNode.name }}\n </h2>\n\n <!-- Status -->\n <div *ngIf=\"statusText\" style=\"margin-bottom: 1em;\">\n {{ statusText }}\n </div>\n\n <!-- Warning for obsolete BoK concept -->\n <p *ngIf=\"isAnObsoleteId && currentVersion\">\n <span style=\"color: var(--danger-color); font-weight: normal;\">\n warning: this is an obsolete BoK concept - this concept is no longer present in \n <a \n style=\"color: var(--danger-color); font-weight: normal; cursor: pointer; text-decoration: underline;\"\n (click)=\"loadOldBokVersion(currentVersion)\">\n the current version of the BoK\n </a>\n </span>\n </p>\n \n <!-- Warning for old version -->\n <p *ngIf=\"isAnOldVersion && !isAnObsoleteId\">\n <span style=\"color: var(--warning-color); font-weight: normal;\">\n warning: this is an old version of this BoK concept; see \"Versioning\" below for more recent version(s)\n </span>\n </p>\n\n <!-- Last Updated -->\n <small *ngIf=\"formattedTimestamp\">{{ formattedTimestamp }}</small>\n \n <!-- Description -->\n <h3>Description:</h3>\n <div id=\"currentDescription\" class=\"hideContent\">\n {{ bokNode.description }}\n </div>\n\n <!-- Superconcepts -->\n <div *ngIf=\"parentHierarchy.length > 0\">\n <h3>Superconcepts [{{ 1 + bokNode.otherParents.length }}]</h3>\n <div style=\"padding-left: 1em;\">\n <dl>\n <ng-container *ngFor=\"let parent of parentHierarchy; let i = index\">\n <dt *ngIf=\"parent === parentHierarchy[0]\" class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(parent.nameShort)\">\n <b>-</b> [{{ parent.nameShort }}] {{ parent.name }}\n </dt>\n <dd *ngIf=\"parent !== parentHierarchy[0]\"\n [style.marginLeft.em]=\"i * 0.8\"\n style=\"margin-top: 0.25em;\">\n <dl>\n <dt class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(parent.nameShort)\">\n <b>-</b> [{{ parent.nameShort }}] {{ parent.name }}\n </dt>\n </dl>\n </dd>\n </ng-container>\n </dl>\n </div>\n </div>\n\n <!-- Other Superconcepts -->\n <div *ngFor=\"let hierarchy of otherParentHierarchies\">\n <div style=\"margin-top: 1em; padding-left: 1em;\">\n <dl>\n <ng-container *ngFor=\"let other of hierarchy; let i = index\">\n <dt *ngIf=\"other === hierarchy[0]\" class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(other.nameShort)\">\n <b>-</b> [{{ other.nameShort }}] {{ other.name }}\n </dt>\n <dd *ngIf=\"other !== hierarchy[0]\"\n [style.marginLeft.px]=\"i * 8\"\n style=\"margin-top: 0.25em;\">\n <dl>\n <dt class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(other.nameShort)\">\n <b>-</b> [{{ other.nameShort }}] {{ other.name }}\n </dt>\n </dl>\n </dd>\n </ng-container>\n </dl>\n </div>\n </div>\n\n <!-- Subconcepts -->\n <list [array]=\"bokNode.children\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Subconcepts'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- Prerequisites -->\n <list [array]=\"bokNode.prerequisites\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Prerequisites'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- postrequisites -->\n <list [array]=\"bokNode.postrequisites\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Postrequisites'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- Similar concepts -->\n <list [array]=\"bokNode.similarConcepts\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Similar concepts'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- Skills -->\n @if (useBloomSkills) {\n <skillsTree [array]=\"unifiedSkills()\" [headline]=\"'Skills'\"></skillsTree>\n }\n @else {\n <list [array]=\"bokNode.skills\" [propertyname]=\"'description'\" [headline]=\"'Skills'\" [isConcept]=\"false\"></list>\n }\n\n <!-- Contributors -->\n <list [array]=\"bokNode.contributors\" [propertyname]=\"'nameShort'\" [propertyname2]=\"'url'\" \n [headline]=\"'Contributors'\" [isConcept]=\"false\"></list>\n\n <!-- Source Documents -->\n <list [array]=\"bokNode.sourceDocuments\" [propertyname]=\"'nameShort'\" [propertyname2]=\"'url'\" \n [headline]=\"'Source documents'\" [isConcept]=\"false\"></list>\n\n <!-- Versions -->\n <div *ngIf=\"showVersions && bokVersion && currentVersion && versionMap\">\n <versions (bokVersionChange)=\"loadOldBokVersion($event)\" [bokVersion]=\"bokVersion\" [currentVersion]=\"currentVersion\" [bokVersions]=\"versionMap\"></versions>\n </div>\n\n</div>\n ", styles: [".dt-link{color:var(--secondary-color)}.dt-link:hover{color:var(--hover-color)}a{color:var(--secondary-color)}a:hover{color:var(--hover-color)}\n"] }]
|
|
730
|
-
}], propDecorators: { bokNode: [{
|
|
731
|
-
type: Input
|
|
732
|
-
}], isAnOldVersion: [{
|
|
733
|
-
type: Input
|
|
734
|
-
}], isAnObsoleteId: [{
|
|
735
|
-
type: Input
|
|
736
|
-
}], showVersions: [{
|
|
737
|
-
type: Input
|
|
738
|
-
}], versionMap: [{
|
|
739
|
-
type: Input
|
|
740
|
-
}], currentVersion: [{
|
|
741
|
-
type: Input
|
|
742
|
-
}], bokVersion: [{
|
|
743
|
-
type: Input
|
|
744
|
-
}], codSelectedChange: [{
|
|
745
|
-
type: Output
|
|
746
|
-
}], bokVersionChange: [{
|
|
747
|
-
type: Output
|
|
748
|
-
}] } });
|
|
749
|
-
|
|
750
|
-
class TruncatePipe {
|
|
751
|
-
transform(value, searchWord, margin) {
|
|
752
|
-
const limitStart = value.toUpperCase().indexOf(searchWord.toUpperCase());
|
|
753
|
-
const truncateString = limitStart > margin;
|
|
754
|
-
if (limitStart >= 0) {
|
|
755
|
-
let newValue = '';
|
|
756
|
-
if (truncateString)
|
|
757
|
-
newValue += '...' + value.substring(limitStart - margin, limitStart);
|
|
758
|
-
else
|
|
759
|
-
newValue += value.substring(0, limitStart);
|
|
760
|
-
newValue += '<b>' + value.substring(limitStart, limitStart + searchWord.length) + '</b>' + value.substring(limitStart + searchWord.length, limitStart + value.length);
|
|
761
|
-
return newValue;
|
|
762
|
-
}
|
|
763
|
-
return value;
|
|
764
|
-
}
|
|
765
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
766
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: TruncatePipe, isStandalone: true, name: "truncate" });
|
|
767
|
-
}
|
|
768
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TruncatePipe, decorators: [{
|
|
769
|
-
type: Pipe,
|
|
677
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokDataService, decorators: [{
|
|
678
|
+
type: Injectable,
|
|
770
679
|
args: [{
|
|
771
|
-
|
|
680
|
+
providedIn: 'root',
|
|
772
681
|
}]
|
|
773
682
|
}] });
|
|
774
683
|
|
|
775
|
-
class SearchResultsComponent {
|
|
776
|
-
nodeSuggestions = [];
|
|
777
|
-
searchValue = '';
|
|
778
|
-
highlightDescription = false;
|
|
779
|
-
codSelectedChange = new EventEmitter();
|
|
780
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SearchResultsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
781
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: SearchResultsComponent, isStandalone: true, selector: "searchResults", inputs: { nodeSuggestions: ["suggestions", "nodeSuggestions"], searchValue: "searchValue", highlightDescription: "highlightDescription" }, outputs: { codSelectedChange: "codSelectedChange" }, ngImport: i0, template: "<p *ngIf=\"nodeSuggestions.length > 0\">{{nodeSuggestions.length}} concepts</p>\n<p-dataview [value]=\"nodeSuggestions\" [rows]=\"8\" [paginator]=\"true\" >\n <ng-template #list let-items>\n <div class=\"h-4rem mt-2 pr-4\" *ngFor=\"let item of items; let first = first\">\n <a (click)=\"codSelectedChange.emit(item.nameShort)\" style=\"font-weight: 400; cursor: pointer;\">\n <div class=\"white-space-nowrap overflow-hidden text-overflow-ellipsis\">\n [{{item.nameShort}}] {{item.name}}\n </div>\n </a>\n <div class=\"mt-1 white-space-nowrap overflow-hidden text-overflow-ellipsis\" style=\"font-size: 0.85em\" \n [innerHTML]=\"highlightDescription ? (item.description | truncate : searchValue : 25) : item.description\"></div>\n </div>\n </ng-template>\n</p-dataview>", styles: ["a{color:var(--secondary-color)}a:hover{color:var(--hover-color)}\n"], dependencies: [{ kind: "component", type: DataView, selector: "p-dataView, p-dataview, p-data-view", inputs: ["paginator", "rows", "totalRecords", "pageLinks", "rowsPerPageOptions", "paginatorPosition", "paginatorStyleClass", "alwaysShowPaginator", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showFirstLastIcon", "showPageLinks", "lazy", "lazyLoadOnInit", "emptyMessage", "style", "styleClass", "gridStyleClass", "trackBy", "filterBy", "filterLocale", "loading", "loadingIcon", "first", "sortField", "sortOrder", "value", "layout"], outputs: ["onLazyLoad", "onPage", "onSort", "onChangeLayout"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "pipe", type: TruncatePipe, name: "truncate" }] });
|
|
782
|
-
}
|
|
783
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SearchResultsComponent, decorators: [{
|
|
784
|
-
type: Component,
|
|
785
|
-
args: [{ standalone: true, selector: 'searchResults', imports: [DataView, CommonModule, ButtonModule, TruncatePipe], template: "<p *ngIf=\"nodeSuggestions.length > 0\">{{nodeSuggestions.length}} concepts</p>\n<p-dataview [value]=\"nodeSuggestions\" [rows]=\"8\" [paginator]=\"true\" >\n <ng-template #list let-items>\n <div class=\"h-4rem mt-2 pr-4\" *ngFor=\"let item of items; let first = first\">\n <a (click)=\"codSelectedChange.emit(item.nameShort)\" style=\"font-weight: 400; cursor: pointer;\">\n <div class=\"white-space-nowrap overflow-hidden text-overflow-ellipsis\">\n [{{item.nameShort}}] {{item.name}}\n </div>\n </a>\n <div class=\"mt-1 white-space-nowrap overflow-hidden text-overflow-ellipsis\" style=\"font-size: 0.85em\" \n [innerHTML]=\"highlightDescription ? (item.description | truncate : searchValue : 25) : item.description\"></div>\n </div>\n </ng-template>\n</p-dataview>", styles: ["a{color:var(--secondary-color)}a:hover{color:var(--hover-color)}\n"] }]
|
|
786
|
-
}], propDecorators: { nodeSuggestions: [{
|
|
787
|
-
type: Input,
|
|
788
|
-
args: [{ alias: 'suggestions' }]
|
|
789
|
-
}], searchValue: [{
|
|
790
|
-
type: Input
|
|
791
|
-
}], highlightDescription: [{
|
|
792
|
-
type: Input
|
|
793
|
-
}], codSelectedChange: [{
|
|
794
|
-
type: Output
|
|
795
|
-
}] } });
|
|
796
|
-
|
|
797
|
-
class SearchComponent {
|
|
798
|
-
breakpointObserver;
|
|
799
|
-
inputValue = '';
|
|
800
|
-
searchBooleans = {
|
|
801
|
-
searchCode: true,
|
|
802
|
-
searchName: true,
|
|
803
|
-
searchDescription: true,
|
|
804
|
-
searchSkills: false,
|
|
805
|
-
};
|
|
806
|
-
nodeSuggestions = [];
|
|
807
|
-
inputValueChange = new EventEmitter();
|
|
808
|
-
searchSettingsChange = new EventEmitter();
|
|
809
|
-
codSelectedChange = new EventEmitter();
|
|
810
|
-
visible = false;
|
|
811
|
-
isMobile = false;
|
|
812
|
-
constructor(breakpointObserver) {
|
|
813
|
-
this.breakpointObserver = breakpointObserver;
|
|
814
|
-
this.breakpointObserver.observe(['(max-width: 992px)'])
|
|
815
|
-
.subscribe(result => {
|
|
816
|
-
this.isMobile = result.matches;
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
ngOnChanges(changes) {
|
|
820
|
-
if (changes['inputValue'] && changes['inputValue'].previousValue != changes['inputValue'].currentValue)
|
|
821
|
-
this.onInputValueChange(changes['inputValue'].currentValue);
|
|
822
|
-
if (changes['searchBooleans'] && changes['searchBooleans'].previousValue != changes['searchBooleans'].currentValue)
|
|
823
|
-
this.updateSearchSettings();
|
|
824
|
-
}
|
|
825
|
-
onInputValueChange(value) {
|
|
826
|
-
this.inputValue = value;
|
|
827
|
-
this.inputValueChange.emit(this.inputValue);
|
|
828
|
-
}
|
|
829
|
-
updateSearchSettings() {
|
|
830
|
-
this.searchSettingsChange.emit(this.searchBooleans);
|
|
831
|
-
}
|
|
832
|
-
onCodSelectedChange(value) {
|
|
833
|
-
this.codSelectedChange.emit(value);
|
|
834
|
-
this.visible = false;
|
|
835
|
-
}
|
|
836
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SearchComponent, deps: [{ token: i1$1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component });
|
|
837
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: SearchComponent, isStandalone: true, selector: "search", inputs: { inputValue: "inputValue", searchBooleans: "searchBooleans", nodeSuggestions: ["suggestions", "nodeSuggestions"] }, outputs: { inputValueChange: "inputValueChange", searchSettingsChange: "searchSettingsChange", codSelectedChange: "codSelectedChange" }, usesOnChanges: true, ngImport: i0, template: "<p-drawer header=\"Search Concepts\" position=\"right\" [(visible)]=\"visible\" [blockScroll]=\"true\" styleClass=\"w-full md:w-25rem xl:w-30rem\">\n <div class=\"flex flex-wrap justify-center align-items-center my-4\">\n <p-floatlabel variant=\"on\">\n <input pInputText id=\"on_label\" [(ngModel)]=\"inputValue\" (ngModelChange)=\"onInputValueChange($event)\" autocomplete=\"off\" class=\"w-19rem custom-input\"/>\n <label for=\"on_label\" class=\"custom-label\">Search</label>\n </p-floatlabel>\n <p-button variant=\"text\" severity=\"secondary\" (click)=\"onInputValueChange('')\" size=\"small\" [rounded]=\"true\" icon=\"pi pi-times\"/>\n </div>\n <div class=\"flex flex-wrap justify-center align-items-center gap-3\">\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchCode\" [(ngModel)]=\"searchBooleans.searchCode\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchCode\" class=\"ml-2\"> Code </label>\n </div>\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchName\" [(ngModel)]=\"searchBooleans.searchName\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchName\" class=\"ml-2\"> Name </label>\n </div>\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchDescription\" [(ngModel)]=\"searchBooleans.searchDescription\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchDescription\" class=\"ml-2\"> Description </label>\n </div>\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchSkills\" [(ngModel)]=\"searchBooleans.searchSkills\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchSkills\" class=\"ml-2\"> Skills </label>\n </div>\n </div>\n <p-divider />\n <searchResults [suggestions]=\"nodeSuggestions\" [searchValue]=\"inputValue\" [highlightDescription]=\"searchBooleans.searchDescription\" (codSelectedChange)=\"onCodSelectedChange($event)\"/>\n</p-drawer>\n<p-button variant=\"text\" (click)=\"visible = true\" icon=\"pi pi-search\" [label]=\"isMobile ? '' : 'Search'\" class=\"absolute m-4 custom-button\" [style.right]=\"'1%'\"/>\n", styles: [".custom-checkbox{--p-checkbox-checked-background: var(--secondary-color);--p-checkbox-checked-border-color: var(--secondary-color);--p-checkbox-checked-hover-background: var(--hover-color);--p-checkbox-checked-hover-border-color: var(--hover-color);--p-checkbox-checked-focus-border-color: var(--secondary-color);--p-checkbox-focus-ring-color: var(--secondary-color)}.custom-input{--p-inputtext-focus-border-color: var(--hover-color)}.custom-label{--p-floatlabel-focus-color: var(--hover-color)}.custom-button{--p-button-text-primary-color: var(--secondary-color);--p-button-text-primary-hover-background: var(--p-button-text-secondary-hover-background);--p-button-text-primary-active-background: var(--p-button-text-secondary-active-background);background-color:#ffffffb7;border-radius:.25rem}.custom-button:hover{--p-button-text-primary-color: var(--hover-color)}\n"], dependencies: [{ kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$1.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "component", type: FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: DrawerModule }, { kind: "component", type: i5.Drawer, selector: "p-drawer", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "closeButtonProps", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen", "header", "maskStyle", "closable"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i6.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: DividerModule }, { kind: "component", type: i7.Divider, selector: "p-divider", inputs: ["style", "styleClass", "layout", "type", "align"] }, { kind: "component", type: SearchResultsComponent, selector: "searchResults", inputs: ["suggestions", "searchValue", "highlightDescription"], outputs: ["codSelectedChange"] }] });
|
|
838
|
-
}
|
|
839
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SearchComponent, decorators: [{
|
|
840
|
-
type: Component,
|
|
841
|
-
args: [{ standalone: true, selector: 'search', imports: [InputTextModule, FloatLabel,
|
|
842
|
-
FormsModule, CheckboxModule,
|
|
843
|
-
DrawerModule, ButtonModule,
|
|
844
|
-
DividerModule, SearchResultsComponent], template: "<p-drawer header=\"Search Concepts\" position=\"right\" [(visible)]=\"visible\" [blockScroll]=\"true\" styleClass=\"w-full md:w-25rem xl:w-30rem\">\n <div class=\"flex flex-wrap justify-center align-items-center my-4\">\n <p-floatlabel variant=\"on\">\n <input pInputText id=\"on_label\" [(ngModel)]=\"inputValue\" (ngModelChange)=\"onInputValueChange($event)\" autocomplete=\"off\" class=\"w-19rem custom-input\"/>\n <label for=\"on_label\" class=\"custom-label\">Search</label>\n </p-floatlabel>\n <p-button variant=\"text\" severity=\"secondary\" (click)=\"onInputValueChange('')\" size=\"small\" [rounded]=\"true\" icon=\"pi pi-times\"/>\n </div>\n <div class=\"flex flex-wrap justify-center align-items-center gap-3\">\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchCode\" [(ngModel)]=\"searchBooleans.searchCode\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchCode\" class=\"ml-2\"> Code </label>\n </div>\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchName\" [(ngModel)]=\"searchBooleans.searchName\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchName\" class=\"ml-2\"> Name </label>\n </div>\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchDescription\" [(ngModel)]=\"searchBooleans.searchDescription\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchDescription\" class=\"ml-2\"> Description </label>\n </div>\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchSkills\" [(ngModel)]=\"searchBooleans.searchSkills\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchSkills\" class=\"ml-2\"> Skills </label>\n </div>\n </div>\n <p-divider />\n <searchResults [suggestions]=\"nodeSuggestions\" [searchValue]=\"inputValue\" [highlightDescription]=\"searchBooleans.searchDescription\" (codSelectedChange)=\"onCodSelectedChange($event)\"/>\n</p-drawer>\n<p-button variant=\"text\" (click)=\"visible = true\" icon=\"pi pi-search\" [label]=\"isMobile ? '' : 'Search'\" class=\"absolute m-4 custom-button\" [style.right]=\"'1%'\"/>\n", styles: [".custom-checkbox{--p-checkbox-checked-background: var(--secondary-color);--p-checkbox-checked-border-color: var(--secondary-color);--p-checkbox-checked-hover-background: var(--hover-color);--p-checkbox-checked-hover-border-color: var(--hover-color);--p-checkbox-checked-focus-border-color: var(--secondary-color);--p-checkbox-focus-ring-color: var(--secondary-color)}.custom-input{--p-inputtext-focus-border-color: var(--hover-color)}.custom-label{--p-floatlabel-focus-color: var(--hover-color)}.custom-button{--p-button-text-primary-color: var(--secondary-color);--p-button-text-primary-hover-background: var(--p-button-text-secondary-hover-background);--p-button-text-primary-active-background: var(--p-button-text-secondary-active-background);background-color:#ffffffb7;border-radius:.25rem}.custom-button:hover{--p-button-text-primary-color: var(--hover-color)}\n"] }]
|
|
845
|
-
}], ctorParameters: () => [{ type: i1$1.BreakpointObserver }], propDecorators: { inputValue: [{
|
|
846
|
-
type: Input
|
|
847
|
-
}], searchBooleans: [{
|
|
848
|
-
type: Input
|
|
849
|
-
}], nodeSuggestions: [{
|
|
850
|
-
type: Input,
|
|
851
|
-
args: [{ alias: 'suggestions' }]
|
|
852
|
-
}], inputValueChange: [{
|
|
853
|
-
type: Output
|
|
854
|
-
}], searchSettingsChange: [{
|
|
855
|
-
type: Output
|
|
856
|
-
}], codSelectedChange: [{
|
|
857
|
-
type: Output
|
|
858
|
-
}] } });
|
|
859
|
-
|
|
860
684
|
const environment = {
|
|
861
685
|
URL_ARRAY: [
|
|
862
686
|
'https://eo4geo-uji-backup.firebaseio.com/',
|
|
@@ -1004,7 +828,7 @@ class BokFirebaseService {
|
|
|
1004
828
|
}
|
|
1005
829
|
}));
|
|
1006
830
|
}
|
|
1007
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokFirebaseService, deps: [{ token: i1$
|
|
831
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokFirebaseService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1008
832
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokFirebaseService, providedIn: 'root' });
|
|
1009
833
|
}
|
|
1010
834
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokFirebaseService, decorators: [{
|
|
@@ -1012,165 +836,470 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1012
836
|
args: [{
|
|
1013
837
|
providedIn: 'root',
|
|
1014
838
|
}]
|
|
1015
|
-
}], ctorParameters: () => [{ type: i1$
|
|
839
|
+
}], ctorParameters: () => [{ type: i1$1.HttpClient }] });
|
|
1016
840
|
|
|
1017
|
-
class
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
PREREQUISITEOF: 'is prerequisite of',
|
|
1028
|
-
};
|
|
1029
|
-
colorhash = {
|
|
1030
|
-
GI: '#cef4ff',
|
|
1031
|
-
IP: '#1f77b4',
|
|
1032
|
-
CF: '#aec7e8',
|
|
1033
|
-
CV: '#ff7f0e',
|
|
1034
|
-
DA: '#ffbb78',
|
|
1035
|
-
DM: '#2ca02c',
|
|
1036
|
-
DN: '#98df8a',
|
|
1037
|
-
PS: '#d62728',
|
|
1038
|
-
GD: '#cc5b59',
|
|
1039
|
-
GS: '#9467bd',
|
|
1040
|
-
AM: '#8c564b',
|
|
1041
|
-
MD: '#8c564b',
|
|
1042
|
-
OI: '#c49c94',
|
|
1043
|
-
GC: '#e377c2',
|
|
1044
|
-
PP: '#f7b6d2',
|
|
1045
|
-
SD: '#7f7f7f',
|
|
1046
|
-
SH: '#c7c7c7',
|
|
1047
|
-
TA: '#bcbd22',
|
|
1048
|
-
WB: '#07561e',
|
|
1049
|
-
GN: '#1ca8dd',
|
|
1050
|
-
SC: '#ffcc00',
|
|
1051
|
-
SA: '#ff9f4a',
|
|
1052
|
-
no: '#17becf',
|
|
1053
|
-
};
|
|
1054
|
-
parsedBokData$ = new BehaviorSubject(undefined);
|
|
1055
|
-
getParsedBokData() {
|
|
1056
|
-
return this.parsedBokData$;
|
|
841
|
+
class BokInformationService {
|
|
842
|
+
bokDataService;
|
|
843
|
+
bokFirebaseService;
|
|
844
|
+
deprecatedConceptsCache = new Map();
|
|
845
|
+
constructor(bokDataService, bokFirebaseService) {
|
|
846
|
+
this.bokDataService = bokDataService;
|
|
847
|
+
this.bokFirebaseService = bokFirebaseService;
|
|
848
|
+
this.bokFirebaseService.getBokVersion('current').subscribe((bok) => {
|
|
849
|
+
this.bokDataService.parseBOKData(bok);
|
|
850
|
+
});
|
|
1057
851
|
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
children: [],
|
|
1071
|
-
classifiedSkills: [],
|
|
1072
|
-
skills: [],
|
|
1073
|
-
sourceDocuments: [],
|
|
1074
|
-
contributors: [],
|
|
1075
|
-
parent: null,
|
|
1076
|
-
otherParents: [],
|
|
1077
|
-
similarConcepts: [],
|
|
1078
|
-
});
|
|
1079
|
-
namehash[bokJSON.concepts[n].code] = newNode.name || '';
|
|
1080
|
-
allNodes.push(newNode);
|
|
1081
|
-
}
|
|
1082
|
-
// Handle relations
|
|
1083
|
-
for (const relation of bokJSON.relations) {
|
|
1084
|
-
const sourceNode = allNodes[relation.source];
|
|
1085
|
-
const targetNode = allNodes[relation.target];
|
|
1086
|
-
if (relation.name === this.Relationtype.SUBCONCEPT) {
|
|
1087
|
-
if (sourceNode.parent) {
|
|
1088
|
-
sourceNode.otherParents.push(targetNode);
|
|
852
|
+
getConceptColor(code) {
|
|
853
|
+
let knowledgeAreaCode = code.slice(0, 2);
|
|
854
|
+
return this.bokDataService.getParsedBokData().pipe(filter((parsedData) => parsedData !== undefined), map((parsedData) => parsedData.colors[knowledgeAreaCode]));
|
|
855
|
+
}
|
|
856
|
+
getConceptName(code) {
|
|
857
|
+
return this.bokDataService.getParsedBokData().pipe(filter((parsedData) => parsedData !== undefined), switchMap((parsedData) => {
|
|
858
|
+
const currentName = parsedData.namehash[code];
|
|
859
|
+
if (currentName)
|
|
860
|
+
return of(currentName);
|
|
861
|
+
return this.getDeprecatedConcept(code).pipe(map((deprecatedConcept) => {
|
|
862
|
+
if (deprecatedConcept) {
|
|
863
|
+
return deprecatedConcept.name;
|
|
1089
864
|
}
|
|
1090
865
|
else {
|
|
1091
|
-
|
|
866
|
+
return 'Unknown Concept';
|
|
1092
867
|
}
|
|
1093
|
-
|
|
868
|
+
}));
|
|
869
|
+
}));
|
|
870
|
+
}
|
|
871
|
+
getDeprecatedConcept(code) {
|
|
872
|
+
if (this.deprecatedConceptsCache.has(code)) {
|
|
873
|
+
return of(this.deprecatedConceptsCache.get(code));
|
|
874
|
+
}
|
|
875
|
+
return this.bokFirebaseService.getDeprecatedConcept(code).pipe(tap((deprecatedConcept) => {
|
|
876
|
+
if (deprecatedConcept) {
|
|
877
|
+
this.deprecatedConceptsCache.set(code, deprecatedConcept);
|
|
1094
878
|
}
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
879
|
+
}));
|
|
880
|
+
}
|
|
881
|
+
getKnowledgeAreas(code) {
|
|
882
|
+
return this.bokDataService.getParsedBokData().pipe(filter((parsedData) => parsedData !== undefined), map((parsedData) => {
|
|
883
|
+
let currentNode = parsedData.conceptNodeCollection.getNodeByNameShort(code);
|
|
884
|
+
if (!currentNode)
|
|
885
|
+
return [];
|
|
886
|
+
if (currentNode?.nameShort == 'GIST')
|
|
887
|
+
return [currentNode.nameShort];
|
|
888
|
+
let knowledgeAreas = new Set();
|
|
889
|
+
return Array.from(this.checkParents(currentNode, knowledgeAreas));
|
|
890
|
+
}));
|
|
891
|
+
}
|
|
892
|
+
getConceptSkills(code) {
|
|
893
|
+
return this.bokDataService.getParsedBokData().pipe(filter((parsedData) => parsedData !== undefined), map((parsedData) => {
|
|
894
|
+
const node = parsedData.conceptNodeCollection.getNodeByNameShort(code);
|
|
895
|
+
const skills = node?.classifiedSkills || [];
|
|
896
|
+
const unclassifiedSkills = node?.skills || [];
|
|
897
|
+
return [...skills, ...unclassifiedSkills.map(value => ({
|
|
898
|
+
name: value.description,
|
|
899
|
+
bloomLevel: 0,
|
|
900
|
+
bloomVerb: ''
|
|
901
|
+
}))];
|
|
902
|
+
}));
|
|
903
|
+
}
|
|
904
|
+
checkParents(node, knowledgeAreas) {
|
|
905
|
+
let superiorNodes = [...node.otherParents];
|
|
906
|
+
if (node.parent)
|
|
907
|
+
superiorNodes.push(node.parent);
|
|
908
|
+
let newKnowledgeAreas = new Set(knowledgeAreas);
|
|
909
|
+
superiorNodes.forEach(superiorNode => {
|
|
910
|
+
if (superiorNode.nameShort == 'GIST') {
|
|
911
|
+
newKnowledgeAreas.add(node.nameShort);
|
|
1098
912
|
}
|
|
1099
|
-
|
|
1100
|
-
|
|
913
|
+
else {
|
|
914
|
+
newKnowledgeAreas = new Set([...newKnowledgeAreas, ...this.checkParents(superiorNode, knowledgeAreas)]);
|
|
1101
915
|
}
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
916
|
+
});
|
|
917
|
+
return newKnowledgeAreas;
|
|
918
|
+
}
|
|
919
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokInformationService, deps: [{ token: BokDataService }, { token: BokFirebaseService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
920
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokInformationService, providedIn: 'root' });
|
|
921
|
+
}
|
|
922
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokInformationService, decorators: [{
|
|
923
|
+
type: Injectable,
|
|
924
|
+
args: [{
|
|
925
|
+
providedIn: 'root',
|
|
926
|
+
}]
|
|
927
|
+
}], ctorParameters: () => [{ type: BokDataService }, { type: BokFirebaseService }] });
|
|
928
|
+
|
|
929
|
+
class SkillsTreeComponent {
|
|
930
|
+
array = [];
|
|
931
|
+
headline = '';
|
|
932
|
+
formattedTree = signal([]);
|
|
933
|
+
bokInfo = inject(BokInformationService);
|
|
934
|
+
ngOnChanges(changes) {
|
|
935
|
+
if (changes['array']) {
|
|
936
|
+
const tempTree = [
|
|
937
|
+
{
|
|
938
|
+
key: '1',
|
|
939
|
+
label: 'Level 1: Remember',
|
|
940
|
+
children: [],
|
|
941
|
+
leaf: false,
|
|
942
|
+
expanded: false,
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
key: '2',
|
|
946
|
+
label: 'Level 2: Understand',
|
|
947
|
+
children: [],
|
|
948
|
+
leaf: false,
|
|
949
|
+
expanded: false,
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
key: '3',
|
|
953
|
+
label: 'Level 3: Apply',
|
|
954
|
+
children: [],
|
|
955
|
+
leaf: false,
|
|
956
|
+
expanded: false,
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
key: '4',
|
|
960
|
+
label: 'Level 4: Analyze',
|
|
961
|
+
children: [],
|
|
962
|
+
leaf: false,
|
|
963
|
+
expanded: false,
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
key: '5',
|
|
967
|
+
label: 'Level 5: Evaluate',
|
|
968
|
+
children: [],
|
|
969
|
+
leaf: false,
|
|
970
|
+
expanded: false,
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
key: '6',
|
|
974
|
+
label: 'Level 6: Create',
|
|
975
|
+
children: [],
|
|
976
|
+
leaf: false,
|
|
977
|
+
expanded: false,
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
key: '0',
|
|
981
|
+
label: 'Unclassified Skills',
|
|
982
|
+
children: [],
|
|
983
|
+
leaf: false,
|
|
984
|
+
expanded: false,
|
|
985
|
+
}
|
|
986
|
+
];
|
|
987
|
+
const newArray = changes['array'].currentValue;
|
|
988
|
+
newArray.forEach(element => {
|
|
989
|
+
const levelNode = tempTree.at(element.bloomLevel - 1);
|
|
990
|
+
if (!levelNode)
|
|
991
|
+
return;
|
|
992
|
+
levelNode.children ??= [];
|
|
993
|
+
levelNode.children.push({
|
|
994
|
+
key: `${element.bloomLevel}-${element.bloomVerb}-${levelNode.children.length}`,
|
|
995
|
+
label: element.name,
|
|
996
|
+
children: [],
|
|
997
|
+
leaf: true,
|
|
998
|
+
expanded: false,
|
|
999
|
+
type: 'leaf',
|
|
1000
|
+
data: element
|
|
1111
1001
|
});
|
|
1112
|
-
}
|
|
1002
|
+
});
|
|
1003
|
+
tempTree.forEach(levelNode => {
|
|
1004
|
+
levelNode.children = this.getSortedArray(levelNode.children ?? []);
|
|
1005
|
+
});
|
|
1006
|
+
this.formattedTree.set(tempTree);
|
|
1113
1007
|
}
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
description: skill.name,
|
|
1119
|
-
nameShort: skill.name,
|
|
1120
|
-
url: skill.name,
|
|
1121
|
-
});
|
|
1122
|
-
}
|
|
1008
|
+
}
|
|
1009
|
+
getSortedArray(values) {
|
|
1010
|
+
if (values.length > 0) {
|
|
1011
|
+
return [...values].sort((a, b) => this.compareStrings(a.label ?? '', b.label ?? ''));
|
|
1123
1012
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1013
|
+
return values;
|
|
1014
|
+
}
|
|
1015
|
+
countChildren(node) {
|
|
1016
|
+
let count = 0;
|
|
1017
|
+
if (node.children && node.children.length > 0) {
|
|
1018
|
+
node.children.forEach(child => count += this.countChildren(child));
|
|
1019
|
+
}
|
|
1020
|
+
else if (node.leaf)
|
|
1021
|
+
count += 1;
|
|
1022
|
+
return count;
|
|
1023
|
+
}
|
|
1024
|
+
compareStrings = (a, b) => {
|
|
1025
|
+
const partsA = a.split('-');
|
|
1026
|
+
const partsB = b.split('-');
|
|
1027
|
+
for (let i = 0; i < Math.max(partsA.length, partsB.length); i++) {
|
|
1028
|
+
const partA = partsA[i];
|
|
1029
|
+
const partB = partsB[i];
|
|
1030
|
+
if (!isNaN(Number(partA)) && !isNaN(Number(partB))) {
|
|
1031
|
+
const numA = parseInt(partA, 10);
|
|
1032
|
+
const numB = parseInt(partB, 10);
|
|
1033
|
+
if (numA !== numB)
|
|
1034
|
+
return numA - numB;
|
|
1035
|
+
}
|
|
1036
|
+
else {
|
|
1037
|
+
const result = (partA || "").localeCompare(partB || "");
|
|
1038
|
+
if (result !== 0)
|
|
1039
|
+
return result;
|
|
1133
1040
|
}
|
|
1134
1041
|
}
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1042
|
+
return 0;
|
|
1043
|
+
};
|
|
1044
|
+
divideSkill(value) {
|
|
1045
|
+
return this.bokInfo.getConceptName(value.concept).pipe(map(conceptName => {
|
|
1046
|
+
const words = value.name.split(' ');
|
|
1047
|
+
const verb = words[0];
|
|
1048
|
+
const conceptIndex = value.name
|
|
1049
|
+
.toLowerCase()
|
|
1050
|
+
.indexOf(conceptName.toLowerCase());
|
|
1051
|
+
const verbIndex = verb.length;
|
|
1052
|
+
const textBeforeConcept = value.name
|
|
1053
|
+
.substring(verbIndex, conceptIndex)
|
|
1054
|
+
.trim();
|
|
1055
|
+
const textAfterConcept = value.name
|
|
1056
|
+
.substring(conceptIndex + conceptName.length)
|
|
1057
|
+
.trim();
|
|
1058
|
+
return [
|
|
1059
|
+
verb,
|
|
1060
|
+
textBeforeConcept,
|
|
1061
|
+
conceptName,
|
|
1062
|
+
textAfterConcept
|
|
1063
|
+
];
|
|
1064
|
+
}));
|
|
1065
|
+
}
|
|
1066
|
+
getBackgroundColor(code) {
|
|
1067
|
+
return this.bokInfo.getConceptColor(code).pipe(take(1), map(color => {
|
|
1068
|
+
if (color) {
|
|
1069
|
+
let hex = color.replace('#', '');
|
|
1070
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
1071
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
1072
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
1073
|
+
return `rgba(${r}, ${g}, ${b}, ${0.5})`;
|
|
1147
1074
|
}
|
|
1075
|
+
return '';
|
|
1076
|
+
}));
|
|
1077
|
+
}
|
|
1078
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SkillsTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1079
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SkillsTreeComponent, isStandalone: true, selector: "skillsTree", inputs: { array: "array", headline: "headline" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"array && array.length > 0\">\n <h3>{{ headline }} [{{ array.length }}]</h3>\n <p-tree [value]=\"formattedTree()\" class=\"w-full custom-tree ml-0\" >\n <ng-template let-node pTemplate=\"leaf\">\n @if(node.data.bloomVerb != '') {\n @if(divideSkill(node.data) | async; as parts) {\n <div [style.display]=\"'list-item'\" [style.list-style-type]=\"'disc'\">\n <b>{{parts[0]}}</b>\n @if(parts[1] != '') {\n <div class=\"inline ml-1\">{{parts[1]}}</div>\n }\n <a class=\"custom-concept-link inline border-round-xl mx-1\" target=\"_blank\" [href]=\"'https://geospacebok.eu/' + node.data.concept\" [style.background]=\"getBackgroundColor(node.data.concept) | async\">\n {{parts[2]}}\n </a>\n {{parts[3]}}\n </div>\n }\n }\n @else {\n <div [style.display]=\"'list-item'\" [style.list-style-type]=\"'disc'\">{{ node.label }}</div>\n }\n </ng-template>\n <ng-template let-node pTemplate=\"default\">\n <a (click)=\"node.expanded = !node.expanded\">{{ node.label }} ({{countChildren(node)}})</a>\n </ng-template>\n </p-tree>\n</div>", styles: [".custom-tree{--p-tree-node-color: var(--primary-color);--p-tree-node-icon-color: var(--primary-color);--p-tree-indent: 2rem;--p-tree-padding: 0rem;--p-tree-gap: 0rem;--p-tree-node-padding: 0rem}::ng-deep .p-tree{padding-bottom:0rem;padding-left:0rem}::ng-deep .p-tree-node-content{margin-top:.25rem}::ng-deep .p-tree-node-content.p-tree-node-selected .p-tree-node-label{font-weight:700}a{cursor:pointer;text-decoration:none;color:var(--secondary-color)}a:hover{color:var(--hover-color)}.custom-concept-link{color:var(--primary-color);text-decoration:none}.custom-concept-link:hover{color:#fff}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TreeModule }, { kind: "component", type: i2.Tree, selector: "p-tree", inputs: ["value", "selectionMode", "loadingMode", "selection", "style", "styleClass", "contextMenu", "draggableScope", "droppableScope", "draggableNodes", "droppableNodes", "metaKeySelection", "propagateSelectionUp", "propagateSelectionDown", "loading", "loadingIcon", "emptyMessage", "ariaLabel", "togglerAriaLabel", "ariaLabelledBy", "validateDrop", "filter", "filterInputAutoFocus", "filterBy", "filterMode", "filterOptions", "filterPlaceholder", "filteredNodes", "filterLocale", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "indentation", "_templateMap", "trackBy", "highlightOnSelect", "virtualNodeHeight"], outputs: ["selectionChange", "onNodeSelect", "onNodeUnselect", "onNodeExpand", "onNodeCollapse", "onNodeContextMenuSelect", "onNodeDoubleClick", "onNodeDrop", "onLazyLoad", "onScroll", "onScrollIndexChange", "onFilter"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }] });
|
|
1080
|
+
}
|
|
1081
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SkillsTreeComponent, decorators: [{
|
|
1082
|
+
type: Component,
|
|
1083
|
+
args: [{ standalone: true, selector: 'skillsTree', imports: [CommonModule, TreeModule], template: "<div *ngIf=\"array && array.length > 0\">\n <h3>{{ headline }} [{{ array.length }}]</h3>\n <p-tree [value]=\"formattedTree()\" class=\"w-full custom-tree ml-0\" >\n <ng-template let-node pTemplate=\"leaf\">\n @if(node.data.bloomVerb != '') {\n @if(divideSkill(node.data) | async; as parts) {\n <div [style.display]=\"'list-item'\" [style.list-style-type]=\"'disc'\">\n <b>{{parts[0]}}</b>\n @if(parts[1] != '') {\n <div class=\"inline ml-1\">{{parts[1]}}</div>\n }\n <a class=\"custom-concept-link inline border-round-xl mx-1\" target=\"_blank\" [href]=\"'https://geospacebok.eu/' + node.data.concept\" [style.background]=\"getBackgroundColor(node.data.concept) | async\">\n {{parts[2]}}\n </a>\n {{parts[3]}}\n </div>\n }\n }\n @else {\n <div [style.display]=\"'list-item'\" [style.list-style-type]=\"'disc'\">{{ node.label }}</div>\n }\n </ng-template>\n <ng-template let-node pTemplate=\"default\">\n <a (click)=\"node.expanded = !node.expanded\">{{ node.label }} ({{countChildren(node)}})</a>\n </ng-template>\n </p-tree>\n</div>", styles: [".custom-tree{--p-tree-node-color: var(--primary-color);--p-tree-node-icon-color: var(--primary-color);--p-tree-indent: 2rem;--p-tree-padding: 0rem;--p-tree-gap: 0rem;--p-tree-node-padding: 0rem}::ng-deep .p-tree{padding-bottom:0rem;padding-left:0rem}::ng-deep .p-tree-node-content{margin-top:.25rem}::ng-deep .p-tree-node-content.p-tree-node-selected .p-tree-node-label{font-weight:700}a{cursor:pointer;text-decoration:none;color:var(--secondary-color)}a:hover{color:var(--hover-color)}.custom-concept-link{color:var(--primary-color);text-decoration:none}.custom-concept-link:hover{color:#fff}\n"] }]
|
|
1084
|
+
}], propDecorators: { array: [{
|
|
1085
|
+
type: Input
|
|
1086
|
+
}], headline: [{
|
|
1087
|
+
type: Input
|
|
1088
|
+
}] } });
|
|
1089
|
+
|
|
1090
|
+
class DescriptionComponent {
|
|
1091
|
+
bokNode = new CustomD3Node();
|
|
1092
|
+
isAnOldVersion = false;
|
|
1093
|
+
isAnObsoleteId = false;
|
|
1094
|
+
showVersions = true;
|
|
1095
|
+
versionMap;
|
|
1096
|
+
currentVersion;
|
|
1097
|
+
bokVersion;
|
|
1098
|
+
codSelectedChange = new EventEmitter();
|
|
1099
|
+
bokVersionChange = new EventEmitter();
|
|
1100
|
+
unifiedSkills = signal([]);
|
|
1101
|
+
ngOnChanges(changes) {
|
|
1102
|
+
if (changes['bokNode']) {
|
|
1103
|
+
const newValue = changes['bokNode'].currentValue;
|
|
1104
|
+
this.unifiedSkills.set([
|
|
1105
|
+
...(newValue.classifiedSkills || []).map(skill => ({
|
|
1106
|
+
name: skill.name,
|
|
1107
|
+
bloomLevel: skill.bloomLevel,
|
|
1108
|
+
bloomVerb: skill.bloomVerb,
|
|
1109
|
+
concept: newValue.nameShort
|
|
1110
|
+
})),
|
|
1111
|
+
...newValue.skills.map(skill => ({
|
|
1112
|
+
name: skill.description,
|
|
1113
|
+
bloomLevel: 0,
|
|
1114
|
+
bloomVerb: '',
|
|
1115
|
+
concept: newValue.nameShort
|
|
1116
|
+
}))
|
|
1117
|
+
]);
|
|
1148
1118
|
}
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1119
|
+
}
|
|
1120
|
+
get permalink() {
|
|
1121
|
+
return `https://geospacebok.eu/${this.bokNode.nameShort}`;
|
|
1122
|
+
}
|
|
1123
|
+
get statusText() {
|
|
1124
|
+
if (this.bokNode.selfAssesment) {
|
|
1125
|
+
return `Status: ${this.removeHtmlTags(this.bokNode.selfAssesment)}`;
|
|
1126
|
+
}
|
|
1127
|
+
return null;
|
|
1128
|
+
}
|
|
1129
|
+
get formattedTimestamp() {
|
|
1130
|
+
if (this.bokNode.timestamp) {
|
|
1131
|
+
return `Last Updated: ${new Date(this.bokNode.timestamp).toUTCString()}`;
|
|
1132
|
+
}
|
|
1133
|
+
return '';
|
|
1134
|
+
}
|
|
1135
|
+
get parentHierarchy() {
|
|
1136
|
+
const parents = [];
|
|
1137
|
+
let p = this.bokNode.parent;
|
|
1138
|
+
while (p) {
|
|
1139
|
+
parents.push(p);
|
|
1140
|
+
p = p.parent;
|
|
1153
1141
|
}
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1142
|
+
return parents.reverse();
|
|
1143
|
+
}
|
|
1144
|
+
get otherParentHierarchies() {
|
|
1145
|
+
return this.bokNode.otherParents.map((op) => {
|
|
1146
|
+
const hierarchy = [];
|
|
1147
|
+
while (op) {
|
|
1148
|
+
hierarchy.push(op);
|
|
1149
|
+
op = op.parent;
|
|
1150
|
+
}
|
|
1151
|
+
return hierarchy.reverse();
|
|
1160
1152
|
});
|
|
1161
|
-
this.parsedBokData$.next(parsedData);
|
|
1162
|
-
return parsedData;
|
|
1163
1153
|
}
|
|
1164
|
-
|
|
1165
|
-
|
|
1154
|
+
browseToConcept(nameShort) {
|
|
1155
|
+
this.codSelectedChange.emit(nameShort);
|
|
1156
|
+
}
|
|
1157
|
+
loadOldBokVersion(version) {
|
|
1158
|
+
this.bokVersion = version;
|
|
1159
|
+
this.bokVersionChange.emit(version);
|
|
1160
|
+
}
|
|
1161
|
+
removeHtmlTags(text) {
|
|
1162
|
+
return text.replace(/<\/?[^>]+(>|$)/g, "");
|
|
1163
|
+
}
|
|
1164
|
+
get useBloomSkills() {
|
|
1165
|
+
return parseInt(this.bokVersion?.slice(1) ?? '') >= 11;
|
|
1166
|
+
}
|
|
1167
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DescriptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1168
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DescriptionComponent, isStandalone: true, selector: "description", inputs: { bokNode: "bokNode", isAnOldVersion: "isAnOldVersion", isAnObsoleteId: "isAnObsoleteId", showVersions: "showVersions", versionMap: "versionMap", currentVersion: "currentVersion", bokVersion: "bokVersion" }, outputs: { codSelectedChange: "codSelectedChange", bokVersionChange: "bokVersionChange" }, usesOnChanges: true, ngImport: i0, template: "<div>\n <!-- Permalink -->\n <p>\n Permalink: \n <a style=\"text-decoration: none;\" [href]=\"permalink\">{{ permalink }}</a>\n </p>\n\n <!-- Title -->\n <h2 id=\"boktitle\" style=\"margin-bottom: 0px;\">\n [{{ bokNode.nameShort }}] {{ bokNode.name }}\n </h2>\n\n <!-- Status -->\n <div *ngIf=\"statusText\" style=\"margin-bottom: 1em;\">\n {{ statusText }}\n </div>\n\n <!-- Warning for obsolete BoK concept -->\n <p *ngIf=\"isAnObsoleteId && currentVersion\">\n <span style=\"color: var(--danger-color); font-weight: normal;\">\n warning: this is an obsolete BoK concept - this concept is no longer present in \n <a \n style=\"color: var(--danger-color); font-weight: normal; cursor: pointer; text-decoration: underline;\"\n (click)=\"loadOldBokVersion(currentVersion)\">\n the current version of the BoK\n </a>\n </span>\n </p>\n \n <!-- Warning for old version -->\n <p *ngIf=\"isAnOldVersion && !isAnObsoleteId\">\n <span style=\"color: var(--warning-color); font-weight: normal;\">\n warning: this is an old version of this BoK concept; see \"Versioning\" below for more recent version(s)\n </span>\n </p>\n\n <!-- Last Updated -->\n <small *ngIf=\"formattedTimestamp\">{{ formattedTimestamp }}</small>\n \n <!-- Description -->\n <h3>Description:</h3>\n <div id=\"currentDescription\" class=\"hideContent\">\n {{ bokNode.description }}\n </div>\n\n <!-- Superconcepts -->\n <div *ngIf=\"parentHierarchy.length > 0\">\n <h3>Superconcepts [{{ 1 + bokNode.otherParents.length }}]</h3>\n <div style=\"padding-left: 1em;\">\n <dl>\n <ng-container *ngFor=\"let parent of parentHierarchy; let i = index\">\n <dt *ngIf=\"parent === parentHierarchy[0]\" class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(parent.nameShort)\">\n <b>-</b> [{{ parent.nameShort }}] {{ parent.name }}\n </dt>\n <dd *ngIf=\"parent !== parentHierarchy[0]\"\n [style.marginLeft.em]=\"i * 0.8\"\n style=\"margin-top: 0.25em;\">\n <dl>\n <dt class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(parent.nameShort)\">\n <b>-</b> [{{ parent.nameShort }}] {{ parent.name }}\n </dt>\n </dl>\n </dd>\n </ng-container>\n </dl>\n </div>\n </div>\n\n <!-- Other Superconcepts -->\n <div *ngFor=\"let hierarchy of otherParentHierarchies\">\n <div style=\"margin-top: 1em; padding-left: 1em;\">\n <dl>\n <ng-container *ngFor=\"let other of hierarchy; let i = index\">\n <dt *ngIf=\"other === hierarchy[0]\" class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(other.nameShort)\">\n <b>-</b> [{{ other.nameShort }}] {{ other.name }}\n </dt>\n <dd *ngIf=\"other !== hierarchy[0]\"\n [style.marginLeft.px]=\"i * 8\"\n style=\"margin-top: 0.25em;\">\n <dl>\n <dt class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(other.nameShort)\">\n <b>-</b> [{{ other.nameShort }}] {{ other.name }}\n </dt>\n </dl>\n </dd>\n </ng-container>\n </dl>\n </div>\n </div>\n\n <!-- Subconcepts -->\n <list [array]=\"bokNode.children\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Subconcepts'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- Prerequisites -->\n <list [array]=\"bokNode.prerequisites\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Prerequisites'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- postrequisites -->\n <list [array]=\"bokNode.postrequisites\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Postrequisites'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- Similar concepts -->\n <list [array]=\"bokNode.similarConcepts\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Similar concepts'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- Skills -->\n @if (useBloomSkills) {\n <skillsTree [array]=\"unifiedSkills()\" [headline]=\"'Skills'\"></skillsTree>\n }\n @else {\n <list [array]=\"bokNode.skills\" [propertyname]=\"'description'\" [headline]=\"'Skills'\" [isConcept]=\"false\"></list>\n }\n\n <!-- Contributors -->\n <list [array]=\"bokNode.contributors\" [propertyname]=\"'nameShort'\" [propertyname2]=\"'url'\" \n [headline]=\"'Contributors'\" [isConcept]=\"false\"></list>\n\n <!-- Source Documents -->\n <list [array]=\"bokNode.sourceDocuments\" [propertyname]=\"'nameShort'\" [propertyname2]=\"'url'\" \n [headline]=\"'Source documents'\" [isConcept]=\"false\"></list>\n\n <!-- Versions -->\n <div *ngIf=\"showVersions && bokVersion && currentVersion && versionMap\">\n <versions (bokVersionChange)=\"loadOldBokVersion($event)\" [bokVersion]=\"bokVersion\" [currentVersion]=\"currentVersion\" [bokVersions]=\"versionMap\"></versions>\n </div>\n\n</div>\n ", styles: [".dt-link{color:var(--secondary-color)}.dt-link:hover{color:var(--hover-color)}a{color:var(--secondary-color)}a:hover{color:var(--hover-color)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ListComponent, selector: "list", inputs: ["array", "propertyname", "propertyname2", "headline", "isConcept"], outputs: ["codSelectedChange"] }, { kind: "component", type: VersionsComponent, selector: "versions", inputs: ["currentVersion", "bokVersion", "bokVersions"], outputs: ["bokVersionChange"] }, { kind: "component", type: SkillsTreeComponent, selector: "skillsTree", inputs: ["array", "headline"] }] });
|
|
1166
1169
|
}
|
|
1167
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type:
|
|
1168
|
-
type:
|
|
1170
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DescriptionComponent, decorators: [{
|
|
1171
|
+
type: Component,
|
|
1172
|
+
args: [{ standalone: true, selector: 'description', imports: [CommonModule, ListComponent, VersionsComponent, SkillsTreeComponent], template: "<div>\n <!-- Permalink -->\n <p>\n Permalink: \n <a style=\"text-decoration: none;\" [href]=\"permalink\">{{ permalink }}</a>\n </p>\n\n <!-- Title -->\n <h2 id=\"boktitle\" style=\"margin-bottom: 0px;\">\n [{{ bokNode.nameShort }}] {{ bokNode.name }}\n </h2>\n\n <!-- Status -->\n <div *ngIf=\"statusText\" style=\"margin-bottom: 1em;\">\n {{ statusText }}\n </div>\n\n <!-- Warning for obsolete BoK concept -->\n <p *ngIf=\"isAnObsoleteId && currentVersion\">\n <span style=\"color: var(--danger-color); font-weight: normal;\">\n warning: this is an obsolete BoK concept - this concept is no longer present in \n <a \n style=\"color: var(--danger-color); font-weight: normal; cursor: pointer; text-decoration: underline;\"\n (click)=\"loadOldBokVersion(currentVersion)\">\n the current version of the BoK\n </a>\n </span>\n </p>\n \n <!-- Warning for old version -->\n <p *ngIf=\"isAnOldVersion && !isAnObsoleteId\">\n <span style=\"color: var(--warning-color); font-weight: normal;\">\n warning: this is an old version of this BoK concept; see \"Versioning\" below for more recent version(s)\n </span>\n </p>\n\n <!-- Last Updated -->\n <small *ngIf=\"formattedTimestamp\">{{ formattedTimestamp }}</small>\n \n <!-- Description -->\n <h3>Description:</h3>\n <div id=\"currentDescription\" class=\"hideContent\">\n {{ bokNode.description }}\n </div>\n\n <!-- Superconcepts -->\n <div *ngIf=\"parentHierarchy.length > 0\">\n <h3>Superconcepts [{{ 1 + bokNode.otherParents.length }}]</h3>\n <div style=\"padding-left: 1em;\">\n <dl>\n <ng-container *ngFor=\"let parent of parentHierarchy; let i = index\">\n <dt *ngIf=\"parent === parentHierarchy[0]\" class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(parent.nameShort)\">\n <b>-</b> [{{ parent.nameShort }}] {{ parent.name }}\n </dt>\n <dd *ngIf=\"parent !== parentHierarchy[0]\"\n [style.marginLeft.em]=\"i * 0.8\"\n style=\"margin-top: 0.25em;\">\n <dl>\n <dt class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(parent.nameShort)\">\n <b>-</b> [{{ parent.nameShort }}] {{ parent.name }}\n </dt>\n </dl>\n </dd>\n </ng-container>\n </dl>\n </div>\n </div>\n\n <!-- Other Superconcepts -->\n <div *ngFor=\"let hierarchy of otherParentHierarchies\">\n <div style=\"margin-top: 1em; padding-left: 1em;\">\n <dl>\n <ng-container *ngFor=\"let other of hierarchy; let i = index\">\n <dt *ngIf=\"other === hierarchy[0]\" class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(other.nameShort)\">\n <b>-</b> [{{ other.nameShort }}] {{ other.name }}\n </dt>\n <dd *ngIf=\"other !== hierarchy[0]\"\n [style.marginLeft.px]=\"i * 8\"\n style=\"margin-top: 0.25em;\">\n <dl>\n <dt class=\"concept-name dt-link\" \n style=\"font-weight: 400; cursor: pointer;\"\n (click)=\"browseToConcept(other.nameShort)\">\n <b>-</b> [{{ other.nameShort }}] {{ other.name }}\n </dt>\n </dl>\n </dd>\n </ng-container>\n </dl>\n </div>\n </div>\n\n <!-- Subconcepts -->\n <list [array]=\"bokNode.children\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Subconcepts'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- Prerequisites -->\n <list [array]=\"bokNode.prerequisites\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Prerequisites'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- postrequisites -->\n <list [array]=\"bokNode.postrequisites\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Postrequisites'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- Similar concepts -->\n <list [array]=\"bokNode.similarConcepts\" [propertyname]=\"'name'\" [propertyname2]=\"'nameShort'\" \n [headline]=\"'Similar concepts'\" [isConcept]=\"true\" (codSelectedChange)=\"browseToConcept($event)\"></list>\n\n <!-- Skills -->\n @if (useBloomSkills) {\n <skillsTree [array]=\"unifiedSkills()\" [headline]=\"'Skills'\"></skillsTree>\n }\n @else {\n <list [array]=\"bokNode.skills\" [propertyname]=\"'description'\" [headline]=\"'Skills'\" [isConcept]=\"false\"></list>\n }\n\n <!-- Contributors -->\n <list [array]=\"bokNode.contributors\" [propertyname]=\"'nameShort'\" [propertyname2]=\"'url'\" \n [headline]=\"'Contributors'\" [isConcept]=\"false\"></list>\n\n <!-- Source Documents -->\n <list [array]=\"bokNode.sourceDocuments\" [propertyname]=\"'nameShort'\" [propertyname2]=\"'url'\" \n [headline]=\"'Source documents'\" [isConcept]=\"false\"></list>\n\n <!-- Versions -->\n <div *ngIf=\"showVersions && bokVersion && currentVersion && versionMap\">\n <versions (bokVersionChange)=\"loadOldBokVersion($event)\" [bokVersion]=\"bokVersion\" [currentVersion]=\"currentVersion\" [bokVersions]=\"versionMap\"></versions>\n </div>\n\n</div>\n ", styles: [".dt-link{color:var(--secondary-color)}.dt-link:hover{color:var(--hover-color)}a{color:var(--secondary-color)}a:hover{color:var(--hover-color)}\n"] }]
|
|
1173
|
+
}], propDecorators: { bokNode: [{
|
|
1174
|
+
type: Input
|
|
1175
|
+
}], isAnOldVersion: [{
|
|
1176
|
+
type: Input
|
|
1177
|
+
}], isAnObsoleteId: [{
|
|
1178
|
+
type: Input
|
|
1179
|
+
}], showVersions: [{
|
|
1180
|
+
type: Input
|
|
1181
|
+
}], versionMap: [{
|
|
1182
|
+
type: Input
|
|
1183
|
+
}], currentVersion: [{
|
|
1184
|
+
type: Input
|
|
1185
|
+
}], bokVersion: [{
|
|
1186
|
+
type: Input
|
|
1187
|
+
}], codSelectedChange: [{
|
|
1188
|
+
type: Output
|
|
1189
|
+
}], bokVersionChange: [{
|
|
1190
|
+
type: Output
|
|
1191
|
+
}] } });
|
|
1192
|
+
|
|
1193
|
+
class TruncatePipe {
|
|
1194
|
+
transform(value, searchWord, margin) {
|
|
1195
|
+
const limitStart = value.toUpperCase().indexOf(searchWord.toUpperCase());
|
|
1196
|
+
const truncateString = limitStart > margin;
|
|
1197
|
+
if (limitStart >= 0) {
|
|
1198
|
+
let newValue = '';
|
|
1199
|
+
if (truncateString)
|
|
1200
|
+
newValue += '...' + value.substring(limitStart - margin, limitStart);
|
|
1201
|
+
else
|
|
1202
|
+
newValue += value.substring(0, limitStart);
|
|
1203
|
+
newValue += '<b>' + value.substring(limitStart, limitStart + searchWord.length) + '</b>' + value.substring(limitStart + searchWord.length, limitStart + value.length);
|
|
1204
|
+
return newValue;
|
|
1205
|
+
}
|
|
1206
|
+
return value;
|
|
1207
|
+
}
|
|
1208
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1209
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: TruncatePipe, isStandalone: true, name: "truncate" });
|
|
1210
|
+
}
|
|
1211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TruncatePipe, decorators: [{
|
|
1212
|
+
type: Pipe,
|
|
1169
1213
|
args: [{
|
|
1170
|
-
|
|
1214
|
+
name: 'truncate'
|
|
1171
1215
|
}]
|
|
1172
1216
|
}] });
|
|
1173
1217
|
|
|
1218
|
+
class SearchResultsComponent {
|
|
1219
|
+
nodeSuggestions = [];
|
|
1220
|
+
searchValue = '';
|
|
1221
|
+
highlightDescription = false;
|
|
1222
|
+
codSelectedChange = new EventEmitter();
|
|
1223
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SearchResultsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1224
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: SearchResultsComponent, isStandalone: true, selector: "searchResults", inputs: { nodeSuggestions: ["suggestions", "nodeSuggestions"], searchValue: "searchValue", highlightDescription: "highlightDescription" }, outputs: { codSelectedChange: "codSelectedChange" }, ngImport: i0, template: "<p *ngIf=\"nodeSuggestions.length > 0\">{{nodeSuggestions.length}} concepts</p>\n<p-dataview [value]=\"nodeSuggestions\" [rows]=\"8\" [paginator]=\"true\" >\n <ng-template #list let-items>\n <div class=\"h-4rem mt-2 pr-4\" *ngFor=\"let item of items; let first = first\">\n <a (click)=\"codSelectedChange.emit(item.nameShort)\" style=\"font-weight: 400; cursor: pointer;\">\n <div class=\"white-space-nowrap overflow-hidden text-overflow-ellipsis\">\n [{{item.nameShort}}] {{item.name}}\n </div>\n </a>\n <div class=\"mt-1 white-space-nowrap overflow-hidden text-overflow-ellipsis\" style=\"font-size: 0.85em\" \n [innerHTML]=\"highlightDescription ? (item.description | truncate : searchValue : 25) : item.description\"></div>\n </div>\n </ng-template>\n</p-dataview>", styles: ["a{color:var(--secondary-color)}a:hover{color:var(--hover-color)}\n"], dependencies: [{ kind: "component", type: DataView, selector: "p-dataView, p-dataview, p-data-view", inputs: ["paginator", "rows", "totalRecords", "pageLinks", "rowsPerPageOptions", "paginatorPosition", "paginatorStyleClass", "alwaysShowPaginator", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showFirstLastIcon", "showPageLinks", "lazy", "lazyLoadOnInit", "emptyMessage", "style", "styleClass", "gridStyleClass", "trackBy", "filterBy", "filterLocale", "loading", "loadingIcon", "first", "sortField", "sortOrder", "value", "layout"], outputs: ["onLazyLoad", "onPage", "onSort", "onChangeLayout"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "pipe", type: TruncatePipe, name: "truncate" }] });
|
|
1225
|
+
}
|
|
1226
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SearchResultsComponent, decorators: [{
|
|
1227
|
+
type: Component,
|
|
1228
|
+
args: [{ standalone: true, selector: 'searchResults', imports: [DataView, CommonModule, ButtonModule, TruncatePipe], template: "<p *ngIf=\"nodeSuggestions.length > 0\">{{nodeSuggestions.length}} concepts</p>\n<p-dataview [value]=\"nodeSuggestions\" [rows]=\"8\" [paginator]=\"true\" >\n <ng-template #list let-items>\n <div class=\"h-4rem mt-2 pr-4\" *ngFor=\"let item of items; let first = first\">\n <a (click)=\"codSelectedChange.emit(item.nameShort)\" style=\"font-weight: 400; cursor: pointer;\">\n <div class=\"white-space-nowrap overflow-hidden text-overflow-ellipsis\">\n [{{item.nameShort}}] {{item.name}}\n </div>\n </a>\n <div class=\"mt-1 white-space-nowrap overflow-hidden text-overflow-ellipsis\" style=\"font-size: 0.85em\" \n [innerHTML]=\"highlightDescription ? (item.description | truncate : searchValue : 25) : item.description\"></div>\n </div>\n </ng-template>\n</p-dataview>", styles: ["a{color:var(--secondary-color)}a:hover{color:var(--hover-color)}\n"] }]
|
|
1229
|
+
}], propDecorators: { nodeSuggestions: [{
|
|
1230
|
+
type: Input,
|
|
1231
|
+
args: [{ alias: 'suggestions' }]
|
|
1232
|
+
}], searchValue: [{
|
|
1233
|
+
type: Input
|
|
1234
|
+
}], highlightDescription: [{
|
|
1235
|
+
type: Input
|
|
1236
|
+
}], codSelectedChange: [{
|
|
1237
|
+
type: Output
|
|
1238
|
+
}] } });
|
|
1239
|
+
|
|
1240
|
+
class SearchComponent {
|
|
1241
|
+
breakpointObserver;
|
|
1242
|
+
inputValue = '';
|
|
1243
|
+
searchBooleans = {
|
|
1244
|
+
searchCode: true,
|
|
1245
|
+
searchName: true,
|
|
1246
|
+
searchDescription: true,
|
|
1247
|
+
searchSkills: false,
|
|
1248
|
+
};
|
|
1249
|
+
nodeSuggestions = [];
|
|
1250
|
+
inputValueChange = new EventEmitter();
|
|
1251
|
+
searchSettingsChange = new EventEmitter();
|
|
1252
|
+
codSelectedChange = new EventEmitter();
|
|
1253
|
+
visible = false;
|
|
1254
|
+
isMobile = false;
|
|
1255
|
+
constructor(breakpointObserver) {
|
|
1256
|
+
this.breakpointObserver = breakpointObserver;
|
|
1257
|
+
this.breakpointObserver.observe(['(max-width: 992px)'])
|
|
1258
|
+
.subscribe(result => {
|
|
1259
|
+
this.isMobile = result.matches;
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
ngOnChanges(changes) {
|
|
1263
|
+
if (changes['inputValue'] && changes['inputValue'].previousValue != changes['inputValue'].currentValue)
|
|
1264
|
+
this.onInputValueChange(changes['inputValue'].currentValue);
|
|
1265
|
+
if (changes['searchBooleans'] && changes['searchBooleans'].previousValue != changes['searchBooleans'].currentValue)
|
|
1266
|
+
this.updateSearchSettings();
|
|
1267
|
+
}
|
|
1268
|
+
onInputValueChange(value) {
|
|
1269
|
+
this.inputValue = value;
|
|
1270
|
+
this.inputValueChange.emit(this.inputValue);
|
|
1271
|
+
}
|
|
1272
|
+
updateSearchSettings() {
|
|
1273
|
+
this.searchSettingsChange.emit(this.searchBooleans);
|
|
1274
|
+
}
|
|
1275
|
+
onCodSelectedChange(value) {
|
|
1276
|
+
this.codSelectedChange.emit(value);
|
|
1277
|
+
this.visible = false;
|
|
1278
|
+
}
|
|
1279
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SearchComponent, deps: [{ token: i1$2.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component });
|
|
1280
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: SearchComponent, isStandalone: true, selector: "search", inputs: { inputValue: "inputValue", searchBooleans: "searchBooleans", nodeSuggestions: ["suggestions", "nodeSuggestions"] }, outputs: { inputValueChange: "inputValueChange", searchSettingsChange: "searchSettingsChange", codSelectedChange: "codSelectedChange" }, usesOnChanges: true, ngImport: i0, template: "<p-drawer header=\"Search Concepts\" position=\"right\" [(visible)]=\"visible\" [blockScroll]=\"true\" styleClass=\"w-full md:w-25rem xl:w-30rem\">\n <div class=\"flex flex-wrap justify-center align-items-center my-4\">\n <p-floatlabel variant=\"on\">\n <input pInputText id=\"on_label\" [(ngModel)]=\"inputValue\" (ngModelChange)=\"onInputValueChange($event)\" autocomplete=\"off\" class=\"w-19rem custom-input\"/>\n <label for=\"on_label\" class=\"custom-label\">Search</label>\n </p-floatlabel>\n <p-button variant=\"text\" severity=\"secondary\" (click)=\"onInputValueChange('')\" size=\"small\" [rounded]=\"true\" icon=\"pi pi-times\"/>\n </div>\n <div class=\"flex flex-wrap justify-center align-items-center gap-3\">\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchCode\" [(ngModel)]=\"searchBooleans.searchCode\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchCode\" class=\"ml-2\"> Code </label>\n </div>\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchName\" [(ngModel)]=\"searchBooleans.searchName\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchName\" class=\"ml-2\"> Name </label>\n </div>\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchDescription\" [(ngModel)]=\"searchBooleans.searchDescription\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchDescription\" class=\"ml-2\"> Description </label>\n </div>\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchSkills\" [(ngModel)]=\"searchBooleans.searchSkills\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchSkills\" class=\"ml-2\"> Skills </label>\n </div>\n </div>\n <p-divider />\n <searchResults [suggestions]=\"nodeSuggestions\" [searchValue]=\"inputValue\" [highlightDescription]=\"searchBooleans.searchDescription\" (codSelectedChange)=\"onCodSelectedChange($event)\"/>\n</p-drawer>\n<p-button variant=\"text\" (click)=\"visible = true\" icon=\"pi pi-search\" [label]=\"isMobile ? '' : 'Search'\" class=\"absolute m-4 custom-button\" [style.right]=\"'1%'\"/>\n", styles: [".custom-checkbox{--p-checkbox-checked-background: var(--secondary-color);--p-checkbox-checked-border-color: var(--secondary-color);--p-checkbox-checked-hover-background: var(--hover-color);--p-checkbox-checked-hover-border-color: var(--hover-color);--p-checkbox-checked-focus-border-color: var(--secondary-color);--p-checkbox-focus-ring-color: var(--secondary-color)}.custom-input{--p-inputtext-focus-border-color: var(--hover-color)}.custom-label{--p-floatlabel-focus-color: var(--hover-color)}.custom-button{--p-button-text-primary-color: var(--secondary-color);--p-button-text-primary-hover-background: var(--p-button-text-secondary-hover-background);--p-button-text-primary-active-background: var(--p-button-text-secondary-active-background);background-color:#ffffffb7;border-radius:.25rem}.custom-button:hover{--p-button-text-primary-color: var(--hover-color)}\n"], dependencies: [{ kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$1.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "component", type: FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: DrawerModule }, { kind: "component", type: i5.Drawer, selector: "p-drawer", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "closeButtonProps", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen", "header", "maskStyle", "closable"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i6.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: DividerModule }, { kind: "component", type: i7.Divider, selector: "p-divider", inputs: ["style", "styleClass", "layout", "type", "align"] }, { kind: "component", type: SearchResultsComponent, selector: "searchResults", inputs: ["suggestions", "searchValue", "highlightDescription"], outputs: ["codSelectedChange"] }] });
|
|
1281
|
+
}
|
|
1282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SearchComponent, decorators: [{
|
|
1283
|
+
type: Component,
|
|
1284
|
+
args: [{ standalone: true, selector: 'search', imports: [InputTextModule, FloatLabel,
|
|
1285
|
+
FormsModule, CheckboxModule,
|
|
1286
|
+
DrawerModule, ButtonModule,
|
|
1287
|
+
DividerModule, SearchResultsComponent], template: "<p-drawer header=\"Search Concepts\" position=\"right\" [(visible)]=\"visible\" [blockScroll]=\"true\" styleClass=\"w-full md:w-25rem xl:w-30rem\">\n <div class=\"flex flex-wrap justify-center align-items-center my-4\">\n <p-floatlabel variant=\"on\">\n <input pInputText id=\"on_label\" [(ngModel)]=\"inputValue\" (ngModelChange)=\"onInputValueChange($event)\" autocomplete=\"off\" class=\"w-19rem custom-input\"/>\n <label for=\"on_label\" class=\"custom-label\">Search</label>\n </p-floatlabel>\n <p-button variant=\"text\" severity=\"secondary\" (click)=\"onInputValueChange('')\" size=\"small\" [rounded]=\"true\" icon=\"pi pi-times\"/>\n </div>\n <div class=\"flex flex-wrap justify-center align-items-center gap-3\">\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchCode\" [(ngModel)]=\"searchBooleans.searchCode\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchCode\" class=\"ml-2\"> Code </label>\n </div>\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchName\" [(ngModel)]=\"searchBooleans.searchName\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchName\" class=\"ml-2\"> Name </label>\n </div>\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchDescription\" [(ngModel)]=\"searchBooleans.searchDescription\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchDescription\" class=\"ml-2\"> Description </label>\n </div>\n <div class=\"flex items-center\">\n <p-checkbox inputId=\"searchSkills\" [(ngModel)]=\"searchBooleans.searchSkills\" (ngModelChange)=\"updateSearchSettings()\" [binary]=\"true\" class=\"custom-checkbox\"/>\n <label for=\"searchSkills\" class=\"ml-2\"> Skills </label>\n </div>\n </div>\n <p-divider />\n <searchResults [suggestions]=\"nodeSuggestions\" [searchValue]=\"inputValue\" [highlightDescription]=\"searchBooleans.searchDescription\" (codSelectedChange)=\"onCodSelectedChange($event)\"/>\n</p-drawer>\n<p-button variant=\"text\" (click)=\"visible = true\" icon=\"pi pi-search\" [label]=\"isMobile ? '' : 'Search'\" class=\"absolute m-4 custom-button\" [style.right]=\"'1%'\"/>\n", styles: [".custom-checkbox{--p-checkbox-checked-background: var(--secondary-color);--p-checkbox-checked-border-color: var(--secondary-color);--p-checkbox-checked-hover-background: var(--hover-color);--p-checkbox-checked-hover-border-color: var(--hover-color);--p-checkbox-checked-focus-border-color: var(--secondary-color);--p-checkbox-focus-ring-color: var(--secondary-color)}.custom-input{--p-inputtext-focus-border-color: var(--hover-color)}.custom-label{--p-floatlabel-focus-color: var(--hover-color)}.custom-button{--p-button-text-primary-color: var(--secondary-color);--p-button-text-primary-hover-background: var(--p-button-text-secondary-hover-background);--p-button-text-primary-active-background: var(--p-button-text-secondary-active-background);background-color:#ffffffb7;border-radius:.25rem}.custom-button:hover{--p-button-text-primary-color: var(--hover-color)}\n"] }]
|
|
1288
|
+
}], ctorParameters: () => [{ type: i1$2.BreakpointObserver }], propDecorators: { inputValue: [{
|
|
1289
|
+
type: Input
|
|
1290
|
+
}], searchBooleans: [{
|
|
1291
|
+
type: Input
|
|
1292
|
+
}], nodeSuggestions: [{
|
|
1293
|
+
type: Input,
|
|
1294
|
+
args: [{ alias: 'suggestions' }]
|
|
1295
|
+
}], inputValueChange: [{
|
|
1296
|
+
type: Output
|
|
1297
|
+
}], searchSettingsChange: [{
|
|
1298
|
+
type: Output
|
|
1299
|
+
}], codSelectedChange: [{
|
|
1300
|
+
type: Output
|
|
1301
|
+
}] } });
|
|
1302
|
+
|
|
1174
1303
|
class BokComponent {
|
|
1175
1304
|
bokFirebaseService;
|
|
1176
1305
|
bokDataService;
|
|
@@ -1329,94 +1458,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1329
1458
|
args: ['selectedConceptChange']
|
|
1330
1459
|
}] } });
|
|
1331
1460
|
|
|
1332
|
-
class BokInformationService {
|
|
1333
|
-
bokDataService;
|
|
1334
|
-
bokFirebaseService;
|
|
1335
|
-
deprecatedConceptsCache = new Map();
|
|
1336
|
-
constructor(bokDataService, bokFirebaseService) {
|
|
1337
|
-
this.bokDataService = bokDataService;
|
|
1338
|
-
this.bokFirebaseService = bokFirebaseService;
|
|
1339
|
-
this.bokFirebaseService.getBokVersion('current').subscribe((bok) => {
|
|
1340
|
-
this.bokDataService.parseBOKData(bok);
|
|
1341
|
-
});
|
|
1342
|
-
}
|
|
1343
|
-
getConceptColor(code) {
|
|
1344
|
-
let knowledgeAreaCode = code.slice(0, 2);
|
|
1345
|
-
return this.bokDataService.getParsedBokData().pipe(filter((parsedData) => parsedData !== undefined), map((parsedData) => parsedData.colors[knowledgeAreaCode]));
|
|
1346
|
-
}
|
|
1347
|
-
getConceptName(code) {
|
|
1348
|
-
return this.bokDataService.getParsedBokData().pipe(filter((parsedData) => parsedData !== undefined), switchMap((parsedData) => {
|
|
1349
|
-
const currentName = parsedData.namehash[code];
|
|
1350
|
-
if (currentName)
|
|
1351
|
-
return of(currentName);
|
|
1352
|
-
return this.getDeprecatedConcept(code).pipe(map((deprecatedConcept) => {
|
|
1353
|
-
if (deprecatedConcept) {
|
|
1354
|
-
return deprecatedConcept.name;
|
|
1355
|
-
}
|
|
1356
|
-
else {
|
|
1357
|
-
return 'Unknown Concept';
|
|
1358
|
-
}
|
|
1359
|
-
}));
|
|
1360
|
-
}));
|
|
1361
|
-
}
|
|
1362
|
-
getDeprecatedConcept(code) {
|
|
1363
|
-
if (this.deprecatedConceptsCache.has(code)) {
|
|
1364
|
-
return of(this.deprecatedConceptsCache.get(code));
|
|
1365
|
-
}
|
|
1366
|
-
return this.bokFirebaseService.getDeprecatedConcept(code).pipe(tap((deprecatedConcept) => {
|
|
1367
|
-
if (deprecatedConcept) {
|
|
1368
|
-
this.deprecatedConceptsCache.set(code, deprecatedConcept);
|
|
1369
|
-
}
|
|
1370
|
-
}));
|
|
1371
|
-
}
|
|
1372
|
-
getKnowledgeAreas(code) {
|
|
1373
|
-
return this.bokDataService.getParsedBokData().pipe(filter((parsedData) => parsedData !== undefined), map((parsedData) => {
|
|
1374
|
-
let currentNode = parsedData.conceptNodeCollection.getNodeByNameShort(code);
|
|
1375
|
-
if (!currentNode)
|
|
1376
|
-
return [];
|
|
1377
|
-
if (currentNode?.nameShort == 'GIST')
|
|
1378
|
-
return [currentNode.nameShort];
|
|
1379
|
-
let knowledgeAreas = new Set();
|
|
1380
|
-
return Array.from(this.checkParents(currentNode, knowledgeAreas));
|
|
1381
|
-
}));
|
|
1382
|
-
}
|
|
1383
|
-
getConceptSkills(code) {
|
|
1384
|
-
return this.bokDataService.getParsedBokData().pipe(filter((parsedData) => parsedData !== undefined), map((parsedData) => {
|
|
1385
|
-
const node = parsedData.conceptNodeCollection.getNodeByNameShort(code);
|
|
1386
|
-
const skills = node?.classifiedSkills || [];
|
|
1387
|
-
const unclassifiedSkills = node?.skills || [];
|
|
1388
|
-
return [...skills, ...unclassifiedSkills.map(value => ({
|
|
1389
|
-
name: value.description,
|
|
1390
|
-
bloomLevel: 0,
|
|
1391
|
-
bloomVerb: ''
|
|
1392
|
-
}))];
|
|
1393
|
-
}));
|
|
1394
|
-
}
|
|
1395
|
-
checkParents(node, knowledgeAreas) {
|
|
1396
|
-
let superiorNodes = [...node.otherParents];
|
|
1397
|
-
if (node.parent)
|
|
1398
|
-
superiorNodes.push(node.parent);
|
|
1399
|
-
let newKnowledgeAreas = new Set(knowledgeAreas);
|
|
1400
|
-
superiorNodes.forEach(superiorNode => {
|
|
1401
|
-
if (superiorNode.nameShort == 'GIST') {
|
|
1402
|
-
newKnowledgeAreas.add(node.nameShort);
|
|
1403
|
-
}
|
|
1404
|
-
else {
|
|
1405
|
-
newKnowledgeAreas = new Set([...newKnowledgeAreas, ...this.checkParents(superiorNode, knowledgeAreas)]);
|
|
1406
|
-
}
|
|
1407
|
-
});
|
|
1408
|
-
return newKnowledgeAreas;
|
|
1409
|
-
}
|
|
1410
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokInformationService, deps: [{ token: BokDataService }, { token: BokFirebaseService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1411
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokInformationService, providedIn: 'root' });
|
|
1412
|
-
}
|
|
1413
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: BokInformationService, decorators: [{
|
|
1414
|
-
type: Injectable,
|
|
1415
|
-
args: [{
|
|
1416
|
-
providedIn: 'root',
|
|
1417
|
-
}]
|
|
1418
|
-
}], ctorParameters: () => [{ type: BokDataService }, { type: BokFirebaseService }] });
|
|
1419
|
-
|
|
1420
1461
|
/*
|
|
1421
1462
|
* Public API Surface of ngx-bok-visualization
|
|
1422
1463
|
*/
|