codexly-ui 0.15.0 → 0.15.2

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.
@@ -15975,6 +15975,13 @@ class ClxStatCardComponent {
15975
15975
  return CLX_COLOR_HEX[color] ?? CLX_COLOR_HEX.indigo;
15976
15976
  }, ...(ngDevMode ? [{ debugName: "_lineColor" }] : /* istanbul ignore next */ []));
15977
15977
  _gradId = computed(() => `spark-grad-${this.color()}`, ...(ngDevMode ? [{ debugName: "_gradId" }] : /* istanbul ignore next */ []));
15978
+ /** A widget with no meaningful period-over-period comparison (e.g. a plain point-in-time count
15979
+ * like "pending commissions") passes trend: '' — hides the trend badge/row entirely instead of
15980
+ * rendering an empty pill with just an arrow icon and no text. */
15981
+ _hasTrend = computed(() => {
15982
+ const t = this.metric().trend;
15983
+ return t !== '' && t !== null && t !== undefined;
15984
+ }, ...(ngDevMode ? [{ debugName: "_hasTrend" }] : /* istanbul ignore next */ []));
15978
15985
  _trendColor = computed(() => {
15979
15986
  const d = this.metric().trendDirection;
15980
15987
  return d === 'up' ? 'green' : d === 'down' ? 'red' : 'slate';
@@ -16052,14 +16059,16 @@ class ClxStatCardComponent {
16052
16059
  <span class="text-2xl font-semibold text-clx-text leading-tight">
16053
16060
  {{ _formattedValue() }}
16054
16061
  </span>
16055
- <span clx-badge
16056
- [color]="_trendColor()"
16057
- variant="light"
16058
- shape="pill"
16059
- class="self-start gap-1 mt-0.5">
16060
- <span clx-icon [name]="_trendIcon()" size="xxs"></span>
16061
- {{ metric().trend }}
16062
- </span>
16062
+ @if (_hasTrend()) {
16063
+ <span clx-badge
16064
+ [color]="_trendColor()"
16065
+ variant="light"
16066
+ shape="pill"
16067
+ class="self-start gap-1 mt-0.5">
16068
+ <span clx-icon [name]="_trendIcon()" size="xxs"></span>
16069
+ {{ metric().trend }}
16070
+ </span>
16071
+ }
16063
16072
  </div>
16064
16073
 
16065
16074
  <!-- Sparkline -->
@@ -16101,25 +16110,29 @@ class ClxStatCardComponent {
16101
16110
  }
16102
16111
  </div>
16103
16112
  <!-- Tendencia -->
16104
- <div class="flex items-center gap-1 text-xs text-clx-text-subtle whitespace-nowrap">
16105
- {{ metric().trendDirection === 'up' ? 'Increased By' : 'Decreased By' }}
16106
- <span class="font-semibold" [class]="_trendTextClass()">{{ metric().trend }}</span>
16107
- <span clx-icon [name]="_trendArrowIcon()" size="sm" [class]="_trendTextClass()"></span>
16108
- </div>
16113
+ @if (_hasTrend()) {
16114
+ <div class="flex items-center gap-1 text-xs text-clx-text-subtle whitespace-nowrap">
16115
+ {{ metric().trendDirection === 'up' ? 'Increased By' : 'Decreased By' }}
16116
+ <span class="font-semibold" [class]="_trendTextClass()">{{ metric().trend }}</span>
16117
+ <span clx-icon [name]="_trendArrowIcon()" size="sm" [class]="_trendTextClass()"></span>
16118
+ </div>
16119
+ }
16109
16120
  </div>
16110
16121
  }
16111
16122
 
16112
16123
  @if (layout() === 'vertical') {
16113
16124
  <!-- Col izquierda: badge + valor + título -->
16114
16125
  <div class="flex flex-col justify-between flex-1 min-w-0 gap-1">
16115
- <span clx-badge
16116
- [color]="_trendColor()"
16117
- variant="light"
16118
- shape="pill"
16119
- class="self-start gap-1">
16120
- <span clx-icon [name]="_trendIcon()" size="xxs"></span>
16121
- {{ metric().trend }}
16122
- </span>
16126
+ @if (_hasTrend()) {
16127
+ <span clx-badge
16128
+ [color]="_trendColor()"
16129
+ variant="light"
16130
+ shape="pill"
16131
+ class="self-start gap-1">
16132
+ <span clx-icon [name]="_trendIcon()" size="xxs"></span>
16133
+ {{ metric().trend }}
16134
+ </span>
16135
+ }
16123
16136
  <span class="text-2xl font-semibold text-clx-text leading-tight">{{ _formattedValue() }}</span>
16124
16137
  <span class="text-xs font-semibold tracking-widest text-clx-text-subtle uppercase">{{ metric().title }}</span>
16125
16138
  </div>
@@ -16155,14 +16168,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
16155
16168
  <span class="text-2xl font-semibold text-clx-text leading-tight">
16156
16169
  {{ _formattedValue() }}
16157
16170
  </span>
16158
- <span clx-badge
16159
- [color]="_trendColor()"
16160
- variant="light"
16161
- shape="pill"
16162
- class="self-start gap-1 mt-0.5">
16163
- <span clx-icon [name]="_trendIcon()" size="xxs"></span>
16164
- {{ metric().trend }}
16165
- </span>
16171
+ @if (_hasTrend()) {
16172
+ <span clx-badge
16173
+ [color]="_trendColor()"
16174
+ variant="light"
16175
+ shape="pill"
16176
+ class="self-start gap-1 mt-0.5">
16177
+ <span clx-icon [name]="_trendIcon()" size="xxs"></span>
16178
+ {{ metric().trend }}
16179
+ </span>
16180
+ }
16166
16181
  </div>
16167
16182
 
16168
16183
  <!-- Sparkline -->
@@ -16204,25 +16219,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
16204
16219
  }
16205
16220
  </div>
16206
16221
  <!-- Tendencia -->
16207
- <div class="flex items-center gap-1 text-xs text-clx-text-subtle whitespace-nowrap">
16208
- {{ metric().trendDirection === 'up' ? 'Increased By' : 'Decreased By' }}
16209
- <span class="font-semibold" [class]="_trendTextClass()">{{ metric().trend }}</span>
16210
- <span clx-icon [name]="_trendArrowIcon()" size="sm" [class]="_trendTextClass()"></span>
16211
- </div>
16222
+ @if (_hasTrend()) {
16223
+ <div class="flex items-center gap-1 text-xs text-clx-text-subtle whitespace-nowrap">
16224
+ {{ metric().trendDirection === 'up' ? 'Increased By' : 'Decreased By' }}
16225
+ <span class="font-semibold" [class]="_trendTextClass()">{{ metric().trend }}</span>
16226
+ <span clx-icon [name]="_trendArrowIcon()" size="sm" [class]="_trendTextClass()"></span>
16227
+ </div>
16228
+ }
16212
16229
  </div>
16213
16230
  }
16214
16231
 
16215
16232
  @if (layout() === 'vertical') {
16216
16233
  <!-- Col izquierda: badge + valor + título -->
16217
16234
  <div class="flex flex-col justify-between flex-1 min-w-0 gap-1">
16218
- <span clx-badge
16219
- [color]="_trendColor()"
16220
- variant="light"
16221
- shape="pill"
16222
- class="self-start gap-1">
16223
- <span clx-icon [name]="_trendIcon()" size="xxs"></span>
16224
- {{ metric().trend }}
16225
- </span>
16235
+ @if (_hasTrend()) {
16236
+ <span clx-badge
16237
+ [color]="_trendColor()"
16238
+ variant="light"
16239
+ shape="pill"
16240
+ class="self-start gap-1">
16241
+ <span clx-icon [name]="_trendIcon()" size="xxs"></span>
16242
+ {{ metric().trend }}
16243
+ </span>
16244
+ }
16226
16245
  <span class="text-2xl font-semibold text-clx-text leading-tight">{{ _formattedValue() }}</span>
16227
16246
  <span class="text-xs font-semibold tracking-widest text-clx-text-subtle uppercase">{{ metric().title }}</span>
16228
16247
  </div>
@@ -16566,6 +16585,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
16566
16585
  * overlay usage) and resize-by-dragging a corner handle. Persistence is the caller's job: listen
16567
16586
  * to (layoutChange) and save the resulting ClxGridItem[] (e.g. to rp_dashboard_layouts.layout). */
16568
16587
  class ClxDashboardGridComponent {
16588
+ _themeSvc = inject(ClxThemeService);
16569
16589
  items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
16570
16590
  columns = input(4, ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
16571
16591
  rowHeight = input(92, ...(ngDevMode ? [{ debugName: "rowHeight" }] : /* istanbul ignore next */ []));
@@ -16575,6 +16595,14 @@ class ClxDashboardGridComponent {
16575
16595
  itemResize = output();
16576
16596
  _itemTemplate = contentChild(ClxGridItemDirective, ...(ngDevMode ? [{ debugName: "_itemTemplate" }] : /* istanbul ignore next */ []));
16577
16597
  _gridCols = computed(() => `repeat(${this.columns()}, minmax(0, 1fr))`, ...(ngDevMode ? [{ debugName: "_gridCols" }] : /* istanbul ignore next */ []));
16598
+ /** Editing gets a visibly distinct "canvas" — dashed border + dotted background + surface-2 tint
16599
+ * — so the grid reads as an editable panel, not bare page background with cards floating on it. */
16600
+ _containerClass = computed(() => {
16601
+ const radius = resolveContainerRadius(this._themeSvc.config().borderRadius);
16602
+ if (!this.editable())
16603
+ return `${radius} p-1`;
16604
+ return `${radius} p-4 border-2 border-dashed border-clx-border bg-clx-surface-2`;
16605
+ }, ...(ngDevMode ? [{ debugName: "_containerClass" }] : /* istanbul ignore next */ []));
16578
16606
  _resizing = null;
16579
16607
  _onDrop(event) {
16580
16608
  const next = [...this.items()];
@@ -16617,38 +16645,40 @@ class ClxDashboardGridComponent {
16617
16645
  }
16618
16646
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxDashboardGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
16619
16647
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxDashboardGridComponent, isStandalone: true, selector: "clx-dashboard-grid", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, rowHeight: { classPropertyName: "rowHeight", publicName: "rowHeight", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { layoutChange: "layoutChange", itemResize: "itemResize" }, host: { classAttribute: "block w-full" }, queries: [{ propertyName: "_itemTemplate", first: true, predicate: ClxGridItemDirective, descendants: true, isSignal: true }], ngImport: i0, template: `
16620
- <div
16621
- cdkDropList
16622
- [cdkDropListDisabled]="!editable()"
16623
- (cdkDropListDropped)="_onDrop($event)"
16624
- class="grid w-full"
16625
- [style.grid-template-columns]="_gridCols()"
16626
- [style.grid-auto-rows.px]="rowHeight()"
16627
- [style.gap.px]="gap()">
16628
- @for (item of items(); track item.id) {
16629
- <div
16630
- cdkDrag
16631
- [cdkDragDisabled]="!editable()"
16632
- [cdkDragData]="item"
16633
- (cdkDragMoved)="_onDragMoved($event)"
16634
- class="relative min-w-0"
16635
- [class.cursor-grab]="editable()"
16636
- [style.grid-column]="'span ' + item.w"
16637
- [style.grid-row]="'span ' + item.h">
16638
-
16639
- <ng-container
16640
- [ngTemplateOutlet]="_itemTemplate()?.templateRef ?? null"
16641
- [ngTemplateOutletContext]="{ $implicit: item }">
16642
- </ng-container>
16643
-
16644
- @if (editable()) {
16645
- <div
16646
- class="absolute -right-1 -bottom-1 w-3.5 h-3.5 rounded bg-clx-primary border-2 border-clx-surface shadow cursor-nwse-resize"
16647
- (pointerdown)="_startResize($event, item)">
16648
- </div>
16649
- }
16650
- </div>
16651
- }
16648
+ <div [class]="_containerClass()">
16649
+ <div
16650
+ cdkDropList
16651
+ [cdkDropListDisabled]="!editable()"
16652
+ (cdkDropListDropped)="_onDrop($event)"
16653
+ class="grid w-full"
16654
+ [style.grid-template-columns]="_gridCols()"
16655
+ [style.grid-auto-rows.px]="rowHeight()"
16656
+ [style.gap.px]="gap()">
16657
+ @for (item of items(); track item.id) {
16658
+ <div
16659
+ cdkDrag
16660
+ [cdkDragDisabled]="!editable()"
16661
+ [cdkDragData]="item"
16662
+ (cdkDragMoved)="_onDragMoved($event)"
16663
+ class="relative min-w-0"
16664
+ [class.cursor-grab]="editable()"
16665
+ [style.grid-column]="'span ' + item.w"
16666
+ [style.grid-row]="'span ' + item.h">
16667
+
16668
+ <ng-container
16669
+ [ngTemplateOutlet]="_itemTemplate()?.templateRef ?? null"
16670
+ [ngTemplateOutletContext]="{ $implicit: item }">
16671
+ </ng-container>
16672
+
16673
+ @if (editable()) {
16674
+ <div
16675
+ class="absolute -right-1 -bottom-1 w-3.5 h-3.5 rounded bg-clx-primary border-2 border-clx-surface shadow cursor-nwse-resize z-10"
16676
+ (pointerdown)="_startResize($event, item)">
16677
+ </div>
16678
+ }
16679
+ </div>
16680
+ }
16681
+ </div>
16652
16682
  </div>
16653
16683
  `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
16654
16684
  }
@@ -16662,38 +16692,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
16662
16692
  changeDetection: ChangeDetectionStrategy.OnPush,
16663
16693
  host: { class: 'block w-full' },
16664
16694
  template: `
16665
- <div
16666
- cdkDropList
16667
- [cdkDropListDisabled]="!editable()"
16668
- (cdkDropListDropped)="_onDrop($event)"
16669
- class="grid w-full"
16670
- [style.grid-template-columns]="_gridCols()"
16671
- [style.grid-auto-rows.px]="rowHeight()"
16672
- [style.gap.px]="gap()">
16673
- @for (item of items(); track item.id) {
16674
- <div
16675
- cdkDrag
16676
- [cdkDragDisabled]="!editable()"
16677
- [cdkDragData]="item"
16678
- (cdkDragMoved)="_onDragMoved($event)"
16679
- class="relative min-w-0"
16680
- [class.cursor-grab]="editable()"
16681
- [style.grid-column]="'span ' + item.w"
16682
- [style.grid-row]="'span ' + item.h">
16683
-
16684
- <ng-container
16685
- [ngTemplateOutlet]="_itemTemplate()?.templateRef ?? null"
16686
- [ngTemplateOutletContext]="{ $implicit: item }">
16687
- </ng-container>
16688
-
16689
- @if (editable()) {
16690
- <div
16691
- class="absolute -right-1 -bottom-1 w-3.5 h-3.5 rounded bg-clx-primary border-2 border-clx-surface shadow cursor-nwse-resize"
16692
- (pointerdown)="_startResize($event, item)">
16693
- </div>
16694
- }
16695
- </div>
16696
- }
16695
+ <div [class]="_containerClass()">
16696
+ <div
16697
+ cdkDropList
16698
+ [cdkDropListDisabled]="!editable()"
16699
+ (cdkDropListDropped)="_onDrop($event)"
16700
+ class="grid w-full"
16701
+ [style.grid-template-columns]="_gridCols()"
16702
+ [style.grid-auto-rows.px]="rowHeight()"
16703
+ [style.gap.px]="gap()">
16704
+ @for (item of items(); track item.id) {
16705
+ <div
16706
+ cdkDrag
16707
+ [cdkDragDisabled]="!editable()"
16708
+ [cdkDragData]="item"
16709
+ (cdkDragMoved)="_onDragMoved($event)"
16710
+ class="relative min-w-0"
16711
+ [class.cursor-grab]="editable()"
16712
+ [style.grid-column]="'span ' + item.w"
16713
+ [style.grid-row]="'span ' + item.h">
16714
+
16715
+ <ng-container
16716
+ [ngTemplateOutlet]="_itemTemplate()?.templateRef ?? null"
16717
+ [ngTemplateOutletContext]="{ $implicit: item }">
16718
+ </ng-container>
16719
+
16720
+ @if (editable()) {
16721
+ <div
16722
+ class="absolute -right-1 -bottom-1 w-3.5 h-3.5 rounded bg-clx-primary border-2 border-clx-surface shadow cursor-nwse-resize z-10"
16723
+ (pointerdown)="_startResize($event, item)">
16724
+ </div>
16725
+ }
16726
+ </div>
16727
+ }
16728
+ </div>
16697
16729
  </div>
16698
16730
  `,
16699
16731
  }]