codexly-ui 0.11.7 → 0.11.8
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 +42 -26
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/codexly-ui.d.ts +27 -10
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -641,7 +641,9 @@ class ClxThemeService {
|
|
|
641
641
|
error: n?.severityColors?.error ?? this._config().dangerColor,
|
|
642
642
|
},
|
|
643
643
|
unreadColor: n?.unreadColor ?? this._config().primaryColor,
|
|
644
|
+
tabsColor: n?.tabsColor ?? this._config().primaryColor,
|
|
644
645
|
size: n?.size ?? 'md',
|
|
646
|
+
border: n?.border ?? true,
|
|
645
647
|
borderColor: n?.borderColor ?? this._config().listBorderColor ?? this._config().primaryColor,
|
|
646
648
|
radius: n?.radius ?? this._config().borderRadius,
|
|
647
649
|
titleWeight: n?.titleWeight ?? 600,
|
|
@@ -5235,7 +5237,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
5235
5237
|
|
|
5236
5238
|
const SWITCH_SIZE_MAP = {
|
|
5237
5239
|
xs: { track: 'w-7 h-4', thumb: 'w-3 h-3', translate: 'translate-x-3', label: 'text-xs' },
|
|
5238
|
-
sm: { track: 'w-9 h-5', thumb: 'w-4 h-4', translate: 'translate-x-4', label: 'text-
|
|
5240
|
+
sm: { track: 'w-9 h-5', thumb: 'w-4 h-4', translate: 'translate-x-4', label: 'text-sm' },
|
|
5239
5241
|
md: { track: 'w-12 h-6', thumb: 'w-5 h-5', translate: 'translate-x-6', label: 'text-sm' },
|
|
5240
5242
|
lg: { track: 'w-14 h-7', thumb: 'w-6 h-6', translate: 'translate-x-7', label: 'text-base' },
|
|
5241
5243
|
};
|
|
@@ -11365,27 +11367,39 @@ const NOTIFICATION_SEVERITY_ICON = {
|
|
|
11365
11367
|
class ClxNotificationComponent {
|
|
11366
11368
|
_themeSvc = inject(ClxThemeService);
|
|
11367
11369
|
items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
11368
|
-
color = input(undefined, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
11369
11370
|
/** Optional third tab that filters items by ClxNotificationItem.category — e.g.
|
|
11370
11371
|
* `{ id: 'orders', label: 'Órdenes' }`. Omit for just Todas/Sin leer. */
|
|
11371
11372
|
categoryTab = input(undefined, ...(ngDevMode ? [{ debugName: "categoryTab" }] : /* istanbul ignore next */ []));
|
|
11372
|
-
// ──
|
|
11373
|
-
//
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11373
|
+
// ── Bell button — a real clx-button under the hood, so its own look-and-feel can be pinned
|
|
11374
|
+
// per instance without needing a separate trigger component. Each falls back to the
|
|
11375
|
+
// notification theme block, then a sensible built-in default. ──────────────────────────────
|
|
11376
|
+
buttonColor = input(undefined, ...(ngDevMode ? [{ debugName: "buttonColor" }] : /* istanbul ignore next */ []));
|
|
11377
|
+
buttonVariant = input('ghost', ...(ngDevMode ? [{ debugName: "buttonVariant" }] : /* istanbul ignore next */ []));
|
|
11378
|
+
buttonSize = input('md', ...(ngDevMode ? [{ debugName: "buttonSize" }] : /* istanbul ignore next */ []));
|
|
11379
|
+
buttonIcon = input('notifications', ...(ngDevMode ? [{ debugName: "buttonIcon" }] : /* istanbul ignore next */ []));
|
|
11377
11380
|
/** Unread-count badge color — falls back to the theme's notification.unreadColor (then
|
|
11378
|
-
* primaryColor) when unset
|
|
11379
|
-
* library (instance input > theme block > primaryColor). */
|
|
11381
|
+
* primaryColor) when unset. */
|
|
11380
11382
|
badgeColor = input(undefined, ...(ngDevMode ? [{ debugName: "badgeColor" }] : /* istanbul ignore next */ []));
|
|
11383
|
+
// ── Panel accents — independent from the bell button's own color. ──────────────────────────
|
|
11384
|
+
/** clx-tabs (Todas/Sin leer/...) + "Marcar todo leído" link accent — falls back to the theme's
|
|
11385
|
+
* notification.tabsColor (then primaryColor) when unset. */
|
|
11386
|
+
tabsColor = input(undefined, ...(ngDevMode ? [{ debugName: "tabsColor" }] : /* istanbul ignore next */ []));
|
|
11387
|
+
/** Whether the floating panel shows its outer border — falls back to the theme's
|
|
11388
|
+
* notification.border (then true) when unset. */
|
|
11389
|
+
border = input(undefined, ...(ngDevMode ? [{ debugName: "border" }] : /* istanbul ignore next */ []));
|
|
11390
|
+
/** Panel wrapper border color — falls back to the theme's notification.borderColor when unset. */
|
|
11391
|
+
borderColor = input(undefined, ...(ngDevMode ? [{ debugName: "borderColor" }] : /* istanbul ignore next */ []));
|
|
11381
11392
|
itemClick = output();
|
|
11382
11393
|
markRead = output();
|
|
11383
11394
|
markAllRead = output();
|
|
11384
11395
|
delete = output();
|
|
11385
11396
|
deleteAllRead = output();
|
|
11386
11397
|
_style = this._themeSvc.notificationStyle;
|
|
11387
|
-
|
|
11398
|
+
_buttonColor = computed(() => this.buttonColor() ?? this._themeSvc.config().primaryColor, ...(ngDevMode ? [{ debugName: "_buttonColor" }] : /* istanbul ignore next */ []));
|
|
11388
11399
|
_badgeColor = computed(() => this.badgeColor() ?? this._style().unreadColor, ...(ngDevMode ? [{ debugName: "_badgeColor" }] : /* istanbul ignore next */ []));
|
|
11400
|
+
_tabsColor = computed(() => this.tabsColor() ?? this._style().tabsColor, ...(ngDevMode ? [{ debugName: "_tabsColor" }] : /* istanbul ignore next */ []));
|
|
11401
|
+
_border = computed(() => this.border() ?? this._style().border, ...(ngDevMode ? [{ debugName: "_border" }] : /* istanbul ignore next */ []));
|
|
11402
|
+
_borderColor = computed(() => this.borderColor() ?? this._style().borderColor, ...(ngDevMode ? [{ debugName: "_borderColor" }] : /* istanbul ignore next */ []));
|
|
11389
11403
|
// ── CDK Overlay ─────────────────────────────────────────────────────────────
|
|
11390
11404
|
_sso = inject(ScrollStrategyOptions);
|
|
11391
11405
|
_scrollStrategy = this._sso.reposition();
|
|
@@ -11395,7 +11409,10 @@ class ClxNotificationComponent {
|
|
|
11395
11409
|
];
|
|
11396
11410
|
_isOpen = signal(false, ...(ngDevMode ? [{ debugName: "_isOpen" }] : /* istanbul ignore next */ []));
|
|
11397
11411
|
_filter = signal('all', ...(ngDevMode ? [{ debugName: "_filter" }] : /* istanbul ignore next */ []));
|
|
11398
|
-
_panelClass = computed(() =>
|
|
11412
|
+
_panelClass = computed(() => {
|
|
11413
|
+
const borderCls = this._border() ? `border ${resolveColor(this._borderColor()).borderLight}` : 'border border-transparent';
|
|
11414
|
+
return `w-96 bg-clx-surface shadow-xl ${borderCls} overflow-hidden mt-2 flex flex-col ${resolveContainerRadius(this._style().radius)}`;
|
|
11415
|
+
}, ...(ngDevMode ? [{ debugName: "_panelClass" }] : /* istanbul ignore next */ []));
|
|
11399
11416
|
_unreadCount = computed(() => this.items().filter(i => !i.read).length, ...(ngDevMode ? [{ debugName: "_unreadCount" }] : /* istanbul ignore next */ []));
|
|
11400
11417
|
_readCount = computed(() => this.items().filter(i => i.read).length, ...(ngDevMode ? [{ debugName: "_readCount" }] : /* istanbul ignore next */ []));
|
|
11401
11418
|
_tabs = computed(() => {
|
|
@@ -11433,7 +11450,6 @@ class ClxNotificationComponent {
|
|
|
11433
11450
|
const w = this._style().groupLabelWeight;
|
|
11434
11451
|
return `px-2 pt-3 pb-1.5 text-[11px] uppercase tracking-wide text-clx-text-subtle font-[${w}]`;
|
|
11435
11452
|
}, ...(ngDevMode ? [{ debugName: "_groupLabelClass" }] : /* istanbul ignore next */ []));
|
|
11436
|
-
_linkClass = computed(() => resolveColor(this._color()).textSubtle, ...(ngDevMode ? [{ debugName: "_linkClass" }] : /* istanbul ignore next */ []));
|
|
11437
11453
|
_unreadRailClass = computed(() => resolveColor(this._style().unreadColor).bg, ...(ngDevMode ? [{ debugName: "_unreadRailClass" }] : /* istanbul ignore next */ []));
|
|
11438
11454
|
_unreadDotClass = computed(() => `w-1.5 h-1.5 rounded-full shrink-0 ${resolveColor(this._style().unreadColor).bg}`, ...(ngDevMode ? [{ debugName: "_unreadDotClass" }] : /* istanbul ignore next */ []));
|
|
11439
11455
|
_detailClass = computed(() => this._style().detailColor ? resolveColor(this._style().detailColor).textSubtle : 'text-clx-text-muted', ...(ngDevMode ? [{ debugName: "_detailClass" }] : /* istanbul ignore next */ []));
|
|
@@ -11479,17 +11495,17 @@ class ClxNotificationComponent {
|
|
|
11479
11495
|
return new Date(iso).toLocaleTimeString('es-CO', { hour: '2-digit', minute: '2-digit' });
|
|
11480
11496
|
}
|
|
11481
11497
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxNotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11482
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxNotificationComponent, isStandalone: true, selector: "clx-notification", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null },
|
|
11498
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxNotificationComponent, isStandalone: true, selector: "clx-notification", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, categoryTab: { classPropertyName: "categoryTab", publicName: "categoryTab", isSignal: true, isRequired: false, transformFunction: null }, buttonColor: { classPropertyName: "buttonColor", publicName: "buttonColor", isSignal: true, isRequired: false, transformFunction: null }, buttonVariant: { classPropertyName: "buttonVariant", publicName: "buttonVariant", isSignal: true, isRequired: false, transformFunction: null }, buttonSize: { classPropertyName: "buttonSize", publicName: "buttonSize", isSignal: true, isRequired: false, transformFunction: null }, buttonIcon: { classPropertyName: "buttonIcon", publicName: "buttonIcon", isSignal: true, isRequired: false, transformFunction: null }, badgeColor: { classPropertyName: "badgeColor", publicName: "badgeColor", isSignal: true, isRequired: false, transformFunction: null }, tabsColor: { classPropertyName: "tabsColor", publicName: "tabsColor", isSignal: true, isRequired: false, transformFunction: null }, border: { classPropertyName: "border", publicName: "border", isSignal: true, isRequired: false, transformFunction: null }, borderColor: { classPropertyName: "borderColor", publicName: "borderColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick", markRead: "markRead", markAllRead: "markAllRead", delete: "delete", deleteAllRead: "deleteAllRead" }, host: { classAttribute: "relative inline-flex items-center" }, ngImport: i0, template: `
|
|
11483
11499
|
<!-- Trigger -->
|
|
11484
11500
|
<button clx-button
|
|
11485
11501
|
#origin="cdkOverlayOrigin"
|
|
11486
11502
|
cdkOverlayOrigin
|
|
11487
11503
|
type="button"
|
|
11488
|
-
[variant]="
|
|
11489
|
-
[color]="
|
|
11490
|
-
[size]="
|
|
11504
|
+
[variant]="buttonVariant()"
|
|
11505
|
+
[color]="_buttonColor()"
|
|
11506
|
+
[size]="buttonSize()"
|
|
11491
11507
|
shape="circle"
|
|
11492
|
-
[icon]="
|
|
11508
|
+
[icon]="buttonIcon()"
|
|
11493
11509
|
[iconOnly]="true"
|
|
11494
11510
|
[badge]="_unreadCount() > 0 ? (_unreadCount() > 9 ? '9+' : _unreadCount()) : undefined"
|
|
11495
11511
|
[badgeColor]="_badgeColor()"
|
|
@@ -11514,7 +11530,7 @@ class ClxNotificationComponent {
|
|
|
11514
11530
|
<p class="text-base font-semibold text-clx-text-label">Notificaciones</p>
|
|
11515
11531
|
<div class="flex items-center gap-3">
|
|
11516
11532
|
@if (_unreadCount() > 0) {
|
|
11517
|
-
<button clx-button type="button" variant="ghost" [color]="
|
|
11533
|
+
<button clx-button type="button" variant="ghost" [color]="_tabsColor()" size="xs"
|
|
11518
11534
|
(click)="markAllRead.emit()">
|
|
11519
11535
|
Marcar todo leído
|
|
11520
11536
|
</button>
|
|
@@ -11526,7 +11542,7 @@ class ClxNotificationComponent {
|
|
|
11526
11542
|
|
|
11527
11543
|
<!-- Tabs -->
|
|
11528
11544
|
<div class="px-4">
|
|
11529
|
-
<clx-tabs [tabs]="_tabs()" [(activeTab)]="_filter" [clxColor]="
|
|
11545
|
+
<clx-tabs [tabs]="_tabs()" [(activeTab)]="_filter" [clxColor]="_tabsColor()" />
|
|
11530
11546
|
</div>
|
|
11531
11547
|
|
|
11532
11548
|
<!-- List -->
|
|
@@ -11599,11 +11615,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
11599
11615
|
#origin="cdkOverlayOrigin"
|
|
11600
11616
|
cdkOverlayOrigin
|
|
11601
11617
|
type="button"
|
|
11602
|
-
[variant]="
|
|
11603
|
-
[color]="
|
|
11604
|
-
[size]="
|
|
11618
|
+
[variant]="buttonVariant()"
|
|
11619
|
+
[color]="_buttonColor()"
|
|
11620
|
+
[size]="buttonSize()"
|
|
11605
11621
|
shape="circle"
|
|
11606
|
-
[icon]="
|
|
11622
|
+
[icon]="buttonIcon()"
|
|
11607
11623
|
[iconOnly]="true"
|
|
11608
11624
|
[badge]="_unreadCount() > 0 ? (_unreadCount() > 9 ? '9+' : _unreadCount()) : undefined"
|
|
11609
11625
|
[badgeColor]="_badgeColor()"
|
|
@@ -11628,7 +11644,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
11628
11644
|
<p class="text-base font-semibold text-clx-text-label">Notificaciones</p>
|
|
11629
11645
|
<div class="flex items-center gap-3">
|
|
11630
11646
|
@if (_unreadCount() > 0) {
|
|
11631
|
-
<button clx-button type="button" variant="ghost" [color]="
|
|
11647
|
+
<button clx-button type="button" variant="ghost" [color]="_tabsColor()" size="xs"
|
|
11632
11648
|
(click)="markAllRead.emit()">
|
|
11633
11649
|
Marcar todo leído
|
|
11634
11650
|
</button>
|
|
@@ -11640,7 +11656,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
11640
11656
|
|
|
11641
11657
|
<!-- Tabs -->
|
|
11642
11658
|
<div class="px-4">
|
|
11643
|
-
<clx-tabs [tabs]="_tabs()" [(activeTab)]="_filter" [clxColor]="
|
|
11659
|
+
<clx-tabs [tabs]="_tabs()" [(activeTab)]="_filter" [clxColor]="_tabsColor()" />
|
|
11644
11660
|
</div>
|
|
11645
11661
|
|
|
11646
11662
|
<!-- List -->
|
|
@@ -11704,7 +11720,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
11704
11720
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11705
11721
|
host: { class: 'relative inline-flex items-center' },
|
|
11706
11722
|
}]
|
|
11707
|
-
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }],
|
|
11723
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], categoryTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "categoryTab", required: false }] }], buttonColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonColor", required: false }] }], buttonVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonVariant", required: false }] }], buttonSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonSize", required: false }] }], buttonIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonIcon", required: false }] }], badgeColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeColor", required: false }] }], tabsColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabsColor", required: false }] }], border: [{ type: i0.Input, args: [{ isSignal: true, alias: "border", required: false }] }], borderColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderColor", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], markRead: [{ type: i0.Output, args: ["markRead"] }], markAllRead: [{ type: i0.Output, args: ["markAllRead"] }], delete: [{ type: i0.Output, args: ["delete"] }], deleteAllRead: [{ type: i0.Output, args: ["deleteAllRead"] }] } });
|
|
11708
11724
|
|
|
11709
11725
|
// ─── CDK overlay token (carries the resolved ref into the component) ──────────
|
|
11710
11726
|
const CLX_ALERT_OPTIONS = new InjectionToken('CLX_ALERT_OPTIONS');
|