@hestia-earth/ui-components 0.41.45 → 0.41.47

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/ui-components",
3
- "version": "0.41.45",
3
+ "version": "0.41.47",
4
4
  "description": "HESTIA reusable components",
5
5
  "repository": {
6
6
  "type": "git",
package/styles.scss CHANGED
@@ -402,3 +402,9 @@ ngb-popover-window {
402
402
  padding: 8px;
403
403
  }
404
404
  }
405
+
406
+ .with-border-secondary-accent {
407
+ border-color: $secondary-accent;
408
+ border-style: solid;
409
+ border-width: 0px; // to override
410
+ }
@@ -5,7 +5,7 @@ import { ControlValueAccessor as ControlValueAccessor$1, FormControl } from '@an
5
5
  import * as _hestia_earth_schema from '@hestia-earth/schema';
6
6
  import { Source, Bibliography, TermTermType, blankNodesType, Term, Indicator, ITermJSONLD, EmissionMethodTier, ICycleJSONLD, IImpactAssessmentJSONLD, ISiteJSONLD, Animal, Transformation, blankNodesKey, NodeType, NonBlankNodesKey, Emission, CycleFunctionalUnit, BlankNodesKey, Practice, Input, Product, SchemaType, SiteSiteType, JSONLD, JSON, ISourceJSONLD, IndicatorMethodTier, sortConfig, Infrastructure, nonBlankNodesType, nonBlankNodesKey, Property, Measurement, Site, IOrganisationJSONLD, Organisation, Management } from '@hestia-earth/schema';
7
7
  import * as chart_js from 'chart.js';
8
- import { Chart, BarOptions, Plugin, ChartEvent, Color, ChartDataset, Scale, ChartConfiguration, ChartComponentLike, ChartData } from 'chart.js';
8
+ import { Chart, BarOptions, Plugin, ChartEvent, Color, ChartDataset, Scale, ChartConfiguration, ChartComponentLike, ChartData, ActiveElement } from 'chart.js';
9
9
  import * as rxjs from 'rxjs';
10
10
  import { Observable, ReplaySubject } from 'rxjs';
11
11
  import { PlacementArray } from '@ng-bootstrap/ng-bootstrap';
