@colijnit/extendedcomponents 12.0.9 → 12.0.11

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ViewEncapsulation, HostBinding, Input, NgModule, Injectable, Pipe } from '@angular/core';
2
+ import { Component, ViewEncapsulation, HostBinding, Input, NgModule, Injectable, Pipe, EventEmitter, Output } from '@angular/core';
3
3
  import * as i3 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i1 from 'ngx-echarts';
@@ -822,12 +822,14 @@ class RecursiveListComponent {
822
822
  constructor(iconCacheService) {
823
823
  this.iconCacheService = iconCacheService;
824
824
  this.icons = Icon;
825
+ this.hyperLinkDeepestLevel = false;
825
826
  this.columns = [];
826
827
  this.subColumns = [];
827
828
  this.tableLegend = "";
828
829
  this.depth = 0;
829
830
  this.indentation = 10;
830
831
  this.dataPipe = null;
832
+ this.dataPointClicked = new EventEmitter();
831
833
  }
832
834
  toggleCollapse(event, item) {
833
835
  event.stopPropagation(); // Stop event propagation here
@@ -847,9 +849,15 @@ class RecursiveListComponent {
847
849
  return dataValue.toString(); // No formatting needed
848
850
  }
849
851
  }
852
+ handleDataPointClicked(event) {
853
+ this.dataPointClicked.emit(event);
854
+ }
855
+ parseableToInt(prop) {
856
+ return parseInt(prop) !== undefined;
857
+ }
850
858
  }
851
859
  RecursiveListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: RecursiveListComponent, deps: [{ token: IconCacheService }], target: i0.ɵɵFactoryTarget.Component });
852
- RecursiveListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RecursiveListComponent, selector: "co-recursive-list", inputs: { collection: "collection", columns: "columns", subColumns: "subColumns", tableLegend: "tableLegend", depth: "depth", indentation: "indentation", dataPipe: "dataPipe", params: "params" }, ngImport: i0, template: `
860
+ RecursiveListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RecursiveListComponent, selector: "co-recursive-list", inputs: { hyperLinkDeepestLevel: "hyperLinkDeepestLevel", collection: "collection", columns: "columns", subColumns: "subColumns", tableLegend: "tableLegend", depth: "depth", indentation: "indentation", dataPipe: "dataPipe", params: "params" }, outputs: { dataPointClicked: "dataPointClicked" }, ngImport: i0, template: `
853
861
  <div class="co-recursive-list">
854
862
  <div class="table-header-row">
855
863
  <div class="table-legend" *ngIf="tableLegend.length > 1">
@@ -871,8 +879,9 @@ RecursiveListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
871
879
  <div class="tree-node" [class.background]="depth === 0" *ngFor="let item of collection" (click)="toggleCollapse($event, item)">
872
880
  <div class="table-row">
873
881
  <div class="table-cell node-text-icon" [ngStyle]="{'padding-left.px' : indentation}">
874
- <co-icon *ngIf="item.children && item.children.length > 0" [iconData]="iconCacheService.getIcon(getCurrentIcon(item))"></co-icon>
875
- <span [textContent]="item.name"></span>
882
+ <co-icon *ngIf="item?.children && item.children?.length > 0" [iconData]="iconCacheService.getIcon(getCurrentIcon(item))"></co-icon>
883
+ <span *ngIf="item?.children || depth === 0" (click)="handleDataPointClicked(item.name)" [textContent]="item.name"></span>
884
+ <a *ngIf="!item.children && depth !== 0 && parseableToInt(item.name)" (click)="handleDataPointClicked(item.name)" [textContent]="item.name"></a>
876
885
  </div>
877
886
  <div class="table-cell data-points">
878
887
  <div *ngFor="let dataPoint of item.data" class="custom-property">
@@ -881,11 +890,11 @@ RecursiveListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
881
890
  </div>
882
891
  </div>
883
892
  <ng-container *ngIf="item.children && item.children.length > 0 && item.expanded">
884
- <co-recursive-list [dataPipe]="dataPipe" [collection]="item.children" [depth]="depth + 1" [indentation]="indentation + 20" [params]="params"></co-recursive-list>
893
+ <co-recursive-list [dataPipe]="dataPipe" [collection]="item.children" [depth]="depth + 1" [indentation]="indentation + 20" [params]="params" (dataPointClicked)="handleDataPointClicked($event)"></co-recursive-list>
885
894
  </ng-container>
886
895
  </div>
887
896
  </div>
