@colijnit/extendedcomponents 12.0.8 → 12.0.10

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';
@@ -828,6 +828,7 @@ class RecursiveListComponent {
828
828
  this.depth = 0;
829
829
  this.indentation = 10;
830
830
  this.dataPipe = null;
831
+ this.dataPointClicked = new EventEmitter();
831
832
  }
832
833
  toggleCollapse(event, item) {
833
834
  event.stopPropagation(); // Stop event propagation here
@@ -847,9 +848,12 @@ class RecursiveListComponent {
847
848
  return dataValue.toString(); // No formatting needed
848
849
  }
849
850
  }
851
+ handleDataPointClicked(event) {
852
+ this.dataPointClicked.emit(event);
853
+ }
850
854
  }
851
855
  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: `
856
+ 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" }, outputs: { dataPointClicked: "dataPointClicked" }, ngImport: i0, template: `
853
857
  <div class="co-recursive-list">
854
858
  <div class="table-header-row">
855
859
  <div class="table-legend" *ngIf="tableLegend.length > 1">
@@ -872,7 +876,7 @@ RecursiveListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
872
876
  <div class="table-row">
873
877
  <div class="table-cell node-text-icon" [ngStyle]="{'padding-left.px' : indentation}">
874
878
  <co-icon *ngIf="item.children && item.children.length > 0" [iconData]="iconCacheService.getIcon(getCurrentIcon(item))"></co-icon>
875
- <span [textContent]="item.name"></span>
879
+ <span (click)="handleDataPointClicked(item.name)" [textContent]="item.name"></span>
876
880
  </div>
877
881
  <div class="table-cell data-points">
878
882
  <div *ngFor="let dataPoint of item.data" class="custom-property">
@@ -881,11 +885,11 @@ RecursiveListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
881
885
  </div>
882
886
  </div>
883
887
  <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>
888
+ <co-recursive-list [dataPipe]="dataPipe" [collection]="item.children" [depth]="depth + 1" [indentation]="indentation + 20" [params]="params" (dataPointClicked)="handleDataPointClicked($event)"></co-recursive-list>
885
889
  </ng-container>
886
890
  </div>
887
891
  </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 });
892
+ `, 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"], 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
893
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: RecursiveListComponent, decorators: [{
890
894
  type: Component,
891
895
  args: [{
@@ -913,7 +917,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
913
917
  <div class="table-row">
914
918
  <div class="table-cell node-text-icon" [ngStyle]="{'padding-left.px' : indentation}">
915
919
  <co-icon *ngIf="item.children && item.children.length > 0" [iconData]="iconCacheService.getIcon(getCurrentIcon(item))"></co-icon>
916
- <span [textContent]="item.name"></span>
920
+ <span (click)="handleDataPointClicked(item.name)" [textContent]="item.name"></span>
917
921
  </div>
918
922
  <div class="table-cell data-points">
919
923
  <div *ngFor="let dataPoint of item.data" class="custom-property">
@@ -922,7 +926,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
922
926
  </div>
923
927
  </div>
924
928
  <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>
929
+ <co-recursive-list [dataPipe]="dataPipe" [collection]="item.children" [depth]="depth + 1" [indentation]="indentation + 20" [params]="params" (dataPointClicked)="handleDataPointClicked($event)"></co-recursive-list>
926
930
  </ng-container>
927
931
  </div>
928
932
  </div>
@@ -945,73 +949,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
945
949
  type: Input
946
950
  }], params: [{
947
951
  type: Input
952
+ }], dataPointClicked: [{
953
+ type: Output
948
954
  }] } });
949
955
 
950
956
  // summary-grid.component.ts
951
957
  class SummaryGridComponent {
952
958
  constructor() {
953
959
  this.showClass = true;
954
- this.columns = ['Column1', 'Column2']; // Add your column headers here
955
- this.subColumns = ['SubColumn1', 'SubColumn2']; // Add your column headers here
956
- this.tableLegend = "Legend";
960
+ this.columns = [];
961
+ this.subColumns = [];
962
+ this.tableLegend = "";
957
963
  this.dataPipe = null;
958
- this.collection = [
959
- {
960
- name: 'Root 1',
961
- expanded: false,
962
- data: [1, 2],
963
- children: [
964
- {
965
- name: 'Child 1.1',
966
- expanded: false,
967
- data: [3, 4],
968
- children: [
969
- {
970
- name: 'Grandchild 1.1.1',
971
- expanded: false,
972
- data: [5, 6],
973
- },
974
- {
975
- name: 'Grandchild 1.1.2',
976
- expanded: false,
977
- data: [7, 0],
978
- },
979
- ],
980
- },
981
- // ... other nodes
982
- ],
983
- },
984
- {
985
- name: 'Root 2',
986
- expanded: false,
987
- data: [9, 10],
988
- children: [
989
- {
990
- name: 'Child 2.1',
991
- expanded: false,
992
- data: [11, 12],
993
- children: [
994
- {
995
- name: 'Grandchild 2.1.1',
996
- expanded: false,
997
- data: [13, 14],
998
- },
999
- {
1000
- name: 'Grandchild 2.1.2',
1001
- expanded: false,
1002
- data: [15, 16],
1003
- },
1004
- ],
1005
- },
1006
- // ... other nodes
1007
- ],
1008
- },
1009
- // ... other root nodes
1010
- ];
964
+ this.collection = [];
965
+ this.dataPointClickedEvent = new EventEmitter();
1011
966
  }
1012
967
  }
1013
968
  SummaryGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SummaryGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1014
- 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: `
969
+ 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" }, outputs: { dataPointClickedEvent: "dataPointClickedEvent" }, host: { properties: { "class.co-summary-grid": "this.showClass" } }, ngImport: i0, template: `
1015
970
  <co-recursive-list
1016
971
  [collection]="collection"
1017
972
  [columns]="columns"
@@ -1019,8 +974,9 @@ SummaryGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
1019
974
  [tableLegend]="tableLegend"
1020
975
  [dataPipe]="dataPipe"
1021
976
  [params]="params"
977
+ (dataPointClicked)="dataPointClickedEvent.emit($event)"
1022
978
  ></co-recursive-list>
1023
- `, isInline: true, components: [{ type: RecursiveListComponent, selector: "co-recursive-list", inputs: ["collection", "columns", "subColumns", "tableLegend", "depth", "indentation", "dataPipe", "params"] }], encapsulation: i0.ViewEncapsulation.None });
979
+ `, isInline: true, components: [{ type: RecursiveListComponent, selector: "co-recursive-list", inputs: ["collection", "columns", "subColumns", "tableLegend", "depth", "indentation", "dataPipe", "params"], outputs: ["dataPointClicked"] }], encapsulation: i0.ViewEncapsulation.None });
1024
980
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SummaryGridComponent, decorators: [{
1025
981
  type: Component,
1026
982
  args: [{
@@ -1033,6 +989,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1033
989
  [tableLegend]="tableLegend"
1034
990
  [dataPipe]="dataPipe"
1035
991
  [params]="params"
992
+ (dataPointClicked)="dataPointClickedEvent.emit($event)"
1036
993
  ></co-recursive-list>
1037
994
  `,
1038
995
  encapsulation: ViewEncapsulation.None,
@@ -1052,6 +1009,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1052
1009
  type: Input
1053
1010
  }], collection: [{
1054
1011
  type: Input
1012
+ }], dataPointClickedEvent: [{
1013
+ type: Output
1055
1014
  }] } });
1056
1015
 
1057
1016
  class ExtendedComponentsTranslationService {