codexly-ui 0.0.9 → 0.0.12

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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { input, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, effect, signal, inject, ElementRef, InjectionToken, PLATFORM_ID, Injectable, Renderer2, ApplicationRef, EnvironmentInjector, DestroyRef, createComponent, Directive, output, contentChildren, NgZone, model, untracked, forwardRef, viewChild, HostListener, ViewChildren, contentChild, Injector, ViewChild, ChangeDetectorRef, ContentChildren, Input, numberAttribute, booleanAttribute } from '@angular/core';
3
- import { isPlatformBrowser, CurrencyPipe, NgTemplateOutlet, DecimalPipe, NgStyle } from '@angular/common';
3
+ import { isPlatformBrowser, CurrencyPipe, NgTemplateOutlet, DecimalPipe, NgStyle, DOCUMENT } from '@angular/common';
4
4
  import * as i1 from '@angular/forms';
5
5
  import { NG_VALUE_ACCESSOR, FormsModule, NgControl, FormControl, ReactiveFormsModule, FormGroup, Validators } from '@angular/forms';
6
6
  import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
@@ -10880,57 +10880,109 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
10880
10880
  args: [ClxStepComponent]
10881
10881
  }] } });
10882
10882
 
10883
+ const CLX_MENU_COLOR = new InjectionToken('CLX_MENU_COLOR');
10884
+ const CLX_LAYOUT_COLLAPSED = new InjectionToken('CLX_LAYOUT_COLLAPSED');
10885
+ // ── Item geometry ──────────────────────────────────────────────────────────────
10886
+ const NAV_ITEM_BASE = 'flex items-center gap-3 w-full text-sm font-medium transition-colors duration-150 cursor-pointer select-none';
10887
+ const NAV_ITEM_L1 = 'px-6 py-3';
10888
+ const NAV_ITEM_L2 = 'pl-4 pr-3 py-2';
10889
+ const NAV_ITEM_IDLE = 'text-slate-400';
10890
+ // ── Children container ─────────────────────────────────────────────────────────
10891
+ const NAV_CHILDREN_WRAPPER = 'grid transition-all duration-300 ease-in-out';
10892
+ const NAV_CHILDREN_INNER = 'overflow-hidden';
10893
+ const NAV_CHILDREN_LIST = 'ml-6 border-l border-slate-700/60 py-1 space-y-0.5';
10894
+
10883
10895
  class ClxAppLayoutComponent {
10884
- // ── Inputs ─────────────────────────────────────────────────────────────────
10896
+ _zone = inject(NgZone);
10897
+ _document = inject(DOCUMENT);
10885
10898
  activeColor = input('indigo', ...(ngDevMode ? [{ debugName: "activeColor" }] : []));
10886
- // ── Sidebar state ──────────────────────────────────────────────────────────
10887
- _sidebarOpen = signal(true, ...(ngDevMode ? [{ debugName: "_sidebarOpen" }] : []));
10899
+ _sidebarOpen = signal(false, ...(ngDevMode ? [{ debugName: "_sidebarOpen" }] : []));
10900
+ _collapsed = signal(false, ...(ngDevMode ? [{ debugName: "_collapsed" }] : []));
10901
+ _isMobile = signal(true, ...(ngDevMode ? [{ debugName: "_isMobile" }] : []));
10902
+ _showBackdrop = computed(() => this._sidebarOpen() && this._isMobile(), ...(ngDevMode ? [{ debugName: "_showBackdrop" }] : []));
10888
10903
  _sidebarCls = computed(() => {
10889
- const base = [
10890
- // Mobile: fixed overlay from left edge
10891
- 'fixed inset-y-0 left-0 z-30 w-72 flex flex-col',
10904
+ const collapsed = this._collapsed() && !this._isMobile();
10905
+ const width = collapsed ? 'w-16' : 'w-72';
10906
+ return [
10907
+ `fixed inset-y-0 left-0 z-30 ${width} flex flex-col`,
10892
10908
  'bg-slate-900 overflow-y-auto shrink-0',
10893
- 'transition-transform duration-300 ease-in-out',
10894
- // Desktop (lg+): back into flow, no translation
10895
- 'lg:relative lg:inset-auto lg:z-auto lg:translate-x-0',
10909
+ 'transition-[width,transform] duration-300 ease-in-out',
10910
+ 'lg:transition-[width] lg:relative lg:inset-auto lg:z-auto lg:translate-x-0',
10911
+ (!this._isMobile() || this._sidebarOpen()) ? 'translate-x-0' : '-translate-x-full',
10896
10912
  ].join(' ');
10897
- return this._sidebarOpen()
10898
- ? `${base} translate-x-0`
10899
- : `${base} -translate-x-full`;
10900
10913
  }, ...(ngDevMode ? [{ debugName: "_sidebarCls" }] : []));
10901
- // ── Public API ─────────────────────────────────────────────────────────────
10902
- toggleSidebar() {
10903
- this._sidebarOpen.update(v => !v);
10904
- }
10905
- openSidebar() {
10906
- this._sidebarOpen.set(true);
10914
+ _mql;
10915
+ _mqlListener;
10916
+ ngOnInit() {
10917
+ const win = this._document.defaultView;
10918
+ if (!win)
10919
+ return;
10920
+ this._mql = win.matchMedia('(min-width: 1024px)');
10921
+ this._isMobile.set(!this._mql.matches);
10922
+ if (this._mql.matches)
10923
+ this._sidebarOpen.set(true);
10924
+ this._mqlListener = (e) => {
10925
+ this._zone.run(() => {
10926
+ this._isMobile.set(!e.matches);
10927
+ if (e.matches) {
10928
+ this._sidebarOpen.set(true);
10929
+ }
10930
+ else {
10931
+ this._sidebarOpen.set(false);
10932
+ this._collapsed.set(false);
10933
+ }
10934
+ });
10935
+ };
10936
+ this._mql.addEventListener('change', this._mqlListener);
10907
10937
  }
10908
- closeSidebar() {
10909
- this._sidebarOpen.set(false);
10938
+ ngOnDestroy() {
10939
+ this._mql?.removeEventListener('change', this._mqlListener);
10910
10940
  }
10941
+ _toggleCollapsed() { this._collapsed.update(v => !v); }
10942
+ toggleSidebar() { this._sidebarOpen.update(v => !v); }
10943
+ openSidebar() { this._sidebarOpen.set(true); }
10944
+ closeSidebar() { this._sidebarOpen.set(false); }
10911
10945
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ClxAppLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
10912
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: ClxAppLayoutComponent, isStandalone: true, selector: "clx-app-layout", inputs: { activeColor: { classPropertyName: "activeColor", publicName: "activeColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "flex h-screen overflow-hidden" }, ngImport: i0, template: `
10913
- <!-- ── Mobile backdrop ───────────────────────────────────────────────────── -->
10914
- @if (_sidebarOpen()) {
10946
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: ClxAppLayoutComponent, isStandalone: true, selector: "clx-app-layout", inputs: { activeColor: { classPropertyName: "activeColor", publicName: "activeColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "flex h-screen overflow-hidden" }, providers: [
10947
+ {
10948
+ provide: CLX_LAYOUT_COLLAPSED,
10949
+ useFactory: (self) => () => self._collapsed(),
10950
+ deps: [ClxAppLayoutComponent],
10951
+ },
10952
+ ], ngImport: i0, template: `
10953
+ <!-- Mobile backdrop -->
10954
+ @if (_showBackdrop()) {
10915
10955
  <div
10916
- class="fixed inset-0 z-20 bg-slate-900/60 backdrop-blur-sm lg:hidden"
10956
+ class="fixed inset-0 z-20 bg-slate-900/60"
10917
10957
  aria-hidden="true"
10918
10958
  (click)="closeSidebar()">
10919
10959
  </div>
10920
10960
  }
10921
10961
 
10922
- <!-- ── Sidebar ───────────────────────────────────────────────────────────── -->
10923
- <aside
10924
- [class]="_sidebarCls()"
10925
- aria-label="Navegación principal">
10962
+ <!-- Sidebar -->
10963
+ <aside [class]="_sidebarCls()" aria-label="Navegación principal">
10926
10964
  <ng-content select="[clx-sidebar]"></ng-content>
10927
10965
  </aside>
10928
10966
 
10929
- <!-- ── Right panel ───────────────────────────────────────────────────────── -->
10967
+ <!-- Right panel -->
10930
10968
  <div class="flex-1 flex flex-col overflow-hidden min-w-0">
10931
10969
 
10932
- <!-- Header slot (h-16, white/blur, bottom border) -->
10933
- <header class="h-16 shrink-0 bg-white backdrop-blur-md border-b border-slate-200 flex items-center z-10 px-4 gap-3">
10970
+ <header class="h-16 shrink-0 bg-white border-b border-slate-200 flex items-center z-10 px-4 gap-3">
10971
+ <!-- Toggle button desktop -->
10972
+ <button
10973
+ type="button"
10974
+ class="hidden lg:flex items-center justify-center w-8 h-8 rounded-md text-slate-500 hover:text-slate-700 hover:bg-slate-100 transition-colors shrink-0"
10975
+ (click)="_toggleCollapsed()">
10976
+ <span clx-icon [name]="_collapsed() ? 'menu_open' : 'menu'" size="sm"></span>
10977
+ </button>
10978
+ <!-- Toggle button mobile -->
10979
+ <button
10980
+ type="button"
10981
+ class="flex lg:hidden items-center justify-center w-8 h-8 rounded-md text-slate-500 hover:text-slate-700 hover:bg-slate-100 transition-colors shrink-0"
10982
+ (click)="toggleSidebar()">
10983
+ <span clx-icon name="menu" size="sm"></span>
10984
+ </button>
10985
+
10934
10986
  <ng-content select="[clx-header]"></ng-content>
10935
10987
  </header>
10936
10988
 
@@ -10939,36 +10991,55 @@ class ClxAppLayoutComponent {
10939
10991
  </main>
10940
10992
 
10941
10993
  </div>
10942
- `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10994
+ `, isInline: true, dependencies: [{ kind: "component", type: ClxIconComponent, selector: "span[clx-icon]", inputs: ["name", "size", "color", "fill"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
10943
10995
  }
10944
10996
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ClxAppLayoutComponent, decorators: [{
10945
10997
  type: Component,
10946
10998
  args: [{
10947
10999
  selector: 'clx-app-layout',
10948
11000
  standalone: true,
10949
- imports: [],
11001
+ imports: [ClxIconComponent],
11002
+ providers: [
11003
+ {
11004
+ provide: CLX_LAYOUT_COLLAPSED,
11005
+ useFactory: (self) => () => self._collapsed(),
11006
+ deps: [ClxAppLayoutComponent],
11007
+ },
11008
+ ],
10950
11009
  template: `
10951
- <!-- ── Mobile backdrop ───────────────────────────────────────────────────── -->
10952
- @if (_sidebarOpen()) {
11010
+ <!-- Mobile backdrop -->
11011
+ @if (_showBackdrop()) {
10953
11012
  <div
10954
- class="fixed inset-0 z-20 bg-slate-900/60 backdrop-blur-sm lg:hidden"
11013
+ class="fixed inset-0 z-20 bg-slate-900/60"
10955
11014
  aria-hidden="true"
10956
11015
  (click)="closeSidebar()">
10957
11016
  </div>
10958
11017
  }
10959
11018
 
10960
- <!-- ── Sidebar ───────────────────────────────────────────────────────────── -->
10961
- <aside
10962
- [class]="_sidebarCls()"
10963
- aria-label="Navegación principal">
11019
+ <!-- Sidebar -->
11020
+ <aside [class]="_sidebarCls()" aria-label="Navegación principal">
10964
11021
  <ng-content select="[clx-sidebar]"></ng-content>
10965
11022
  </aside>
10966
11023
 
10967
- <!-- ── Right panel ───────────────────────────────────────────────────────── -->
11024
+ <!-- Right panel -->
10968
11025
  <div class="flex-1 flex flex-col overflow-hidden min-w-0">
10969
11026
 
10970
- <!-- Header slot (h-16, white/blur, bottom border) -->
10971
- <header class="h-16 shrink-0 bg-white backdrop-blur-md border-b border-slate-200 flex items-center z-10 px-4 gap-3">
11027
+ <header class="h-16 shrink-0 bg-white border-b border-slate-200 flex items-center z-10 px-4 gap-3">
11028
+ <!-- Toggle button desktop -->
11029
+ <button
11030
+ type="button"
11031
+ class="hidden lg:flex items-center justify-center w-8 h-8 rounded-md text-slate-500 hover:text-slate-700 hover:bg-slate-100 transition-colors shrink-0"
11032
+ (click)="_toggleCollapsed()">
11033
+ <span clx-icon [name]="_collapsed() ? 'menu_open' : 'menu'" size="sm"></span>
11034
+ </button>
11035
+ <!-- Toggle button mobile -->
11036
+ <button
11037
+ type="button"
11038
+ class="flex lg:hidden items-center justify-center w-8 h-8 rounded-md text-slate-500 hover:text-slate-700 hover:bg-slate-100 transition-colors shrink-0"
11039
+ (click)="toggleSidebar()">
11040
+ <span clx-icon name="menu" size="sm"></span>
11041
+ </button>
11042
+
10972
11043
  <ng-content select="[clx-header]"></ng-content>
10973
11044
  </header>
10974
11045
 
@@ -10980,23 +11051,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
10980
11051
  `,
10981
11052
  encapsulation: ViewEncapsulation.None,
10982
11053
  changeDetection: ChangeDetectionStrategy.OnPush,
10983
- host: {
10984
- class: 'flex h-screen overflow-hidden',
10985
- },
11054
+ host: { class: 'flex h-screen overflow-hidden' },
10986
11055
  }]
10987
11056
  }], propDecorators: { activeColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeColor", required: false }] }] } });
10988
11057
 
10989
- const CLX_MENU_COLOR = new InjectionToken('CLX_MENU_COLOR');
10990
- // ── Item geometry ──────────────────────────────────────────────────────────────
10991
- const NAV_ITEM_BASE = 'flex items-center gap-3 w-full text-sm font-medium transition-colors duration-150 cursor-pointer select-none';
10992
- const NAV_ITEM_L1 = 'px-6 py-3';
10993
- const NAV_ITEM_L2 = 'pl-4 pr-3 py-2';
10994
- const NAV_ITEM_IDLE = 'text-slate-400';
10995
- // ── Children container ─────────────────────────────────────────────────────────
10996
- const NAV_CHILDREN_WRAPPER = 'grid transition-all duration-300 ease-in-out';
10997
- const NAV_CHILDREN_INNER = 'overflow-hidden';
10998
- const NAV_CHILDREN_LIST = 'ml-6 border-l border-slate-700/60 py-1 space-y-0.5';
10999
-
11000
11058
  class ClxMenuItemComponent {
11001
11059
  label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
11002
11060
  icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
@@ -11004,9 +11062,15 @@ class ClxMenuItemComponent {
11004
11062
  color = input('indigo', ...(ngDevMode ? [{ debugName: "color" }] : []));
11005
11063
  nested = input(false, ...(ngDevMode ? [{ debugName: "nested" }] : []));
11006
11064
  _menuColorFn = inject(CLX_MENU_COLOR, { optional: true });
11065
+ _collapsedFn = inject(CLX_LAYOUT_COLLAPSED, { optional: true });
11007
11066
  _hasParent = !!this._menuColorFn;
11067
+ _collapsed = computed(() => this._collapsedFn?.() ?? false, ...(ngDevMode ? [{ debugName: "_collapsed" }] : []));
11008
11068
  _resolvedColor = computed(() => this._menuColorFn?.() ?? this.color(), ...(ngDevMode ? [{ debugName: "_resolvedColor" }] : []));
11009
- _geom = computed(() => this.nested() ? NAV_ITEM_L2 : NAV_ITEM_L1, ...(ngDevMode ? [{ debugName: "_geom" }] : []));
11069
+ _geom = computed(() => {
11070
+ if (this._collapsed())
11071
+ return 'px-0 justify-center';
11072
+ return this.nested() ? NAV_ITEM_L2 : NAV_ITEM_L1;
11073
+ }, ...(ngDevMode ? [{ debugName: "_geom" }] : []));
11010
11074
  _iconCls = computed(() => resolveColor(this._resolvedColor()).textSubtle, ...(ngDevMode ? [{ debugName: "_iconCls" }] : []));
11011
11075
  _idleCls = computed(() => {
11012
11076
  const t = resolveColor(this._resolvedColor());
@@ -11014,6 +11078,9 @@ class ClxMenuItemComponent {
11014
11078
  }, ...(ngDevMode ? [{ debugName: "_idleCls" }] : []));
11015
11079
  _activeCls = computed(() => {
11016
11080
  const t = resolveColor(this._resolvedColor());
11081
+ if (this._collapsed()) {
11082
+ return `${NAV_ITEM_BASE} ${this._geom()} ${t.textSubtle} font-semibold`;
11083
+ }
11017
11084
  return `${NAV_ITEM_BASE} ${this._geom()} ${t.textSubtle} font-semibold border-l-2 ${t.borderLight} !pl-[22px] ${t.hoverBgMuted}`;
11018
11085
  }, ...(ngDevMode ? [{ debugName: "_activeCls" }] : []));
11019
11086
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ClxMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -11024,11 +11091,14 @@ class ClxMenuItemComponent {
11024
11091
  #rla="routerLinkActive"
11025
11092
  [routerLinkActiveOptions]="{ exact: false }"
11026
11093
  [class]="rla.isActive ? _activeCls() : _idleCls()"
11094
+ [title]="_collapsed() ? label() : ''"
11027
11095
  (click)="route() ? null : $event.preventDefault()">
11028
11096
  @if (icon()) {
11029
11097
  <span clx-icon [name]="icon()" size="sm" [class]="rla.isActive || !_hasParent ? _iconCls() : 'text-slate-500'"></span>
11030
11098
  }
11031
- <span class="flex-1 truncate">{{ label() }}</span>
11099
+ @if (!_collapsed()) {
11100
+ <span class="flex-1 truncate">{{ label() }}</span>
11101
+ }
11032
11102
  </a>
11033
11103
  `, isInline: true, dependencies: [{ kind: "component", type: ClxIconComponent, selector: "span[clx-icon]", inputs: ["name", "size", "color", "fill"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11034
11104
  }
@@ -11045,11 +11115,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
11045
11115
  #rla="routerLinkActive"
11046
11116
  [routerLinkActiveOptions]="{ exact: false }"
11047
11117
  [class]="rla.isActive ? _activeCls() : _idleCls()"
11118
+ [title]="_collapsed() ? label() : ''"
11048
11119
  (click)="route() ? null : $event.preventDefault()">
11049
11120
  @if (icon()) {
11050
11121
  <span clx-icon [name]="icon()" size="sm" [class]="rla.isActive || !_hasParent ? _iconCls() : 'text-slate-500'"></span>
11051
11122
  }
11052
- <span class="flex-1 truncate">{{ label() }}</span>
11123
+ @if (!_collapsed()) {
11124
+ <span class="flex-1 truncate">{{ label() }}</span>
11125
+ }
11053
11126
  </a>
11054
11127
  `,
11055
11128
  encapsulation: ViewEncapsulation.None,
@@ -11063,6 +11136,8 @@ class ClxMenuComponent {
11063
11136
  icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
11064
11137
  color = input('indigo', ...(ngDevMode ? [{ debugName: "color" }] : []));
11065
11138
  _isExpanded = signal(false, ...(ngDevMode ? [{ debugName: "_isExpanded" }] : []));
11139
+ _collapsedFn = inject(CLX_LAYOUT_COLLAPSED, { optional: true });
11140
+ _collapsed = computed(() => this._collapsedFn?.() ?? false, ...(ngDevMode ? [{ debugName: "_collapsed" }] : []));
11066
11141
  _childItems;
11067
11142
  _childRoutes = [];
11068
11143
  _router = inject(Router);
@@ -11078,9 +11153,12 @@ class ClxMenuComponent {
11078
11153
  }
11079
11154
  _iconCls = computed(() => resolveColor(this.color()).textSubtle, ...(ngDevMode ? [{ debugName: "_iconCls" }] : []));
11080
11155
  _buttonCls = computed(() => {
11081
- const base = `${NAV_ITEM_BASE} ${NAV_ITEM_L1}`;
11156
+ const geom = this._collapsed() ? 'px-0 justify-center' : NAV_ITEM_L1;
11157
+ const base = `${NAV_ITEM_BASE} ${geom}`;
11082
11158
  const t = resolveColor(this.color());
11083
11159
  if (this._isChildActive()) {
11160
+ if (this._collapsed())
11161
+ return `${base} ${t.textSubtle} font-semibold`;
11084
11162
  return `${base} ${t.textSubtle} font-semibold border-l-2 ${t.borderLight} !pl-[22px]`;
11085
11163
  }
11086
11164
  return `${base} ${NAV_ITEM_IDLE} ${t.hoverBgMuted}`;
@@ -11109,29 +11187,34 @@ class ClxMenuComponent {
11109
11187
  <button
11110
11188
  type="button"
11111
11189
  [class]="_buttonCls()"
11112
- (click)="_toggle()">
11190
+ [title]="_collapsed() ? label() : ''"
11191
+ (click)="!_collapsed() && _toggle()">
11113
11192
  @if (icon()) {
11114
11193
  <span clx-icon [name]="icon()" size="sm" [class]="_iconCls()"></span>
11115
11194
  }
11116
- <span class="flex-1 text-left truncate">{{ label() }}</span>
11117
- <span
11118
- clx-icon
11119
- name="expand_more"
11120
- size="sm"
11121
- class="shrink-0 transition-transform duration-300"
11122
- [style.transform]="_isExpanded() ? 'rotate(180deg)' : 'rotate(0deg)'">
11123
- </span>
11195
+ @if (!_collapsed()) {
11196
+ <span class="flex-1 text-left truncate">{{ label() }}</span>
11197
+ <span
11198
+ clx-icon
11199
+ name="expand_more"
11200
+ size="sm"
11201
+ class="shrink-0 transition-transform duration-300"
11202
+ [style.transform]="_isExpanded() ? 'rotate(180deg)' : 'rotate(0deg)'">
11203
+ </span>
11204
+ }
11124
11205
  </button>
11125
11206
 
11126
- <div
11127
- [class]="NAV_CHILDREN_WRAPPER"
11128
- [style.grid-template-rows]="_isExpanded() ? '1fr' : '0fr'">
11129
- <div [class]="NAV_CHILDREN_INNER">
11130
- <div [class]="NAV_CHILDREN_LIST">
11131
- <ng-content></ng-content>
11207
+ @if (!_collapsed()) {
11208
+ <div
11209
+ [class]="NAV_CHILDREN_WRAPPER"
11210
+ [style.grid-template-rows]="_isExpanded() ? '1fr' : '0fr'">
11211
+ <div [class]="NAV_CHILDREN_INNER">
11212
+ <div [class]="NAV_CHILDREN_LIST">
11213
+ <ng-content></ng-content>
11214
+ </div>
11132
11215
  </div>
11133
11216
  </div>
11134
- </div>
11217
+ }
11135
11218
  `, isInline: true, dependencies: [{ kind: "component", type: ClxIconComponent, selector: "span[clx-icon]", inputs: ["name", "size", "color", "fill"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
11136
11219
  }
11137
11220
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ClxMenuComponent, decorators: [{
@@ -11147,29 +11230,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
11147
11230
  <button
11148
11231
  type="button"
11149
11232
  [class]="_buttonCls()"
11150
- (click)="_toggle()">
11233
+ [title]="_collapsed() ? label() : ''"
11234
+ (click)="!_collapsed() && _toggle()">
11151
11235
  @if (icon()) {
11152
11236
  <span clx-icon [name]="icon()" size="sm" [class]="_iconCls()"></span>
11153
11237
  }
11154
- <span class="flex-1 text-left truncate">{{ label() }}</span>
11155
- <span
11156
- clx-icon
11157
- name="expand_more"
11158
- size="sm"
11159
- class="shrink-0 transition-transform duration-300"
11160
- [style.transform]="_isExpanded() ? 'rotate(180deg)' : 'rotate(0deg)'">
11161
- </span>
11238
+ @if (!_collapsed()) {
11239
+ <span class="flex-1 text-left truncate">{{ label() }}</span>
11240
+ <span
11241
+ clx-icon
11242
+ name="expand_more"
11243
+ size="sm"
11244
+ class="shrink-0 transition-transform duration-300"
11245
+ [style.transform]="_isExpanded() ? 'rotate(180deg)' : 'rotate(0deg)'">
11246
+ </span>
11247
+ }
11162
11248
  </button>
11163
11249
 
11164
- <div
11165
- [class]="NAV_CHILDREN_WRAPPER"
11166
- [style.grid-template-rows]="_isExpanded() ? '1fr' : '0fr'">
11167
- <div [class]="NAV_CHILDREN_INNER">
11168
- <div [class]="NAV_CHILDREN_LIST">
11169
- <ng-content></ng-content>
11250
+ @if (!_collapsed()) {
11251
+ <div
11252
+ [class]="NAV_CHILDREN_WRAPPER"
11253
+ [style.grid-template-rows]="_isExpanded() ? '1fr' : '0fr'">
11254
+ <div [class]="NAV_CHILDREN_INNER">
11255
+ <div [class]="NAV_CHILDREN_LIST">
11256
+ <ng-content></ng-content>
11257
+ </div>
11170
11258
  </div>
11171
11259
  </div>
11172
- </div>
11260
+ }
11173
11261
  `,
11174
11262
  encapsulation: ViewEncapsulation.None,
11175
11263
  changeDetection: ChangeDetectionStrategy.OnPush,