@hestia-earth/ui-components 0.0.26 → 0.0.27

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.
Files changed (43) hide show
  1. package/bundles/hestia-earth-ui-components.umd.js +344 -221
  2. package/bundles/hestia-earth-ui-components.umd.js.map +1 -1
  3. package/common/blank-node-state/blank-node-state.component.d.ts +1 -10
  4. package/common/common.module.d.ts +8 -7
  5. package/common/index.d.ts +1 -0
  6. package/common/is-array.pipe.d.ts +7 -0
  7. package/common/node-utils.d.ts +51 -0
  8. package/common/utils.d.ts +0 -41
  9. package/cycles/cycles-activity/cycles-activity.component.d.ts +1 -1
  10. package/cycles/cycles-emissions/cycles-emissions.component.d.ts +1 -1
  11. package/cycles/cycles-emissions-chart/cycles-emissions-chart.component.d.ts +1 -1
  12. package/cycles/cycles-practices/cycles-practices.component.d.ts +1 -1
  13. package/engine/engine.service.d.ts +3 -3
  14. package/esm2015/common/blank-node-state/blank-node-state.component.js +12 -14
  15. package/esm2015/common/common.module.js +8 -4
  16. package/esm2015/common/index.js +2 -1
  17. package/esm2015/common/is-array.pipe.js +16 -0
  18. package/esm2015/common/node-utils.js +80 -0
  19. package/esm2015/common/utils.js +2 -62
  20. package/esm2015/cycles/cycles-activity/cycles-activity.component.js +4 -3
  21. package/esm2015/cycles/cycles-emissions/cycles-emissions.component.js +4 -3
  22. package/esm2015/cycles/cycles-emissions-chart/cycles-emissions-chart.component.js +3 -2
  23. package/esm2015/cycles/cycles-practices/cycles-practices.component.js +4 -3
  24. package/esm2015/cycles/cycles-result/cycles-result.component.js +3 -2
  25. package/esm2015/engine/engine.service.js +4 -4
  26. package/esm2015/impact-assessments/impact-assessments-indicator-breakdown-chart/impact-assessments-indicator-breakdown-chart.component.js +14 -7
  27. package/esm2015/impact-assessments/impact-assessments-indicators-chart/impact-assessments-indicators-chart.component.js +3 -2
  28. package/esm2015/impact-assessments/impact-assessments-products/impact-assessments-products.component.js +4 -3
  29. package/esm2015/node/node-logs-models/node-logs-models.component.js +138 -58
  30. package/esm2015/node/node-value-details/node-value-details.component.js +3 -2
  31. package/esm2015/node/node.service.js +1 -1
  32. package/esm2015/sites/sites-measurements/sites-measurements.component.js +4 -3
  33. package/esm2015/sites/sites.model.js +1 -1
  34. package/fesm2015/hestia-earth-ui-components.js +270 -151
  35. package/fesm2015/hestia-earth-ui-components.js.map +1 -1
  36. package/impact-assessments/impact-assessments-indicators-chart/impact-assessments-indicators-chart.component.d.ts +1 -1
  37. package/impact-assessments/impact-assessments-products/impact-assessments-products.component.d.ts +1 -1
  38. package/node/node-logs-models/node-logs-models.component.d.ts +28 -16
  39. package/node/node-value-details/node-value-details.component.d.ts +1 -1
  40. package/node/node.service.d.ts +16 -15
  41. package/package.json +1 -1
  42. package/sites/sites-measurements/sites-measurements.component.d.ts +2 -2
  43. package/sites/sites.model.d.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  import { AfterViewInit, OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { Indicator, Term, TermTermType } from '@hestia-earth/schema';
3
- import { IGroupedNodes } from '../../common/utils';
3
+ import { IGroupedNodes } from '../../common/node-utils';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class ImpactAssessmentsIndicatorsChartComponent implements AfterViewInit, OnChanges {
6
6
  private chartRef?;
@@ -2,7 +2,7 @@ import { OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { DataState } from '@hestia-earth/api';
3
3
  import { IImpactAssessmentJSONLD, Indicator, TermTermType, Term } from '@hestia-earth/schema';
4
4
  import { HeNodeService } from '../../node/node.service';
5
- import { IGroupedKeys } from '../../common/utils';
5
+ import { IGroupedKeys } from '../../common/node-utils';
6
6
  import * as i0 from "@angular/core";
7
7
  declare enum View {
8
8
  table = "table",
@@ -1,29 +1,34 @@
1
1
  import { OnInit } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
- import { Emission, ITermJSONLD, Product, Input as HestiaInput } from '@hestia-earth/schema';
4
- import { INodeTermLogs } from '../node.service';
3
+ import { Emission, ITermJSONLD, Product, Input as HestiaInput, Property } from '@hestia-earth/schema';
4
+ import { INodeTermLogs, INodeTermLog } from '../node.service';
5
5
  import { HeEngineService } from '../../engine/engine.service';
6
6
  import { HeSearchService } from '../../search/search.service';
7
7
  import * as i0 from "@angular/core";
8
- declare type subValueKeys = 'input' | 'property';
8
+ declare type blankNode = Emission | Product | HestiaInput | Property;
9
9
  interface IBlankNodeLogSubValue {
10
- key: subValueKeys | 'backgroundData';
11
- value: any;
12
- configModels: string[];
10
+ key: string;
11
+ originalValue: number | string | boolean;
12
+ recalculatedValue: number | string | boolean;
13
+ id?: any;
14
+ configModels?: string[];
13
15
  }
14
16
  interface IBlankNodeLog {
15
17
  isOpen: boolean;
16
18
  canOpen: boolean;
17
19
  term: ITermJSONLD;
20
+ termId: string;
18
21
  type?: string;
19
22
  configModels: string[];
20
- original: number;
21
- recalculated: number;
23
+ original: blankNode[];
24
+ originalValue: number;
25
+ recalculated: blankNode[];
26
+ recalculatedValue: number;
22
27
  isOriginal: boolean;
23
28
  isRecalculated: boolean;
24
29
  hasData: boolean;
25
30
  logs?: INodeTermLogs;
26
- keys: string[];
31
+ keys: IBlankNodeLogSubValue[];
27
32
  subValues: IBlankNodeLogSubValue[];
28
33
  }
29
34
  declare enum LogStatus {
@@ -46,7 +51,7 @@ export declare class NodeLogsModelsComponent implements OnInit {
46
51
  */
47
52
  private nodeKey?;
48
53
  logsUrl?: string;
49
- originalValues: (Emission | Product | HestiaInput)[];
54
+ originalValues: blankNode[];
50
55
  private recalculatedValues;
51
56
  private terms;
52
57
  private logs?;
@@ -81,21 +86,28 @@ export declare class NodeLogsModelsComponent implements OnInit {
81
86
  private fetchAllTerms;
82
87
  private suggestByTerm;
83
88
  trackByBlankNode(_index: number, node: IBlankNodeLog): string;
89
+ get showOriginalValue(): number;
90
+ keyValue(blankNodes: blankNode[], key: string): any;
84
91
  togglePopover(popover: any, context: any): any;
92
+ filterResults(): void;
93
+ /** Logs **/
94
+ private getTransformationLogs;
95
+ getLogs(node: IBlankNodeLog, methodId: string, subValue?: IBlankNodeLogSubValue): INodeTermLog;
85
96
  private isBackground;
86
97
  private isRequired;
87
- private shouldRun;
88
98
  private isUserProvided;
89
99
  validSubValue(node: IBlankNodeLog, index: number, subValue?: IBlankNodeLogSubValue): boolean;
90
100
  getMethodIdAt(node: IBlankNodeLog, index: number, subValue?: IBlankNodeLogSubValue): string;
91
- methodName({ logs }: IBlankNodeLog, methodId: string): any;
92
- hasLog({ logs }: IBlankNodeLog, methodId: string, withOrchestrator?: boolean): boolean;
93
- hasLogDetails(node: IBlankNodeLog, methodId: string): number | {
101
+ methodName(node: IBlankNodeLog, methodId: string, subValue?: IBlankNodeLogSubValue): any;
102
+ hasLog(log: INodeTermLog, withOrchestrator?: boolean): boolean;
103
+ hasLogDetails(node: IBlankNodeLog, methodId: string, subValue?: IBlankNodeLogSubValue): number | {
94
104
  [key: string]: any;
95
105
  };
96
- logStatus(node: IBlankNodeLog, methodId: string): LogStatus;
106
+ logStatus(node: IBlankNodeLog, methodId: string, subValue?: IBlankNodeLogSubValue): LogStatus;
107
+ requirementKeys(requirements: {
108
+ [key: string]: any;
109
+ }): string[];
97
110
  requirementColor(value: any): "danger" | "white";
98
- filterResults(): void;
99
111
  static ɵfac: i0.ɵɵFactoryDeclaration<NodeLogsModelsComponent, never>;
100
112
  static ɵcmp: i0.ɵɵComponentDeclaration<NodeLogsModelsComponent, "he-node-logs-models", never, { "nodeType": "nodeType"; "nodeKey": "nodeKey"; "logsUrl": "logsUrl"; "originalValues": "originalValues"; "recalculatedValues": "recalculatedValues"; "terms": "terms"; "logs": "logs"; "filteredType": "filteredType"; }, {}, never, never>;
101
113
  }
@@ -1,6 +1,6 @@
1
1
  import { OnInit } from '@angular/core';
2
2
  import { NodeType } from '@hestia-earth/schema';
3
- import { IGroupedNode } from '../../common/utils';
3
+ import { IGroupedNode } from '../../common/node-utils';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class NodeValueDetailsComponent<T> implements OnInit {
6
6
  data?: IGroupedNode<T>;
@@ -40,23 +40,24 @@ export interface INodeMissingLookupLog {
40
40
  term?: string;
41
41
  key?: string;
42
42
  }
43
- export interface INodeTermLogs {
44
- [modelKey: string]: {
45
- model: string;
46
- isKey: boolean;
47
- shouldRun?: boolean;
48
- shouldRunOrchestrator?: boolean;
49
- missingLookups?: INodeMissingLookupLog[];
50
- requirements?: {
51
- [key: string]: any;
52
- };
53
- logs?: {
54
- [key: string]: any;
55
- };
43
+ export interface INodeTermLog {
44
+ model: string;
45
+ isKey: boolean;
46
+ shouldRun?: boolean;
47
+ shouldRunOrchestrator?: boolean;
48
+ missingLookups?: INodeMissingLookupLog[];
49
+ requirements?: {
50
+ [key: string]: any;
51
+ };
52
+ logs?: {
56
53
  [key: string]: any;
57
- input?: string | string[];
58
- property?: string | string[];
59
54
  };
55
+ [key: string]: any;
56
+ input?: string | string[];
57
+ property?: string | string[];
58
+ }
59
+ export interface INodeTermLogs {
60
+ [modelKey: string]: INodeTermLog;
60
61
  }
61
62
  export interface INodeLogs {
62
63
  [term: string]: INodeTermLogs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/ui-components",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "description": "Hestia reusable components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,7 +1,7 @@
1
1
  import { OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { DataState } from '@hestia-earth/api';
3
3
  import { ISiteJSONLD, Measurement } from '@hestia-earth/schema';
4
- import { IGroupedKeys } from '../../common/utils';
4
+ import { IGroupedKeys } from '../../common/node-utils';
5
5
  import * as i0 from "@angular/core";
6
6
  declare enum View {
7
7
  table = "table",
@@ -18,7 +18,7 @@ export declare class SitesMeasurementsComponent implements OnChanges {
18
18
  maxAreaSize: number;
19
19
  siteTooBig: ({ area }: ISiteJSONLD) => boolean;
20
20
  defaultLabel: (node?: any) => any;
21
- measurementValue: ({ value, depthLower, depthUpper }: import("../../common/utils").IGroupedNode<Measurement>, termId: string) => number;
21
+ measurementValue: ({ value, depthLower, depthUpper }: import("../../common/node-utils").IGroupedNode<Measurement>, termId: string) => number;
22
22
  measurements: IGroupedKeys<Measurement>[];
23
23
  ngOnChanges(changes: SimpleChanges): void;
24
24
  trackById(_index: number, item: ISiteJSONLD): string;
@@ -1,5 +1,5 @@
1
1
  import { NodeType, ISiteJSONLD, Measurement } from '@hestia-earth/schema';
2
- import { IGroupedNode } from '../common/utils';
2
+ import { IGroupedNode } from '../common/node-utils';
3
3
  export interface ISiteJSONLDExtended extends ISiteJSONLD {
4
4
  related: {
5
5
  [type in NodeType]?: string[];