coer-elements 1.1.35 → 2.0.1

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.
@@ -7,7 +7,6 @@ export declare class CoerSidenav {
7
7
  private _router;
8
8
  protected isOpen: WritableSignal<boolean>;
9
9
  protected _isModalOpen: WritableSignal<boolean>;
10
- protected _navigation: WritableSignal<IMenu[]>;
11
10
  protected _isLoading: WritableSignal<boolean>;
12
11
  protected sidenav: import("@angular/core").Signal<MatDrawer>;
13
12
  protected menuList: import("@angular/core").Signal<readonly CoerTreeAccordion[]>;
@@ -15,6 +14,7 @@ export declare class CoerSidenav {
15
14
  protected get backdrop(): boolean;
16
15
  protected get mode(): 'over' | 'push';
17
16
  protected get showAsideMenu(): boolean;
17
+ _navigation: import("@angular/core").Signal<IMenu[]>;
18
18
  constructor();
19
19
  /** */
20
20
  protected NavigateTo(selectedOption: IMenuOptionSelected, showGridMenu?: boolean): Promise<void>;
@@ -38,7 +38,7 @@ import * as i2$a from '@angular/material/toolbar';
38
38
  import { MatToolbarModule } from '@angular/material/toolbar';
39
39
  import { Tools, ControlValue, CONTROL_VALUE, DateTime, Screen, CoerAlert, Files, ElementsHTML, Source, Menu, Breadcrumbs } from 'coer-elements/tools';
40
40
  import { Tooltip, Modal } from 'bootstrap';
41
- import { isModalOpenSIGNAL, menuSelectedSIGNAL, breakpointSIGNAL, isMenuOpenSIGNAL, navigationSIGNAL, isLoadingSIGNAL } from 'coer-elements/signals';
41
+ import { isModalOpenSIGNAL, menuSelectedSIGNAL, breakpointSIGNAL, isMenuOpenSIGNAL, isLoadingSIGNAL, navigationSIGNAL } from 'coer-elements/signals';
42
42
 
43
43
  class CoerAccordion {
44
44
  constructor() {
@@ -2862,11 +2862,11 @@ class CoerMenuOption {
2862
2862
  });
2863
2863
  }
2864
2864
  get _icon() {
2865
- return (this.icon && this.icon.length > 0)
2865
+ return (Tools.IsNotOnlyWhiteSpace(this.icon) && this.icon.length > 0)
2866
2866
  ? this.icon : '';
2867
2867
  }
2868
2868
  get _path() {
2869
- return (this.path && this.path.length > 0)
2869
+ return (Tools.IsNotOnlyWhiteSpace(this.path) && this.path.length > 0)
2870
2870
  ? this.path : '/home';
2871
2871
  }
2872
2872
  get _tree() {
@@ -3163,7 +3163,7 @@ class CoerTreeAccordion {
3163
3163
  return [...this.tree].concat([{ ...this.item }]);
3164
3164
  }
3165
3165
  get _icon() {
3166
- return (this.item && this.item.hasOwnProperty('icon') && this.item.icon.length > 0)
3166
+ return (this.item && Tools.IsNotOnlyWhiteSpace(this.item?.icon) && this.item.icon.length > 0)
3167
3167
  ? this.item.icon : 'fa-solid fa-bars';
3168
3168
  }
3169
3169
  get marginLeft() {
@@ -3296,13 +3296,18 @@ class CoerSidenav {
3296
3296
  //signals
3297
3297
  this.isOpen = isMenuOpenSIGNAL;
3298
3298
  this._isModalOpen = isModalOpenSIGNAL;
3299
- this._navigation = navigationSIGNAL;
3300
3299
  this._isLoading = isLoadingSIGNAL;
3301
3300
  //Elements
3302
3301
  this.sidenav = viewChild.required('matSidenav');
3303
3302
  this.menuList = viewChildren(CoerTreeAccordion);
3304
3303
  //Outputs
3305
3304
  this.onMenuSelected = output();
3305
+ //computed
3306
+ this._navigation = computed(() => {
3307
+ let id = 0;
3308
+ const navigation = navigationSIGNAL();
3309
+ return navigation.map(item => Object.assign(item, { id: ++id }));
3310
+ });
3306
3311
  /** */
3307
3312
  this._IsMenu = (item) => Tools.IsNotNull(item) && Tools.IsNotNull(item?.items);
3308
3313
  /** */