codexly-ui 0.0.10 → 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.
- package/fesm2022/codexly-ui.mjs +180 -91
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/index.d.ts +16 -2
- package/package.json +1 -1
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -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,56 +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
|
-
|
|
10896
|
+
_zone = inject(NgZone);
|
|
10897
|
+
_document = inject(DOCUMENT);
|
|
10885
10898
|
activeColor = input('indigo', ...(ngDevMode ? [{ debugName: "activeColor" }] : []));
|
|
10886
|
-
|
|
10887
|
-
|
|
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
|
|
10890
|
-
|
|
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`,
|
|
10891
10908
|
'bg-slate-900 overflow-y-auto shrink-0',
|
|
10892
|
-
|
|
10893
|
-
'lg:transition-
|
|
10894
|
-
'
|
|
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',
|
|
10895
10912
|
].join(' ');
|
|
10896
|
-
return this._sidebarOpen()
|
|
10897
|
-
? `${base} translate-x-0`
|
|
10898
|
-
: `${base} -translate-x-full`;
|
|
10899
10913
|
}, ...(ngDevMode ? [{ debugName: "_sidebarCls" }] : []));
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
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);
|
|
10906
10937
|
}
|
|
10907
|
-
|
|
10908
|
-
this.
|
|
10938
|
+
ngOnDestroy() {
|
|
10939
|
+
this._mql?.removeEventListener('change', this._mqlListener);
|
|
10909
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); }
|
|
10910
10945
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ClxAppLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10911
|
-
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" },
|
|
10912
|
-
|
|
10913
|
-
|
|
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()) {
|
|
10914
10955
|
<div
|
|
10915
|
-
class="fixed inset-0 z-20 bg-slate-900/60
|
|
10956
|
+
class="fixed inset-0 z-20 bg-slate-900/60"
|
|
10916
10957
|
aria-hidden="true"
|
|
10917
10958
|
(click)="closeSidebar()">
|
|
10918
10959
|
</div>
|
|
10919
10960
|
}
|
|
10920
10961
|
|
|
10921
|
-
<!--
|
|
10922
|
-
<aside
|
|
10923
|
-
[class]="_sidebarCls()"
|
|
10924
|
-
aria-label="Navegación principal">
|
|
10962
|
+
<!-- Sidebar -->
|
|
10963
|
+
<aside [class]="_sidebarCls()" aria-label="Navegación principal">
|
|
10925
10964
|
<ng-content select="[clx-sidebar]"></ng-content>
|
|
10926
10965
|
</aside>
|
|
10927
10966
|
|
|
10928
|
-
<!--
|
|
10967
|
+
<!-- Right panel -->
|
|
10929
10968
|
<div class="flex-1 flex flex-col overflow-hidden min-w-0">
|
|
10930
10969
|
|
|
10931
|
-
<!-- Header slot (h-16, white/blur, bottom border) -->
|
|
10932
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
|
+
|
|
10933
10986
|
<ng-content select="[clx-header]"></ng-content>
|
|
10934
10987
|
</header>
|
|
10935
10988
|
|
|
@@ -10938,36 +10991,55 @@ class ClxAppLayoutComponent {
|
|
|
10938
10991
|
</main>
|
|
10939
10992
|
|
|
10940
10993
|
</div>
|
|
10941
|
-
`, 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 });
|
|
10942
10995
|
}
|
|
10943
10996
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ClxAppLayoutComponent, decorators: [{
|
|
10944
10997
|
type: Component,
|
|
10945
10998
|
args: [{
|
|
10946
10999
|
selector: 'clx-app-layout',
|
|
10947
11000
|
standalone: true,
|
|
10948
|
-
imports: [],
|
|
11001
|
+
imports: [ClxIconComponent],
|
|
11002
|
+
providers: [
|
|
11003
|
+
{
|
|
11004
|
+
provide: CLX_LAYOUT_COLLAPSED,
|
|
11005
|
+
useFactory: (self) => () => self._collapsed(),
|
|
11006
|
+
deps: [ClxAppLayoutComponent],
|
|
11007
|
+
},
|
|
11008
|
+
],
|
|
10949
11009
|
template: `
|
|
10950
|
-
<!--
|
|
10951
|
-
@if (
|
|
11010
|
+
<!-- Mobile backdrop -->
|
|
11011
|
+
@if (_showBackdrop()) {
|
|
10952
11012
|
<div
|
|
10953
|
-
class="fixed inset-0 z-20 bg-slate-900/60
|
|
11013
|
+
class="fixed inset-0 z-20 bg-slate-900/60"
|
|
10954
11014
|
aria-hidden="true"
|
|
10955
11015
|
(click)="closeSidebar()">
|
|
10956
11016
|
</div>
|
|
10957
11017
|
}
|
|
10958
11018
|
|
|
10959
|
-
<!--
|
|
10960
|
-
<aside
|
|
10961
|
-
[class]="_sidebarCls()"
|
|
10962
|
-
aria-label="Navegación principal">
|
|
11019
|
+
<!-- Sidebar -->
|
|
11020
|
+
<aside [class]="_sidebarCls()" aria-label="Navegación principal">
|
|
10963
11021
|
<ng-content select="[clx-sidebar]"></ng-content>
|
|
10964
11022
|
</aside>
|
|
10965
11023
|
|
|
10966
|
-
<!--
|
|
11024
|
+
<!-- Right panel -->
|
|
10967
11025
|
<div class="flex-1 flex flex-col overflow-hidden min-w-0">
|
|
10968
11026
|
|
|
10969
|
-
<!-- Header slot (h-16, white/blur, bottom border) -->
|
|
10970
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
|
+
|
|
10971
11043
|
<ng-content select="[clx-header]"></ng-content>
|
|
10972
11044
|
</header>
|
|
10973
11045
|
|
|
@@ -10979,23 +11051,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
10979
11051
|
`,
|
|
10980
11052
|
encapsulation: ViewEncapsulation.None,
|
|
10981
11053
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10982
|
-
host: {
|
|
10983
|
-
class: 'flex h-screen overflow-hidden',
|
|
10984
|
-
},
|
|
11054
|
+
host: { class: 'flex h-screen overflow-hidden' },
|
|
10985
11055
|
}]
|
|
10986
11056
|
}], propDecorators: { activeColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeColor", required: false }] }] } });
|
|
10987
11057
|
|
|
10988
|
-
const CLX_MENU_COLOR = new InjectionToken('CLX_MENU_COLOR');
|
|
10989
|
-
// ── Item geometry ──────────────────────────────────────────────────────────────
|
|
10990
|
-
const NAV_ITEM_BASE = 'flex items-center gap-3 w-full text-sm font-medium transition-colors duration-150 cursor-pointer select-none';
|
|
10991
|
-
const NAV_ITEM_L1 = 'px-6 py-3';
|
|
10992
|
-
const NAV_ITEM_L2 = 'pl-4 pr-3 py-2';
|
|
10993
|
-
const NAV_ITEM_IDLE = 'text-slate-400';
|
|
10994
|
-
// ── Children container ─────────────────────────────────────────────────────────
|
|
10995
|
-
const NAV_CHILDREN_WRAPPER = 'grid transition-all duration-300 ease-in-out';
|
|
10996
|
-
const NAV_CHILDREN_INNER = 'overflow-hidden';
|
|
10997
|
-
const NAV_CHILDREN_LIST = 'ml-6 border-l border-slate-700/60 py-1 space-y-0.5';
|
|
10998
|
-
|
|
10999
11058
|
class ClxMenuItemComponent {
|
|
11000
11059
|
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
11001
11060
|
icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
@@ -11003,9 +11062,15 @@ class ClxMenuItemComponent {
|
|
|
11003
11062
|
color = input('indigo', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
11004
11063
|
nested = input(false, ...(ngDevMode ? [{ debugName: "nested" }] : []));
|
|
11005
11064
|
_menuColorFn = inject(CLX_MENU_COLOR, { optional: true });
|
|
11065
|
+
_collapsedFn = inject(CLX_LAYOUT_COLLAPSED, { optional: true });
|
|
11006
11066
|
_hasParent = !!this._menuColorFn;
|
|
11067
|
+
_collapsed = computed(() => this._collapsedFn?.() ?? false, ...(ngDevMode ? [{ debugName: "_collapsed" }] : []));
|
|
11007
11068
|
_resolvedColor = computed(() => this._menuColorFn?.() ?? this.color(), ...(ngDevMode ? [{ debugName: "_resolvedColor" }] : []));
|
|
11008
|
-
_geom = computed(() =>
|
|
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" }] : []));
|
|
11009
11074
|
_iconCls = computed(() => resolveColor(this._resolvedColor()).textSubtle, ...(ngDevMode ? [{ debugName: "_iconCls" }] : []));
|
|
11010
11075
|
_idleCls = computed(() => {
|
|
11011
11076
|
const t = resolveColor(this._resolvedColor());
|
|
@@ -11013,6 +11078,9 @@ class ClxMenuItemComponent {
|
|
|
11013
11078
|
}, ...(ngDevMode ? [{ debugName: "_idleCls" }] : []));
|
|
11014
11079
|
_activeCls = computed(() => {
|
|
11015
11080
|
const t = resolveColor(this._resolvedColor());
|
|
11081
|
+
if (this._collapsed()) {
|
|
11082
|
+
return `${NAV_ITEM_BASE} ${this._geom()} ${t.textSubtle} font-semibold`;
|
|
11083
|
+
}
|
|
11016
11084
|
return `${NAV_ITEM_BASE} ${this._geom()} ${t.textSubtle} font-semibold border-l-2 ${t.borderLight} !pl-[22px] ${t.hoverBgMuted}`;
|
|
11017
11085
|
}, ...(ngDevMode ? [{ debugName: "_activeCls" }] : []));
|
|
11018
11086
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ClxMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -11023,11 +11091,14 @@ class ClxMenuItemComponent {
|
|
|
11023
11091
|
#rla="routerLinkActive"
|
|
11024
11092
|
[routerLinkActiveOptions]="{ exact: false }"
|
|
11025
11093
|
[class]="rla.isActive ? _activeCls() : _idleCls()"
|
|
11094
|
+
[title]="_collapsed() ? label() : ''"
|
|
11026
11095
|
(click)="route() ? null : $event.preventDefault()">
|
|
11027
11096
|
@if (icon()) {
|
|
11028
11097
|
<span clx-icon [name]="icon()" size="sm" [class]="rla.isActive || !_hasParent ? _iconCls() : 'text-slate-500'"></span>
|
|
11029
11098
|
}
|
|
11030
|
-
|
|
11099
|
+
@if (!_collapsed()) {
|
|
11100
|
+
<span class="flex-1 truncate">{{ label() }}</span>
|
|
11101
|
+
}
|
|
11031
11102
|
</a>
|
|
11032
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 });
|
|
11033
11104
|
}
|
|
@@ -11044,11 +11115,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
11044
11115
|
#rla="routerLinkActive"
|
|
11045
11116
|
[routerLinkActiveOptions]="{ exact: false }"
|
|
11046
11117
|
[class]="rla.isActive ? _activeCls() : _idleCls()"
|
|
11118
|
+
[title]="_collapsed() ? label() : ''"
|
|
11047
11119
|
(click)="route() ? null : $event.preventDefault()">
|
|
11048
11120
|
@if (icon()) {
|
|
11049
11121
|
<span clx-icon [name]="icon()" size="sm" [class]="rla.isActive || !_hasParent ? _iconCls() : 'text-slate-500'"></span>
|
|
11050
11122
|
}
|
|
11051
|
-
|
|
11123
|
+
@if (!_collapsed()) {
|
|
11124
|
+
<span class="flex-1 truncate">{{ label() }}</span>
|
|
11125
|
+
}
|
|
11052
11126
|
</a>
|
|
11053
11127
|
`,
|
|
11054
11128
|
encapsulation: ViewEncapsulation.None,
|
|
@@ -11062,6 +11136,8 @@ class ClxMenuComponent {
|
|
|
11062
11136
|
icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
11063
11137
|
color = input('indigo', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
11064
11138
|
_isExpanded = signal(false, ...(ngDevMode ? [{ debugName: "_isExpanded" }] : []));
|
|
11139
|
+
_collapsedFn = inject(CLX_LAYOUT_COLLAPSED, { optional: true });
|
|
11140
|
+
_collapsed = computed(() => this._collapsedFn?.() ?? false, ...(ngDevMode ? [{ debugName: "_collapsed" }] : []));
|
|
11065
11141
|
_childItems;
|
|
11066
11142
|
_childRoutes = [];
|
|
11067
11143
|
_router = inject(Router);
|
|
@@ -11077,9 +11153,12 @@ class ClxMenuComponent {
|
|
|
11077
11153
|
}
|
|
11078
11154
|
_iconCls = computed(() => resolveColor(this.color()).textSubtle, ...(ngDevMode ? [{ debugName: "_iconCls" }] : []));
|
|
11079
11155
|
_buttonCls = computed(() => {
|
|
11080
|
-
const
|
|
11156
|
+
const geom = this._collapsed() ? 'px-0 justify-center' : NAV_ITEM_L1;
|
|
11157
|
+
const base = `${NAV_ITEM_BASE} ${geom}`;
|
|
11081
11158
|
const t = resolveColor(this.color());
|
|
11082
11159
|
if (this._isChildActive()) {
|
|
11160
|
+
if (this._collapsed())
|
|
11161
|
+
return `${base} ${t.textSubtle} font-semibold`;
|
|
11083
11162
|
return `${base} ${t.textSubtle} font-semibold border-l-2 ${t.borderLight} !pl-[22px]`;
|
|
11084
11163
|
}
|
|
11085
11164
|
return `${base} ${NAV_ITEM_IDLE} ${t.hoverBgMuted}`;
|
|
@@ -11108,29 +11187,34 @@ class ClxMenuComponent {
|
|
|
11108
11187
|
<button
|
|
11109
11188
|
type="button"
|
|
11110
11189
|
[class]="_buttonCls()"
|
|
11111
|
-
|
|
11190
|
+
[title]="_collapsed() ? label() : ''"
|
|
11191
|
+
(click)="!_collapsed() && _toggle()">
|
|
11112
11192
|
@if (icon()) {
|
|
11113
11193
|
<span clx-icon [name]="icon()" size="sm" [class]="_iconCls()"></span>
|
|
11114
11194
|
}
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
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
|
+
}
|
|
11123
11205
|
</button>
|
|
11124
11206
|
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
<div [class]="
|
|
11130
|
-
<
|
|
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>
|
|
11131
11215
|
</div>
|
|
11132
11216
|
</div>
|
|
11133
|
-
|
|
11217
|
+
}
|
|
11134
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 });
|
|
11135
11219
|
}
|
|
11136
11220
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ClxMenuComponent, decorators: [{
|
|
@@ -11146,29 +11230,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
11146
11230
|
<button
|
|
11147
11231
|
type="button"
|
|
11148
11232
|
[class]="_buttonCls()"
|
|
11149
|
-
|
|
11233
|
+
[title]="_collapsed() ? label() : ''"
|
|
11234
|
+
(click)="!_collapsed() && _toggle()">
|
|
11150
11235
|
@if (icon()) {
|
|
11151
11236
|
<span clx-icon [name]="icon()" size="sm" [class]="_iconCls()"></span>
|
|
11152
11237
|
}
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
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
|
+
}
|
|
11161
11248
|
</button>
|
|
11162
11249
|
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
<div [class]="
|
|
11168
|
-
<
|
|
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>
|
|
11169
11258
|
</div>
|
|
11170
11259
|
</div>
|
|
11171
|
-
|
|
11260
|
+
}
|
|
11172
11261
|
`,
|
|
11173
11262
|
encapsulation: ViewEncapsulation.None,
|
|
11174
11263
|
changeDetection: ChangeDetectionStrategy.OnPush,
|