@aaamb/ngx-design-system 1.5.7 → 1.6.0

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.
@@ -2737,6 +2737,10 @@ class SideNavComponent {
2737
2737
  footerButton = input(null, ...(ngDevMode ? [{ debugName: "footerButton" }] : /* istanbul ignore next */ []));
2738
2738
  footerButtons = input([], ...(ngDevMode ? [{ debugName: "footerButtons" }] : /* istanbul ignore next */ []));
2739
2739
  logoAlt = input('Side navigation logo', ...(ngDevMode ? [{ debugName: "logoAlt" }] : /* istanbul ignore next */ []));
2740
+ /** Grouped options with optional titles. When set, takes precedence over `options`. */
2741
+ sections = input([], ...(ngDevMode ? [{ debugName: "sections" }] : /* istanbul ignore next */ []));
2742
+ variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
2743
+ copyrightText = input('Copyrights by AAAMB', ...(ngDevMode ? [{ debugName: "copyrightText" }] : /* istanbul ignore next */ []));
2740
2744
  optionSelected = output();
2741
2745
  childSelected = output();
2742
2746
  activePathChange = output();
@@ -2745,6 +2749,39 @@ class SideNavComponent {
2745
2749
  currentLogoSrc = computed(() => this.isCollapsed()
2746
2750
  ? this.collapsedLogoSrc() || this.logoSrc()
2747
2751
  : this.logoSrc(), ...(ngDevMode ? [{ debugName: "currentLogoSrc" }] : /* istanbul ignore next */ []));
2752
+ isCompact = computed(() => this.variant() === 'compact', ...(ngDevMode ? [{ debugName: "isCompact" }] : /* istanbul ignore next */ []));
2753
+ // `offset` keeps data-testid indexes flat across sections.
2754
+ resolvedSections = computed(() => {
2755
+ const sections = this.sections().length
2756
+ ? this.sections()
2757
+ : [{ options: this.options() }];
2758
+ let offset = 0;
2759
+ return sections.map((section) => {
2760
+ const resolved = { ...section, offset };
2761
+ offset += section.options.length;
2762
+ return resolved;
2763
+ });
2764
+ }, ...(ngDevMode ? [{ debugName: "resolvedSections" }] : /* istanbul ignore next */ []));
2765
+ navClasses = computed(() => {
2766
+ if (this.isCompact()) {
2767
+ const padding = this.isCollapsed() ? 'px-0' : 'px-3';
2768
+ return `min-h-0 overflow-y-auto overflow-x-hidden gap-1 ${padding} py-4`;
2769
+ }
2770
+ return this.isCollapsed()
2771
+ ? 'overflow-hidden gap-5 px-0 py-8'
2772
+ : 'overflow-hidden gap-5 px-5 py-8';
2773
+ }, ...(ngDevMode ? [{ debugName: "navClasses" }] : /* istanbul ignore next */ []));
2774
+ footerContainerClasses = computed(() => this.isCompact() ? 'h-10 px-3' : 'h-12 px-5', ...(ngDevMode ? [{ debugName: "footerContainerClasses" }] : /* istanbul ignore next */ []));
2775
+ footerButtonClasses = computed(() => {
2776
+ if (this.isCompact()) {
2777
+ return this.isCollapsed()
2778
+ ? 'h-9 w-9 mx-auto rounded-lg text-sm hover:bg-white/10 px-0 justify-center'
2779
+ : 'h-9 rounded-lg text-sm hover:bg-white/10 px-3 justify-start';
2780
+ }
2781
+ return this.isCollapsed()
2782
+ ? 'h-10 rounded-[3rem] hover:bg-[#005f58] px-2 justify-center'
2783
+ : 'h-10 rounded-[3rem] hover:bg-[#005f58] px-5 justify-start';
2784
+ }, ...(ngDevMode ? [{ debugName: "footerButtonClasses" }] : /* istanbul ignore next */ []));
2748
2785
  onOptionClick(option) {
2749
2786
  if (option.children?.length) {
2750
2787
  this.toggleMenu(option.name);
@@ -2779,14 +2816,26 @@ class SideNavComponent {
2779
2816
  isPathActive(path) {
2780
2817
  return this.isRouteActive(path);
2781
2818
  }
2819
+ hasBadge(option) {
2820
+ return option.badge !== undefined && option.badge !== null && option.badge !== '';
2821
+ }
2782
2822
  optionButtonClasses(option) {
2823
+ const badge = this.hasBadge(option) ? ' relative' : '';
2824
+ if (this.isCompact()) {
2825
+ const base = this.isCollapsed()
2826
+ ? 'justify-center w-9 h-9 rounded-lg mx-auto'
2827
+ : 'w-full h-9 px-3 rounded-lg';
2828
+ return this.isOptionActive(option)
2829
+ ? `${base}${badge} bg-green-6 text-green-base`
2830
+ : `${base}${badge} bg-transparent hover:bg-white/10`;
2831
+ }
2783
2832
  const base = this.isCollapsed()
2784
2833
  ? 'justify-center w-12 h-12 rounded-full mx-auto px-2 bg-transparent'
2785
2834
  : 'w-full px-5 py-2 rounded-[3rem] bg-transparent';
2786
2835
  if (this.isOptionActive(option)) {
2787
- return `${base} bg-white text-green-base`;
2836
+ return `${base}${badge} bg-white text-green-base`;
2788
2837
  }
2789
- return `${base} hover:bg-[#006761]`;
2838
+ return `${base}${badge} hover:bg-[#006761]`;
2790
2839
  }
2791
2840
  childButtonClasses(path, collapsed) {
2792
2841
  const base = collapsed
@@ -2823,7 +2872,7 @@ class SideNavComponent {
2823
2872
  return this.activePath() || this.internalActivePath();
2824
2873
  }
2825
2874
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: SideNavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2826
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: SideNavComponent, isStandalone: true, selector: "ads-side-nav", inputs: { isCollapsed: { classPropertyName: "isCollapsed", publicName: "isCollapsed", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, activePath: { classPropertyName: "activePath", publicName: "activePath", isSignal: true, isRequired: false, transformFunction: null }, logoSrc: { classPropertyName: "logoSrc", publicName: "logoSrc", isSignal: true, isRequired: false, transformFunction: null }, footerLogoSrc: { classPropertyName: "footerLogoSrc", publicName: "footerLogoSrc", isSignal: true, isRequired: false, transformFunction: null }, collapsedLogoSrc: { classPropertyName: "collapsedLogoSrc", publicName: "collapsedLogoSrc", isSignal: true, isRequired: false, transformFunction: null }, footerButton: { classPropertyName: "footerButton", publicName: "footerButton", isSignal: true, isRequired: false, transformFunction: null }, footerButtons: { classPropertyName: "footerButtons", publicName: "footerButtons", isSignal: true, isRequired: false, transformFunction: null }, logoAlt: { classPropertyName: "logoAlt", publicName: "logoAlt", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { optionSelected: "optionSelected", childSelected: "childSelected", activePathChange: "activePathChange" }, ngImport: i0, template: `
2875
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.11", type: SideNavComponent, isStandalone: true, selector: "ads-side-nav", inputs: { isCollapsed: { classPropertyName: "isCollapsed", publicName: "isCollapsed", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, activePath: { classPropertyName: "activePath", publicName: "activePath", isSignal: true, isRequired: false, transformFunction: null }, logoSrc: { classPropertyName: "logoSrc", publicName: "logoSrc", isSignal: true, isRequired: false, transformFunction: null }, footerLogoSrc: { classPropertyName: "footerLogoSrc", publicName: "footerLogoSrc", isSignal: true, isRequired: false, transformFunction: null }, collapsedLogoSrc: { classPropertyName: "collapsedLogoSrc", publicName: "collapsedLogoSrc", isSignal: true, isRequired: false, transformFunction: null }, footerButton: { classPropertyName: "footerButton", publicName: "footerButton", isSignal: true, isRequired: false, transformFunction: null }, footerButtons: { classPropertyName: "footerButtons", publicName: "footerButtons", isSignal: true, isRequired: false, transformFunction: null }, logoAlt: { classPropertyName: "logoAlt", publicName: "logoAlt", isSignal: true, isRequired: false, transformFunction: null }, sections: { classPropertyName: "sections", publicName: "sections", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, copyrightText: { classPropertyName: "copyrightText", publicName: "copyrightText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { optionSelected: "optionSelected", childSelected: "childSelected", activePathChange: "activePathChange" }, ngImport: i0, template: `
2827
2876
  <aside
2828
2877
  class="w-full h-full bg-green-base flex flex-col items-center select-none"
2829
2878
  >
@@ -2839,118 +2888,179 @@ class SideNavComponent {
2839
2888
  }
2840
2889
  </div>
2841
2890
  <nav
2842
- class="relative w-full flex-1 flex flex-col gap-5 overflow-hidden"
2843
- [ngClass]="isCollapsed() ? 'px-0 py-8' : 'px-5 py-8'"
2891
+ class="relative w-full flex-1 flex flex-col"
2892
+ [ngClass]="navClasses()"
2844
2893
  >
2845
- @for (option of options(); track option.name; let idx = $index) {
2846
- <div>
2847
- <button
2848
- type="button"
2849
- nz-tooltip
2850
- class="cursor-pointer flex items-center max-h-12 transition-colors duration-300 border-none outline-none"
2851
- [ngClass]="optionButtonClasses(option)"
2852
- [attr.data-testid]="'side-nav-option-' + idx"
2853
- (click)="onOptionClick(option)"
2854
- [nzTooltipTitle]="isCollapsed() ? option.name : null"
2855
- nzTooltipPlacement="right"
2856
- [nzTooltipMouseEnterDelay]="0.3"
2894
+ @for (
2895
+ section of resolvedSections();
2896
+ track $index;
2897
+ let sectionIdx = $index
2898
+ ) {
2899
+ @if (isCollapsed()) {
2900
+ @if (sectionIdx > 0) {
2901
+ <div
2902
+ class="mx-auto my-2 w-6 border-t border-white/20"
2903
+ [attr.data-testid]="'side-nav-section-divider-' + sectionIdx"
2904
+ ></div>
2905
+ }
2906
+ } @else if (section.title) {
2907
+ <span
2908
+ class="px-3 pt-3 pb-1 text-xs font-medium text-[#7FD1AE] whitespace-nowrap"
2909
+ animate.enter="fade-in"
2910
+ [attr.data-testid]="'side-nav-section-title-' + sectionIdx"
2911
+ >{{ section.title }}</span
2857
2912
  >
2858
- @if (option.icon) {
2859
- <ads-icon
2860
- [iconName]="option.icon"
2861
- [size]="16"
2862
- [color]="isOptionActive(option) ? '#014744' : '#ffffff'"
2863
- [ngClass]="!isCollapsed() ? 'mr-2' : ''"
2864
- ></ads-icon>
2865
- }
2866
-
2867
- @if (!isCollapsed()) {
2868
- <span
2869
- class="text-base font-medium whitespace-nowrap flex items-center justify-between w-full"
2870
- animate.enter="fade-in"
2871
- animate.leave="fade-out"
2872
- [ngClass]="
2873
- isOptionActive(option)
2874
- ? 'text-green-base'
2875
- : 'text-neutral-light-text'
2876
- "
2877
- >
2913
+ }
2914
+ @for (
2915
+ option of section.options;
2916
+ track option.name;
2917
+ let optionIdx = $index
2918
+ ) {
2919
+ @let idx = section.offset + optionIdx;
2920
+ <div>
2921
+ <ng-template #badgeTooltip>
2922
+ <span class="flex items-center gap-2">
2878
2923
  {{ option.name }}
2879
- @if (option.children?.length) {
2880
- <ads-icon
2881
- iconName="arrow_right"
2882
- [size]="16"
2883
- [color]="isOptionActive(option) ? '#014744' : '#ffffff'"
2884
- class="ml-2 transition-transform duration-200"
2885
- [ngClass]="
2886
- expandedMenus()[option.name]
2887
- ? 'rotate-90'
2888
- : '-rotate-90'
2889
- "
2890
- ></ads-icon>
2891
- }
2924
+ <span
2925
+ class="min-w-5 h-5 px-1.5 rounded-full text-xs flex items-center justify-center bg-white/15 text-[#7FD1AE]"
2926
+ >{{ option.badge }}</span
2927
+ >
2892
2928
  </span>
2893
- }
2894
- </button>
2895
-
2896
- @if (option.children?.length && expandedMenus()[option.name]) {
2897
- <div
2898
- class="flex flex-col w-full mt-2"
2899
- [ngClass]="isCollapsed() ? 'items-center gap-2' : 'pl-8 gap-4'"
2900
- animate.enter="fade-in"
2929
+ </ng-template>
2930
+ <button
2931
+ type="button"
2932
+ nz-tooltip
2933
+ class="cursor-pointer flex items-center max-h-12 transition-colors duration-300 border-none outline-none"
2934
+ [ngClass]="optionButtonClasses(option)"
2935
+ [attr.data-testid]="'side-nav-option-' + idx"
2936
+ (click)="onOptionClick(option)"
2937
+ [nzTooltipTitle]="
2938
+ isCollapsed()
2939
+ ? hasBadge(option)
2940
+ ? badgeTooltip
2941
+ : option.name
2942
+ : null
2943
+ "
2944
+ nzTooltipPlacement="right"
2945
+ [nzTooltipMouseEnterDelay]="0.3"
2901
2946
  >
2902
- @for (
2903
- child of option.children;
2904
- track child.name;
2905
- let subIdx = $index
2906
- ) {
2907
- <button
2908
- type="button"
2909
- nz-tooltip
2910
- class="cursor-pointer rounded-[44px] h-9 flex items-center transition-colors duration-300 border-none outline-none"
2911
- [ngClass]="childButtonClasses(child.url, isCollapsed())"
2912
- [attr.data-testid]="
2913
- 'side-nav-sub-option-' + idx + '-' + subIdx
2947
+ @if (option.icon) {
2948
+ <ads-icon
2949
+ [iconName]="option.icon"
2950
+ [size]="16"
2951
+ [color]="isOptionActive(option) ? '#014744' : '#ffffff'"
2952
+ [ngClass]="!isCollapsed() ? 'mr-2' : ''"
2953
+ ></ads-icon>
2954
+ }
2955
+
2956
+ @if (isCollapsed() && hasBadge(option)) {
2957
+ <span
2958
+ class="absolute top-1.5 right-1.5 w-1.5 h-1.5 rounded-full bg-[#7FD1AE]"
2959
+ [attr.data-testid]="'side-nav-option-badge-dot-' + idx"
2960
+ ></span>
2961
+ }
2962
+
2963
+ @if (!isCollapsed()) {
2964
+ <span
2965
+ class="font-medium whitespace-nowrap flex items-center justify-between w-full"
2966
+ animate.enter="fade-in"
2967
+ animate.leave="fade-out"
2968
+ [class.text-base]="!isCompact()"
2969
+ [class.text-sm]="isCompact()"
2970
+ [ngClass]="
2971
+ isOptionActive(option)
2972
+ ? 'text-green-base'
2973
+ : 'text-neutral-light-text'
2914
2974
  "
2915
- (click)="onChildClick(child.url)"
2916
- [nzTooltipTitle]="isCollapsed() ? child.name : null"
2917
- nzTooltipPlacement="right"
2918
- [nzTooltipMouseEnterDelay]="0.3"
2919
2975
  >
2920
- @if (!isCollapsed()) {
2921
- <span animate.enter="fade-in" animate.leave="fade-out">{{
2922
- child.name
2923
- }}</span>
2924
- } @else {
2976
+ {{ option.name }}
2977
+ @if (hasBadge(option)) {
2925
2978
  <span
2926
- class="rounded-full bg-neutral-light-text"
2927
- animate.enter="fade-in"
2928
- animate.leave="fade-out"
2979
+ class="ml-auto min-w-5 h-5 px-1.5 rounded-full text-xs font-medium flex items-center justify-center"
2929
2980
  [ngClass]="
2930
- isPathActive(child.url) ? 'w-2 h-2' : 'w-1.25 h-1.25'
2981
+ isOptionActive(option)
2982
+ ? 'bg-green-base text-[#7FD1AE]'
2983
+ : 'bg-white/15 text-[#7FD1AE]'
2931
2984
  "
2932
- ></span>
2985
+ [attr.data-testid]="'side-nav-option-badge-' + idx"
2986
+ >{{ option.badge }}</span
2987
+ >
2933
2988
  }
2934
- </button>
2989
+ @if (option.children?.length) {
2990
+ <ads-icon
2991
+ iconName="arrow_right"
2992
+ [size]="16"
2993
+ [color]="isOptionActive(option) ? '#014744' : '#ffffff'"
2994
+ class="ml-2 transition-transform duration-200"
2995
+ [ngClass]="
2996
+ expandedMenus()[option.name]
2997
+ ? 'rotate-90'
2998
+ : '-rotate-90'
2999
+ "
3000
+ ></ads-icon>
3001
+ }
3002
+ </span>
2935
3003
  }
2936
- </div>
2937
- }
2938
- </div>
3004
+ </button>
3005
+
3006
+ @if (option.children?.length && expandedMenus()[option.name]) {
3007
+ <div
3008
+ class="flex flex-col w-full mt-2"
3009
+ [ngClass]="isCollapsed() ? 'items-center gap-2' : 'pl-8 gap-4'"
3010
+ animate.enter="fade-in"
3011
+ >
3012
+ @for (
3013
+ child of option.children;
3014
+ track child.name;
3015
+ let subIdx = $index
3016
+ ) {
3017
+ <button
3018
+ type="button"
3019
+ nz-tooltip
3020
+ class="cursor-pointer rounded-[44px] h-9 flex items-center transition-colors duration-300 border-none outline-none"
3021
+ [ngClass]="childButtonClasses(child.url, isCollapsed())"
3022
+ [attr.data-testid]="
3023
+ 'side-nav-sub-option-' + idx + '-' + subIdx
3024
+ "
3025
+ (click)="onChildClick(child.url)"
3026
+ [nzTooltipTitle]="isCollapsed() ? child.name : null"
3027
+ nzTooltipPlacement="right"
3028
+ [nzTooltipMouseEnterDelay]="0.3"
3029
+ >
3030
+ @if (!isCollapsed()) {
3031
+ <span animate.enter="fade-in" animate.leave="fade-out">{{
3032
+ child.name
3033
+ }}</span>
3034
+ } @else {
3035
+ <span
3036
+ class="rounded-full bg-neutral-light-text"
3037
+ animate.enter="fade-in"
3038
+ animate.leave="fade-out"
3039
+ [ngClass]="
3040
+ isPathActive(child.url) ? 'w-2 h-2' : 'w-1.25 h-1.25'
3041
+ "
3042
+ ></span>
3043
+ }
3044
+ </button>
3045
+ }
3046
+ </div>
3047
+ }
3048
+ </div>
3049
+ }
2939
3050
  }
2940
3051
  </nav>
2941
3052
  @if (footerButton()) {
2942
3053
  <div
2943
- class="w-full h-12 py-0 px-5 overflow-hidden mt-auto"
3054
+ class="w-full py-0 overflow-hidden mt-auto"
3055
+ [ngClass]="footerContainerClasses()"
2944
3056
  animate.enter="fade-in"
2945
3057
  animate.leave="fade-out"
2946
3058
  >
2947
3059
  <button
2948
3060
  type="button"
2949
3061
  nz-tooltip
2950
- class="w-full h-10 flex items-center gap-2 rounded-[3rem] border-none outline-none bg-transparent text-white font-medium transition-colors duration-300 hover:bg-[#005f58] cursor-pointer"
2951
- [ngClass]="
2952
- isCollapsed() ? 'px-2 justify-center' : 'px-5 justify-start'
2953
- "
3062
+ class="w-full flex items-center gap-2 border-none outline-none bg-transparent text-white font-medium transition-colors duration-300 cursor-pointer"
3063
+ [ngClass]="footerButtonClasses()"
2954
3064
  [disabled]="footerButton()!.disabled ?? false"
2955
3065
  (click)="footerButton()!.callback()"
2956
3066
  [nzTooltipTitle]="isCollapsed() ? footerButton()!.text : null"
@@ -2969,11 +3079,18 @@ class SideNavComponent {
2969
3079
  </button>
2970
3080
  </div>
2971
3081
  }
2972
- @for (btn of footerButtons(); track $index) {
2973
- <div class="w-full h-12 py-0 px-5 overflow-hidden" animate.enter="fade-in" animate.leave="fade-out">
2974
- <button type="button" nz-tooltip
2975
- class="w-full h-10 flex items-center gap-2 rounded-[3rem] border-none outline-none bg-transparent text-white font-medium transition-colors duration-300 hover:bg-[#005f58] cursor-pointer"
2976
- [ngClass]="isCollapsed() ? 'px-2 justify-center' : 'px-5 justify-start'"
3082
+ @for (btn of footerButtons(); track $index) {
3083
+ <div
3084
+ class="w-full py-0 overflow-hidden"
3085
+ [ngClass]="footerContainerClasses()"
3086
+ animate.enter="fade-in"
3087
+ animate.leave="fade-out"
3088
+ >
3089
+ <button
3090
+ type="button"
3091
+ nz-tooltip
3092
+ class="w-full flex items-center gap-2 border-none outline-none bg-transparent text-white font-medium transition-colors duration-300 cursor-pointer"
3093
+ [ngClass]="footerButtonClasses()"
2977
3094
  [disabled]="btn.disabled ?? false"
2978
3095
  (click)="btn.callback()"
2979
3096
  [nzTooltipTitle]="isCollapsed() ? btn.text : null"
@@ -3003,7 +3120,7 @@ class SideNavComponent {
3003
3120
  />
3004
3121
  }
3005
3122
 
3006
- <span class="text-white text-[0.75rem]">Copyrights by AAAMB</span>
3123
+ <span class="text-white text-[0.75rem]">{{ copyrightText() }}</span>
3007
3124
  </div>
3008
3125
  </div>
3009
3126
  }
@@ -3032,118 +3149,179 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
3032
3149
  }
3033
3150
  </div>
3034
3151
  <nav
3035
- class="relative w-full flex-1 flex flex-col gap-5 overflow-hidden"
3036
- [ngClass]="isCollapsed() ? 'px-0 py-8' : 'px-5 py-8'"
3152
+ class="relative w-full flex-1 flex flex-col"
3153
+ [ngClass]="navClasses()"
3037
3154
  >
3038
- @for (option of options(); track option.name; let idx = $index) {
3039
- <div>
3040
- <button
3041
- type="button"
3042
- nz-tooltip
3043
- class="cursor-pointer flex items-center max-h-12 transition-colors duration-300 border-none outline-none"
3044
- [ngClass]="optionButtonClasses(option)"
3045
- [attr.data-testid]="'side-nav-option-' + idx"
3046
- (click)="onOptionClick(option)"
3047
- [nzTooltipTitle]="isCollapsed() ? option.name : null"
3048
- nzTooltipPlacement="right"
3049
- [nzTooltipMouseEnterDelay]="0.3"
3155
+ @for (
3156
+ section of resolvedSections();
3157
+ track $index;
3158
+ let sectionIdx = $index
3159
+ ) {
3160
+ @if (isCollapsed()) {
3161
+ @if (sectionIdx > 0) {
3162
+ <div
3163
+ class="mx-auto my-2 w-6 border-t border-white/20"
3164
+ [attr.data-testid]="'side-nav-section-divider-' + sectionIdx"
3165
+ ></div>
3166
+ }
3167
+ } @else if (section.title) {
3168
+ <span
3169
+ class="px-3 pt-3 pb-1 text-xs font-medium text-[#7FD1AE] whitespace-nowrap"
3170
+ animate.enter="fade-in"
3171
+ [attr.data-testid]="'side-nav-section-title-' + sectionIdx"
3172
+ >{{ section.title }}</span
3050
3173
  >
3051
- @if (option.icon) {
3052
- <ads-icon
3053
- [iconName]="option.icon"
3054
- [size]="16"
3055
- [color]="isOptionActive(option) ? '#014744' : '#ffffff'"
3056
- [ngClass]="!isCollapsed() ? 'mr-2' : ''"
3057
- ></ads-icon>
3058
- }
3059
-
3060
- @if (!isCollapsed()) {
3061
- <span
3062
- class="text-base font-medium whitespace-nowrap flex items-center justify-between w-full"
3063
- animate.enter="fade-in"
3064
- animate.leave="fade-out"
3065
- [ngClass]="
3066
- isOptionActive(option)
3067
- ? 'text-green-base'
3068
- : 'text-neutral-light-text'
3069
- "
3070
- >
3174
+ }
3175
+ @for (
3176
+ option of section.options;
3177
+ track option.name;
3178
+ let optionIdx = $index
3179
+ ) {
3180
+ @let idx = section.offset + optionIdx;
3181
+ <div>
3182
+ <ng-template #badgeTooltip>
3183
+ <span class="flex items-center gap-2">
3071
3184
  {{ option.name }}
3072
- @if (option.children?.length) {
3073
- <ads-icon
3074
- iconName="arrow_right"
3075
- [size]="16"
3076
- [color]="isOptionActive(option) ? '#014744' : '#ffffff'"
3077
- class="ml-2 transition-transform duration-200"
3078
- [ngClass]="
3079
- expandedMenus()[option.name]
3080
- ? 'rotate-90'
3081
- : '-rotate-90'
3082
- "
3083
- ></ads-icon>
3084
- }
3185
+ <span
3186
+ class="min-w-5 h-5 px-1.5 rounded-full text-xs flex items-center justify-center bg-white/15 text-[#7FD1AE]"
3187
+ >{{ option.badge }}</span
3188
+ >
3085
3189
  </span>
3086
- }
3087
- </button>
3088
-
3089
- @if (option.children?.length && expandedMenus()[option.name]) {
3090
- <div
3091
- class="flex flex-col w-full mt-2"
3092
- [ngClass]="isCollapsed() ? 'items-center gap-2' : 'pl-8 gap-4'"
3093
- animate.enter="fade-in"
3190
+ </ng-template>
3191
+ <button
3192
+ type="button"
3193
+ nz-tooltip
3194
+ class="cursor-pointer flex items-center max-h-12 transition-colors duration-300 border-none outline-none"
3195
+ [ngClass]="optionButtonClasses(option)"
3196
+ [attr.data-testid]="'side-nav-option-' + idx"
3197
+ (click)="onOptionClick(option)"
3198
+ [nzTooltipTitle]="
3199
+ isCollapsed()
3200
+ ? hasBadge(option)
3201
+ ? badgeTooltip
3202
+ : option.name
3203
+ : null
3204
+ "
3205
+ nzTooltipPlacement="right"
3206
+ [nzTooltipMouseEnterDelay]="0.3"
3094
3207
  >
3095
- @for (
3096
- child of option.children;
3097
- track child.name;
3098
- let subIdx = $index
3099
- ) {
3100
- <button
3101
- type="button"
3102
- nz-tooltip
3103
- class="cursor-pointer rounded-[44px] h-9 flex items-center transition-colors duration-300 border-none outline-none"
3104
- [ngClass]="childButtonClasses(child.url, isCollapsed())"
3105
- [attr.data-testid]="
3106
- 'side-nav-sub-option-' + idx + '-' + subIdx
3208
+ @if (option.icon) {
3209
+ <ads-icon
3210
+ [iconName]="option.icon"
3211
+ [size]="16"
3212
+ [color]="isOptionActive(option) ? '#014744' : '#ffffff'"
3213
+ [ngClass]="!isCollapsed() ? 'mr-2' : ''"
3214
+ ></ads-icon>
3215
+ }
3216
+
3217
+ @if (isCollapsed() && hasBadge(option)) {
3218
+ <span
3219
+ class="absolute top-1.5 right-1.5 w-1.5 h-1.5 rounded-full bg-[#7FD1AE]"
3220
+ [attr.data-testid]="'side-nav-option-badge-dot-' + idx"
3221
+ ></span>
3222
+ }
3223
+
3224
+ @if (!isCollapsed()) {
3225
+ <span
3226
+ class="font-medium whitespace-nowrap flex items-center justify-between w-full"
3227
+ animate.enter="fade-in"
3228
+ animate.leave="fade-out"
3229
+ [class.text-base]="!isCompact()"
3230
+ [class.text-sm]="isCompact()"
3231
+ [ngClass]="
3232
+ isOptionActive(option)
3233
+ ? 'text-green-base'
3234
+ : 'text-neutral-light-text'
3107
3235
  "
3108
- (click)="onChildClick(child.url)"
3109
- [nzTooltipTitle]="isCollapsed() ? child.name : null"
3110
- nzTooltipPlacement="right"
3111
- [nzTooltipMouseEnterDelay]="0.3"
3112
3236
  >
3113
- @if (!isCollapsed()) {
3114
- <span animate.enter="fade-in" animate.leave="fade-out">{{
3115
- child.name
3116
- }}</span>
3117
- } @else {
3237
+ {{ option.name }}
3238
+ @if (hasBadge(option)) {
3118
3239
  <span
3119
- class="rounded-full bg-neutral-light-text"
3120
- animate.enter="fade-in"
3121
- animate.leave="fade-out"
3240
+ class="ml-auto min-w-5 h-5 px-1.5 rounded-full text-xs font-medium flex items-center justify-center"
3122
3241
  [ngClass]="
3123
- isPathActive(child.url) ? 'w-2 h-2' : 'w-1.25 h-1.25'
3242
+ isOptionActive(option)
3243
+ ? 'bg-green-base text-[#7FD1AE]'
3244
+ : 'bg-white/15 text-[#7FD1AE]'
3124
3245
  "
3125
- ></span>
3246
+ [attr.data-testid]="'side-nav-option-badge-' + idx"
3247
+ >{{ option.badge }}</span
3248
+ >
3126
3249
  }
3127
- </button>
3250
+ @if (option.children?.length) {
3251
+ <ads-icon
3252
+ iconName="arrow_right"
3253
+ [size]="16"
3254
+ [color]="isOptionActive(option) ? '#014744' : '#ffffff'"
3255
+ class="ml-2 transition-transform duration-200"
3256
+ [ngClass]="
3257
+ expandedMenus()[option.name]
3258
+ ? 'rotate-90'
3259
+ : '-rotate-90'
3260
+ "
3261
+ ></ads-icon>
3262
+ }
3263
+ </span>
3128
3264
  }
3129
- </div>
3130
- }
3131
- </div>
3265
+ </button>
3266
+
3267
+ @if (option.children?.length && expandedMenus()[option.name]) {
3268
+ <div
3269
+ class="flex flex-col w-full mt-2"
3270
+ [ngClass]="isCollapsed() ? 'items-center gap-2' : 'pl-8 gap-4'"
3271
+ animate.enter="fade-in"
3272
+ >
3273
+ @for (
3274
+ child of option.children;
3275
+ track child.name;
3276
+ let subIdx = $index
3277
+ ) {
3278
+ <button
3279
+ type="button"
3280
+ nz-tooltip
3281
+ class="cursor-pointer rounded-[44px] h-9 flex items-center transition-colors duration-300 border-none outline-none"
3282
+ [ngClass]="childButtonClasses(child.url, isCollapsed())"
3283
+ [attr.data-testid]="
3284
+ 'side-nav-sub-option-' + idx + '-' + subIdx
3285
+ "
3286
+ (click)="onChildClick(child.url)"
3287
+ [nzTooltipTitle]="isCollapsed() ? child.name : null"
3288
+ nzTooltipPlacement="right"
3289
+ [nzTooltipMouseEnterDelay]="0.3"
3290
+ >
3291
+ @if (!isCollapsed()) {
3292
+ <span animate.enter="fade-in" animate.leave="fade-out">{{
3293
+ child.name
3294
+ }}</span>
3295
+ } @else {
3296
+ <span
3297
+ class="rounded-full bg-neutral-light-text"
3298
+ animate.enter="fade-in"
3299
+ animate.leave="fade-out"
3300
+ [ngClass]="
3301
+ isPathActive(child.url) ? 'w-2 h-2' : 'w-1.25 h-1.25'
3302
+ "
3303
+ ></span>
3304
+ }
3305
+ </button>
3306
+ }
3307
+ </div>
3308
+ }
3309
+ </div>
3310
+ }
3132
3311
  }
3133
3312
  </nav>
3134
3313
  @if (footerButton()) {
3135
3314
  <div
3136
- class="w-full h-12 py-0 px-5 overflow-hidden mt-auto"
3315
+ class="w-full py-0 overflow-hidden mt-auto"
3316
+ [ngClass]="footerContainerClasses()"
3137
3317
  animate.enter="fade-in"
3138
3318
  animate.leave="fade-out"
3139
3319
  >
3140
3320
  <button
3141
3321
  type="button"
3142
3322
  nz-tooltip
3143
- class="w-full h-10 flex items-center gap-2 rounded-[3rem] border-none outline-none bg-transparent text-white font-medium transition-colors duration-300 hover:bg-[#005f58] cursor-pointer"
3144
- [ngClass]="
3145
- isCollapsed() ? 'px-2 justify-center' : 'px-5 justify-start'
3146
- "
3323
+ class="w-full flex items-center gap-2 border-none outline-none bg-transparent text-white font-medium transition-colors duration-300 cursor-pointer"
3324
+ [ngClass]="footerButtonClasses()"
3147
3325
  [disabled]="footerButton()!.disabled ?? false"
3148
3326
  (click)="footerButton()!.callback()"
3149
3327
  [nzTooltipTitle]="isCollapsed() ? footerButton()!.text : null"
@@ -3162,11 +3340,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
3162
3340
  </button>
3163
3341
  </div>
3164
3342
  }
3165
- @for (btn of footerButtons(); track $index) {
3166
- <div class="w-full h-12 py-0 px-5 overflow-hidden" animate.enter="fade-in" animate.leave="fade-out">
3167
- <button type="button" nz-tooltip
3168
- class="w-full h-10 flex items-center gap-2 rounded-[3rem] border-none outline-none bg-transparent text-white font-medium transition-colors duration-300 hover:bg-[#005f58] cursor-pointer"
3169
- [ngClass]="isCollapsed() ? 'px-2 justify-center' : 'px-5 justify-start'"
3343
+ @for (btn of footerButtons(); track $index) {
3344
+ <div
3345
+ class="w-full py-0 overflow-hidden"
3346
+ [ngClass]="footerContainerClasses()"
3347
+ animate.enter="fade-in"
3348
+ animate.leave="fade-out"
3349
+ >
3350
+ <button
3351
+ type="button"
3352
+ nz-tooltip
3353
+ class="w-full flex items-center gap-2 border-none outline-none bg-transparent text-white font-medium transition-colors duration-300 cursor-pointer"
3354
+ [ngClass]="footerButtonClasses()"
3170
3355
  [disabled]="btn.disabled ?? false"
3171
3356
  (click)="btn.callback()"
3172
3357
  [nzTooltipTitle]="isCollapsed() ? btn.text : null"
@@ -3196,14 +3381,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
3196
3381
  />
3197
3382
  }
3198
3383
 
3199
- <span class="text-white text-[0.75rem]">Copyrights by AAAMB</span>
3384
+ <span class="text-white text-[0.75rem]">{{ copyrightText() }}</span>
3200
3385
  </div>
3201
3386
  </div>
3202
3387
  }
3203
3388
  </aside>
3204
3389
  `,
3205
3390
  }]
3206
- }], propDecorators: { isCollapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCollapsed", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], activePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "activePath", required: false }] }], logoSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoSrc", required: false }] }], footerLogoSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerLogoSrc", required: false }] }], collapsedLogoSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedLogoSrc", required: false }] }], footerButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButton", required: false }] }], footerButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButtons", required: false }] }], logoAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoAlt", required: false }] }], optionSelected: [{ type: i0.Output, args: ["optionSelected"] }], childSelected: [{ type: i0.Output, args: ["childSelected"] }], activePathChange: [{ type: i0.Output, args: ["activePathChange"] }] } });
3391
+ }], propDecorators: { isCollapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCollapsed", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], activePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "activePath", required: false }] }], logoSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoSrc", required: false }] }], footerLogoSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerLogoSrc", required: false }] }], collapsedLogoSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedLogoSrc", required: false }] }], footerButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButton", required: false }] }], footerButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButtons", required: false }] }], logoAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoAlt", required: false }] }], sections: [{ type: i0.Input, args: [{ isSignal: true, alias: "sections", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], copyrightText: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyrightText", required: false }] }], optionSelected: [{ type: i0.Output, args: ["optionSelected"] }], childSelected: [{ type: i0.Output, args: ["childSelected"] }], activePathChange: [{ type: i0.Output, args: ["activePathChange"] }] } });
3207
3392
 
3208
3393
  class MultipleSelectorComponent {
3209
3394
  label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));