@sumaris-net/ngx-components 18.23.61 → 18.23.62

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.
@@ -31646,6 +31646,8 @@ var MenuItem_1;
31646
31646
  let MenuItem = class MenuItem extends Entity {
31647
31647
  static { MenuItem_1 = this; }
31648
31648
  static fromObject;
31649
+ _badgeSubscription;
31650
+ _badgeColorSubscription;
31649
31651
  parent;
31650
31652
  parentId;
31651
31653
  $children = new BehaviorSubject([]);
@@ -31676,11 +31678,22 @@ let MenuItem = class MenuItem extends Entity {
31676
31678
  matSvgIcon;
31677
31679
  fromObject(source, opts) {
31678
31680
  this.id = source.id;
31681
+ console.log('source', source);
31679
31682
  this.title = source.title;
31680
31683
  this.titleProperty = source.titleProperty;
31681
31684
  this.titleArgs = source.titleArgs;
31682
- this.badge = source.badge;
31683
- this.badgeColor = source.badgeColor;
31685
+ if (source.badge$) {
31686
+ this.badge$ = source.badge$;
31687
+ }
31688
+ else {
31689
+ this.badge = source.badge;
31690
+ }
31691
+ if (source.badgeColor$) {
31692
+ this.badgeColor$ = source.badgeColor$;
31693
+ }
31694
+ else {
31695
+ this.badgeColor = source.badgeColor;
31696
+ }
31684
31697
  // Clean path
31685
31698
  if (source.path) {
31686
31699
  const { path, params } = MenuItems.parsePathWithQuery(source.path);
@@ -31722,6 +31735,8 @@ let MenuItem = class MenuItem extends Entity {
31722
31735
  }
31723
31736
  delete target.$children;
31724
31737
  delete target.$title;
31738
+ delete target.$badge;
31739
+ delete target.$badgeColor;
31725
31740
  delete target.parent;
31726
31741
  return target;
31727
31742
  }
@@ -31755,6 +31770,15 @@ let MenuItem = class MenuItem extends Entity {
31755
31770
  this.$badge.next(value);
31756
31771
  }
31757
31772
  }
31773
+ get badge$() {
31774
+ return this.$badge.asObservable();
31775
+ }
31776
+ set badge$(value$) {
31777
+ this._badgeSubscription?.unsubscribe();
31778
+ this._badgeSubscription = value$?.subscribe((value) => {
31779
+ this.badge = value;
31780
+ });
31781
+ }
31758
31782
  get badgeColor() {
31759
31783
  return this.$badgeColor.value;
31760
31784
  }
@@ -31763,6 +31787,15 @@ let MenuItem = class MenuItem extends Entity {
31763
31787
  this.$badgeColor.next(value);
31764
31788
  }
31765
31789
  }
31790
+ get badgeColor$() {
31791
+ return this.$badgeColor.asObservable();
31792
+ }
31793
+ set badgeColor$(value$) {
31794
+ this._badgeColorSubscription?.unsubscribe();
31795
+ this._badgeColorSubscription = value$?.subscribe((value) => {
31796
+ this.badgeColor = value;
31797
+ });
31798
+ }
31766
31799
  get detached() {
31767
31800
  return !this.parentPath || !this.parent;
31768
31801
  }
@@ -37021,6 +37054,7 @@ class HomePage extends RxState {
37021
37054
  });
37022
37055
  this.buttons = (buttons || [])?.map((item) => MenuItem.fromObject(item));
37023
37056
  this.toolbarButtons = (toolbarButtons || [])?.map((item) => MenuItem.fromObject(item));
37057
+ console.log('toolbarButtons', this.toolbarButtons);
37024
37058
  this.mobile = this.platform.is('mobile');
37025
37059
  this.platform.ready().then(() => this.start());
37026
37060
  this.showAccountButton = environment.account?.showAccountButton ?? true;
@@ -37223,7 +37257,7 @@ class HomePage extends RxState {
37223
37257
  .map((item) => {
37224
37258
  // Replace title using properties
37225
37259
  if (isNotNilOrBlank(item.titleProperty) && this._config) {
37226
- const title = this._config.properties[item.titleProperty] ?? item.title;
37260
+ const title = this._config.properties?.[item.titleProperty] ?? item.title;
37227
37261
  if (item.title !== title) {
37228
37262
  // Clone before changing, to be able to restore the original title (e.g. if config property changed)
37229
37263
  item.clone();