@@ -416,10 +416,12 @@ declare class ChartExportButtonComponent {
416
416
 
417
417
  type chartTooltipContentFn<T> = (data: T) => string;
418
418
  interface ITooltipOptions {
419
+ tooltipClass?: string;
419
420
  placement?: PlacementArray;
420
421
  container?: 'body';
421
422
  }
422
423
  declare class ChartTooltipComponent<T> {
424
+ private readonly domSanitizer;
423
425
  protected readonly tooltipFn: _angular_core.InputSignal<chartTooltipContentFn<T>>;
424
426
  private readonly tooltip;
425
427
  protected readonly tooltipX: _angular_core.WritableSignal<number>;
@@ -438,7 +440,16 @@ interface ContributionChartDataItem {
438
440
  borderColor?: string;
439
441
  includedItems?: ContributionChartDataItem[];
440
442
  }
443
+ interface ContributionTooltipData {
444
+ label: string;
445
+ units: string;
446
+ values: (ContributionChartDataItem & {
447
+ value: number;
448
+ })[];
449
+ selectedLabel?: string;
450
+ }
441
451
  declare class ContributionChartComponent {
452
+ protected readonly tooltipFn: chartTooltipContentFn<ContributionTooltipData>;
442
453
  /**
443
454
  * Contribution data.
444
455
  */
@@ -451,9 +462,18 @@ declare class ContributionChartComponent {
451
462
  * Label to display below the chart (X-axis title).
452
463
  */
453
464
  readonly label: _angular_core.InputSignal<string>;
465
+ /**
466
+ * Show default button for export, located on the top-right corner of the chart.
467
+ */
468
+ protected readonly showExportButton: _angular_core.InputSignal<boolean>;
454
469
  readonly config: _angular_core.InputSignal<Partial<ChartConfiguration<keyof chart_js.ChartTypeRegistry, (number | [number, number] | chart_js.Point | chart_js.BubbleDataPoint)[], unknown>>>;
455
- protected readonly chart: _angular_core.Signal<ChartComponent>;
470
+ protected readonly minHeight: _angular_core.InputSignal<number>;
471
+ protected readonly maxHeight: _angular_core.InputSignal<number>;
472
+ private readonly chart;
473
+ private readonly tooltip;
456
474
  readonly exporting: _angular_core.Signal<boolean>;
475
+ protected readonly height: _angular_core.Signal<number>;
476
+ private readonly hasNegativeContributions;
457
477
  private readonly defaultConfig;
458
478
  protected readonly dataConfig: _angular_core.Signal<{
459
479
  datasets: {
@@ -461,8 +481,8 @@ declare class ContributionChartComponent {
461
481
  data: number[];
462
482
  backgroundColor: string;
463
483
  borderColor: string;
464
- borderWidth: number;
465
- type: "bar";
484
+ barThickness: number;
485
+ maxBarThickness: number;
466
486
  includedItems: ContributionChartDataItem[];
467
487
  }[];
468
488
  labels: string[];
@@ -470,13 +490,11 @@ declare class ContributionChartComponent {
470
490
  protected readonly configuration: _angular_core.Signal<Readonly<{
471
491
  type: "bar";
472
492
  options: {
493
+ indexAxis: "y";
473
494
  responsive: true;
474
495
  plugins: {
475
496
  tooltip: {
476
- enabled: true;
477
- callbacks: {
478
- label: (this: chart_js.TooltipModel<keyof chart_js.ChartTypeRegistry>, { dataset, raw, dataIndex }: chart_js.TooltipItem<keyof chart_js.ChartTypeRegistry>) => string[];
479
- };
497
+ enabled: false;
480
498
  };
481
499
  legend: {
482
500
  display: false;
@@ -487,52 +505,74 @@ declare class ContributionChartComponent {
487
505
  stacked: true;
488
506
  display: true;
489
507
  grid: {
490
- display: false;
508
+ display: true;
509
+ drawOnChartArea: true;
510
+ };
511
+ ticks: {
512
+ font: {
513
+ family: string;
514
+ size: number;
515
+ };
516
+ callback: (this: chart_js.Scale, label: string | number) => string;
491
517
  };
492
518
  };
493
519
  y: {
494
520
  stacked: true;
495
521
  display: true;
496
522
  position: "left";
497
- beginAtZero: true;
498
523
  grid: {
499
524
  display: true;
525
+ drawOnChartArea: false;
526
+ drawTicks: true;
527
+ tickLength: number;
528
+ offset: false;
529
+ };
530
+ ticks: {
531
+ color: string;
532
+ padding: number;
533
+ crossAlign: "center";
534
+ font: {
535
+ weight: number;
536
+ family: string;
537
+ size: number;
538
+ };
539
+ callback: (this: chart_js.Scale, value: string | number) => string;
500
540
  };
501
541
  };
502
542
  };
503
543
  };
504
544
  }> & {
505
545
  options: {
546
+ onClick: (event: ChartEvent, activeElements: ActiveElement[], chart: Chart<keyof chart_js.ChartTypeRegistry, (number | [number, number] | chart_js.Point | chart_js.BubbleDataPoint)[], unknown>) => void;
506
547
  scales: {
507
548
  x: {
549
+ afterDataLimits: (scale: chart_js.Scale<chart_js.CoreScaleOptions>) => void;
508
550
  title: {
509
551
  display: boolean;
510
552
  text: string;
511
553
  };
512
- ticks: {
513
- font: {
514
- family: string;
515
- size: number;
516
- };
517
- };
518
- };
519
- y: {
520
- ticks: {
521
- font: {
522
- family: string;
523
- size: number;
524
- weight: number;
525
- };
526
- color: string;
554
+ grid: {
555
+ lineWidth: (context: chart_js.ScriptableScaleContext) => 0 | 1;
527
556
  };
528
557
  };
529
558
  };
530
559
  };
560
+ plugins: {
561
+ id: string;
562
+ afterEvent: (chart: Chart, args: {
563
+ event: ChartEvent;
564
+ changed?: boolean;
565
+ }) => void;
566
+ beforeDraw: (chart: Chart) => void;
567
+ }[];
531
568
  } & Partial<ChartConfiguration<keyof chart_js.ChartTypeRegistry, (number | [number, number] | chart_js.Point | chart_js.BubbleDataPoint)[], unknown>>>;
569
+ private readonly csvContent;
570
+ private onItemClick;
532
571
  exportAsSvg(config?: Partial<ChartExportMetadata>): Promise<void>;
533
572
  exportAsPng(): void;
573
+ exportAsCsv(title: string): void;
534
574
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContributionChartComponent, never>;
535
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContributionChartComponent, "he-contribution-chart", ["contributionChart"], { "data": { "alias": "data"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
575
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContributionChartComponent, "he-contribution-chart", ["contributionChart"], { "data": { "alias": "data"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "showExportButton": { "alias": "showExportButton"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
536
576
  }
537
577
 
538
578
  interface HistogramChartDataItem {
@@ -4073,6 +4113,7 @@ declare class ImpactAssessmentsIndicatorBreakdownChartComponent {
4073
4113
  index: number;
4074
4114
  }>;
4075
4115
  protected readonly afterBarDrawSettings: _angular_core.Signal<AfterBarDrawSettings>;
4116
+ private readonly chartMin;
4076
4117
  protected readonly configuration: _angular_core.Signal<{
4077
4118
  options: {
4078
4119
  scales: {
@@ -4133,6 +4174,8 @@ declare class ImpactAssessmentsIndicatorsChartComponent {
4133
4174
  color: string;
4134
4175
  }[]>;
4135
4176
  protected readonly chartLabels: _angular_core.Signal<string[]>;
4177
+ protected readonly exportFormats: _angular_core.Signal<IChartExportFormat[]>;
4178
+ protected readonly chartExportFn: chartExportFn;
4136
4179
  constructor();
4137
4180
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ImpactAssessmentsIndicatorsChartComponent, never>;
4138
4181
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ImpactAssessmentsIndicatorsChartComponent, "he-impact-assessments-indicators-chart", never, { "key": { "alias": "key"; "required": false; "isSignal": true; }; "filterTermTypes": { "alias": "filterTermTypes"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
@@ -5408,4 +5451,4 @@ declare class TermsUnitsDescriptionComponent {
5408
5451
  }
5409
5452
 
5410
5453
  export { ARRAY_DELIMITER, ApplyPurePipe, BarChartComponent, BibliographiesSearchConfirmComponent, BlankNodeStateComponent, BlankNodeStateNoticeComponent, BlankNodeValueDeltaComponent, CapitalizePipe, ChartComponent, ChartConfigurationDirective, ChartExportButtonComponent, ChartTooltipComponent, ClickOutsideDirective, ClipboardComponent, CollapsibleBoxComponent, CollapsibleBoxStyle, ColorPalette, CompoundDirective, CompoundPipe, ContributionChartComponent, ControlValueAccessor, CycleNodesKeyGroup, CyclesCompletenessComponent, CyclesEmissionsChartComponent, CyclesFunctionalUnitMeasureComponent, CyclesMetadataComponent, CyclesNodesComponent, CyclesNodesTimelineComponent, CyclesResultComponent, DataTableComponent, DefaultPipe, DeltaColour, DistributionChartComponent, DrawerContainerComponent, DurationPipe, EllipsisPipe, EngineModelsLinkComponent, EngineModelsLookupInfoComponent, EngineModelsStageComponent, EngineModelsStageDeepComponent, EngineModelsStageDeepService, EngineModelsVersionInfoComponent, EngineModelsVersionLinkComponent, EngineOrchestratorEditComponent, EngineRequirementsFormComponent, FileSizePipe, FileUploadErrorKeys, FilesErrorSummaryComponent, FilesFormComponent, FilesFormEditableComponent, FilesUploadErrorsComponent, FilterAccordionComponent, GUIDE_ENABLED, GetPipe, GlossaryMigrationFormat, GuideOverlayComponent, HESvgIconComponent, HE_API_BASE_URL, HE_CALCULATIONS_BASE_URL, HE_MAP_LOADED, HeAuthService, HeCommonService, HeEngineService, HeGlossaryService, HeMendeleyService, HeNodeCsvService, HeNodeService, HeNodeStoreService, HeSchemaService, HeSearchService, HeToastService, HorizontalBarChartComponent, HorizontalButtonsGroupComponent, ImpactAssessmentsGraphComponent, ImpactAssessmentsIndicatorBreakdownChartComponent, ImpactAssessmentsIndicatorsChartComponent, ImpactAssessmentsProductsComponent, IsArrayPipe, IsObjectPipe, IssueConfirmComponent, KeyToLabelPipe, Level, LineChartComponent, LinkKeyValueComponent, LogStatus, LongPressDirective, MAX_RESULTS, MapsDrawingComponent, MapsDrawingConfirmComponent, MendeleySearchResult, MobileShellComponent, NavigationMenuComponent, NoExtPipe, NodeAggregatedComponent, NodeAggregatedInfoComponent, NodeAggregatedQualityScoreComponent, NodeCsvExportConfirmComponent, NodeCsvPreviewComponent, NodeCsvSelectHeadersComponent, NodeIconComponent, NodeJsonldComponent, NodeJsonldSchemaComponent, NodeKeyState, NodeLinkComponent, NodeLogsFileComponent, NodeLogsModelsComponent, NodeLogsTimeComponent, NodeMissingLookupFactorsComponent, NodeQualityScore, NodeRecommendationsComponent, NodeSelectComponent, NodeValueDetailsComponent, PipelineStagesProgressComponent, PluralizePipe, PopoverComponent, PopoverConfirmComponent, PrecisionPipe, RelatedNodeResult, RemoveMarkdownPipe, RepeatPipe, Repository, ResizedDirective, ResizedEvent, ResponsiveService, SchemaInfoComponent, SchemaVersionLinkComponent, SearchExtendComponent, ShelfDialogComponent, ShellComponent, SitesManagementChartComponent, SitesMapsComponent, SitesNodesComponent, SkeletonTextComponent, SocialTagsComponent, SortByPipe, SortSelectComponent, TagsInputDirective, Template, TermsPropertyContentComponent, TermsSubClassOfContentComponent, TermsUnitsDescriptionComponent, ThousandSuffixesPipe, ThousandsPipe, TimesPipe, ToastComponent, UncapitalizePipe, addPolygonToFeature, afterBarDrawPlugin, allCountriesQuery, allGroups, allOptions, availableProperties, axisHoverPlugin, backgroundHoverPlugin, baseApiUrl, baseUrl, bottom, buildSummary, bytesSize, calculateCycleDuration, calculateCycleDurationEnabled, calculateCycleStartDate, calculateCycleStartDateEnabled, capitalize, changelogUrl, clustererImage, code, colorToRgba, compoundToHtml, computeKeys, computeTerms, contactUsEmail, contactUsLink, convertToSvg, coordinatesToPoint, copyObject, countGroupVisibleNodes, countriesQuery, createMarker, cropsQuery, d3ellipse, d3wrap, dataPathLabel, dataPathToKey, dataVersionHeader, dataVersionHeaderKey, defaultFeature, defaultLabel, defaultSuggestionType, defaultSvgIconSize, defaultTicksFont, definitionToSchemaType, distinctUntilChangedDeep, downloadFile, downloadPng, downloadSvg, ellipsis, engineGitBaseUrl, engineGitUrl, errorHasError, errorHasWarning, errorText, evaluateSuccess, exportAsSVG, exportFormats, externalLink, externalNodeLink, fillColor, fillStyle, filterBlankNode, filterError, filterParams, findConfigModels, findMatchingModel, findModels, findNodeModel, findOrchestratorModel, findProperty, findPropertyById, flatFilterData, flatFilterNode, formatCustomErrorMessage, formatDate, formatError, formatPropertyError, formatter, getColor, getDatesBetween, gitBranch, gitHome, gitlabRawUrl, glossaryBaseUrl, glossaryLink, groupChanged, groupLogsByModel, groupLogsByTerm, groupNodesByTerm, groupdLogsByKey, grouppedKeys, grouppedValueKeys, groupsLogsByFields, guideModelUrl, guideNamespace, guidePageId, handleAPIError, handleGuideEvent, hasError, hasValidationError, hasWarning, hexToRgba, iconSizes, icons, ignoreKeys, increaseScaleLimits, initialFilterState, injectResizeEvent$, inputGroupsTermTypes, isAddPropertyEnabled, isChrome, isDateBetween, isEqual, isExternal, isKeyClosedVisible, isKeyHidden, isMaxStage, isMethodModelAllowed, isMigrationError, isMissingOneOfError, isMissingPropertyError, isNonNodeModelKey, isSchemaIri, isScrolledBelow, isState, isTermTypeAllowed, isValidKey, keyToDataPath, levels, listColor, listColorContinuous, listColorWithAlpha, loadMapApi, loadSvgSprite, locationQuery, logToCsv, logValueArray, logsKey, lollipopChartPlugin, lookupUrl, mapFilterData, mapsUrl, markerIcon, markerPie, matchAggregatedQuery, matchAggregatedValidatedQuery, matchBoolPrefixQuery, matchCountry, matchExactQuery, matchGlobalRegion, matchId, matchNameNormalized, matchNestedKey, matchPhrasePrefixQuery, matchPhraseQuery, matchPrimaryProductQuery, matchQuery, matchRegex, matchRegion, matchTermType, matchType, maxAreaSize, measurementValue, mergeDataWithHeaders, methodTierOrder, migrationErrorMessage, migrationsUrl, missingNodeErrors, modelCount, modelKeyParams, modelParams, models, multiMatchQuery, nestedProperty, nestingEnabled, nestingTypeEnabled, nodeAvailableProperties, nodeById, nodeColours, nodeDataState, nodeDataStates, nodeId, nodeIds, nodeLink, nodeLinkEnabled, nodeLinkTypeEnabled, nodeLogsUrl, nodeQualityScoreColor, nodeQualityScoreLevel, nodeQualityScoreMaxDefault, nodeQualityScoreOrder, nodeSecondaryColours, nodeToAggregationFilename, nodeType, nodeTypeDataState, nodeTypeIcon, nodeTypeIconSchema, nodeUrl, nodeUrlParams, nodeVersion, nodesByState, nodesByType, numberGte, optionsFromGroup, parentKey, parentProperty, parseColor, parseData, parseDataPath, parseLines, parseLogMessage, parseMessage, parseNewValue, pluralize, pointToCoordinates, polygonBounds, polygonToCoordinates, polygonToMap, polygonsFromFeature, populateWithTrackIdsFilterData, postGuideEvent, primaryProduct, productsQuery, propertyError, propertyId, recursiveProperties, refToSchemaType, refreshPropertyKeys, regionsQuery, registerChart, repeat, reportIssueLink, reportIssueUrl, safeJSONParse, safeJSONStringify, schemaBaseUrl, schemaDataBaseUrl, schemaLink, schemaRequiredProperties, schemaTypeToDefaultValue, scrollToEl, scrollTop, searchFilterData, searchableTypes, siblingProperty, singleProperty, siteTooBig, siteTypeToColor, siteTypeToIcon, sortProperties, sortedDates, strokeColor, strokeStyle, suggestMatchQuery, suggestQuery, takeAfterViewInit, termLocation, termLocationName, termProperties, termTypeLabel, toSnakeCase, toThousands, typeToNewProperty, typeaheadFocus, uncapitalize, uniqueDatesBetween, updateProperties, valueLink, valueToString, valueTypeToDefault, valueValue, waitFor, wildcardQuery };
5411
- export type { AfterBarDrawSettings, AxisHoverSettings, BarChartDataItem, ButtonGroupItem, ChartExportMetadata, ContributionChartDataItem, FilterData, FilterElement, FilterFn, FilterGroup, FilterOption, FilterState, HistogramChartDataItem, IBlankNodeLog, IBlankNodeLogSubValue, ICalculationsModel, ICalculationsModelsParams, ICalculationsRequirementsParams, IChartExportFormat, ICloseMessage, IConfigModel, ICustomValidationRules, ICycleJSONLDExtended, IErrorProperty, IFeature, IFeatureCollection, IFileUploadError, IGeometryCollection, IGlossaryMigration, IGlossaryMigrations, IGroupedKeys, IGroupedNode, IGroupedNodes, IGroupedNodesValue, IGroupedNodesValues, IImpactAssessmentJSONLDExtended, IIssueParams, IJSONData, IJSONNode, ILine, ILog, IMarker, IMessage, IMobileShellMenuButton, INavigationMenuLink, INewProperty, INodeContributions, INodeErrorLog, INodeHeaders, INodeLogs, INodeMissingLookupLog, INodeProperty, INodeRequestParams, INodeTermLog, INodeTermLogs, INonBlankNodeLog, IPolygonMap, IRelatedNode, ISearchParams, ISearchResultExtended, ISearchResults, IShellMenuButton, ISiteJSONLDExtended, IStoredNode, ISummary, ISummaryError, IToast, IValidationError, IValidationErrorWithIndex, LollipopPluginSettings, RgbColor, SelectValue, SortOption, SortSelectEvent, SortSelectOrder, blankNodesTypeValue, chartExportFn, chartTooltipContentFn, contributions, feature, horizontalTooltipData, modelKey, nodes, nonBlankNodesTypeValue, searchResult, searchableType, sortOrders, suggestionType, svgIconNames, svgIconSizes, validationErrorKeyword, validationErrorLevel, validationErrorParam };
5454
+ export type { AfterBarDrawSettings, AxisHoverSettings, BarChartDataItem, ButtonGroupItem, ChartExportMetadata, ContributionChartDataItem, ContributionTooltipData, FilterData, FilterElement, FilterFn, FilterGroup, FilterOption, FilterState, HistogramChartDataItem, IBlankNodeLog, IBlankNodeLogSubValue, ICalculationsModel, ICalculationsModelsParams, ICalculationsRequirementsParams, IChartExportFormat, ICloseMessage, IConfigModel, ICustomValidationRules, ICycleJSONLDExtended, IErrorProperty, IFeature, IFeatureCollection, IFileUploadError, IGeometryCollection, IGlossaryMigration, IGlossaryMigrations, IGroupedKeys, IGroupedNode, IGroupedNodes, IGroupedNodesValue, IGroupedNodesValues, IImpactAssessmentJSONLDExtended, IIssueParams, IJSONData, IJSONNode, ILine, ILog, IMarker, IMessage, IMobileShellMenuButton, INavigationMenuLink, INewProperty, INodeContributions, INodeErrorLog, INodeHeaders, INodeLogs, INodeMissingLookupLog, INodeProperty, INodeRequestParams, INodeTermLog, INodeTermLogs, INonBlankNodeLog, IPolygonMap, IRelatedNode, ISearchParams, ISearchResultExtended, ISearchResults, IShellMenuButton, ISiteJSONLDExtended, IStoredNode, ISummary, ISummaryError, IToast, IValidationError, IValidationErrorWithIndex, LollipopPluginSettings, RgbColor, SelectValue, SortOption, SortSelectEvent, SortSelectOrder, blankNodesTypeValue, chartExportFn, chartTooltipContentFn, contributions, feature, horizontalTooltipData, modelKey, nodes, nonBlankNodesTypeValue, searchResult, searchableType, sortOrders, suggestionType, svgIconNames, svgIconSizes, validationErrorKeyword, validationErrorLevel, validationErrorParam };