888
- `, isInline: true, components: [{ type: i2.IconComponent, selector: "co-icon", inputs: ["icon", "iconData"] }, { type: RecursiveListComponent, selector: "co-recursive-list", inputs: ["collection", "columns", "subColumns", "tableLegend", "depth", "indentation", "dataPipe", "params"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "localize": LocalizePipe }, encapsulation: i0.ViewEncapsulation.None });
897
+ `, isInline: true, components: [{ type: i2.IconComponent, selector: "co-icon", inputs: ["icon", "iconData"] }, { type: RecursiveListComponent, selector: "co-recursive-list", inputs: ["hyperLinkDeepestLevel", "collection", "columns", "subColumns", "tableLegend", "depth", "indentation", "dataPipe", "params"], outputs: ["dataPointClicked"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "localize": LocalizePipe }, encapsulation: i0.ViewEncapsulation.None });
889
898
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: RecursiveListComponent, decorators: [{
890
899
  type: Component,
891
900
  args: [{
@@ -912,8 +921,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
912
921
  <div class="tree-node" [class.background]="depth === 0" *ngFor="let item of collection" (click)="toggleCollapse($event, item)">
913
922
  <div class="table-row">
914
923
  <div class="table-cell node-text-icon" [ngStyle]="{'padding-left.px' : indentation}">
915
- <co-icon *ngIf="item.children && item.children.length > 0" [iconData]="iconCacheService.getIcon(getCurrentIcon(item))"></co-icon>
916
- <span [textContent]="item.name"></span>
924
+ <co-icon *ngIf="item?.children && item.children?.length > 0" [iconData]="iconCacheService.getIcon(getCurrentIcon(item))"></co-icon>
925
+ <span *ngIf="item?.children || depth === 0" (click)="handleDataPointClicked(item.name)" [textContent]="item.name"></span>
926
+ <a *ngIf="!item.children && depth !== 0 && parseableToInt(item.name)" (click)="handleDataPointClicked(item.name)" [textContent]="item.name"></a>
917
927
  </div>
918
928
  <div class="table-cell data-points">
919
929
  <div *ngFor="let dataPoint of item.data" class="custom-property">
@@ -922,14 +932,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
922
932
  </div>
923
933
  </div>
924
934
  <ng-container *ngIf="item.children && item.children.length > 0 && item.expanded">
925
- <co-recursive-list [dataPipe]="dataPipe" [collection]="item.children" [depth]="depth + 1" [indentation]="indentation + 20" [params]="params"></co-recursive-list>
935
+ <co-recursive-list [dataPipe]="dataPipe" [collection]="item.children" [depth]="depth + 1" [indentation]="indentation + 20" [params]="params" (dataPointClicked)="handleDataPointClicked($event)"></co-recursive-list>
926
936
  </ng-container>
927
937
  </div>
928
938
  </div>
929
939
  `,
930
940
  encapsulation: ViewEncapsulation.None,
931
941
  }]
932
- }], ctorParameters: function () { return [{ type: IconCacheService }]; }, propDecorators: { collection: [{
942
+ }], ctorParameters: function () { return [{ type: IconCacheService }]; }, propDecorators: { hyperLinkDeepestLevel: [{
943
+ type: Input
944
+ }], collection: [{
933
945
  type: Input
934
946
  }], columns: [{
935
947
  type: Input
@@ -945,21 +957,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
945
957
  type: Input
946
958
  }], params: [{
947
959
  type: Input
960
+ }], dataPointClicked: [{
961
+ type: Output
948
962
  }] } });
949
963
 
950
964
  // summary-grid.component.ts
951
965
  class SummaryGridComponent {
952
966
  constructor() {
953
967
  this.showClass = true;
968
+ this.hyperLinkDeepestLevel = false;
954
969
  this.columns = [];
955
970
  this.subColumns = [];
956
971
  this.tableLegend = "";
957
972
  this.dataPipe = null;
958
973
  this.collection = [];
974
+ this.dataPointClickedEvent = new EventEmitter();
959
975
  }
960
976
  }
961
977
  SummaryGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SummaryGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
962
- SummaryGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SummaryGridComponent, selector: "co-summary-grid", inputs: { columns: "columns", subColumns: "subColumns", tableLegend: "tableLegend", dataPipe: "dataPipe", params: "params", collection: "collection" }, host: { properties: { "class.co-summary-grid": "this.showClass" } }, ngImport: i0, template: `
978
+ SummaryGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SummaryGridComponent, selector: "co-summary-grid", inputs: { hyperLinkDeepestLevel: "hyperLinkDeepestLevel", columns: "columns", subColumns: "subColumns", tableLegend: "tableLegend", dataPipe: "dataPipe", params: "params", collection: "collection" }, outputs: { dataPointClickedEvent: "dataPointClickedEvent" }, host: { properties: { "class.co-summary-grid": "this.showClass" } }, ngImport: i0, template: `
963
979
  <co-recursive-list
964
980
  [collection]="collection"
965
981
  [columns]="columns"
@@ -967,8 +983,9 @@ SummaryGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
967
983
  [tableLegend]="tableLegend"
968
984
  [dataPipe]="dataPipe"
969
985
  [params]="params"
986
+ (dataPointClicked)="dataPointClickedEvent.emit($event)"
970
987
  ></co-recursive-list>
971
- `, isInline: true, components: [{ type: RecursiveListComponent, selector: "co-recursive-list", inputs: ["collection", "columns", "subColumns", "tableLegend", "depth", "indentation", "dataPipe", "params"] }], encapsulation: i0.ViewEncapsulation.None });
988
+ `, isInline: true, components: [{ type: RecursiveListComponent, selector: "co-recursive-list", inputs: ["hyperLinkDeepestLevel", "collection", "columns", "subColumns", "tableLegend", "depth", "indentation", "dataPipe", "params"], outputs: ["dataPointClicked"] }], encapsulation: i0.ViewEncapsulation.None });
972
989
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SummaryGridComponent, decorators: [{
973
990
  type: Component,
974
991
  args: [{
@@ -981,6 +998,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
981
998
  [tableLegend]="tableLegend"
982
999
  [dataPipe]="dataPipe"
983
1000
  [params]="params"
1001
+ (dataPointClicked)="dataPointClickedEvent.emit($event)"
984
1002
  ></co-recursive-list>
985
1003
  `,
986
1004
  encapsulation: ViewEncapsulation.None,
@@ -988,6 +1006,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
988
1006
  }], propDecorators: { showClass: [{
989
1007
  type: HostBinding,
990
1008
  args: ['class.co-summary-grid']
1009
+ }], hyperLinkDeepestLevel: [{
1010
+ type: Input
991
1011
  }], columns: [{
992
1012
  type: Input
993
1013
  }], subColumns: [{
@@ -1000,6 +1020,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1000
1020
  type: Input
1001
1021
  }], collection: [{
1002
1022
  type: Input
1023
+ }], dataPointClickedEvent: [{
1024
+ type: Output
1003
1025
  }] } });
1004
1026
 
1005
1027
  class ExtendedComponentsTranslationService {