codexly-ui 0.0.27 → 0.0.28
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 +26 -41
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/index.d.ts +6 -8
- package/package.json +1 -1
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -11,8 +11,6 @@ import { Chart, LineController, BarController, PieController, DoughnutController
|
|
|
11
11
|
import * as i1$2 from '@angular/cdk/portal';
|
|
12
12
|
import { PortalModule, ComponentPortal } from '@angular/cdk/portal';
|
|
13
13
|
import { FocusTrapFactory } from '@angular/cdk/a11y';
|
|
14
|
-
import { RouterLink, RouterLinkActive, Router, NavigationEnd } from '@angular/router';
|
|
15
|
-
import { filter, map, startWith as startWith$1 } from 'rxjs/operators';
|
|
16
14
|
|
|
17
15
|
// ── Parse 'red' | 'red-500' → { color, shade } ───────────────────────────────
|
|
18
16
|
function parseColorInput(input) {
|
|
@@ -11145,10 +11143,11 @@ const NAV_CHILDREN_LIST = 'ml-6 border-l border-slate-700/60 py-1 space-y-0.5';
|
|
|
11145
11143
|
class ClxMenuItemComponent {
|
|
11146
11144
|
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
11147
11145
|
icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
11148
|
-
|
|
11146
|
+
active = input(false, ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
11149
11147
|
color = input('indigo', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
11150
11148
|
nested = input(false, ...(ngDevMode ? [{ debugName: "nested" }] : []));
|
|
11151
11149
|
collapsed = input(false, ...(ngDevMode ? [{ debugName: "collapsed" }] : []));
|
|
11150
|
+
itemClick = output();
|
|
11152
11151
|
_inheritedColor = signal(null, ...(ngDevMode ? [{ debugName: "_inheritedColor" }] : []));
|
|
11153
11152
|
_resolvedColor = computed(() => this._inheritedColor() ?? this.color(), ...(ngDevMode ? [{ debugName: "_resolvedColor" }] : []));
|
|
11154
11153
|
inheritColor(c) { this._inheritedColor.set(c); }
|
|
@@ -11170,70 +11169,58 @@ class ClxMenuItemComponent {
|
|
|
11170
11169
|
return `${NAV_ITEM_BASE} ${this._geom()} ${t.textSubtle} font-semibold border-l-2 ${t.borderLight} !pl-[22px] ${t.hoverBgMuted}`;
|
|
11171
11170
|
}, ...(ngDevMode ? [{ debugName: "_activeCls" }] : []));
|
|
11172
11171
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ClxMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11173
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: ClxMenuItemComponent, isStandalone: true, selector: "clx-menu-item", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null },
|
|
11174
|
-
<
|
|
11175
|
-
|
|
11176
|
-
|
|
11177
|
-
#rla="routerLinkActive"
|
|
11178
|
-
[routerLinkActiveOptions]="{ exact: false }"
|
|
11179
|
-
[class]="rla.isActive ? _activeCls() : _idleCls()"
|
|
11172
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: ClxMenuItemComponent, isStandalone: true, selector: "clx-menu-item", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, nested: { classPropertyName: "nested", publicName: "nested", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, host: { classAttribute: "block" }, ngImport: i0, template: `
|
|
11173
|
+
<button
|
|
11174
|
+
type="button"
|
|
11175
|
+
[class]="active() ? _activeCls() : _idleCls()"
|
|
11180
11176
|
[title]="collapsed() ? label() : ''"
|
|
11181
|
-
(click)="
|
|
11177
|
+
(click)="itemClick.emit()">
|
|
11182
11178
|
@if (icon()) {
|
|
11183
|
-
<span clx-icon [name]="icon()" size="sm" [class]="
|
|
11179
|
+
<span clx-icon [name]="icon()" size="sm" [class]="active() || nested() ? _iconCls() : 'text-slate-500'"></span>
|
|
11184
11180
|
}
|
|
11185
11181
|
@if (!collapsed()) {
|
|
11186
|
-
<span class="flex-1 truncate">{{ label() }}</span>
|
|
11182
|
+
<span class="flex-1 text-left truncate">{{ label() }}</span>
|
|
11187
11183
|
}
|
|
11188
|
-
</
|
|
11189
|
-
`, isInline: true, dependencies: [{ kind: "component", type: ClxIconComponent, selector: "span[clx-icon]", inputs: ["name", "size", "color", "fill"] }
|
|
11184
|
+
</button>
|
|
11185
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ClxIconComponent, selector: "span[clx-icon]", inputs: ["name", "size", "color", "fill"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
11190
11186
|
}
|
|
11191
11187
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ClxMenuItemComponent, decorators: [{
|
|
11192
11188
|
type: Component,
|
|
11193
11189
|
args: [{
|
|
11194
11190
|
selector: 'clx-menu-item',
|
|
11195
11191
|
standalone: true,
|
|
11196
|
-
imports: [ClxIconComponent
|
|
11192
|
+
imports: [ClxIconComponent],
|
|
11197
11193
|
template: `
|
|
11198
|
-
<
|
|
11199
|
-
|
|
11200
|
-
|
|
11201
|
-
#rla="routerLinkActive"
|
|
11202
|
-
[routerLinkActiveOptions]="{ exact: false }"
|
|
11203
|
-
[class]="rla.isActive ? _activeCls() : _idleCls()"
|
|
11194
|
+
<button
|
|
11195
|
+
type="button"
|
|
11196
|
+
[class]="active() ? _activeCls() : _idleCls()"
|
|
11204
11197
|
[title]="collapsed() ? label() : ''"
|
|
11205
|
-
(click)="
|
|
11198
|
+
(click)="itemClick.emit()">
|
|
11206
11199
|
@if (icon()) {
|
|
11207
|
-
<span clx-icon [name]="icon()" size="sm" [class]="
|
|
11200
|
+
<span clx-icon [name]="icon()" size="sm" [class]="active() || nested() ? _iconCls() : 'text-slate-500'"></span>
|
|
11208
11201
|
}
|
|
11209
11202
|
@if (!collapsed()) {
|
|
11210
|
-
<span class="flex-1 truncate">{{ label() }}</span>
|
|
11203
|
+
<span class="flex-1 text-left truncate">{{ label() }}</span>
|
|
11211
11204
|
}
|
|
11212
|
-
</
|
|
11205
|
+
</button>
|
|
11213
11206
|
`,
|
|
11214
11207
|
encapsulation: ViewEncapsulation.None,
|
|
11215
11208
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11216
11209
|
host: { class: 'block' },
|
|
11217
11210
|
}]
|
|
11218
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }],
|
|
11211
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], nested: [{ type: i0.Input, args: [{ isSignal: true, alias: "nested", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }] } });
|
|
11219
11212
|
|
|
11220
11213
|
class ClxMenuComponent {
|
|
11221
11214
|
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
11222
11215
|
icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
11223
11216
|
color = input('indigo', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
11224
11217
|
collapsed = input(false, ...(ngDevMode ? [{ debugName: "collapsed" }] : []));
|
|
11218
|
+
active = input(false, ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
11225
11219
|
_isExpanded = signal(false, ...(ngDevMode ? [{ debugName: "_isExpanded" }] : []));
|
|
11226
11220
|
_childItems;
|
|
11227
|
-
_childRoutes = [];
|
|
11228
|
-
_router = inject(Router);
|
|
11229
11221
|
_destroyRef = inject(DestroyRef);
|
|
11230
|
-
_url = toSignal(this._router.events.pipe(filter(e => e instanceof NavigationEnd), map(() => this._router.url), startWith$1(this._router.url)), { initialValue: this._router.url });
|
|
11231
|
-
_isChildActive = computed(() => {
|
|
11232
|
-
const url = this._url();
|
|
11233
|
-
return this._childRoutes.some(r => r && (url === r || url.startsWith(r + '/')));
|
|
11234
|
-
}, ...(ngDevMode ? [{ debugName: "_isChildActive" }] : []));
|
|
11235
11222
|
constructor() {
|
|
11236
|
-
effect(() => { if (this.
|
|
11223
|
+
effect(() => { if (this.active())
|
|
11237
11224
|
this._isExpanded.set(true); });
|
|
11238
11225
|
effect(() => { if (this.collapsed())
|
|
11239
11226
|
this._isExpanded.set(false); });
|
|
@@ -11243,7 +11230,7 @@ class ClxMenuComponent {
|
|
|
11243
11230
|
const geom = this.collapsed() ? 'w-full py-3 px-0 justify-center' : NAV_ITEM_L1;
|
|
11244
11231
|
const base = `${NAV_ITEM_BASE} ${geom}`;
|
|
11245
11232
|
const t = resolveColor(this.color());
|
|
11246
|
-
if (this.
|
|
11233
|
+
if (this.active()) {
|
|
11247
11234
|
if (this.collapsed())
|
|
11248
11235
|
return `${base} ${t.textSubtle} font-semibold`;
|
|
11249
11236
|
return `${base} ${t.textSubtle} font-semibold border-l-2 ${t.borderLight} !pl-[22px]`;
|
|
@@ -11261,15 +11248,13 @@ class ClxMenuComponent {
|
|
|
11261
11248
|
}
|
|
11262
11249
|
_syncChildren() {
|
|
11263
11250
|
const color = this.color();
|
|
11264
|
-
this.
|
|
11265
|
-
.filter(c => !!c.route())
|
|
11266
|
-
.map(c => { c.inheritColor(color); return c.route(); });
|
|
11251
|
+
this._childItems.forEach(c => c.inheritColor(color));
|
|
11267
11252
|
}
|
|
11268
11253
|
_toggle() {
|
|
11269
11254
|
this._isExpanded.update(v => !v);
|
|
11270
11255
|
}
|
|
11271
11256
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ClxMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11272
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: ClxMenuComponent, isStandalone: true, selector: "clx-menu", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block" }, queries: [{ propertyName: "_childItems", predicate: ClxMenuItemComponent, descendants: true }], ngImport: i0, template: `
|
|
11257
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: ClxMenuComponent, isStandalone: true, selector: "clx-menu", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block" }, queries: [{ propertyName: "_childItems", predicate: ClxMenuItemComponent, descendants: true }], ngImport: i0, template: `
|
|
11273
11258
|
<button
|
|
11274
11259
|
type="button"
|
|
11275
11260
|
[class]="_buttonCls()"
|
|
@@ -11342,7 +11327,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
11342
11327
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11343
11328
|
host: { class: 'block' },
|
|
11344
11329
|
}]
|
|
11345
|
-
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], _childItems: [{
|
|
11330
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], _childItems: [{
|
|
11346
11331
|
type: ContentChildren,
|
|
11347
11332
|
args: [ClxMenuItemComponent, { descendants: true }]
|
|
11348
11333
|
}] } });
|