codexly-ui 0.15.16 → 0.16.1
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 +128 -236
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/codexly-ui.d.ts +35 -87
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -10,8 +10,6 @@ import * as i1 from '@angular/cdk/overlay';
|
|
|
10
10
|
import { ScrollStrategyOptions, OverlayModule } from '@angular/cdk/overlay';
|
|
11
11
|
import { ScrollingModule, CdkScrollable } from '@angular/cdk/scrolling';
|
|
12
12
|
import { Router, NavigationEnd, RouterLink, RouterLinkActive } from '@angular/router';
|
|
13
|
-
import * as i1$2 from '@angular/cdk/drag-drop';
|
|
14
|
-
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
15
13
|
|
|
16
14
|
// ── Parse 'red' | 'red-500' → { color, shade } ───────────────────────────────
|
|
17
15
|
function parseColorInput(input) {
|
|
@@ -16656,16 +16654,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
16656
16654
|
* Mount it inside `<ng-template clxCell let-row>` instead of hand-building the flex row each time. */
|
|
16657
16655
|
class ClxTableStatusCellComponent {
|
|
16658
16656
|
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
16657
|
+
/** Optional second line under the label (e.g. the customer's email under their name). */
|
|
16658
|
+
sublabel = input(null, ...(ngDevMode ? [{ debugName: "sublabel" }] : /* istanbul ignore next */ []));
|
|
16659
16659
|
avatarSrc = input(null, ...(ngDevMode ? [{ debugName: "avatarSrc" }] : /* istanbul ignore next */ []));
|
|
16660
16660
|
avatarInitials = input(null, ...(ngDevMode ? [{ debugName: "avatarInitials" }] : /* istanbul ignore next */ []));
|
|
16661
16661
|
avatarColor = input(undefined, ...(ngDevMode ? [{ debugName: "avatarColor" }] : /* istanbul ignore next */ []));
|
|
16662
16662
|
statusLabel = input.required(...(ngDevMode ? [{ debugName: "statusLabel" }] : /* istanbul ignore next */ []));
|
|
16663
16663
|
statusColor = input('slate', ...(ngDevMode ? [{ debugName: "statusColor" }] : /* istanbul ignore next */ []));
|
|
16664
16664
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxTableStatusCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
16665
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
16665
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxTableStatusCellComponent, isStandalone: true, selector: "clx-table-status-cell", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, sublabel: { classPropertyName: "sublabel", publicName: "sublabel", isSignal: true, isRequired: false, transformFunction: null }, avatarSrc: { classPropertyName: "avatarSrc", publicName: "avatarSrc", isSignal: true, isRequired: false, transformFunction: null }, avatarInitials: { classPropertyName: "avatarInitials", publicName: "avatarInitials", isSignal: true, isRequired: false, transformFunction: null }, avatarColor: { classPropertyName: "avatarColor", publicName: "avatarColor", isSignal: true, isRequired: false, transformFunction: null }, statusLabel: { classPropertyName: "statusLabel", publicName: "statusLabel", isSignal: true, isRequired: true, transformFunction: null }, statusColor: { classPropertyName: "statusColor", publicName: "statusColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "flex items-center justify-between gap-3 w-full" }, ngImport: i0, template: `
|
|
16666
16666
|
<div class="flex items-center gap-2.5 min-w-0">
|
|
16667
16667
|
<clx-avatar [src]="avatarSrc()" [initials]="avatarInitials()" [color]="avatarColor()" size="xs" />
|
|
16668
|
-
<
|
|
16668
|
+
<div class="min-w-0">
|
|
16669
|
+
<p class="text-sm text-clx-text-label truncate">{{ label() }}</p>
|
|
16670
|
+
@if (sublabel()) {
|
|
16671
|
+
<p class="text-xs text-clx-text-muted truncate">{{ sublabel() }}</p>
|
|
16672
|
+
}
|
|
16673
|
+
</div>
|
|
16669
16674
|
</div>
|
|
16670
16675
|
<span clx-badge [color]="statusColor()" variant="light" shape="pill" size="xs" class="shrink-0">
|
|
16671
16676
|
{{ statusLabel() }}
|
|
@@ -16684,259 +16689,146 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
16684
16689
|
template: `
|
|
16685
16690
|
<div class="flex items-center gap-2.5 min-w-0">
|
|
16686
16691
|
<clx-avatar [src]="avatarSrc()" [initials]="avatarInitials()" [color]="avatarColor()" size="xs" />
|
|
16687
|
-
<
|
|
16692
|
+
<div class="min-w-0">
|
|
16693
|
+
<p class="text-sm text-clx-text-label truncate">{{ label() }}</p>
|
|
16694
|
+
@if (sublabel()) {
|
|
16695
|
+
<p class="text-xs text-clx-text-muted truncate">{{ sublabel() }}</p>
|
|
16696
|
+
}
|
|
16697
|
+
</div>
|
|
16688
16698
|
</div>
|
|
16689
16699
|
<span clx-badge [color]="statusColor()" variant="light" shape="pill" size="xs" class="shrink-0">
|
|
16690
16700
|
{{ statusLabel() }}
|
|
16691
16701
|
</span>
|
|
16692
16702
|
`,
|
|
16693
16703
|
}]
|
|
16694
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], avatarSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarSrc", required: false }] }], avatarInitials: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarInitials", required: false }] }], avatarColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarColor", required: false }] }], statusLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusLabel", required: true }] }], statusColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusColor", required: false }] }] } });
|
|
16695
|
-
|
|
16696
|
-
/** Content template for one grid cell — `<ng-template clxGridItem let-item>...</ng-template>`,
|
|
16697
|
-
* mirroring the `clxCell`/`clxColumn` convention ClxTableComponent already uses for projected
|
|
16698
|
-
* per-row templates. Typically a <clx-widget-card> wrapping whatever the widget actually renders. */
|
|
16699
|
-
class ClxGridItemDirective {
|
|
16700
|
-
templateRef;
|
|
16701
|
-
constructor(templateRef) {
|
|
16702
|
-
this.templateRef = templateRef;
|
|
16703
|
-
}
|
|
16704
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxGridItemDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
16705
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.15", type: ClxGridItemDirective, isStandalone: true, selector: "ng-template[clxGridItem]", ngImport: i0 });
|
|
16706
|
-
}
|
|
16707
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxGridItemDirective, decorators: [{
|
|
16708
|
-
type: Directive,
|
|
16709
|
-
args: [{ selector: 'ng-template[clxGridItem]', standalone: true }]
|
|
16710
|
-
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
16711
|
-
/** Content-agnostic configurable dashboard grid: positions/sizes projected widgets on a CSS grid
|
|
16712
|
-
* using column/row units, supports drag-to-reorder (via Angular CDK's CdkDropList/CdkDrag — no
|
|
16713
|
-
* new dependency, @angular/cdk is already pulled in by ClxProfileComponent/ClxWidgetCardComponent's
|
|
16714
|
-
* overlay usage) and resize-by-dragging a corner handle. Persistence is the caller's job: listen
|
|
16715
|
-
* to (layoutChange) and save the resulting ClxGridItem[] (e.g. to rp_dashboard_layouts.layout).
|
|
16716
|
-
*
|
|
16717
|
-
* Responsive: `columns` is the desktop column count; the grid itself halves it under 1024px and
|
|
16718
|
-
* collapses to a single column under 640px (both breakpoints measured off its own host width via
|
|
16719
|
-
* ResizeObserver, not the viewport — correct inside a narrow sidebar-pushed layout too). Below
|
|
16720
|
-
* 640px, pointer-drag reorder/resize is replaced by an up/down reorder button pair per item —
|
|
16721
|
-
* CdkDrag's pointer events are unreliable with real fingers on a dense grid, and a 1-column layout
|
|
16722
|
-
* has nothing to resize width-wise anyway. */
|
|
16723
|
-
class ClxDashboardGridComponent {
|
|
16724
|
-
_themeSvc = inject(ClxThemeService);
|
|
16725
|
-
_isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
16726
|
-
items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
16727
|
-
columns = input(4, ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
16728
|
-
rowHeight = input(92, ...(ngDevMode ? [{ debugName: "rowHeight" }] : /* istanbul ignore next */ []));
|
|
16729
|
-
gap = input(16, ...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
|
|
16730
|
-
editable = input(false, ...(ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []));
|
|
16731
|
-
layoutChange = output();
|
|
16732
|
-
itemResize = output();
|
|
16733
|
-
_itemTemplate = contentChild(ClxGridItemDirective, ...(ngDevMode ? [{ debugName: "_itemTemplate" }] : /* istanbul ignore next */ []));
|
|
16734
|
-
_container = viewChild('container', ...(ngDevMode ? [{ debugName: "_container" }] : /* istanbul ignore next */ []));
|
|
16735
|
-
_hostWidth = signal(1280, ...(ngDevMode ? [{ debugName: "_hostWidth" }] : /* istanbul ignore next */ []));
|
|
16736
|
-
_resizeObserver;
|
|
16737
|
-
/** Below 640px: single column, no drag/resize (reorder buttons instead). 640-1024px: half the
|
|
16738
|
-
* desktop column count (min 2). 1024px+: the full `columns()` count. */
|
|
16739
|
-
_isCompact = computed(() => this._hostWidth() < 640, ...(ngDevMode ? [{ debugName: "_isCompact" }] : /* istanbul ignore next */ []));
|
|
16740
|
-
_effectiveColumns = computed(() => {
|
|
16741
|
-
const w = this._hostWidth();
|
|
16742
|
-
if (w < 640)
|
|
16743
|
-
return 1;
|
|
16744
|
-
if (w < 1024)
|
|
16745
|
-
return Math.max(2, Math.floor(this.columns() / 2));
|
|
16746
|
-
return this.columns();
|
|
16747
|
-
}, ...(ngDevMode ? [{ debugName: "_effectiveColumns" }] : /* istanbul ignore next */ []));
|
|
16748
|
-
_gridCols = computed(() => `repeat(${this._effectiveColumns()}, minmax(0, 1fr))`, ...(ngDevMode ? [{ debugName: "_gridCols" }] : /* istanbul ignore next */ []));
|
|
16749
|
-
/** Editing gets a visibly distinct "canvas" — dashed border + dotted background + surface-2 tint
|
|
16750
|
-
* — so the grid reads as an editable panel, not bare page background with cards floating on it. */
|
|
16751
|
-
_containerClass = computed(() => {
|
|
16752
|
-
const radius = resolveContainerRadius(this._themeSvc.config().borderRadius);
|
|
16753
|
-
if (!this.editable())
|
|
16754
|
-
return `${radius} p-1`;
|
|
16755
|
-
return `${radius} p-4 border-2 border-dashed border-clx-border bg-clx-surface-2`;
|
|
16756
|
-
}, ...(ngDevMode ? [{ debugName: "_containerClass" }] : /* istanbul ignore next */ []));
|
|
16757
|
-
_resizing = null;
|
|
16758
|
-
constructor() {
|
|
16759
|
-
effect((onCleanup) => {
|
|
16760
|
-
const el = this._container()?.nativeElement;
|
|
16761
|
-
if (!this._isBrowser || !el)
|
|
16762
|
-
return;
|
|
16763
|
-
this._hostWidth.set(el.clientWidth);
|
|
16764
|
-
this._resizeObserver = new ResizeObserver(entries => {
|
|
16765
|
-
const width = entries[0]?.contentRect.width;
|
|
16766
|
-
if (width)
|
|
16767
|
-
this._hostWidth.set(width);
|
|
16768
|
-
});
|
|
16769
|
-
this._resizeObserver.observe(el);
|
|
16770
|
-
onCleanup(() => this._resizeObserver?.disconnect());
|
|
16771
|
-
});
|
|
16772
|
-
}
|
|
16773
|
-
ngOnDestroy() {
|
|
16774
|
-
this._resizeObserver?.disconnect();
|
|
16775
|
-
}
|
|
16776
|
-
_onDrop(event) {
|
|
16777
|
-
const next = [...this.items()];
|
|
16778
|
-
moveItemInArray(next, event.previousIndex, event.currentIndex);
|
|
16779
|
-
this.layoutChange.emit(next);
|
|
16780
|
-
}
|
|
16781
|
-
_onDragMoved(_event) {
|
|
16782
|
-
// Reordering is handled by cdkDropListDropped above; this hook exists for future free-form
|
|
16783
|
-
// (x/y pixel) positioning if a consumer needs it — not required for a reorderable column grid.
|
|
16784
|
-
}
|
|
16785
|
-
/** Compact-mode reorder (touch-friendly alternative to CdkDrag) — swap item at `index` with its
|
|
16786
|
-
* neighbor `delta` positions away (-1 = up/earlier, 1 = down/later). */
|
|
16787
|
-
_moveBy(index, delta) {
|
|
16788
|
-
const next = [...this.items()];
|
|
16789
|
-
const target = index + delta;
|
|
16790
|
-
if (target < 0 || target >= next.length)
|
|
16791
|
-
return;
|
|
16792
|
-
[next[index], next[target]] = [next[target], next[index]];
|
|
16793
|
-
this.layoutChange.emit(next);
|
|
16794
|
-
}
|
|
16795
|
-
_startResize(event, item) {
|
|
16796
|
-
event.preventDefault();
|
|
16797
|
-
event.stopPropagation();
|
|
16798
|
-
this._resizing = { item, startX: event.clientX, startY: event.clientY, startW: item.w, startH: item.h };
|
|
16799
|
-
const cellW = event.target.closest('[style*="grid-column"]')?.clientWidth
|
|
16800
|
-
?? (this.rowHeight() * 2);
|
|
16801
|
-
const onMove = (e) => {
|
|
16802
|
-
if (!this._resizing)
|
|
16803
|
-
return;
|
|
16804
|
-
const dx = e.clientX - this._resizing.startX;
|
|
16805
|
-
const dy = e.clientY - this._resizing.startY;
|
|
16806
|
-
const deltaCols = Math.round(dx / (cellW / this._resizing.startW || 1));
|
|
16807
|
-
const deltaRows = Math.round(dy / this.rowHeight());
|
|
16808
|
-
const nextW = Math.max(item.minW ?? 1, this._resizing.startW + deltaCols);
|
|
16809
|
-
const nextH = Math.max(item.minH ?? 1, this._resizing.startH + deltaRows);
|
|
16810
|
-
if (nextW !== item.w || nextH !== item.h) {
|
|
16811
|
-
item.w = nextW;
|
|
16812
|
-
item.h = nextH;
|
|
16813
|
-
this.itemResize.emit({ id: item.id, w: nextW, h: nextH });
|
|
16814
|
-
}
|
|
16815
|
-
};
|
|
16816
|
-
const onUp = () => {
|
|
16817
|
-
this._resizing = null;
|
|
16818
|
-
this.layoutChange.emit([...this.items()]);
|
|
16819
|
-
window.removeEventListener('pointermove', onMove);
|
|
16820
|
-
window.removeEventListener('pointerup', onUp);
|
|
16821
|
-
};
|
|
16822
|
-
window.addEventListener('pointermove', onMove);
|
|
16823
|
-
window.addEventListener('pointerup', onUp);
|
|
16824
|
-
}
|
|
16825
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxDashboardGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
16826
|
-
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 }], viewQueries: [{ propertyName: "_container", first: true, predicate: ["container"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
16827
|
-
<div #container [class]="_containerClass()">
|
|
16828
|
-
<div
|
|
16829
|
-
cdkDropList
|
|
16830
|
-
[cdkDropListDisabled]="!editable() || _isCompact()"
|
|
16831
|
-
(cdkDropListDropped)="_onDrop($event)"
|
|
16832
|
-
class="grid w-full"
|
|
16833
|
-
[style.grid-template-columns]="_gridCols()"
|
|
16834
|
-
[style.grid-auto-rows.px]="rowHeight()"
|
|
16835
|
-
[style.gap.px]="gap()">
|
|
16836
|
-
@for (item of items(); track item.id; let i = $index) {
|
|
16837
|
-
<div
|
|
16838
|
-
cdkDrag
|
|
16839
|
-
[cdkDragDisabled]="!editable() || _isCompact()"
|
|
16840
|
-
[cdkDragData]="item"
|
|
16841
|
-
(cdkDragMoved)="_onDragMoved($event)"
|
|
16842
|
-
class="relative"
|
|
16843
|
-
[class.cursor-grab]="editable() && !_isCompact()"
|
|
16844
|
-
[style.grid-column]="_isCompact() ? 'span 1' : 'span ' + item.w"
|
|
16845
|
-
[style.grid-row]="_isCompact() ? 'span 1' : 'span ' + item.h">
|
|
16846
|
-
|
|
16847
|
-
<ng-container
|
|
16848
|
-
[ngTemplateOutlet]="_itemTemplate()?.templateRef ?? null"
|
|
16849
|
-
[ngTemplateOutletContext]="{ $implicit: item }">
|
|
16850
|
-
</ng-container>
|
|
16851
|
-
|
|
16852
|
-
@if (editable() && !_isCompact()) {
|
|
16853
|
-
<div
|
|
16854
|
-
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"
|
|
16855
|
-
(pointerdown)="_startResize($event, item)">
|
|
16856
|
-
</div>
|
|
16857
|
-
}
|
|
16704
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], sublabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "sublabel", required: false }] }], avatarSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarSrc", required: false }] }], avatarInitials: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarInitials", required: false }] }], avatarColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarColor", required: false }] }], statusLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusLabel", required: true }] }], statusColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusColor", required: false }] }] } });
|
|
16858
16705
|
|
|
16859
|
-
|
|
16860
|
-
|
|
16861
|
-
|
|
16862
|
-
|
|
16863
|
-
|
|
16864
|
-
|
|
16865
|
-
|
|
16866
|
-
|
|
16867
|
-
|
|
16868
|
-
|
|
16869
|
-
|
|
16870
|
-
|
|
16871
|
-
|
|
16872
|
-
|
|
16706
|
+
/** Drop-in cell for a `clxCell` table column: product image + name/category on the left, price +
|
|
16707
|
+
* quantity sold on the right — e.g. a "top selling products" dashboard widget row. Mount it inside
|
|
16708
|
+
* `<ng-template clxCell let-row>` instead of hand-building the flex row each time. */
|
|
16709
|
+
class ClxTableProductCellComponent {
|
|
16710
|
+
imageSrc = input(null, ...(ngDevMode ? [{ debugName: "imageSrc" }] : /* istanbul ignore next */ []));
|
|
16711
|
+
name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
16712
|
+
category = input('', ...(ngDevMode ? [{ debugName: "category" }] : /* istanbul ignore next */ []));
|
|
16713
|
+
price = input('', ...(ngDevMode ? [{ debugName: "price" }] : /* istanbul ignore next */ []));
|
|
16714
|
+
soldQty = input('', ...(ngDevMode ? [{ debugName: "soldQty" }] : /* istanbul ignore next */ []));
|
|
16715
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxTableProductCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
16716
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxTableProductCellComponent, isStandalone: true, selector: "clx-table-product-cell", inputs: { imageSrc: { classPropertyName: "imageSrc", publicName: "imageSrc", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, category: { classPropertyName: "category", publicName: "category", isSignal: true, isRequired: false, transformFunction: null }, price: { classPropertyName: "price", publicName: "price", isSignal: true, isRequired: false, transformFunction: null }, soldQty: { classPropertyName: "soldQty", publicName: "soldQty", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "flex items-center gap-2 w-full min-w-0" }, ngImport: i0, template: `
|
|
16717
|
+
<div class="flex items-center gap-2 min-w-0 flex-1">
|
|
16718
|
+
@if (imageSrc()) {
|
|
16719
|
+
<img [src]="imageSrc()" [alt]="name()" class="w-8 h-8 rounded-lg object-cover shrink-0 bg-clx-surface-2" />
|
|
16720
|
+
} @else {
|
|
16721
|
+
<div class="w-8 h-8 rounded-lg shrink-0 bg-clx-surface-2"></div>
|
|
16722
|
+
}
|
|
16723
|
+
<div class="min-w-0">
|
|
16724
|
+
<p class="text-sm text-clx-text-label truncate">{{ name() }}</p>
|
|
16725
|
+
@if (category()) {
|
|
16726
|
+
<p class="text-xs text-clx-text-muted truncate">{{ category() }}</p>
|
|
16873
16727
|
}
|
|
16874
16728
|
</div>
|
|
16875
16729
|
</div>
|
|
16876
|
-
|
|
16730
|
+
<div class="text-right shrink-0 min-w-0">
|
|
16731
|
+
<p class="text-sm font-semibold text-clx-text tabular-nums truncate">{{ price() }}</p>
|
|
16732
|
+
@if (soldQty()) {
|
|
16733
|
+
<p class="text-xs text-clx-text-muted whitespace-nowrap">{{ soldQty() }} vendidos</p>
|
|
16734
|
+
}
|
|
16735
|
+
</div>
|
|
16736
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
16877
16737
|
}
|
|
16878
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type:
|
|
16738
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxTableProductCellComponent, decorators: [{
|
|
16879
16739
|
type: Component,
|
|
16880
16740
|
args: [{
|
|
16881
|
-
selector: 'clx-
|
|
16741
|
+
selector: 'clx-table-product-cell',
|
|
16882
16742
|
standalone: true,
|
|
16883
|
-
imports: [NgTemplateOutlet, DragDropModule, ClxIconComponent],
|
|
16884
16743
|
encapsulation: ViewEncapsulation.None,
|
|
16885
16744
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16886
|
-
host: { class: '
|
|
16745
|
+
host: { class: 'flex items-center gap-2 w-full min-w-0' },
|
|
16887
16746
|
template: `
|
|
16888
|
-
<div
|
|
16889
|
-
|
|
16890
|
-
|
|
16891
|
-
|
|
16892
|
-
|
|
16893
|
-
|
|
16894
|
-
|
|
16895
|
-
|
|
16896
|
-
|
|
16897
|
-
|
|
16898
|
-
<div
|
|
16899
|
-
cdkDrag
|
|
16900
|
-
[cdkDragDisabled]="!editable() || _isCompact()"
|
|
16901
|
-
[cdkDragData]="item"
|
|
16902
|
-
(cdkDragMoved)="_onDragMoved($event)"
|
|
16903
|
-
class="relative"
|
|
16904
|
-
[class.cursor-grab]="editable() && !_isCompact()"
|
|
16905
|
-
[style.grid-column]="_isCompact() ? 'span 1' : 'span ' + item.w"
|
|
16906
|
-
[style.grid-row]="_isCompact() ? 'span 1' : 'span ' + item.h">
|
|
16907
|
-
|
|
16908
|
-
<ng-container
|
|
16909
|
-
[ngTemplateOutlet]="_itemTemplate()?.templateRef ?? null"
|
|
16910
|
-
[ngTemplateOutletContext]="{ $implicit: item }">
|
|
16911
|
-
</ng-container>
|
|
16912
|
-
|
|
16913
|
-
@if (editable() && !_isCompact()) {
|
|
16914
|
-
<div
|
|
16915
|
-
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"
|
|
16916
|
-
(pointerdown)="_startResize($event, item)">
|
|
16917
|
-
</div>
|
|
16918
|
-
}
|
|
16919
|
-
|
|
16920
|
-
@if (editable() && _isCompact()) {
|
|
16921
|
-
<div class="absolute top-2 right-2 z-10 flex flex-col rounded-lg overflow-hidden border border-clx-border bg-clx-surface shadow-sm">
|
|
16922
|
-
<button type="button" class="w-7 h-7 flex items-center justify-center disabled:opacity-30"
|
|
16923
|
-
[disabled]="i === 0" (click)="_moveBy(i, -1)" aria-label="Mover arriba">
|
|
16924
|
-
<span clx-icon name="keyboard_arrow_up" size="sm"></span>
|
|
16925
|
-
</button>
|
|
16926
|
-
<div class="h-px bg-clx-border-soft"></div>
|
|
16927
|
-
<button type="button" class="w-7 h-7 flex items-center justify-center disabled:opacity-30"
|
|
16928
|
-
[disabled]="i === items().length - 1" (click)="_moveBy(i, 1)" aria-label="Mover abajo">
|
|
16929
|
-
<span clx-icon name="keyboard_arrow_down" size="sm"></span>
|
|
16930
|
-
</button>
|
|
16931
|
-
</div>
|
|
16932
|
-
}
|
|
16933
|
-
</div>
|
|
16747
|
+
<div class="flex items-center gap-2 min-w-0 flex-1">
|
|
16748
|
+
@if (imageSrc()) {
|
|
16749
|
+
<img [src]="imageSrc()" [alt]="name()" class="w-8 h-8 rounded-lg object-cover shrink-0 bg-clx-surface-2" />
|
|
16750
|
+
} @else {
|
|
16751
|
+
<div class="w-8 h-8 rounded-lg shrink-0 bg-clx-surface-2"></div>
|
|
16752
|
+
}
|
|
16753
|
+
<div class="min-w-0">
|
|
16754
|
+
<p class="text-sm text-clx-text-label truncate">{{ name() }}</p>
|
|
16755
|
+
@if (category()) {
|
|
16756
|
+
<p class="text-xs text-clx-text-muted truncate">{{ category() }}</p>
|
|
16934
16757
|
}
|
|
16935
16758
|
</div>
|
|
16936
16759
|
</div>
|
|
16760
|
+
<div class="text-right shrink-0 min-w-0">
|
|
16761
|
+
<p class="text-sm font-semibold text-clx-text tabular-nums truncate">{{ price() }}</p>
|
|
16762
|
+
@if (soldQty()) {
|
|
16763
|
+
<p class="text-xs text-clx-text-muted whitespace-nowrap">{{ soldQty() }} vendidos</p>
|
|
16764
|
+
}
|
|
16765
|
+
</div>
|
|
16766
|
+
`,
|
|
16767
|
+
}]
|
|
16768
|
+
}], propDecorators: { imageSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageSrc", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], category: [{ type: i0.Input, args: [{ isSignal: true, alias: "category", required: false }] }], price: [{ type: i0.Input, args: [{ isSignal: true, alias: "price", required: false }] }], soldQty: [{ type: i0.Input, args: [{ isSignal: true, alias: "soldQty", required: false }] }] } });
|
|
16769
|
+
|
|
16770
|
+
/** A ranking: color dot + label on the left, optional trend badge + value on the right — e.g. "Top
|
|
16771
|
+
* selling categories" or "Sales by channel" on a dashboard. Composes ClxListComponent/
|
|
16772
|
+
* ClxListItemComponent (their clxLead/clxTrail slots) rather than reinventing list chrome. */
|
|
16773
|
+
class ClxRankedListComponent {
|
|
16774
|
+
items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
16775
|
+
color = input(undefined, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
16776
|
+
dotClass(color) {
|
|
16777
|
+
return resolveColor(color).bg;
|
|
16778
|
+
}
|
|
16779
|
+
trendColor(direction) {
|
|
16780
|
+
return direction === 'up' ? 'green' : direction === 'down' ? 'red' : 'slate';
|
|
16781
|
+
}
|
|
16782
|
+
trendIcon(direction) {
|
|
16783
|
+
return direction === 'up' ? 'arrow_upward' : direction === 'down' ? 'arrow_downward' : 'remove';
|
|
16784
|
+
}
|
|
16785
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxRankedListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
16786
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxRankedListComponent, isStandalone: true, selector: "clx-ranked-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
16787
|
+
<clx-list [color]="color()">
|
|
16788
|
+
@for (item of items(); track item.label) {
|
|
16789
|
+
<clx-list-item [label]="item.label">
|
|
16790
|
+
<span clxLead class="w-2 h-2 rounded-full shrink-0" [class]="dotClass(item.colorDot)"></span>
|
|
16791
|
+
<div clxTrail class="flex items-center gap-2">
|
|
16792
|
+
@if (item.trend) {
|
|
16793
|
+
<span clx-badge size="xs" variant="light" shape="pill" [color]="trendColor(item.trendDirection)">
|
|
16794
|
+
<span clx-icon [name]="trendIcon(item.trendDirection)" size="xxs"></span>
|
|
16795
|
+
{{ item.trend }}
|
|
16796
|
+
</span>
|
|
16797
|
+
}
|
|
16798
|
+
<span class="text-sm font-semibold text-clx-text tabular-nums">{{ item.value }}</span>
|
|
16799
|
+
</div>
|
|
16800
|
+
</clx-list-item>
|
|
16801
|
+
}
|
|
16802
|
+
</clx-list>
|
|
16803
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ClxListComponent, selector: "clx-list", inputs: ["color", "variant", "size", "numbered"] }, { kind: "component", type: ClxListItemComponent, selector: "clx-list-item", inputs: ["label", "sublabel", "wrapSublabel", "icon", "meta", "metaColor", "disabled"] }, { kind: "component", type: ClxBadgeComponent, selector: "span[clx-badge]", inputs: ["variant", "color", "size", "shape", "positioned"] }, { kind: "component", type: ClxIconComponent, selector: "span[clx-icon]", inputs: ["name", "size", "color", "fill"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
16804
|
+
}
|
|
16805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxRankedListComponent, decorators: [{
|
|
16806
|
+
type: Component,
|
|
16807
|
+
args: [{
|
|
16808
|
+
selector: 'clx-ranked-list',
|
|
16809
|
+
standalone: true,
|
|
16810
|
+
imports: [ClxListComponent, ClxListItemComponent, ClxBadgeComponent, ClxIconComponent],
|
|
16811
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16812
|
+
template: `
|
|
16813
|
+
<clx-list [color]="color()">
|
|
16814
|
+
@for (item of items(); track item.label) {
|
|
16815
|
+
<clx-list-item [label]="item.label">
|
|
16816
|
+
<span clxLead class="w-2 h-2 rounded-full shrink-0" [class]="dotClass(item.colorDot)"></span>
|
|
16817
|
+
<div clxTrail class="flex items-center gap-2">
|
|
16818
|
+
@if (item.trend) {
|
|
16819
|
+
<span clx-badge size="xs" variant="light" shape="pill" [color]="trendColor(item.trendDirection)">
|
|
16820
|
+
<span clx-icon [name]="trendIcon(item.trendDirection)" size="xxs"></span>
|
|
16821
|
+
{{ item.trend }}
|
|
16822
|
+
</span>
|
|
16823
|
+
}
|
|
16824
|
+
<span class="text-sm font-semibold text-clx-text tabular-nums">{{ item.value }}</span>
|
|
16825
|
+
</div>
|
|
16826
|
+
</clx-list-item>
|
|
16827
|
+
}
|
|
16828
|
+
</clx-list>
|
|
16937
16829
|
`,
|
|
16938
16830
|
}]
|
|
16939
|
-
}],
|
|
16831
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }] } });
|
|
16940
16832
|
|
|
16941
16833
|
const PRODUCT_TAG_LABEL = {
|
|
16942
16834
|
'new': 'Nuevo',
|
|
@@ -19541,5 +19433,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
19541
19433
|
* Generated bundle index. Do not edit.
|
|
19542
19434
|
*/
|
|
19543
19435
|
|
|
19544
|
-
export { CLX_ADDON_BORDER, CLX_ADDON_TEXT, CLX_ALERT_OPTIONS, CLX_ALERT_RESOLVE, CLX_BG_ADDON, CLX_BG_DISABLED, CLX_BG_ICON_WRAP, CLX_BG_SECTION, CLX_BG_SURFACE, CLX_BORDER_DEFAULT, CLX_BORDER_DISABLED, CLX_BORDER_MEDIUM, CLX_COLOR_HEX, CLX_COLOR_HEX_100, CLX_COLOR_MAP, CLX_FONT_CATALOG, CLX_MODAL_ANIM_CONFIG, CLX_MODAL_DATA, CLX_MODAL_REF, CLX_OPTION_DISABLED, CLX_PLACEHOLDER, CLX_RADIO_GROUP, CLX_RADIUS_MAP, CLX_TEXT_BODY, CLX_TEXT_DISABLED, CLX_TEXT_HEADING, CLX_TEXT_HINT, CLX_TEXT_IDLE, CLX_TEXT_INPUT, CLX_TEXT_LABEL, CLX_TEXT_OPTION, CLX_TEXT_SUBTITLE, CLX_TEXT_TITLE, CLX_THEME_CONFIG, CLX_THEME_DEFAULTS, CLX_TOAST_DEFAULTS, ClxAlertComponent, ClxAlertService, ClxAnimateDirective, ClxAnimateGroupDirective, ClxAnimateService, ClxAppLayoutComponent, ClxAvatarComponent, ClxBadgeComponent, ClxBrandComponent, ClxButtonComponent, ClxButtonGroupComponent, ClxCardBodyDirective, ClxCardComponent, ClxCardExpiryInputComponent, ClxCardFooterDirective, ClxCardHeaderActionsDirective, ClxCardHeaderDirective, ClxCardNumberInputComponent, ClxCardValidators, ClxCarouselComponent, ClxCarouselDirective, ClxCartComponent, ClxCartSummaryDrawer, ClxCellDirective, ClxCheckboxComponent, ClxCollapseComponent, ClxColorPickerComponent, ClxColumnDefDirective,
|
|
19436
|
+
export { CLX_ADDON_BORDER, CLX_ADDON_TEXT, CLX_ALERT_OPTIONS, CLX_ALERT_RESOLVE, CLX_BG_ADDON, CLX_BG_DISABLED, CLX_BG_ICON_WRAP, CLX_BG_SECTION, CLX_BG_SURFACE, CLX_BORDER_DEFAULT, CLX_BORDER_DISABLED, CLX_BORDER_MEDIUM, CLX_COLOR_HEX, CLX_COLOR_HEX_100, CLX_COLOR_MAP, CLX_FONT_CATALOG, CLX_MODAL_ANIM_CONFIG, CLX_MODAL_DATA, CLX_MODAL_REF, CLX_OPTION_DISABLED, CLX_PLACEHOLDER, CLX_RADIO_GROUP, CLX_RADIUS_MAP, CLX_TEXT_BODY, CLX_TEXT_DISABLED, CLX_TEXT_HEADING, CLX_TEXT_HINT, CLX_TEXT_IDLE, CLX_TEXT_INPUT, CLX_TEXT_LABEL, CLX_TEXT_OPTION, CLX_TEXT_SUBTITLE, CLX_TEXT_TITLE, CLX_THEME_CONFIG, CLX_THEME_DEFAULTS, CLX_TOAST_DEFAULTS, ClxAlertComponent, ClxAlertService, ClxAnimateDirective, ClxAnimateGroupDirective, ClxAnimateService, ClxAppLayoutComponent, ClxAvatarComponent, ClxBadgeComponent, ClxBrandComponent, ClxButtonComponent, ClxButtonGroupComponent, ClxCardBodyDirective, ClxCardComponent, ClxCardExpiryInputComponent, ClxCardFooterDirective, ClxCardHeaderActionsDirective, ClxCardHeaderDirective, ClxCardNumberInputComponent, ClxCardValidators, ClxCarouselComponent, ClxCarouselDirective, ClxCartComponent, ClxCartSummaryDrawer, ClxCellDirective, ClxCheckboxComponent, ClxCollapseComponent, ClxColorPickerComponent, ClxColumnDefDirective, ClxDateRangePickerComponent, ClxDatepickerComponent, ClxDrawerComponent, ClxDrawerService, ClxEditorComponent, ClxEditorImageModalComponent, ClxEditorLinkModalComponent, ClxFabComponent, ClxFilterPanelComponent, ClxHeaderCellDirective, ClxIconComponent, ClxInputComponent, ClxListComponent, ClxListItemComponent, ClxMenuComponent, ClxMenuItemComponent, ClxMenuItemTrailingDirective, ClxModalComponent, ClxModalService, ClxNativeOverlayService, ClxNavGroupComponent, ClxNotificationComponent, ClxNumberComponent, ClxOtpComponent, ClxPageEmptyComponent, ClxPageHeaderComponent, ClxPageHeaderTitleDirective, ClxPageNotFoundComponent, ClxPageServerErrorComponent, ClxPageUnauthorizedComponent, ClxPaginationComponent, ClxProductComponent, ClxProductDetailComponent, ClxProductQuickViewComponent, ClxProfileComponent, ClxProgressBarComponent, ClxRadioComponent, ClxRadioGroupComponent, ClxRankedListComponent, ClxRatingComponent, ClxSearchComponent, ClxSelectComponent, ClxSkeletonComponent, ClxSliderComponent, ClxSocialIconComponent, ClxSpinnerComponent, ClxStatCardComponent, ClxStepComponent, ClxStepperComponent, ClxSwitchComponent, ClxTabDirective, ClxTableActionsComponent, ClxTableComponent, ClxTableProductCellComponent, ClxTableProgressCellComponent, ClxTableStatusCellComponent, ClxTabsComponent, ClxTagComponent, ClxTextareaComponent, ClxThemeService, ClxTimelineComponent, ClxTimelineItemComponent, ClxTimepickerComponent, ClxToastComponent, ClxToastContainerComponent, ClxToastService, ClxTooltipComponent, ClxTooltipDirective, ClxTreeComponent, ClxUploadComponent, ClxWidgetCardComponent, ClxWishlistComponent, ClxWizardComponent, TIMEPICKER_SIZE_MAP, detectClxCardBrand, isClxCardExpired, parseColorInput, provideCodexlyTheme, resolveColor, resolveContainerRadius, resolveRadius };
|
|
19545
19437
|
//# sourceMappingURL=codexly-ui.mjs.map
|