@hestia-earth/ui-components 0.32.39 → 0.32.40

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.
@@ -33,11 +33,11 @@ export declare class ShellComponent {
33
33
  className?: string;
34
34
  activeClassName?: string;
35
35
  }[]>;
36
- protected clickedButton: WritableSignal<string | null>;
37
- protected expanded: WritableSignal<boolean>;
38
- protected menuRef: WritableSignal<TemplateRef<any>>;
39
- activeButtonId: import("@angular/core").Signal<string>;
40
- activeMenuId: import("@angular/core").Signal<string>;
36
+ protected readonly clickedButton: WritableSignal<string | null>;
37
+ protected readonly expanded: WritableSignal<boolean>;
38
+ protected readonly menuRef: WritableSignal<TemplateRef<any>>;
39
+ protected readonly activeButtonId: import("@angular/core").Signal<string>;
40
+ protected readonly activeMenuId: import("@angular/core").Signal<string>;
41
41
  protected topMenuButtons: import("@angular/core").Signal<{
42
42
  isActive: boolean;
43
43
  id: string;
@@ -2939,13 +2939,11 @@ class MobileShellComponent {
2939
2939
  this.activeButtonId = computed(() => {
2940
2940
  return this.clickedButton() || this._defaultActiveButtonId();
2941
2941
  });
2942
- this.activeMenuId = computed(() => {
2943
- if (this.expanded() && this.menuRef()) {
2944
- return this._shelfButtons()
2945
- .findIndex(button => button.menuRef === this.menuRef())
2946
- ?.toString();
2947
- }
2948
- });
2942
+ this.activeMenuId = computed(() => this.expanded() && this.menuRef()
2943
+ ? this._shelfButtons()
2944
+ .findIndex(button => button.menuRef === this.menuRef())
2945
+ ?.toString()
2946
+ : undefined);
2949
2947
  }
2950
2948
  set menuButtons(value) {
2951
2949
  this._shelfButtons.set(value);
@@ -3117,13 +3115,11 @@ class ShellComponent {
3117
3115
  this.activeButtonId = computed(() => {
3118
3116
  return this.clickedButton() || this._defaultActiveButtonId();
3119
3117
  });
3120
- this.activeMenuId = computed(() => {
3121
- if (this.expanded() && this.menuRef()) {
3122
- return this._shelfButtons()
3123
- .findIndex(button => button.menuRef === this.menuRef())
3124
- ?.toString();
3125
- }
3126
- });
3118
+ this.activeMenuId = computed(() => this.expanded() && this.menuRef()
3119
+ ? this._shelfButtons()
3120
+ .findIndex(button => button.menuRef === this.menuRef())
3121
+ ?.toString()
3122
+ : undefined);
3127
3123
  this.topMenuButtons = computed(() => {
3128
3124
  return this.buttons().filter(button => !button.position || button.position === 'top');
3129
3125
  });
@@ -12782,10 +12778,7 @@ class SelectOptionGroupComponent {
12782
12778
  return this.expanded;
12783
12779
  }
12784
12780
  toggleSelectAll() {
12785
- if (this.disabled) {
12786
- return;
12787
- }
12788
- return this.isAllSelected ? this.unselectAll() : this.selectAll();
12781
+ return this.disabled ? null : this.isAllSelected ? this.unselectAll() : this.selectAll();
12789
12782
  }
12790
12783
  selectAll() {
12791
12784
  if (!this._parent.isMultiple()) {
@@ -13297,10 +13290,11 @@ class SitesManagementChartComponent {
13297
13290
  this.selectedTermType = signal(undefined);
13298
13291
  this.selectedManagement = computed(() => this.managementPerTermType()?.[this.selectedTermType()?.termType]?.[this.selectedTermType()?.blankNodesGroup] ??
13299
13292
  []);
13293
+ this.selectedManagementTerms = computed(() => unique(this.selectedManagement().map(v => v.term)));
13300
13294
  this.dates = computed(() => this.selectedManagement()
13301
13295
  .flatMap(({ startDate, endDate }) => [formatDate(startDate, true), formatDate(endDate, false)])
13302
13296
  .filter(Boolean));
13303
- this.chartColors = computed(() => this.selectedManagement().reduce((prev, { term }, index) => ({ ...prev, [term.name]: getColor(index) }), {}));
13297
+ this.chartColors = computed(() => Object.fromEntries(this.selectedManagementTerms().map((term, index) => [term.name, getColor(index)])));
13304
13298
  // compute list of all dates used on the chart, sorted ascending.
13305
13299
  // need to add dates even when there are no data, otherwise the chart will stack wrongly
13306
13300
  // @ee https://github.com/chartjs/Chart.js/issues/5405