codexly-ui 0.0.27 → 0.0.29
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 +29 -43
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/index.d.ts +24 -26
- package/package.json +1 -1
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -4,15 +4,13 @@ import { isPlatformBrowser, CurrencyPipe, NgTemplateOutlet, DecimalPipe, NgStyle
|
|
|
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';
|
|
7
|
-
import { startWith, debounceTime, distinctUntilChanged, switchMap, of, catchError } from 'rxjs';
|
|
7
|
+
import { startWith, map, debounceTime, distinctUntilChanged, switchMap, of, catchError } from 'rxjs';
|
|
8
8
|
import * as i1$1 from '@angular/cdk/overlay';
|
|
9
9
|
import { ScrollStrategyOptions, OverlayModule, Overlay, OverlayConfig } from '@angular/cdk/overlay';
|
|
10
10
|
import { Chart, LineController, BarController, PieController, DoughnutController, RadarController, PolarAreaController, CategoryScale, LinearScale, RadialLinearScale, BarElement, LineElement, PointElement, ArcElement, Filler, Tooltip, Legend } from 'chart.js';
|
|
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) {
|
|
@@ -4044,7 +4042,7 @@ class ClxSelectComponent {
|
|
|
4044
4042
|
_overlayWidthPx = signal(0, ...(ngDevMode ? [{ debugName: "_overlayWidthPx" }] : []));
|
|
4045
4043
|
// ── Search control (drives clx-input inside the panel) ─────────────────────
|
|
4046
4044
|
_searchControl = new FormControl('');
|
|
4047
|
-
_searchQuery
|
|
4045
|
+
_searchQuery;
|
|
4048
4046
|
// ── Async state ─────────────────────────────────────────────────────────────
|
|
4049
4047
|
_asyncOptions = signal([], ...(ngDevMode ? [{ debugName: "_asyncOptions" }] : []));
|
|
4050
4048
|
_asyncLoading = signal(false, ...(ngDevMode ? [{ debugName: "_asyncLoading" }] : []));
|
|
@@ -4058,6 +4056,7 @@ class ClxSelectComponent {
|
|
|
4058
4056
|
_sso = inject(ScrollStrategyOptions);
|
|
4059
4057
|
_scrollStrategy = this._sso.reposition();
|
|
4060
4058
|
constructor() {
|
|
4059
|
+
this._searchQuery = toSignal(this._searchControl.valueChanges.pipe(startWith(''), map(v => v ?? '')), { initialValue: '' });
|
|
4061
4060
|
if (this._ngControl)
|
|
4062
4061
|
this._ngControl.valueAccessor = this;
|
|
4063
4062
|
// Async autocomplete: debounce + switchMap sobre el search control
|
|
@@ -11145,10 +11144,11 @@ const NAV_CHILDREN_LIST = 'ml-6 border-l border-slate-700/60 py-1 space-y-0.5';
|
|
|
11145
11144
|
class ClxMenuItemComponent {
|
|
11146
11145
|
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
11147
11146
|
icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
11148
|
-
|
|
11147
|
+
active = input(false, ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
11149
11148
|
color = input('indigo', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
11150
11149
|
nested = input(false, ...(ngDevMode ? [{ debugName: "nested" }] : []));
|
|
11151
11150
|
collapsed = input(false, ...(ngDevMode ? [{ debugName: "collapsed" }] : []));
|
|
11151
|
+
itemClick = output();
|
|
11152
11152
|
_inheritedColor = signal(null, ...(ngDevMode ? [{ debugName: "_inheritedColor" }] : []));
|
|
11153
11153
|
_resolvedColor = computed(() => this._inheritedColor() ?? this.color(), ...(ngDevMode ? [{ debugName: "_resolvedColor" }] : []));
|
|
11154
11154
|
inheritColor(c) { this._inheritedColor.set(c); }
|
|
@@ -11170,70 +11170,58 @@ class ClxMenuItemComponent {
|
|
|
11170
11170
|
return `${NAV_ITEM_BASE} ${this._geom()} ${t.textSubtle} font-semibold border-l-2 ${t.borderLight} !pl-[22px] ${t.hoverBgMuted}`;
|
|
11171
11171
|
}, ...(ngDevMode ? [{ debugName: "_activeCls" }] : []));
|
|
11172
11172
|
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()"
|
|
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 }, 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: `
|
|
11174
|
+
<button
|
|
11175
|
+
type="button"
|
|
11176
|
+
[class]="active() ? _activeCls() : _idleCls()"
|
|
11180
11177
|
[title]="collapsed() ? label() : ''"
|
|
11181
|
-
(click)="
|
|
11178
|
+
(click)="itemClick.emit()">
|
|
11182
11179
|
@if (icon()) {
|
|
11183
|
-
<span clx-icon [name]="icon()" size="sm" [class]="
|
|
11180
|
+
<span clx-icon [name]="icon()" size="sm" [class]="active() || nested() ? _iconCls() : 'text-slate-500'"></span>
|
|
11184
11181
|
}
|
|
11185
11182
|
@if (!collapsed()) {
|
|
11186
|
-
<span class="flex-1 truncate">{{ label() }}</span>
|
|
11183
|
+
<span class="flex-1 text-left truncate">{{ label() }}</span>
|
|
11187
11184
|
}
|
|
11188
|
-
</
|
|
11189
|
-
`, isInline: true, dependencies: [{ kind: "component", type: ClxIconComponent, selector: "span[clx-icon]", inputs: ["name", "size", "color", "fill"] }
|
|
11185
|
+
</button>
|
|
11186
|
+
`, 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
11187
|
}
|
|
11191
11188
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ClxMenuItemComponent, decorators: [{
|
|
11192
11189
|
type: Component,
|
|
11193
11190
|
args: [{
|
|
11194
11191
|
selector: 'clx-menu-item',
|
|
11195
11192
|
standalone: true,
|
|
11196
|
-
imports: [ClxIconComponent
|
|
11193
|
+
imports: [ClxIconComponent],
|
|
11197
11194
|
template: `
|
|
11198
|
-
<
|
|
11199
|
-
|
|
11200
|
-
|
|
11201
|
-
#rla="routerLinkActive"
|
|
11202
|
-
[routerLinkActiveOptions]="{ exact: false }"
|
|
11203
|
-
[class]="rla.isActive ? _activeCls() : _idleCls()"
|
|
11195
|
+
<button
|
|
11196
|
+
type="button"
|
|
11197
|
+
[class]="active() ? _activeCls() : _idleCls()"
|
|
11204
11198
|
[title]="collapsed() ? label() : ''"
|
|
11205
|
-
(click)="
|
|
11199
|
+
(click)="itemClick.emit()">
|
|
11206
11200
|
@if (icon()) {
|
|
11207
|
-
<span clx-icon [name]="icon()" size="sm" [class]="
|
|
11201
|
+
<span clx-icon [name]="icon()" size="sm" [class]="active() || nested() ? _iconCls() : 'text-slate-500'"></span>
|
|
11208
11202
|
}
|
|
11209
11203
|
@if (!collapsed()) {
|
|
11210
|
-
<span class="flex-1 truncate">{{ label() }}</span>
|
|
11204
|
+
<span class="flex-1 text-left truncate">{{ label() }}</span>
|
|
11211
11205
|
}
|
|
11212
|
-
</
|
|
11206
|
+
</button>
|
|
11213
11207
|
`,
|
|
11214
11208
|
encapsulation: ViewEncapsulation.None,
|
|
11215
11209
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11216
11210
|
host: { class: 'block' },
|
|
11217
11211
|
}]
|
|
11218
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }],
|
|
11212
|
+
}], 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
11213
|
|
|
11220
11214
|
class ClxMenuComponent {
|
|
11221
11215
|
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
11222
11216
|
icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
11223
11217
|
color = input('indigo', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
11224
11218
|
collapsed = input(false, ...(ngDevMode ? [{ debugName: "collapsed" }] : []));
|
|
11219
|
+
active = input(false, ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
11225
11220
|
_isExpanded = signal(false, ...(ngDevMode ? [{ debugName: "_isExpanded" }] : []));
|
|
11226
11221
|
_childItems;
|
|
11227
|
-
_childRoutes = [];
|
|
11228
|
-
_router = inject(Router);
|
|
11229
11222
|
_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
11223
|
constructor() {
|
|
11236
|
-
effect(() => { if (this.
|
|
11224
|
+
effect(() => { if (this.active())
|
|
11237
11225
|
this._isExpanded.set(true); });
|
|
11238
11226
|
effect(() => { if (this.collapsed())
|
|
11239
11227
|
this._isExpanded.set(false); });
|
|
@@ -11243,7 +11231,7 @@ class ClxMenuComponent {
|
|
|
11243
11231
|
const geom = this.collapsed() ? 'w-full py-3 px-0 justify-center' : NAV_ITEM_L1;
|
|
11244
11232
|
const base = `${NAV_ITEM_BASE} ${geom}`;
|
|
11245
11233
|
const t = resolveColor(this.color());
|
|
11246
|
-
if (this.
|
|
11234
|
+
if (this.active()) {
|
|
11247
11235
|
if (this.collapsed())
|
|
11248
11236
|
return `${base} ${t.textSubtle} font-semibold`;
|
|
11249
11237
|
return `${base} ${t.textSubtle} font-semibold border-l-2 ${t.borderLight} !pl-[22px]`;
|
|
@@ -11261,15 +11249,13 @@ class ClxMenuComponent {
|
|
|
11261
11249
|
}
|
|
11262
11250
|
_syncChildren() {
|
|
11263
11251
|
const color = this.color();
|
|
11264
|
-
this.
|
|
11265
|
-
.filter(c => !!c.route())
|
|
11266
|
-
.map(c => { c.inheritColor(color); return c.route(); });
|
|
11252
|
+
this._childItems.forEach(c => c.inheritColor(color));
|
|
11267
11253
|
}
|
|
11268
11254
|
_toggle() {
|
|
11269
11255
|
this._isExpanded.update(v => !v);
|
|
11270
11256
|
}
|
|
11271
11257
|
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: `
|
|
11258
|
+
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
11259
|
<button
|
|
11274
11260
|
type="button"
|
|
11275
11261
|
[class]="_buttonCls()"
|
|
@@ -11342,7 +11328,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
11342
11328
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11343
11329
|
host: { class: 'block' },
|
|
11344
11330
|
}]
|
|
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: [{
|
|
11331
|
+
}], 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
11332
|
type: ContentChildren,
|
|
11347
11333
|
args: [ClxMenuItemComponent, { descendants: true }]
|
|
11348
11334
|
}] } });
|