codexly-ui 0.5.9 → 0.6.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 +30 -31
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/codexly-ui.d.ts +7 -6
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -3346,9 +3346,19 @@ class ClxNumberComponent {
|
|
|
3346
3346
|
_handleInput(event) {
|
|
3347
3347
|
const raw = event.target.value;
|
|
3348
3348
|
const num = raw === '' ? 0 : parseFloat(raw);
|
|
3349
|
-
if (
|
|
3350
|
-
|
|
3351
|
-
|
|
3349
|
+
if (isNaN(num))
|
|
3350
|
+
return;
|
|
3351
|
+
let clamped = num;
|
|
3352
|
+
if (this.min() !== null)
|
|
3353
|
+
clamped = Math.max(clamped, this.min());
|
|
3354
|
+
if (this.max() !== null)
|
|
3355
|
+
clamped = Math.min(clamped, this.max());
|
|
3356
|
+
this._value.set(clamped);
|
|
3357
|
+
this._onChange(clamped);
|
|
3358
|
+
// Reflect the clamp back into the native input immediately — otherwise the DOM would keep
|
|
3359
|
+
// showing the raw out-of-range digits the user typed until blur re-renders the value.
|
|
3360
|
+
if (clamped !== num) {
|
|
3361
|
+
event.target.value = String(clamped);
|
|
3352
3362
|
}
|
|
3353
3363
|
}
|
|
3354
3364
|
_handleBlur() {
|
|
@@ -11323,7 +11333,10 @@ class ClxPaginationComponent {
|
|
|
11323
11333
|
return items;
|
|
11324
11334
|
}, ...(ngDevMode ? [{ debugName: "_pageItems" }] : /* istanbul ignore next */ []));
|
|
11325
11335
|
// ── Clases ─────────────────────────────────────────────────────────────────
|
|
11326
|
-
_wrapClass = computed(() =>
|
|
11336
|
+
_wrapClass = computed(() => {
|
|
11337
|
+
const { color } = parseColorInput(this._color());
|
|
11338
|
+
return `flex flex-wrap items-center justify-between ${this._cfg().gap} bg-clx-surface rounded-lg border border-${color}-200 px-4 py-3`;
|
|
11339
|
+
}, ...(ngDevMode ? [{ debugName: "_wrapClass" }] : /* istanbul ignore next */ []));
|
|
11327
11340
|
_infoClass = computed(() => `${this._cfg().text} text-clx-text-muted whitespace-nowrap`, ...(ngDevMode ? [{ debugName: "_infoClass" }] : /* istanbul ignore next */ []));
|
|
11328
11341
|
_ellipsisClass = computed(() => {
|
|
11329
11342
|
const sizes = {
|
|
@@ -12189,7 +12202,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
12189
12202
|
const TABLE_BASE_CLASS = 'w-full text-left border-collapse text-sm';
|
|
12190
12203
|
const TABLE_HEADER_CELL_CLASS = 'px-4 py-3 font-semibold whitespace-nowrap';
|
|
12191
12204
|
const TABLE_CELL_CLASS = 'px-4 py-3 border-b border-clx-border-soft text-clx-text-label';
|
|
12192
|
-
const TABLE_ROW_CLASS = '';
|
|
12205
|
+
const TABLE_ROW_CLASS = 'bg-clx-surface';
|
|
12193
12206
|
// ── Alignment ────────────────────────────────────────────────────────────────
|
|
12194
12207
|
const TABLE_ALIGN_MAP = {
|
|
12195
12208
|
left: 'text-left',
|
|
@@ -12394,11 +12407,11 @@ class ClxTableComponent {
|
|
|
12394
12407
|
this.pageChange.emit({ pageIndex: idx, pageSize: this.pageSize() });
|
|
12395
12408
|
}
|
|
12396
12409
|
// ── Computed ───────────────────────────────────────────────────────────────
|
|
12397
|
-
|
|
12410
|
+
_tableWrapperClass = computed(() => {
|
|
12398
12411
|
const { color } = parseColorInput(this._color());
|
|
12399
|
-
|
|
12400
|
-
|
|
12401
|
-
|
|
12412
|
+
return `overflow-x-auto overflow-y-hidden rounded-lg border border-${color}-200`;
|
|
12413
|
+
}, ...(ngDevMode ? [{ debugName: "_tableWrapperClass" }] : /* istanbul ignore next */ []));
|
|
12414
|
+
_tableClass = computed(() => TABLE_BASE_CLASS, ...(ngDevMode ? [{ debugName: "_tableClass" }] : /* istanbul ignore next */ []));
|
|
12402
12415
|
_headerClass = computed(() => {
|
|
12403
12416
|
const t = resolveColor(this._color());
|
|
12404
12417
|
return `${t.bgSubtle} ${t.textSubtle}`;
|
|
@@ -12550,15 +12563,12 @@ class ClxTableComponent {
|
|
|
12550
12563
|
</div>
|
|
12551
12564
|
} @else {
|
|
12552
12565
|
<!-- ── Tabla ───────────────────────────────────────────────────────── -->
|
|
12553
|
-
<div class="
|
|
12566
|
+
<div [class]="_tableWrapperClass()">
|
|
12554
12567
|
<table [class]="_tableClass()">
|
|
12555
12568
|
<thead>
|
|
12556
12569
|
<tr [class]="_headerClass()">
|
|
12557
12570
|
@if (selectable()) {
|
|
12558
|
-
<th [class]="_headerCellClass()"
|
|
12559
|
-
[class.rounded-tl-lg]="true"
|
|
12560
|
-
[class.rounded-bl-lg]="true"
|
|
12561
|
-
class="w-10 text-center">
|
|
12571
|
+
<th [class]="_headerCellClass()" class="w-10 text-center">
|
|
12562
12572
|
@if (!singleSelect()) {
|
|
12563
12573
|
<clx-checkbox
|
|
12564
12574
|
[color]="_color()"
|
|
@@ -12569,13 +12579,9 @@ class ClxTableComponent {
|
|
|
12569
12579
|
</th>
|
|
12570
12580
|
}
|
|
12571
12581
|
|
|
12572
|
-
@for (col of columns(); track col.key
|
|
12582
|
+
@for (col of columns(); track col.key) {
|
|
12573
12583
|
<th
|
|
12574
12584
|
[class]="_getHeaderCellClass(col)"
|
|
12575
|
-
[class.rounded-tl-lg]="first && !selectable()"
|
|
12576
|
-
[class.rounded-bl-lg]="first && !selectable()"
|
|
12577
|
-
[class.rounded-tr-lg]="last"
|
|
12578
|
-
[class.rounded-br-lg]="last"
|
|
12579
12585
|
[style.width]="col.width"
|
|
12580
12586
|
(click)="col.sortable && _handleSort(col.key)">
|
|
12581
12587
|
<div class="flex items-center gap-1.5"
|
|
@@ -12636,7 +12642,7 @@ class ClxTableComponent {
|
|
|
12636
12642
|
|
|
12637
12643
|
<!-- ── Footer: clx-pagination ────────────────────────────────────────── -->
|
|
12638
12644
|
@if (pagination()) {
|
|
12639
|
-
<div class="
|
|
12645
|
+
<div class="mt-3">
|
|
12640
12646
|
<clx-pagination
|
|
12641
12647
|
size="sm"
|
|
12642
12648
|
[totalItems]="_totalItems()"
|
|
@@ -12704,15 +12710,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
12704
12710
|
</div>
|
|
12705
12711
|
} @else {
|
|
12706
12712
|
<!-- ── Tabla ───────────────────────────────────────────────────────── -->
|
|
12707
|
-
<div class="
|
|
12713
|
+
<div [class]="_tableWrapperClass()">
|
|
12708
12714
|
<table [class]="_tableClass()">
|
|
12709
12715
|
<thead>
|
|
12710
12716
|
<tr [class]="_headerClass()">
|
|
12711
12717
|
@if (selectable()) {
|
|
12712
|
-
<th [class]="_headerCellClass()"
|
|
12713
|
-
[class.rounded-tl-lg]="true"
|
|
12714
|
-
[class.rounded-bl-lg]="true"
|
|
12715
|
-
class="w-10 text-center">
|
|
12718
|
+
<th [class]="_headerCellClass()" class="w-10 text-center">
|
|
12716
12719
|
@if (!singleSelect()) {
|
|
12717
12720
|
<clx-checkbox
|
|
12718
12721
|
[color]="_color()"
|
|
@@ -12723,13 +12726,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
12723
12726
|
</th>
|
|
12724
12727
|
}
|
|
12725
12728
|
|
|
12726
|
-
@for (col of columns(); track col.key
|
|
12729
|
+
@for (col of columns(); track col.key) {
|
|
12727
12730
|
<th
|
|
12728
12731
|
[class]="_getHeaderCellClass(col)"
|
|
12729
|
-
[class.rounded-tl-lg]="first && !selectable()"
|
|
12730
|
-
[class.rounded-bl-lg]="first && !selectable()"
|
|
12731
|
-
[class.rounded-tr-lg]="last"
|
|
12732
|
-
[class.rounded-br-lg]="last"
|
|
12733
12732
|
[style.width]="col.width"
|
|
12734
12733
|
(click)="col.sortable && _handleSort(col.key)">
|
|
12735
12734
|
<div class="flex items-center gap-1.5"
|
|
@@ -12790,7 +12789,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
12790
12789
|
|
|
12791
12790
|
<!-- ── Footer: clx-pagination ────────────────────────────────────────── -->
|
|
12792
12791
|
@if (pagination()) {
|
|
12793
|
-
<div class="
|
|
12792
|
+
<div class="mt-3">
|
|
12794
12793
|
<clx-pagination
|
|
12795
12794
|
size="sm"
|
|
12796
12795
|
[totalItems]="_totalItems()"
|