@hestia-earth/ui-components 0.42.2 → 0.42.4

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.
@@ -15,12 +15,12 @@ import { ShadeGenerator } from 'shade-generator/dist/shadeGenerator';
15
15
  import { select, selectAll } from 'd3-selection';
16
16
  import { isEmpty, unique, monthsBefore, toPrecision, isNumber, isUndefined, toComma, duration, keyToLabel, sum, min, max, mean, median, ellipsis as ellipsis$1, getPercentileValue, isEqual as isEqual$2, toDashCase, diffInDays } from '@hestia-earth/utils';
17
17
  import { json2csv } from 'json-2-csv';
18
- import { propertyValue as propertyValue$1, emptyValue } from '@hestia-earth/utils/dist/term';
18
+ import { propertyValue as propertyValue$1, emptyValue } from '@hestia-earth/utils/term';
19
19
  import { getDefaultModelId, getModelGroup, loadResourceKey, isInSystemBoundary } from '@hestia-earth/glossary';
20
20
  import isEqual$1 from 'lodash.isequal';
21
21
  import { DataState, filenameWithoutExt, nodeTypeToParam, allowedDataStates, SupportedExtensions, fileToExt, fileExt, maxFileSizeMb } from '@hestia-earth/api';
22
22
  import { models as models$1, loadConfig, getMaxStage } from '@hestia-earth/engine-models';
23
- import { DeltaDisplayType, delta, customDeltaFuncs } from '@hestia-earth/utils/dist/delta';
23
+ import { DeltaDisplayType, delta, customDeltaFuncs } from '@hestia-earth/utils/delta';
24
24
  import { LocalStorageService } from 'ngx-webstorage';
25
25
  import { trigger, state, transition, style, animate } from '@angular/animations';
26
26
  import { RouterLinkActive, RouterLink, ActivatedRoute } from '@angular/router';
@@ -5594,23 +5594,23 @@ class HeSearchService {
5594
5594
  this.http = inject(HttpClient);
5595
5595
  this.commonService = inject(HeCommonService);
5596
5596
  }
5597
- search$(params, dataVersion) {
5597
+ search$(params, dataVersion, searchPath = 'search') {
5598
5598
  return this.http
5599
- .post(`${this.commonService.apiBaseUrl}/search`, params, {
5599
+ .post(`${this.commonService.apiBaseUrl}/${searchPath}`, params, {
5600
5600
  headers: dataVersionHeader(dataVersion)
5601
5601
  })
5602
5602
  .pipe(catchError(() => of(emptySearchResult())));
5603
5603
  }
5604
- count$(params = {}, dataVersion) {
5604
+ count$(params = {}, dataVersion, countPath = 'count') {
5605
5605
  return this.http
5606
- .post(`${this.commonService.apiBaseUrl}/count`, params, {
5606
+ .post(`${this.commonService.apiBaseUrl}/${countPath}`, params, {
5607
5607
  headers: dataVersionHeader(dataVersion)
5608
5608
  })
5609
5609
  .pipe(catchError(() => of(0)));
5610
5610
  }
5611
- get$(type, id) {
5611
+ get$(type, id, searchPath = 'search') {
5612
5612
  return this.http
5613
- .post(`${this.commonService.apiBaseUrl}/search`, {
5613
+ .post(`${this.commonService.apiBaseUrl}/${searchPath}`, {
5614
5614
  limit: 1,
5615
5615
  query: {
5616
5616
  bool: {
@@ -5620,10 +5620,10 @@ class HeSearchService {
5620
5620
  })
5621
5621
  .pipe(catchError(() => of(emptySearchResult())), map(({ results }) => results[0] || null));
5622
5622
  }
5623
- suggest$(term, type, extraQueries = [], fullQuery, limit = 10, includes = []) {
5623
+ suggest$(term, type, extraQueries = [], fullQuery, limit = 10, includes = [], searchPath = 'search') {
5624
5624
  const query = fullQuery || suggestQuery(term, type, extraQueries);
5625
5625
  return this.http
5626
- .post(`${this.commonService.apiBaseUrl}/search`, {
5626
+ .post(`${this.commonService.apiBaseUrl}/${searchPath}`, {
5627
5627
  limit,
5628
5628
  fields: ['name', '@id', type ? '' : '@type', 'termType', 'aggregated', ...includes].filter(val => !!val),
5629
5629
  query