ngx-com 0.1.0 → 0.1.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.
package/README.md CHANGED
@@ -70,7 +70,21 @@ Switch themes at runtime by setting `data-theme` on the `<html>` element:
70
70
  <html data-theme="dark">
71
71
  ```
72
72
 
73
- ### 2. Import CDK overlay styles
73
+ ### 2. Add Tailwind source for ngx-com
74
+
75
+ Library components use Tailwind utility classes in their templates. Tell
76
+ Tailwind to scan the installed package so those classes are generated:
77
+
78
+ ```css
79
+ /* styles.css */
80
+ @source "../../node_modules/ngx-com";
81
+ ```
82
+
83
+ > The path is relative to your CSS file. Adjust the depth if your stylesheet
84
+ > is not at `src/styles.css`. For **pnpm** with strict hoisting, the path may
85
+ > be `../../node_modules/.pnpm/ngx-com@*/node_modules/ngx-com`.
86
+
87
+ ### 3. Import CDK overlay styles
74
88
 
75
89
  Components that use overlays (dropdown, dialog, popover, tooltip, confirm,
76
90
  menu, toast) require the CDK overlay stylesheet:
@@ -79,7 +93,7 @@ menu, toast) require the CDK overlay stylesheet:
79
93
  @import '@angular/cdk/overlay-prebuilt.css';
80
94
  ```
81
95
 
82
- ### 3. Register icons (optional)
96
+ ### 4. Register icons (optional)
83
97
 
84
98
  If using the `<com-icon>` component with Lucide icons:
85
99
 
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, TemplateRef, Directive, input, contentChild, booleanAttribute, signal, DestroyRef, contentChildren, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { NgTemplateOutlet } from '@angular/common';
2
+ import { inject, TemplateRef, Directive, input, contentChild, booleanAttribute, signal, InjectionToken, DestroyRef, contentChildren, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, ElementRef, Renderer2, output, afterNextRender, forwardRef } from '@angular/core';
3
+ import { NgTemplateOutlet, DOCUMENT } from '@angular/common';
4
4
  import { ComSpinner } from 'ngx-com/components/spinner';
5
5
  import { cva } from 'class-variance-authority';
6
6
 
@@ -286,6 +286,12 @@ function isDataSource(value) {
286
286
  return value instanceof ComDataSource;
287
287
  }
288
288
 
289
+ /**
290
+ * Injection token used by ComTable to optionally detect a ComRowClick directive.
291
+ * Breaks the circular dependency between ComTable and ComRowClick.
292
+ */
293
+ const COM_ROW_CLICK = new InjectionToken('COM_ROW_CLICK');
294
+
289
295
  /**
290
296
  * CVA variants for the table container wrapper.
291
297
  */
@@ -313,16 +319,16 @@ const tableHeaderVariants = cva('', {
313
319
  },
314
320
  });
315
321
  /**
316
- * CVA variants for `<th>` header cells.
322
+ * CVA variants for the header `<tr>` — applies base styles to child `<th>` cells via child selectors.
317
323
  *
318
324
  * @tokens `--color-muted-foreground`
319
325
  */
320
- const tableHeaderCellVariants = cva('text-left align-middle font-medium text-muted-foreground [&:has([comSortHeader])]:cursor-pointer', {
326
+ const tableHeaderRowVariants = cva('[&>th]:text-left [&>th]:align-middle [&>th]:font-medium [&>th]:text-muted-foreground [&>th:has([comSortHeader])]:cursor-pointer', {
321
327
  variants: {
322
328
  density: {
323
- compact: 'h-8 px-3 text-xs',
324
- default: 'h-10 px-4 text-xs',
325
- comfortable: 'h-12 px-5 text-sm',
329
+ compact: '[&>th]:h-8 [&>th]:px-3 [&>th]:text-xs',
330
+ default: '[&>th]:h-10 [&>th]:px-4 [&>th]:text-xs',
331
+ comfortable: '[&>th]:h-12 [&>th]:px-5 [&>th]:text-sm',
326
332
  },
327
333
  },
328
334
  defaultVariants: {
@@ -330,53 +336,51 @@ const tableHeaderCellVariants = cva('text-left align-middle font-medium text-mut
330
336
  },
331
337
  });
332
338
  /**
333
- * CVA variants for `<tbody> <tr>` rows.
339
+ * CVA variants for `<tbody> <tr>` rows — includes row-level styles and child `<td>` cell styles.
334
340
  *
335
341
  * @tokens `--color-border-subtle`, `--color-muted`, `--color-muted-hover`
336
342
  */
337
- const tableRowVariants = cva('transition-colors hover:bg-muted-hover', {
343
+ const tableRowVariants = cva('transition-colors hover:bg-muted-hover [&>td]:align-middle [&>td:has(com-checkbox)]:w-px', {
338
344
  variants: {
339
345
  variant: {
340
346
  default: 'border-b border-border-subtle',
341
347
  striped: 'border-b border-border-subtle even:bg-muted-stripe',
342
348
  },
343
- },
344
- defaultVariants: {
345
- variant: 'default',
346
- },
347
- });
348
- /**
349
- * CVA variants for `<td>` body cells.
350
- */
351
- const tableBodyCellVariants = cva('align-middle [&:has(com-checkbox)]:w-px', {
352
- variants: {
353
349
  density: {
354
- compact: 'px-3 py-1.5',
355
- default: 'px-4 py-2.5',
356
- comfortable: 'px-5 py-3.5',
350
+ compact: '[&>td]:px-3 [&>td]:py-1.5',
351
+ default: '[&>td]:px-4 [&>td]:py-2.5',
352
+ comfortable: '[&>td]:px-5 [&>td]:py-3.5',
357
353
  },
358
354
  },
359
355
  defaultVariants: {
356
+ variant: 'default',
360
357
  density: 'default',
361
358
  },
362
359
  });
363
360
  /**
364
- * CVA variants for `<tfoot> <td>` footer cells.
361
+ * CVA variants for the footer `<tr>` — applies base styles to child `<td>` cells via child selectors.
365
362
  *
366
363
  * @tokens `--color-foreground`, `--color-border`
367
364
  */
368
- const tableFooterCellVariants = cva('align-middle font-medium text-foreground border-t border-border', {
365
+ const tableFooterRowVariants = cva('[&>td]:align-middle [&>td]:font-medium [&>td]:text-foreground [&>td]:border-t [&>td]:border-border', {
369
366
  variants: {
370
367
  density: {
371
- compact: 'h-8 px-3 text-xs',
372
- default: 'h-10 px-4 text-sm',
373
- comfortable: 'h-12 px-5 text-sm',
368
+ compact: '[&>td]:h-8 [&>td]:px-3 [&>td]:text-xs',
369
+ default: '[&>td]:h-10 [&>td]:px-4 [&>td]:text-sm',
370
+ comfortable: '[&>td]:h-12 [&>td]:px-5 [&>td]:text-sm',
374
371
  },
375
372
  },
376
373
  defaultVariants: {
377
374
  density: 'default',
378
375
  },
379
376
  });
377
+ // ─── Deprecated aliases (remove in next major) ───
378
+ /** @deprecated Use `tableHeaderRowVariants` instead. */
379
+ const tableHeaderCellVariants = tableHeaderRowVariants;
380
+ /** @deprecated Body cell styles are now part of `tableRowVariants`. */
381
+ const tableBodyCellVariants = tableRowVariants;
382
+ /** @deprecated Use `tableFooterRowVariants` instead. */
383
+ const tableFooterCellVariants = tableFooterRowVariants;
380
384
 
381
385
  /**
382
386
  * Declarative data table component using native HTML `<table>` semantics.
@@ -424,6 +428,7 @@ const tableFooterCellVariants = cva('align-middle font-medium text-foreground bo
424
428
  */
425
429
  class ComTable {
426
430
  destroyRef = inject(DestroyRef);
431
+ rowClickRef = inject(COM_ROW_CLICK, { optional: true, self: true });
427
432
  // ─── Inputs ───
428
433
  /** The data to render — accepts a plain array or a ComDataSource. */
429
434
  dataSource = input([], ...(ngDevMode ? [{ debugName: "dataSource" }] : []));
@@ -469,21 +474,33 @@ class ComTable {
469
474
  }, ...(ngDevMode ? [{ debugName: "renderData" }] : []));
470
475
  /** @internal Header column names. */
471
476
  headerColumns = computed(() => this.headerRowDef()?.columns() ?? [], ...(ngDevMode ? [{ debugName: "headerColumns" }] : []));
472
- /** @internal Body column names. */
477
+ /** @internal Body column names — public for ComRowClick event delegation. */
473
478
  bodyColumns = computed(() => this.rowDef()?.columns() ?? this.headerColumns(), ...(ngDevMode ? [{ debugName: "bodyColumns" }] : []));
474
479
  /** @internal Footer column names. */
475
480
  footerColumns = computed(() => this.footerRowDef()?.columns() ?? [], ...(ngDevMode ? [{ debugName: "footerColumns" }] : []));
476
481
  /** @internal Whether the header should be sticky. */
477
482
  isSticky = computed(() => this.stickyHeader() || (this.headerRowDef()?.sticky() ?? false), ...(ngDevMode ? [{ debugName: "isSticky" }] : []));
483
+ /** @internal Whether body rows are clickable (ComRowClick directive is active). */
484
+ isRowClickable = computed(() => this.rowClickRef?.isActive() ?? false, ...(ngDevMode ? [{ debugName: "isRowClickable" }] : []));
478
485
  // ─── CVA Classes ───
479
486
  containerClasses = computed(() => tableContainerVariants(), ...(ngDevMode ? [{ debugName: "containerClasses" }] : []));
480
487
  tableClasses = computed(() => tableVariants(), ...(ngDevMode ? [{ debugName: "tableClasses" }] : []));
481
488
  theadClasses = computed(() => tableHeaderVariants({ sticky: this.isSticky() }), ...(ngDevMode ? [{ debugName: "theadClasses" }] : []));
482
- thClasses = computed(() => tableHeaderCellVariants({ density: this.density() }), ...(ngDevMode ? [{ debugName: "thClasses" }] : []));
483
- trClasses = computed(() => tableRowVariants({ variant: this.variant() }), ...(ngDevMode ? [{ debugName: "trClasses" }] : []));
484
- tdClasses = computed(() => tableBodyCellVariants({ density: this.density() }), ...(ngDevMode ? [{ debugName: "tdClasses" }] : []));
485
- tfootTdClasses = computed(() => tableFooterCellVariants({ density: this.density() }), ...(ngDevMode ? [{ debugName: "tfootTdClasses" }] : []));
489
+ headerTrClasses = computed(() => tableHeaderRowVariants({ density: this.density() }), ...(ngDevMode ? [{ debugName: "headerTrClasses" }] : []));
490
+ trClasses = computed(() => {
491
+ const base = tableRowVariants({ variant: this.variant(), density: this.density() });
492
+ if (this.isRowClickable()) {
493
+ return `${base} cursor-pointer outline-none focus-visible:outline-[1px] focus-visible:outline-offset-[-1px] focus-visible:outline-[--color-ring]`;
494
+ }
495
+ return base;
496
+ }, ...(ngDevMode ? [{ debugName: "trClasses" }] : []));
497
+ footerTrClasses = computed(() => tableFooterRowVariants({ density: this.density() }), ...(ngDevMode ? [{ debugName: "footerTrClasses" }] : []));
486
498
  constructor() {
499
+ // Push data context to the row-click directive (avoids circular DI)
500
+ this.rowClickRef?._setContext({
501
+ renderData: this.renderData,
502
+ bodyColumns: this.bodyColumns,
503
+ });
487
504
  // Disconnect DataSource on destroy
488
505
  this.destroyRef.onDestroy(() => {
489
506
  const ds = this.dataSource();
@@ -497,13 +514,11 @@ class ComTable {
497
514
  <div [class]="containerClasses()">
498
515
  <table [class]="tableClasses()" [attr.aria-label]="ariaLabel()" [attr.aria-busy]="loading() || null">
499
516
  <thead [class]="theadClasses()">
500
- <tr>
517
+ <tr [class]="headerTrClasses()">
501
518
  @for (colName of headerColumns(); track colName) {
502
519
  @let colDef = columnDefMap().get(colName);
503
520
  @if (colDef?.headerCellDef(); as headerDef) {
504
- <th [class]="thClasses()" scope="col">
505
- <ng-container [ngTemplateOutlet]="headerDef.templateRef" />
506
- </th>
521
+ <ng-container [ngTemplateOutlet]="headerDef.templateRef" />
507
522
  }
508
523
  }
509
524
  </tr>
@@ -516,16 +531,14 @@ class ComTable {
516
531
  </tr>
517
532
  } @else {
518
533
  @for (row of renderData(); track trackByFn()($index, row); let idx = $index) {
519
- <tr [class]="trClasses()">
534
+ <tr [class]="trClasses()" [attr.tabindex]="isRowClickable() ? 0 : null">
520
535
  @for (colName of bodyColumns(); track colName) {
521
536
  @let colDef = columnDefMap().get(colName);
522
537
  @if (colDef?.cellDef(); as cellDef) {
523
- <td [class]="tdClasses()">
524
- <ng-container
525
- [ngTemplateOutlet]="cellDef.templateRef"
526
- [ngTemplateOutletContext]="{ $implicit: row, index: idx }"
527
- />
528
- </td>
538
+ <ng-container
539
+ [ngTemplateOutlet]="cellDef.templateRef"
540
+ [ngTemplateOutletContext]="{ $implicit: row, index: idx }"
541
+ />
529
542
  }
530
543
  }
531
544
  </tr>
@@ -535,13 +548,11 @@ class ComTable {
535
548
 
536
549
  @if (footerRowDef()) {
537
550
  <tfoot>
538
- <tr>
551
+ <tr [class]="footerTrClasses()">
539
552
  @for (colName of footerColumns(); track colName) {
540
553
  @let colDef = columnDefMap().get(colName);
541
554
  @if (colDef?.footerCellDef(); as footerDef) {
542
- <td [class]="tfootTdClasses()">
543
- <ng-container [ngTemplateOutlet]="footerDef.templateRef" />
544
- </td>
555
+ <ng-container [ngTemplateOutlet]="footerDef.templateRef" />
545
556
  }
546
557
  }
547
558
  </tr>
@@ -566,13 +577,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
566
577
  <div [class]="containerClasses()">
567
578
  <table [class]="tableClasses()" [attr.aria-label]="ariaLabel()" [attr.aria-busy]="loading() || null">
568
579
  <thead [class]="theadClasses()">
569
- <tr>
580
+ <tr [class]="headerTrClasses()">
570
581
  @for (colName of headerColumns(); track colName) {
571
582
  @let colDef = columnDefMap().get(colName);
572
583
  @if (colDef?.headerCellDef(); as headerDef) {
573
- <th [class]="thClasses()" scope="col">
574
- <ng-container [ngTemplateOutlet]="headerDef.templateRef" />
575
- </th>
584
+ <ng-container [ngTemplateOutlet]="headerDef.templateRef" />
576
585
  }
577
586
  }
578
587
  </tr>
@@ -585,16 +594,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
585
594
  </tr>
586
595
  } @else {
587
596
  @for (row of renderData(); track trackByFn()($index, row); let idx = $index) {
588
- <tr [class]="trClasses()">
597
+ <tr [class]="trClasses()" [attr.tabindex]="isRowClickable() ? 0 : null">
589
598
  @for (colName of bodyColumns(); track colName) {
590
599
  @let colDef = columnDefMap().get(colName);
591
600
  @if (colDef?.cellDef(); as cellDef) {
592
- <td [class]="tdClasses()">
593
- <ng-container
594
- [ngTemplateOutlet]="cellDef.templateRef"
595
- [ngTemplateOutletContext]="{ $implicit: row, index: idx }"
596
- />
597
- </td>
601
+ <ng-container
602
+ [ngTemplateOutlet]="cellDef.templateRef"
603
+ [ngTemplateOutletContext]="{ $implicit: row, index: idx }"
604
+ />
598
605
  }
599
606
  }
600
607
  </tr>
@@ -604,13 +611,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
604
611
 
605
612
  @if (footerRowDef()) {
606
613
  <tfoot>
607
- <tr>
614
+ <tr [class]="footerTrClasses()">
608
615
  @for (colName of footerColumns(); track colName) {
609
616
  @let colDef = columnDefMap().get(colName);
610
617
  @if (colDef?.footerCellDef(); as footerDef) {
611
- <td [class]="tfootTdClasses()">
612
- <ng-container [ngTemplateOutlet]="footerDef.templateRef" />
613
- </td>
618
+ <ng-container [ngTemplateOutlet]="footerDef.templateRef" />
614
619
  }
615
620
  }
616
621
  </tr>
@@ -634,6 +639,126 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
634
639
  }]
635
640
  }], ctorParameters: () => [], propDecorators: { dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: false }] }], trackByFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackByFn", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], stickyHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "stickyHeader", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], columnDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => ComColumnDef), { isSignal: true }] }], headerRowDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComHeaderRowDef), { isSignal: true }] }], rowDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComRowDef), { isSignal: true }] }], footerRowDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComFooterRowDef), { isSignal: true }] }], noDataRow: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ComNoDataRow), { isSignal: true }] }] } });
636
641
 
642
+ /**
643
+ * Attribute directive that enables click-to-act on `<com-table>` body rows.
644
+ *
645
+ * Uses event delegation — a single click/keydown listener on the `<table>` element —
646
+ * rather than per-row bindings. When a user clicks or presses Enter/Space on a body row,
647
+ * the directive resolves the row data and emits it, unless the click originated from an
648
+ * excluded column's cell.
649
+ *
650
+ * @tokens `--color-ring`
651
+ *
652
+ * @example Basic
653
+ * ```html
654
+ * <com-table [dataSource]="users()" comRowClick (comRowClick)="openDetail($event)">
655
+ * ...
656
+ * </com-table>
657
+ * ```
658
+ *
659
+ * @example With column exclusion
660
+ * ```html
661
+ * <com-table [dataSource]="users()" comRowClick
662
+ * [comRowClickExclude]="['select', 'actions']"
663
+ * (comRowClick)="openDetail($event)">
664
+ * ...
665
+ * </com-table>
666
+ * ```
667
+ */
668
+ class ComRowClick {
669
+ elementRef = inject((ElementRef));
670
+ renderer = inject(Renderer2);
671
+ destroyRef = inject(DestroyRef);
672
+ document = inject(DOCUMENT);
673
+ /** @internal Context pushed by ComTable — avoids circular DI. */
674
+ context = null;
675
+ // ─── Inputs ───
676
+ /** Column names whose cells do NOT trigger the row click output. */
677
+ comRowClickExclude = input([], { ...(ngDevMode ? { debugName: "comRowClickExclude" } : {}), alias: 'comRowClickExclude' });
678
+ /** Disables all row click behavior — removes cursor, tabindex, and event handling. */
679
+ comRowClickDisabled = input(false, { ...(ngDevMode ? { debugName: "comRowClickDisabled" } : {}), alias: 'comRowClickDisabled',
680
+ transform: booleanAttribute });
681
+ // ─── Outputs ───
682
+ /** Emits the row data object when a non-excluded cell is clicked or activated via keyboard. */
683
+ comRowClick = output({ alias: 'comRowClick' });
684
+ // ─── Public (consumed by ComTable via COM_ROW_CLICK token) ───
685
+ /** Whether row-click behavior is currently active. */
686
+ isActive = computed(() => !this.comRowClickDisabled(), ...(ngDevMode ? [{ debugName: "isActive" }] : []));
687
+ /** @internal Called by ComTable to provide data context. */
688
+ _setContext(ctx) {
689
+ this.context = ctx;
690
+ }
691
+ constructor() {
692
+ // SSR-safe: event delegation setup only runs in the browser after render
693
+ afterNextRender(() => {
694
+ const hostEl = this.elementRef.nativeElement;
695
+ const tableEl = hostEl.querySelector('table');
696
+ if (!tableEl)
697
+ return;
698
+ const unlistenClick = this.renderer.listen(tableEl, 'click', (event) => {
699
+ this.handleEvent(event);
700
+ });
701
+ const unlistenKeydown = this.renderer.listen(tableEl, 'keydown', (event) => {
702
+ if (event.key === 'Enter' || event.key === ' ') {
703
+ this.handleEvent(event);
704
+ if (event.key === ' ') {
705
+ event.preventDefault(); // Prevent page scroll
706
+ }
707
+ }
708
+ });
709
+ this.destroyRef.onDestroy(() => {
710
+ unlistenClick();
711
+ unlistenKeydown();
712
+ });
713
+ });
714
+ }
715
+ // ─── Private ───
716
+ handleEvent(event) {
717
+ if (this.comRowClickDisabled() || !this.context)
718
+ return;
719
+ const target = event.target;
720
+ if (!(target instanceof this.document.defaultView.HTMLElement))
721
+ return;
722
+ const tr = target.closest('tbody tr');
723
+ if (!tr)
724
+ return;
725
+ // Keyboard events fire on the focused <tr> directly — no cell exclusion needed
726
+ if (event instanceof KeyboardEvent) {
727
+ if (target !== tr)
728
+ return;
729
+ return this.emitRow(tr);
730
+ }
731
+ // Click events — resolve the cell (direct child of <tr>) that contains the target
732
+ const cell = target.closest('td, th');
733
+ if (!cell || cell.parentElement !== tr)
734
+ return;
735
+ // Map cell index to column name for exclusion check
736
+ const columnName = this.context.bodyColumns()[cell.cellIndex];
737
+ if (!columnName || this.comRowClickExclude().includes(columnName))
738
+ return;
739
+ this.emitRow(tr);
740
+ }
741
+ emitRow(tr) {
742
+ if (!this.context)
743
+ return;
744
+ const rowIndex = tr.sectionRowIndex;
745
+ const data = this.context.renderData();
746
+ if (rowIndex < 0 || rowIndex >= data.length)
747
+ return;
748
+ this.comRowClick.emit(data[rowIndex]);
749
+ }
750
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ComRowClick, deps: [], target: i0.ɵɵFactoryTarget.Directive });
751
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ComRowClick, isStandalone: true, selector: "com-table[comRowClick]", inputs: { comRowClickExclude: { classPropertyName: "comRowClickExclude", publicName: "comRowClickExclude", isSignal: true, isRequired: false, transformFunction: null }, comRowClickDisabled: { classPropertyName: "comRowClickDisabled", publicName: "comRowClickDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { comRowClick: "comRowClick" }, providers: [{ provide: COM_ROW_CLICK, useExisting: forwardRef(() => ComRowClick) }], exportAs: ["comRowClick"], ngImport: i0 });
752
+ }
753
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ComRowClick, decorators: [{
754
+ type: Directive,
755
+ args: [{
756
+ selector: 'com-table[comRowClick]',
757
+ exportAs: 'comRowClick',
758
+ providers: [{ provide: COM_ROW_CLICK, useExisting: forwardRef(() => ComRowClick) }],
759
+ }]
760
+ }], ctorParameters: () => [], propDecorators: { comRowClickExclude: [{ type: i0.Input, args: [{ isSignal: true, alias: "comRowClickExclude", required: false }] }], comRowClickDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "comRowClickDisabled", required: false }] }], comRowClick: [{ type: i0.Output, args: ["comRowClick"] }] } });
761
+
637
762
  // Public API for the table component system
638
763
  // Main component
639
764
 
@@ -641,5 +766,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
641
766
  * Generated bundle index. Do not edit.
642
767
  */
643
768
 
644
- export { ComArrayDataSource, ComCellDef, ComColumnDef, ComDataSource, ComFooterCellDef, ComFooterRowDef, ComHeaderCellDef, ComHeaderRowDef, ComNoDataRow, ComRowDef, ComTable, isDataSource, tableBodyCellVariants, tableContainerVariants, tableFooterCellVariants, tableHeaderCellVariants, tableHeaderVariants, tableRowVariants, tableVariants };
769
+ export { COM_ROW_CLICK, ComArrayDataSource, ComCellDef, ComColumnDef, ComDataSource, ComFooterCellDef, ComFooterRowDef, ComHeaderCellDef, ComHeaderRowDef, ComNoDataRow, ComRowClick, ComRowDef, ComTable, isDataSource, tableBodyCellVariants, tableContainerVariants, tableFooterCellVariants, tableFooterRowVariants, tableHeaderCellVariants, tableHeaderRowVariants, tableHeaderVariants, tableRowVariants, tableVariants };
645
770
  //# sourceMappingURL=ngx-com-components-table.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-com-components-table.mjs","sources":["../../../projects/com/components/table/table-header-cell-def.directive.ts","../../../projects/com/components/table/table-cell-def.directive.ts","../../../projects/com/components/table/table-footer-cell-def.directive.ts","../../../projects/com/components/table/table-column-def.directive.ts","../../../projects/com/components/table/table-header-row-def.directive.ts","../../../projects/com/components/table/table-row-def.directive.ts","../../../projects/com/components/table/table-footer-row-def.directive.ts","../../../projects/com/components/table/table-no-data-row.directive.ts","../../../projects/com/components/table/table-data-source.ts","../../../projects/com/components/table/table.variants.ts","../../../projects/com/components/table/table.component.ts","../../../projects/com/components/table/index.ts","../../../projects/com/components/table/ngx-com-components-table.ts"],"sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural directive that captures the template for a header cell.\n *\n * Use with the star syntax inside a `comColumnDef` container.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <ng-container comColumnDef=\"name\">\n * <th *comHeaderCellDef>Name</th>\n * <td *comCellDef=\"let row\">{{ row.name }}</td>\n * </ng-container>\n * ```\n */\n@Directive({\n selector: '[comHeaderCellDef]',\n})\nexport class ComHeaderCellDef {\n readonly templateRef: TemplateRef<void> = inject(TemplateRef<void>);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\nimport type { CellDefContext } from './table.types';\n\n/**\n * Structural directive that captures the template for a body cell.\n *\n * Use with the star syntax inside a `comColumnDef` container.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <ng-container comColumnDef=\"name\">\n * <th *comHeaderCellDef>Name</th>\n * <td *comCellDef=\"let row\">{{ row.name }}</td>\n * </ng-container>\n * ```\n */\n@Directive({\n selector: '[comCellDef]',\n})\nexport class ComCellDef<T = unknown> {\n readonly templateRef: TemplateRef<CellDefContext<T>> = inject(TemplateRef<CellDefContext<T>>);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural directive that captures the template for a footer cell.\n *\n * Use with the star syntax inside a `comColumnDef` container.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <ng-container comColumnDef=\"amount\">\n * <th *comHeaderCellDef>Amount</th>\n * <td *comCellDef=\"let row\">{{ row.amount | currency }}</td>\n * <td *comFooterCellDef>{{ total() | currency }}</td>\n * </ng-container>\n * ```\n */\n@Directive({\n selector: '[comFooterCellDef]',\n})\nexport class ComFooterCellDef {\n readonly templateRef: TemplateRef<void> = inject(TemplateRef<void>);\n}\n","import { contentChild, Directive, input } from '@angular/core';\nimport type { InputSignal, Signal } from '@angular/core';\nimport { ComHeaderCellDef } from './table-header-cell-def.directive';\nimport { ComCellDef } from './table-cell-def.directive';\nimport { ComFooterCellDef } from './table-footer-cell-def.directive';\n\n/**\n * Defines a single column in a `com-table`.\n *\n * Contains a header cell template, a body cell template, and an optional footer cell template.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <ng-container comColumnDef=\"name\">\n * <th *comHeaderCellDef>Name</th>\n * <td *comCellDef=\"let row\">{{ row.name }}</td>\n * </ng-container>\n * ```\n */\n@Directive({\n selector: '[comColumnDef]',\n exportAs: 'comColumnDef',\n})\nexport class ComColumnDef {\n /** The column name — used to match header/row column lists. */\n readonly name: InputSignal<string> = input.required<string>({ alias: 'comColumnDef' });\n\n /** @internal Header cell template for this column. */\n readonly headerCellDef: Signal<ComHeaderCellDef | undefined> =\n contentChild<ComHeaderCellDef>(ComHeaderCellDef);\n\n /** @internal Body cell template for this column. */\n readonly cellDef: Signal<ComCellDef | undefined> = contentChild<ComCellDef>(ComCellDef);\n\n /** @internal Optional footer cell template for this column. */\n readonly footerCellDef: Signal<ComFooterCellDef | undefined> =\n contentChild<ComFooterCellDef>(ComFooterCellDef);\n}\n","import { booleanAttribute, Directive, input } from '@angular/core';\nimport type { InputSignal, InputSignalWithTransform } from '@angular/core';\n\n/**\n * Defines which columns appear in the header row and their order.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <tr comHeaderRowDef=\"['name', 'email', 'role']\"></tr>\n * ```\n *\n * @example Sticky header row\n * ```html\n * <tr comHeaderRowDef=\"['name', 'email']\" comHeaderRowDefSticky></tr>\n * ```\n */\n@Directive({\n selector: '[comHeaderRowDef]',\n})\nexport class ComHeaderRowDef {\n /** Ordered list of column names to display. */\n readonly columns: InputSignal<string[]> = input.required<string[]>({ alias: 'comHeaderRowDef' });\n\n /** Makes this header row sticky (alternative to table-level `stickyHeader`). */\n readonly sticky: InputSignalWithTransform<boolean, unknown> = input(false, {\n alias: 'comHeaderRowDefSticky',\n transform: booleanAttribute,\n });\n}\n","import { Directive, input } from '@angular/core';\nimport type { InputSignal } from '@angular/core';\n\n/**\n * Defines which columns appear in each body row and their order.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <tr comRowDef [comRowDefColumns]=\"['name', 'email', 'role']\"></tr>\n * ```\n */\n@Directive({\n selector: '[comRowDef]',\n})\nexport class ComRowDef {\n /** Ordered list of column names to display per body row. */\n readonly columns: InputSignal<string[]> = input.required<string[]>({\n alias: 'comRowDefColumns',\n });\n}\n","import { Directive, input } from '@angular/core';\nimport type { InputSignal } from '@angular/core';\n\n/**\n * Defines which columns appear in the footer row and their order.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <tr comFooterRowDef=\"['description', 'amount']\"></tr>\n * ```\n */\n@Directive({\n selector: '[comFooterRowDef]',\n})\nexport class ComFooterRowDef {\n /** Ordered list of column names in the footer. */\n readonly columns: InputSignal<string[]> = input.required<string[]>({\n alias: 'comFooterRowDef',\n });\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural directive for the empty-state row shown when the data source is empty.\n *\n * Place inside `com-table`. The template receives the column count for colspan.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <com-table [dataSource]=\"data()\">\n * <!-- column defs... -->\n *\n * <ng-template comNoDataRow>\n * <td [attr.colspan]=\"displayedColumns().length\" class=\"text-center py-8\">\n * No results found.\n * </td>\n * </ng-template>\n * </com-table>\n * ```\n */\n@Directive({\n selector: '[comNoDataRow]',\n})\nexport class ComNoDataRow {\n readonly templateRef: TemplateRef<void> = inject(TemplateRef<void>);\n}\n","import type { Signal } from '@angular/core';\nimport { signal } from '@angular/core';\n\n/**\n * Abstract data source for ComTable.\n *\n * Implement `connect()` to provide a signal of data, and `disconnect()` to clean up.\n * The table calls `connect()` on init and `disconnect()` on destroy.\n *\n * @example Signal-based data source\n * ```typescript\n * class MyDataSource extends ComDataSource<User> {\n * private readonly data = signal<User[]>([]);\n *\n * connect(): Signal<readonly User[]> {\n * return this.data.asReadonly();\n * }\n *\n * disconnect(): void {\n * // cleanup if needed\n * }\n *\n * setData(users: User[]): void {\n * this.data.set(users);\n * }\n * }\n * ```\n */\nexport abstract class ComDataSource<T> {\n /** Returns a signal of the current data set. Called once when the table initializes. */\n abstract connect(): Signal<readonly T[]>;\n\n /** Cleanup resources. Called when the table is destroyed. */\n abstract disconnect(): void;\n}\n\n/**\n * Simple array-backed data source.\n *\n * Wraps a plain array in a writable signal so it can be used with ComTable's DataSource API.\n */\nexport class ComArrayDataSource<T> extends ComDataSource<T> {\n private readonly data = signal<readonly T[]>([]);\n\n constructor(initialData: T[] = []) {\n super();\n this.data.set(initialData);\n }\n\n connect(): Signal<readonly T[]> {\n return this.data.asReadonly();\n }\n\n disconnect(): void {\n // No cleanup needed for a simple array\n }\n\n /** Replace the entire data set. */\n setData(data: T[]): void {\n this.data.set(data);\n }\n}\n\n/**\n * Type guard to check if a value is a ComDataSource instance.\n */\nexport function isDataSource<T>(value: unknown): value is ComDataSource<T> {\n return value instanceof ComDataSource;\n}\n\n/** The types that ComTable accepts for its dataSource input. */\nexport type ComTableDataSourceInput<T> = T[] | ComDataSource<T>;\n","import { cva, type VariantProps } from 'class-variance-authority';\n\n// Table variant types\nexport type TableVariant = 'default' | 'striped';\nexport type TableDensity = 'compact' | 'default' | 'comfortable';\n\n/**\n * CVA variants for the table container wrapper.\n */\nexport const tableContainerVariants: (props?: Record<string, never>) => string = cva(\n 'relative overflow-x-auto'\n);\n\nexport type TableContainerVariants = VariantProps<typeof tableContainerVariants>;\n\n/**\n * CVA variants for the `<table>` element.\n *\n * @tokens `--color-foreground`\n */\nexport const tableVariants: (props?: Record<string, never>) => string = cva(\n 'w-full caption-bottom text-sm text-foreground'\n);\n\nexport type TableVariants = VariantProps<typeof tableVariants>;\n\n/**\n * CVA variants for the `<thead>` element.\n *\n * @tokens `--color-background`\n */\nexport const tableHeaderVariants: (props?: {\n sticky?: boolean;\n}) => string = cva('', {\n variants: {\n sticky: {\n true: 'sticky top-0 z-10 bg-background',\n false: '',\n },\n },\n defaultVariants: {\n sticky: false,\n },\n});\n\nexport type TableHeaderVariants = VariantProps<typeof tableHeaderVariants>;\n\n/**\n * CVA variants for `<th>` header cells.\n *\n * @tokens `--color-muted-foreground`\n */\nexport const tableHeaderCellVariants: (props?: {\n density?: TableDensity;\n}) => string = cva(\n 'text-left align-middle font-medium text-muted-foreground [&:has([comSortHeader])]:cursor-pointer',\n {\n variants: {\n density: {\n compact: 'h-8 px-3 text-xs',\n default: 'h-10 px-4 text-xs',\n comfortable: 'h-12 px-5 text-sm',\n },\n },\n defaultVariants: {\n density: 'default',\n },\n }\n);\n\nexport type TableHeaderCellVariants = VariantProps<typeof tableHeaderCellVariants>;\n\n/**\n * CVA variants for `<tbody> <tr>` rows.\n *\n * @tokens `--color-border-subtle`, `--color-muted`, `--color-muted-hover`\n */\nexport const tableRowVariants: (props?: {\n variant?: TableVariant;\n}) => string = cva('transition-colors hover:bg-muted-hover', {\n variants: {\n variant: {\n default: 'border-b border-border-subtle',\n striped: 'border-b border-border-subtle even:bg-muted-stripe',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\nexport type TableRowVariants = VariantProps<typeof tableRowVariants>;\n\n/**\n * CVA variants for `<td>` body cells.\n */\nexport const tableBodyCellVariants: (props?: {\n density?: TableDensity;\n}) => string = cva('align-middle [&:has(com-checkbox)]:w-px', {\n variants: {\n density: {\n compact: 'px-3 py-1.5',\n default: 'px-4 py-2.5',\n comfortable: 'px-5 py-3.5',\n },\n },\n defaultVariants: {\n density: 'default',\n },\n});\n\nexport type TableBodyCellVariants = VariantProps<typeof tableBodyCellVariants>;\n\n/**\n * CVA variants for `<tfoot> <td>` footer cells.\n *\n * @tokens `--color-foreground`, `--color-border`\n */\nexport const tableFooterCellVariants: (props?: {\n density?: TableDensity;\n}) => string = cva('align-middle font-medium text-foreground border-t border-border', {\n variants: {\n density: {\n compact: 'h-8 px-3 text-xs',\n default: 'h-10 px-4 text-sm',\n comfortable: 'h-12 px-5 text-sm',\n },\n },\n defaultVariants: {\n density: 'default',\n },\n});\n\nexport type TableFooterCellVariants = VariantProps<typeof tableFooterCellVariants>;\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n contentChildren,\n DestroyRef,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {\n InputSignal,\n InputSignalWithTransform,\n Signal,\n TrackByFunction,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ComSpinner } from 'ngx-com/components/spinner';\nimport { ComColumnDef } from './table-column-def.directive';\nimport { ComHeaderRowDef } from './table-header-row-def.directive';\nimport { ComRowDef } from './table-row-def.directive';\nimport { ComFooterRowDef } from './table-footer-row-def.directive';\nimport { ComNoDataRow } from './table-no-data-row.directive';\nimport { isDataSource } from './table-data-source';\nimport type { ComTableDataSourceInput } from './table-data-source';\nimport type { TableVariant, TableDensity } from './table.variants';\nimport {\n tableContainerVariants,\n tableVariants,\n tableHeaderVariants,\n tableHeaderCellVariants,\n tableRowVariants,\n tableBodyCellVariants,\n tableFooterCellVariants,\n} from './table.variants';\n\n/**\n * Declarative data table component using native HTML `<table>` semantics.\n *\n * Define columns via `comColumnDef` with `*comHeaderCellDef` and `*comCellDef`,\n * then declare row structure via `comHeaderRowDef` and `comRowDef`.\n *\n * Accepts either a plain `T[]` or a `ComDataSource<T>` for the data source.\n *\n * @tokens `--color-background`, `--color-foreground`, `--color-muted`, `--color-muted-foreground`,\n * `--color-muted-hover`, `--color-border`, `--color-border-subtle`\n *\n * @example Basic table\n * ```html\n * <com-table [dataSource]=\"users()\">\n * <ng-container comColumnDef=\"name\">\n * <th *comHeaderCellDef>Name</th>\n * <td *comCellDef=\"let row\">{{ row.name }}</td>\n * </ng-container>\n *\n * <ng-container comColumnDef=\"email\">\n * <th *comHeaderCellDef>Email</th>\n * <td *comCellDef=\"let row\">{{ row.email }}</td>\n * </ng-container>\n *\n * <tr comHeaderRowDef=\"['name', 'email']\"></tr>\n * <tr comRowDef [comRowDefColumns]=\"['name', 'email']\"></tr>\n * </com-table>\n * ```\n *\n * @example With DataSource\n * ```typescript\n * class UserDataSource extends ComDataSource<User> {\n * private data = signal<User[]>([]);\n * connect() { return this.data.asReadonly(); }\n * disconnect() {}\n * setData(users: User[]) { this.data.set(users); }\n * }\n * ```\n * ```html\n * <com-table [dataSource]=\"userDataSource\">\n * ...\n * </com-table>\n * ```\n */\n@Component({\n selector: 'com-table',\n exportAs: 'comTable',\n template: `\n <div [class]=\"containerClasses()\">\n <table [class]=\"tableClasses()\" [attr.aria-label]=\"ariaLabel()\" [attr.aria-busy]=\"loading() || null\">\n <thead [class]=\"theadClasses()\">\n <tr>\n @for (colName of headerColumns(); track colName) {\n @let colDef = columnDefMap().get(colName);\n @if (colDef?.headerCellDef(); as headerDef) {\n <th [class]=\"thClasses()\" scope=\"col\">\n <ng-container [ngTemplateOutlet]=\"headerDef.templateRef\" />\n </th>\n }\n }\n </tr>\n </thead>\n\n <tbody>\n @if (!loading() && renderData().length === 0 && noDataRow()) {\n <tr>\n <ng-container [ngTemplateOutlet]=\"noDataRow()!.templateRef\" />\n </tr>\n } @else {\n @for (row of renderData(); track trackByFn()($index, row); let idx = $index) {\n <tr [class]=\"trClasses()\">\n @for (colName of bodyColumns(); track colName) {\n @let colDef = columnDefMap().get(colName);\n @if (colDef?.cellDef(); as cellDef) {\n <td [class]=\"tdClasses()\">\n <ng-container\n [ngTemplateOutlet]=\"cellDef.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: row, index: idx }\"\n />\n </td>\n }\n }\n </tr>\n }\n }\n </tbody>\n\n @if (footerRowDef()) {\n <tfoot>\n <tr>\n @for (colName of footerColumns(); track colName) {\n @let colDef = columnDefMap().get(colName);\n @if (colDef?.footerCellDef(); as footerDef) {\n <td [class]=\"tfootTdClasses()\">\n <ng-container [ngTemplateOutlet]=\"footerDef.templateRef\" />\n </td>\n }\n }\n </tr>\n </tfoot>\n }\n </table>\n\n @if (loading()) {\n <div class=\"absolute inset-0 flex items-center justify-center bg-overlay\" aria-live=\"polite\">\n <com-spinner size=\"lg\" color=\"primary\" label=\"Loading...\" />\n </div>\n }\n </div>\n `,\n imports: [NgTemplateOutlet, ComSpinner],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'block',\n },\n})\nexport class ComTable<T> {\n private readonly destroyRef: DestroyRef = inject(DestroyRef);\n\n // ─── Inputs ───\n\n /** The data to render — accepts a plain array or a ComDataSource. */\n readonly dataSource: InputSignal<ComTableDataSourceInput<T>> = input<ComTableDataSourceInput<T>>(\n [] as T[]\n );\n\n /** Track function for `@for`. Defaults to tracking by index. */\n readonly trackByFn: InputSignal<TrackByFunction<T>> = input<TrackByFunction<T>>(\n (index: number, _item: T) => index\n );\n\n /** Visual treatment of body rows. */\n readonly variant: InputSignal<TableVariant> = input<TableVariant>('default');\n\n /** Row height / cell padding. */\n readonly density: InputSignal<TableDensity> = input<TableDensity>('default');\n\n /** Whether the header row sticks on scroll. */\n readonly stickyHeader: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n\n /** Shows a loading overlay with spinner. */\n readonly loading: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n\n /** Accessible label for the table element. */\n readonly ariaLabel: InputSignal<string | undefined> = input<string | undefined>(undefined);\n\n // ─── Content Queries ───\n\n /** @internal All column definitions projected into the table. */\n readonly columnDefs: Signal<readonly ComColumnDef[]> = contentChildren<ComColumnDef>(ComColumnDef);\n\n /** @internal Header row definition. */\n readonly headerRowDef: Signal<ComHeaderRowDef | undefined> =\n contentChild<ComHeaderRowDef>(ComHeaderRowDef);\n\n /** @internal Body row definition. */\n readonly rowDef: Signal<ComRowDef | undefined> = contentChild<ComRowDef>(ComRowDef);\n\n /** @internal Optional footer row definition. */\n readonly footerRowDef: Signal<ComFooterRowDef | undefined> =\n contentChild<ComFooterRowDef>(ComFooterRowDef);\n\n /** @internal Optional no-data row template. */\n readonly noDataRow: Signal<ComNoDataRow | undefined> =\n contentChild<ComNoDataRow>(ComNoDataRow);\n\n // ─── Derived State ───\n\n /** @internal Map of column name → column definition for O(1) lookup. */\n protected readonly columnDefMap: Signal<Map<string, ComColumnDef>> = computed(() => {\n const map = new Map<string, ComColumnDef>();\n for (const col of this.columnDefs()) {\n map.set(col.name(), col);\n }\n return map;\n });\n\n /** @internal Resolved render data — handles both array and DataSource inputs. */\n readonly renderData: Signal<readonly T[]> = computed(() => {\n const ds = this.dataSource();\n if (isDataSource<T>(ds)) {\n return ds.connect()();\n }\n return ds;\n });\n\n /** @internal Header column names. */\n protected readonly headerColumns: Signal<string[]> = computed(\n () => this.headerRowDef()?.columns() ?? []\n );\n\n /** @internal Body column names. */\n protected readonly bodyColumns: Signal<string[]> = computed(\n () => this.rowDef()?.columns() ?? this.headerColumns()\n );\n\n /** @internal Footer column names. */\n protected readonly footerColumns: Signal<string[]> = computed(\n () => this.footerRowDef()?.columns() ?? []\n );\n\n /** @internal Whether the header should be sticky. */\n private readonly isSticky: Signal<boolean> = computed(\n () => this.stickyHeader() || (this.headerRowDef()?.sticky() ?? false)\n );\n\n // ─── CVA Classes ───\n\n protected readonly containerClasses: Signal<string> = computed(() => tableContainerVariants());\n\n protected readonly tableClasses: Signal<string> = computed(() => tableVariants());\n\n protected readonly theadClasses: Signal<string> = computed(() =>\n tableHeaderVariants({ sticky: this.isSticky() })\n );\n\n protected readonly thClasses: Signal<string> = computed(() =>\n tableHeaderCellVariants({ density: this.density() })\n );\n\n protected readonly trClasses: Signal<string> = computed(() =>\n tableRowVariants({ variant: this.variant() })\n );\n\n protected readonly tdClasses: Signal<string> = computed(() =>\n tableBodyCellVariants({ density: this.density() })\n );\n\n protected readonly tfootTdClasses: Signal<string> = computed(() =>\n tableFooterCellVariants({ density: this.density() })\n );\n\n constructor() {\n // Disconnect DataSource on destroy\n this.destroyRef.onDestroy(() => {\n const ds = this.dataSource();\n if (isDataSource<T>(ds)) {\n ds.disconnect();\n }\n });\n }\n}\n","// Public API for the table component system\n\n// Main component\nexport { ComTable } from './table.component';\n\n// Data source\nexport { ComDataSource, ComArrayDataSource, isDataSource } from './table-data-source';\nexport type { ComTableDataSourceInput } from './table-data-source';\n\n// Column directives\nexport { ComColumnDef } from './table-column-def.directive';\nexport { ComHeaderCellDef } from './table-header-cell-def.directive';\nexport { ComCellDef } from './table-cell-def.directive';\nexport { ComFooterCellDef } from './table-footer-cell-def.directive';\n\n// Row directives\nexport { ComHeaderRowDef } from './table-header-row-def.directive';\nexport { ComRowDef } from './table-row-def.directive';\nexport { ComFooterRowDef } from './table-footer-row-def.directive';\nexport { ComNoDataRow } from './table-no-data-row.directive';\n\n// Types\nexport type { CellDefContext } from './table.types';\n\n// Variants\nexport {\n tableContainerVariants,\n tableVariants,\n tableHeaderVariants,\n tableHeaderCellVariants,\n tableRowVariants,\n tableBodyCellVariants,\n tableFooterCellVariants,\n} from './table.variants';\n\nexport type {\n TableVariant,\n TableDensity,\n TableContainerVariants,\n TableVariants,\n TableHeaderVariants,\n TableHeaderCellVariants,\n TableRowVariants,\n TableBodyCellVariants,\n TableFooterCellVariants,\n} from './table.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEA;;;;;;;;;;;;;;AAcG;MAIU,gBAAgB,CAAA;AAClB,IAAA,WAAW,GAAsB,MAAM,EAAC,WAAiB,EAAC;uGADxD,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAhB,gBAA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EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,YAAY,8FAIjE,eAAe,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAG0B,SAAS,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAIlD,eAAe,2FAIlB,YAAY,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC/M3C;AAEA;;ACFA;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-com-components-table.mjs","sources":["../../../projects/com/components/table/table-header-cell-def.directive.ts","../../../projects/com/components/table/table-cell-def.directive.ts","../../../projects/com/components/table/table-footer-cell-def.directive.ts","../../../projects/com/components/table/table-column-def.directive.ts","../../../projects/com/components/table/table-header-row-def.directive.ts","../../../projects/com/components/table/table-row-def.directive.ts","../../../projects/com/components/table/table-footer-row-def.directive.ts","../../../projects/com/components/table/table-no-data-row.directive.ts","../../../projects/com/components/table/table-data-source.ts","../../../projects/com/components/table/table-row-click.types.ts","../../../projects/com/components/table/table.variants.ts","../../../projects/com/components/table/table.component.ts","../../../projects/com/components/table/table-row-click.directive.ts","../../../projects/com/components/table/index.ts","../../../projects/com/components/table/ngx-com-components-table.ts"],"sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural directive that captures the template for a header cell.\n *\n * Use with the star syntax inside a `comColumnDef` container.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <ng-container comColumnDef=\"name\">\n * <th *comHeaderCellDef>Name</th>\n * <td *comCellDef=\"let row\">{{ row.name }}</td>\n * </ng-container>\n * ```\n */\n@Directive({\n selector: '[comHeaderCellDef]',\n})\nexport class ComHeaderCellDef {\n readonly templateRef: TemplateRef<void> = inject(TemplateRef<void>);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\nimport type { CellDefContext } from './table.types';\n\n/**\n * Structural directive that captures the template for a body cell.\n *\n * Use with the star syntax inside a `comColumnDef` container.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <ng-container comColumnDef=\"name\">\n * <th *comHeaderCellDef>Name</th>\n * <td *comCellDef=\"let row\">{{ row.name }}</td>\n * </ng-container>\n * ```\n */\n@Directive({\n selector: '[comCellDef]',\n})\nexport class ComCellDef<T = unknown> {\n readonly templateRef: TemplateRef<CellDefContext<T>> = inject(TemplateRef<CellDefContext<T>>);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural directive that captures the template for a footer cell.\n *\n * Use with the star syntax inside a `comColumnDef` container.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <ng-container comColumnDef=\"amount\">\n * <th *comHeaderCellDef>Amount</th>\n * <td *comCellDef=\"let row\">{{ row.amount | currency }}</td>\n * <td *comFooterCellDef>{{ total() | currency }}</td>\n * </ng-container>\n * ```\n */\n@Directive({\n selector: '[comFooterCellDef]',\n})\nexport class ComFooterCellDef {\n readonly templateRef: TemplateRef<void> = inject(TemplateRef<void>);\n}\n","import { contentChild, Directive, input } from '@angular/core';\nimport type { InputSignal, Signal } from '@angular/core';\nimport { ComHeaderCellDef } from './table-header-cell-def.directive';\nimport { ComCellDef } from './table-cell-def.directive';\nimport { ComFooterCellDef } from './table-footer-cell-def.directive';\n\n/**\n * Defines a single column in a `com-table`.\n *\n * Contains a header cell template, a body cell template, and an optional footer cell template.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <ng-container comColumnDef=\"name\">\n * <th *comHeaderCellDef>Name</th>\n * <td *comCellDef=\"let row\">{{ row.name }}</td>\n * </ng-container>\n * ```\n */\n@Directive({\n selector: '[comColumnDef]',\n exportAs: 'comColumnDef',\n})\nexport class ComColumnDef {\n /** The column name — used to match header/row column lists. */\n readonly name: InputSignal<string> = input.required<string>({ alias: 'comColumnDef' });\n\n /** @internal Header cell template for this column. */\n readonly headerCellDef: Signal<ComHeaderCellDef | undefined> =\n contentChild<ComHeaderCellDef>(ComHeaderCellDef);\n\n /** @internal Body cell template for this column. */\n readonly cellDef: Signal<ComCellDef | undefined> = contentChild<ComCellDef>(ComCellDef);\n\n /** @internal Optional footer cell template for this column. */\n readonly footerCellDef: Signal<ComFooterCellDef | undefined> =\n contentChild<ComFooterCellDef>(ComFooterCellDef);\n}\n","import { booleanAttribute, Directive, input } from '@angular/core';\nimport type { InputSignal, InputSignalWithTransform } from '@angular/core';\n\n/**\n * Defines which columns appear in the header row and their order.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <tr comHeaderRowDef=\"['name', 'email', 'role']\"></tr>\n * ```\n *\n * @example Sticky header row\n * ```html\n * <tr comHeaderRowDef=\"['name', 'email']\" comHeaderRowDefSticky></tr>\n * ```\n */\n@Directive({\n selector: '[comHeaderRowDef]',\n})\nexport class ComHeaderRowDef {\n /** Ordered list of column names to display. */\n readonly columns: InputSignal<string[]> = input.required<string[]>({ alias: 'comHeaderRowDef' });\n\n /** Makes this header row sticky (alternative to table-level `stickyHeader`). */\n readonly sticky: InputSignalWithTransform<boolean, unknown> = input(false, {\n alias: 'comHeaderRowDefSticky',\n transform: booleanAttribute,\n });\n}\n","import { Directive, input } from '@angular/core';\nimport type { InputSignal } from '@angular/core';\n\n/**\n * Defines which columns appear in each body row and their order.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <tr comRowDef [comRowDefColumns]=\"['name', 'email', 'role']\"></tr>\n * ```\n */\n@Directive({\n selector: '[comRowDef]',\n})\nexport class ComRowDef {\n /** Ordered list of column names to display per body row. */\n readonly columns: InputSignal<string[]> = input.required<string[]>({\n alias: 'comRowDefColumns',\n });\n}\n","import { Directive, input } from '@angular/core';\nimport type { InputSignal } from '@angular/core';\n\n/**\n * Defines which columns appear in the footer row and their order.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <tr comFooterRowDef=\"['description', 'amount']\"></tr>\n * ```\n */\n@Directive({\n selector: '[comFooterRowDef]',\n})\nexport class ComFooterRowDef {\n /** Ordered list of column names in the footer. */\n readonly columns: InputSignal<string[]> = input.required<string[]>({\n alias: 'comFooterRowDef',\n });\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural directive for the empty-state row shown when the data source is empty.\n *\n * Place inside `com-table`. The template receives the column count for colspan.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <com-table [dataSource]=\"data()\">\n * <!-- column defs... -->\n *\n * <ng-template comNoDataRow>\n * <td [attr.colspan]=\"displayedColumns().length\" class=\"text-center py-8\">\n * No results found.\n * </td>\n * </ng-template>\n * </com-table>\n * ```\n */\n@Directive({\n selector: '[comNoDataRow]',\n})\nexport class ComNoDataRow {\n readonly templateRef: TemplateRef<void> = inject(TemplateRef<void>);\n}\n","import type { Signal } from '@angular/core';\nimport { signal } from '@angular/core';\n\n/**\n * Abstract data source for ComTable.\n *\n * Implement `connect()` to provide a signal of data, and `disconnect()` to clean up.\n * The table calls `connect()` on init and `disconnect()` on destroy.\n *\n * @example Signal-based data source\n * ```typescript\n * class MyDataSource extends ComDataSource<User> {\n * private readonly data = signal<User[]>([]);\n *\n * connect(): Signal<readonly User[]> {\n * return this.data.asReadonly();\n * }\n *\n * disconnect(): void {\n * // cleanup if needed\n * }\n *\n * setData(users: User[]): void {\n * this.data.set(users);\n * }\n * }\n * ```\n */\nexport abstract class ComDataSource<T> {\n /** Returns a signal of the current data set. Called once when the table initializes. */\n abstract connect(): Signal<readonly T[]>;\n\n /** Cleanup resources. Called when the table is destroyed. */\n abstract disconnect(): void;\n}\n\n/**\n * Simple array-backed data source.\n *\n * Wraps a plain array in a writable signal so it can be used with ComTable's DataSource API.\n */\nexport class ComArrayDataSource<T> extends ComDataSource<T> {\n private readonly data = signal<readonly T[]>([]);\n\n constructor(initialData: T[] = []) {\n super();\n this.data.set(initialData);\n }\n\n connect(): Signal<readonly T[]> {\n return this.data.asReadonly();\n }\n\n disconnect(): void {\n // No cleanup needed for a simple array\n }\n\n /** Replace the entire data set. */\n setData(data: T[]): void {\n this.data.set(data);\n }\n}\n\n/**\n * Type guard to check if a value is a ComDataSource instance.\n */\nexport function isDataSource<T>(value: unknown): value is ComDataSource<T> {\n return value instanceof ComDataSource;\n}\n\n/** The types that ComTable accepts for its dataSource input. */\nexport type ComTableDataSourceInput<T> = T[] | ComDataSource<T>;\n","import { InjectionToken } from '@angular/core';\nimport type { Signal } from '@angular/core';\n\n/** Data context that ComTable pushes to ComRowClick to avoid circular DI. */\nexport interface ComRowClickContext<T = unknown> {\n readonly renderData: Signal<readonly T[]>;\n readonly bodyColumns: Signal<string[]>;\n}\n\n/** Minimal interface that ComTable reads to detect an active row-click directive. */\nexport interface ComRowClickRef<T = unknown> {\n /** Whether row-click behavior is currently active (exists and not disabled). */\n readonly isActive: Signal<boolean>;\n\n /** Called by ComTable to provide data context — avoids circular injection. */\n _setContext(ctx: ComRowClickContext<T>): void;\n}\n\n/**\n * Injection token used by ComTable to optionally detect a ComRowClick directive.\n * Breaks the circular dependency between ComTable and ComRowClick.\n */\nexport const COM_ROW_CLICK: InjectionToken<ComRowClickRef> =\n new InjectionToken<ComRowClickRef>('COM_ROW_CLICK');\n","import { cva, type VariantProps } from 'class-variance-authority';\n\n// Table variant types\nexport type TableVariant = 'default' | 'striped';\nexport type TableDensity = 'compact' | 'default' | 'comfortable';\n\n/**\n * CVA variants for the table container wrapper.\n */\nexport const tableContainerVariants: (props?: Record<string, never>) => string = cva(\n 'relative overflow-x-auto'\n);\n\nexport type TableContainerVariants = VariantProps<typeof tableContainerVariants>;\n\n/**\n * CVA variants for the `<table>` element.\n *\n * @tokens `--color-foreground`\n */\nexport const tableVariants: (props?: Record<string, never>) => string = cva(\n 'w-full caption-bottom text-sm text-foreground'\n);\n\nexport type TableVariants = VariantProps<typeof tableVariants>;\n\n/**\n * CVA variants for the `<thead>` element.\n *\n * @tokens `--color-background`\n */\nexport const tableHeaderVariants: (props?: {\n sticky?: boolean;\n}) => string = cva('', {\n variants: {\n sticky: {\n true: 'sticky top-0 z-10 bg-background',\n false: '',\n },\n },\n defaultVariants: {\n sticky: false,\n },\n});\n\nexport type TableHeaderVariants = VariantProps<typeof tableHeaderVariants>;\n\n/**\n * CVA variants for the header `<tr>` — applies base styles to child `<th>` cells via child selectors.\n *\n * @tokens `--color-muted-foreground`\n */\nexport const tableHeaderRowVariants: (props?: {\n density?: TableDensity;\n}) => string = cva(\n '[&>th]:text-left [&>th]:align-middle [&>th]:font-medium [&>th]:text-muted-foreground [&>th:has([comSortHeader])]:cursor-pointer',\n {\n variants: {\n density: {\n compact: '[&>th]:h-8 [&>th]:px-3 [&>th]:text-xs',\n default: '[&>th]:h-10 [&>th]:px-4 [&>th]:text-xs',\n comfortable: '[&>th]:h-12 [&>th]:px-5 [&>th]:text-sm',\n },\n },\n defaultVariants: {\n density: 'default',\n },\n }\n);\n\nexport type TableHeaderRowVariants = VariantProps<typeof tableHeaderRowVariants>;\n\n/**\n * CVA variants for `<tbody> <tr>` rows — includes row-level styles and child `<td>` cell styles.\n *\n * @tokens `--color-border-subtle`, `--color-muted`, `--color-muted-hover`\n */\nexport const tableRowVariants: (props?: {\n variant?: TableVariant;\n density?: TableDensity;\n}) => string = cva(\n 'transition-colors hover:bg-muted-hover [&>td]:align-middle [&>td:has(com-checkbox)]:w-px',\n {\n variants: {\n variant: {\n default: 'border-b border-border-subtle',\n striped: 'border-b border-border-subtle even:bg-muted-stripe',\n },\n density: {\n compact: '[&>td]:px-3 [&>td]:py-1.5',\n default: '[&>td]:px-4 [&>td]:py-2.5',\n comfortable: '[&>td]:px-5 [&>td]:py-3.5',\n },\n },\n defaultVariants: {\n variant: 'default',\n density: 'default',\n },\n }\n);\n\nexport type TableRowVariants = VariantProps<typeof tableRowVariants>;\n\n/**\n * CVA variants for the footer `<tr>` — applies base styles to child `<td>` cells via child selectors.\n *\n * @tokens `--color-foreground`, `--color-border`\n */\nexport const tableFooterRowVariants: (props?: {\n density?: TableDensity;\n}) => string = cva(\n '[&>td]:align-middle [&>td]:font-medium [&>td]:text-foreground [&>td]:border-t [&>td]:border-border',\n {\n variants: {\n density: {\n compact: '[&>td]:h-8 [&>td]:px-3 [&>td]:text-xs',\n default: '[&>td]:h-10 [&>td]:px-4 [&>td]:text-sm',\n comfortable: '[&>td]:h-12 [&>td]:px-5 [&>td]:text-sm',\n },\n },\n defaultVariants: {\n density: 'default',\n },\n }\n);\n\nexport type TableFooterRowVariants = VariantProps<typeof tableFooterRowVariants>;\n\n// ─── Deprecated aliases (remove in next major) ───\n\n/** @deprecated Use `tableHeaderRowVariants` instead. */\nexport const tableHeaderCellVariants: typeof tableHeaderRowVariants = tableHeaderRowVariants;\n/** @deprecated Use `tableHeaderRowVariants` instead. */\nexport type TableHeaderCellVariants = TableHeaderRowVariants;\n\n/** @deprecated Body cell styles are now part of `tableRowVariants`. */\nexport const tableBodyCellVariants: typeof tableRowVariants = tableRowVariants;\n/** @deprecated Body cell styles are now part of `tableRowVariants`. */\nexport type TableBodyCellVariants = TableRowVariants;\n\n/** @deprecated Use `tableFooterRowVariants` instead. */\nexport const tableFooterCellVariants: typeof tableFooterRowVariants = tableFooterRowVariants;\n/** @deprecated Use `tableFooterRowVariants` instead. */\nexport type TableFooterCellVariants = TableFooterRowVariants;\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n contentChildren,\n DestroyRef,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {\n InputSignal,\n InputSignalWithTransform,\n Signal,\n TrackByFunction,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ComSpinner } from 'ngx-com/components/spinner';\nimport { ComColumnDef } from './table-column-def.directive';\nimport { ComHeaderRowDef } from './table-header-row-def.directive';\nimport { ComRowDef } from './table-row-def.directive';\nimport { ComFooterRowDef } from './table-footer-row-def.directive';\nimport { ComNoDataRow } from './table-no-data-row.directive';\nimport { isDataSource } from './table-data-source';\nimport type { ComTableDataSourceInput } from './table-data-source';\nimport { COM_ROW_CLICK } from './table-row-click.types';\nimport type { TableVariant, TableDensity } from './table.variants';\nimport {\n tableContainerVariants,\n tableVariants,\n tableHeaderVariants,\n tableHeaderRowVariants,\n tableRowVariants,\n tableFooterRowVariants,\n} from './table.variants';\n\n/**\n * Declarative data table component using native HTML `<table>` semantics.\n *\n * Define columns via `comColumnDef` with `*comHeaderCellDef` and `*comCellDef`,\n * then declare row structure via `comHeaderRowDef` and `comRowDef`.\n *\n * Accepts either a plain `T[]` or a `ComDataSource<T>` for the data source.\n *\n * @tokens `--color-background`, `--color-foreground`, `--color-muted`, `--color-muted-foreground`,\n * `--color-muted-hover`, `--color-border`, `--color-border-subtle`\n *\n * @example Basic table\n * ```html\n * <com-table [dataSource]=\"users()\">\n * <ng-container comColumnDef=\"name\">\n * <th *comHeaderCellDef>Name</th>\n * <td *comCellDef=\"let row\">{{ row.name }}</td>\n * </ng-container>\n *\n * <ng-container comColumnDef=\"email\">\n * <th *comHeaderCellDef>Email</th>\n * <td *comCellDef=\"let row\">{{ row.email }}</td>\n * </ng-container>\n *\n * <tr comHeaderRowDef=\"['name', 'email']\"></tr>\n * <tr comRowDef [comRowDefColumns]=\"['name', 'email']\"></tr>\n * </com-table>\n * ```\n *\n * @example With DataSource\n * ```typescript\n * class UserDataSource extends ComDataSource<User> {\n * private data = signal<User[]>([]);\n * connect() { return this.data.asReadonly(); }\n * disconnect() {}\n * setData(users: User[]) { this.data.set(users); }\n * }\n * ```\n * ```html\n * <com-table [dataSource]=\"userDataSource\">\n * ...\n * </com-table>\n * ```\n */\n@Component({\n selector: 'com-table',\n exportAs: 'comTable',\n template: `\n <div [class]=\"containerClasses()\">\n <table [class]=\"tableClasses()\" [attr.aria-label]=\"ariaLabel()\" [attr.aria-busy]=\"loading() || null\">\n <thead [class]=\"theadClasses()\">\n <tr [class]=\"headerTrClasses()\">\n @for (colName of headerColumns(); track colName) {\n @let colDef = columnDefMap().get(colName);\n @if (colDef?.headerCellDef(); as headerDef) {\n <ng-container [ngTemplateOutlet]=\"headerDef.templateRef\" />\n }\n }\n </tr>\n </thead>\n\n <tbody>\n @if (!loading() && renderData().length === 0 && noDataRow()) {\n <tr>\n <ng-container [ngTemplateOutlet]=\"noDataRow()!.templateRef\" />\n </tr>\n } @else {\n @for (row of renderData(); track trackByFn()($index, row); let idx = $index) {\n <tr [class]=\"trClasses()\" [attr.tabindex]=\"isRowClickable() ? 0 : null\">\n @for (colName of bodyColumns(); track colName) {\n @let colDef = columnDefMap().get(colName);\n @if (colDef?.cellDef(); as cellDef) {\n <ng-container\n [ngTemplateOutlet]=\"cellDef.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: row, index: idx }\"\n />\n }\n }\n </tr>\n }\n }\n </tbody>\n\n @if (footerRowDef()) {\n <tfoot>\n <tr [class]=\"footerTrClasses()\">\n @for (colName of footerColumns(); track colName) {\n @let colDef = columnDefMap().get(colName);\n @if (colDef?.footerCellDef(); as footerDef) {\n <ng-container [ngTemplateOutlet]=\"footerDef.templateRef\" />\n }\n }\n </tr>\n </tfoot>\n }\n </table>\n\n @if (loading()) {\n <div class=\"absolute inset-0 flex items-center justify-center bg-overlay\" aria-live=\"polite\">\n <com-spinner size=\"lg\" color=\"primary\" label=\"Loading...\" />\n </div>\n }\n </div>\n `,\n imports: [NgTemplateOutlet, ComSpinner],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'block',\n },\n})\nexport class ComTable<T> {\n private readonly destroyRef: DestroyRef = inject(DestroyRef);\n private readonly rowClickRef = inject(COM_ROW_CLICK, { optional: true, self: true });\n\n // ─── Inputs ───\n\n /** The data to render — accepts a plain array or a ComDataSource. */\n readonly dataSource: InputSignal<ComTableDataSourceInput<T>> = input<ComTableDataSourceInput<T>>(\n [] as T[]\n );\n\n /** Track function for `@for`. Defaults to tracking by index. */\n readonly trackByFn: InputSignal<TrackByFunction<T>> = input<TrackByFunction<T>>(\n (index: number, _item: T) => index\n );\n\n /** Visual treatment of body rows. */\n readonly variant: InputSignal<TableVariant> = input<TableVariant>('default');\n\n /** Row height / cell padding. */\n readonly density: InputSignal<TableDensity> = input<TableDensity>('default');\n\n /** Whether the header row sticks on scroll. */\n readonly stickyHeader: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n\n /** Shows a loading overlay with spinner. */\n readonly loading: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n\n /** Accessible label for the table element. */\n readonly ariaLabel: InputSignal<string | undefined> = input<string | undefined>(undefined);\n\n // ─── Content Queries ───\n\n /** @internal All column definitions projected into the table. */\n readonly columnDefs: Signal<readonly ComColumnDef[]> = contentChildren<ComColumnDef>(ComColumnDef);\n\n /** @internal Header row definition. */\n readonly headerRowDef: Signal<ComHeaderRowDef | undefined> =\n contentChild<ComHeaderRowDef>(ComHeaderRowDef);\n\n /** @internal Body row definition. */\n readonly rowDef: Signal<ComRowDef | undefined> = contentChild<ComRowDef>(ComRowDef);\n\n /** @internal Optional footer row definition. */\n readonly footerRowDef: Signal<ComFooterRowDef | undefined> =\n contentChild<ComFooterRowDef>(ComFooterRowDef);\n\n /** @internal Optional no-data row template. */\n readonly noDataRow: Signal<ComNoDataRow | undefined> =\n contentChild<ComNoDataRow>(ComNoDataRow);\n\n // ─── Derived State ───\n\n /** @internal Map of column name → column definition for O(1) lookup. */\n protected readonly columnDefMap: Signal<Map<string, ComColumnDef>> = computed(() => {\n const map = new Map<string, ComColumnDef>();\n for (const col of this.columnDefs()) {\n map.set(col.name(), col);\n }\n return map;\n });\n\n /** @internal Resolved render data — handles both array and DataSource inputs. */\n readonly renderData: Signal<readonly T[]> = computed(() => {\n const ds = this.dataSource();\n if (isDataSource<T>(ds)) {\n return ds.connect()();\n }\n return ds;\n });\n\n /** @internal Header column names. */\n protected readonly headerColumns: Signal<string[]> = computed(\n () => this.headerRowDef()?.columns() ?? []\n );\n\n /** @internal Body column names — public for ComRowClick event delegation. */\n readonly bodyColumns: Signal<string[]> = computed(\n () => this.rowDef()?.columns() ?? this.headerColumns()\n );\n\n /** @internal Footer column names. */\n protected readonly footerColumns: Signal<string[]> = computed(\n () => this.footerRowDef()?.columns() ?? []\n );\n\n /** @internal Whether the header should be sticky. */\n private readonly isSticky: Signal<boolean> = computed(\n () => this.stickyHeader() || (this.headerRowDef()?.sticky() ?? false)\n );\n\n /** @internal Whether body rows are clickable (ComRowClick directive is active). */\n protected readonly isRowClickable: Signal<boolean> = computed(\n () => this.rowClickRef?.isActive() ?? false\n );\n\n // ─── CVA Classes ───\n\n protected readonly containerClasses: Signal<string> = computed(() => tableContainerVariants());\n\n protected readonly tableClasses: Signal<string> = computed(() => tableVariants());\n\n protected readonly theadClasses: Signal<string> = computed(() =>\n tableHeaderVariants({ sticky: this.isSticky() })\n );\n\n protected readonly headerTrClasses: Signal<string> = computed(() =>\n tableHeaderRowVariants({ density: this.density() })\n );\n\n protected readonly trClasses: Signal<string> = computed(() => {\n const base = tableRowVariants({ variant: this.variant(), density: this.density() });\n if (this.isRowClickable()) {\n return `${base} cursor-pointer outline-none focus-visible:outline-[1px] focus-visible:outline-offset-[-1px] focus-visible:outline-[--color-ring]`;\n }\n return base;\n });\n\n protected readonly footerTrClasses: Signal<string> = computed(() =>\n tableFooterRowVariants({ density: this.density() })\n );\n\n constructor() {\n // Push data context to the row-click directive (avoids circular DI)\n this.rowClickRef?._setContext({\n renderData: this.renderData,\n bodyColumns: this.bodyColumns,\n });\n\n // Disconnect DataSource on destroy\n this.destroyRef.onDestroy(() => {\n const ds = this.dataSource();\n if (isDataSource<T>(ds)) {\n ds.disconnect();\n }\n });\n }\n}\n","import {\n afterNextRender,\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n forwardRef,\n inject,\n input,\n output,\n Renderer2,\n} from '@angular/core';\nimport type {\n InputSignal,\n InputSignalWithTransform,\n OutputEmitterRef,\n Signal,\n} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport { COM_ROW_CLICK } from './table-row-click.types';\nimport type { ComRowClickContext, ComRowClickRef } from './table-row-click.types';\n\n/**\n * Attribute directive that enables click-to-act on `<com-table>` body rows.\n *\n * Uses event delegation — a single click/keydown listener on the `<table>` element —\n * rather than per-row bindings. When a user clicks or presses Enter/Space on a body row,\n * the directive resolves the row data and emits it, unless the click originated from an\n * excluded column's cell.\n *\n * @tokens `--color-ring`\n *\n * @example Basic\n * ```html\n * <com-table [dataSource]=\"users()\" comRowClick (comRowClick)=\"openDetail($event)\">\n * ...\n * </com-table>\n * ```\n *\n * @example With column exclusion\n * ```html\n * <com-table [dataSource]=\"users()\" comRowClick\n * [comRowClickExclude]=\"['select', 'actions']\"\n * (comRowClick)=\"openDetail($event)\">\n * ...\n * </com-table>\n * ```\n */\n@Directive({\n selector: 'com-table[comRowClick]',\n exportAs: 'comRowClick',\n providers: [{ provide: COM_ROW_CLICK, useExisting: forwardRef(() => ComRowClick) }],\n})\nexport class ComRowClick<T = unknown> implements ComRowClickRef<T> {\n private readonly elementRef: ElementRef<HTMLElement> = inject(ElementRef<HTMLElement>);\n private readonly renderer: Renderer2 = inject(Renderer2);\n private readonly destroyRef: DestroyRef = inject(DestroyRef);\n private readonly document: Document = inject(DOCUMENT);\n\n /** @internal Context pushed by ComTable — avoids circular DI. */\n private context: ComRowClickContext<T> | null = null;\n\n // ─── Inputs ───\n\n /** Column names whose cells do NOT trigger the row click output. */\n readonly comRowClickExclude: InputSignal<string[]> = input<string[]>([], {\n alias: 'comRowClickExclude',\n });\n\n /** Disables all row click behavior — removes cursor, tabindex, and event handling. */\n readonly comRowClickDisabled: InputSignalWithTransform<boolean, unknown> = input(false, {\n alias: 'comRowClickDisabled',\n transform: booleanAttribute,\n });\n\n // ─── Outputs ───\n\n /** Emits the row data object when a non-excluded cell is clicked or activated via keyboard. */\n readonly comRowClick: OutputEmitterRef<T> = output<T>({ alias: 'comRowClick' });\n\n // ─── Public (consumed by ComTable via COM_ROW_CLICK token) ───\n\n /** Whether row-click behavior is currently active. */\n readonly isActive: Signal<boolean> = computed(() => !this.comRowClickDisabled());\n\n /** @internal Called by ComTable to provide data context. */\n _setContext(ctx: ComRowClickContext<T>): void {\n this.context = ctx;\n }\n\n constructor() {\n // SSR-safe: event delegation setup only runs in the browser after render\n afterNextRender(() => {\n const hostEl = this.elementRef.nativeElement;\n const tableEl = hostEl.querySelector('table');\n if (!tableEl) return;\n\n const unlistenClick = this.renderer.listen(tableEl, 'click', (event: MouseEvent) => {\n this.handleEvent(event);\n });\n\n const unlistenKeydown = this.renderer.listen(\n tableEl,\n 'keydown',\n (event: KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n this.handleEvent(event);\n if (event.key === ' ') {\n event.preventDefault(); // Prevent page scroll\n }\n }\n }\n );\n\n this.destroyRef.onDestroy(() => {\n unlistenClick();\n unlistenKeydown();\n });\n });\n }\n\n // ─── Private ───\n\n private handleEvent(event: Event): void {\n if (this.comRowClickDisabled() || !this.context) return;\n\n const target = event.target;\n if (!(target instanceof this.document.defaultView!.HTMLElement)) return;\n\n const tr = target.closest('tbody tr') as HTMLTableRowElement | null;\n if (!tr) return;\n\n // Keyboard events fire on the focused <tr> directly — no cell exclusion needed\n if (event instanceof KeyboardEvent) {\n if (target !== tr) return;\n return this.emitRow(tr);\n }\n\n // Click events — resolve the cell (direct child of <tr>) that contains the target\n const cell = target.closest('td, th') as HTMLTableCellElement | null;\n if (!cell || cell.parentElement !== tr) return;\n\n // Map cell index to column name for exclusion check\n const columnName = this.context.bodyColumns()[cell.cellIndex];\n if (!columnName || this.comRowClickExclude().includes(columnName)) return;\n\n this.emitRow(tr);\n }\n\n private emitRow(tr: HTMLTableRowElement): void {\n if (!this.context) return;\n const rowIndex = tr.sectionRowIndex;\n const data = this.context.renderData();\n if (rowIndex < 0 || rowIndex >= data.length) return;\n this.comRowClick.emit(data[rowIndex] as T);\n }\n}\n","// Public API for the table component system\n\n// Main component\nexport { ComTable } from './table.component';\n\n// Data source\nexport { ComDataSource, ComArrayDataSource, isDataSource } from './table-data-source';\nexport type { ComTableDataSourceInput } from './table-data-source';\n\n// Column directives\nexport { ComColumnDef } from './table-column-def.directive';\nexport { ComHeaderCellDef } from './table-header-cell-def.directive';\nexport { ComCellDef } from './table-cell-def.directive';\nexport { ComFooterCellDef } from './table-footer-cell-def.directive';\n\n// Row directives\nexport { ComHeaderRowDef } from './table-header-row-def.directive';\nexport { ComRowDef } from './table-row-def.directive';\nexport { ComFooterRowDef } from './table-footer-row-def.directive';\nexport { ComNoDataRow } from './table-no-data-row.directive';\n\n// Row click\nexport { ComRowClick } from './table-row-click.directive';\nexport { COM_ROW_CLICK } from './table-row-click.types';\nexport type { ComRowClickRef } from './table-row-click.types';\n\n// Types\nexport type { CellDefContext } from './table.types';\n\n// Variants\nexport {\n tableContainerVariants,\n tableVariants,\n tableHeaderVariants,\n tableHeaderRowVariants,\n tableRowVariants,\n tableFooterRowVariants,\n // Deprecated aliases\n tableHeaderCellVariants,\n tableBodyCellVariants,\n tableFooterCellVariants,\n} from './table.variants';\n\nexport type {\n TableVariant,\n TableDensity,\n TableContainerVariants,\n TableVariants,\n TableHeaderVariants,\n TableHeaderRowVariants,\n TableRowVariants,\n TableFooterRowVariants,\n // Deprecated aliases\n TableHeaderCellVariants,\n TableBodyCellVariants,\n TableFooterCellVariants,\n} from './table.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEA;;;;;;;;;;;;;;AAcG;MAIU,gBAAgB,CAAA;AAClB,IAAA,WAAW,GAAsB,MAAM,EAAC,WAAiB,EAAC;uGADxD,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC/B,iBAAA;;;AChBD;;;;;;;;;;;;;;AAcG;MAIU,UAAU,CAAA;AACZ,IAAA,WAAW,GAAmC,MAAM,EAAC,WAA8B,EAAC;uGADlF,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAHtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACzB,iBAAA;;;AClBD;;;;;;;;;;;;;;;AAeG;MAIU,gBAAgB,CAAA;AAClB,IAAA,WAAW,GAAsB,MAAM,EAAC,WAAiB,EAAC;uGADxD,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EA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,EAAA,QAAA,EAAA,IAAA,EAAA,WAAW,2bAFX,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,WAAW,CAAC,EAAE,CAAC,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAExE,WAAW,EAAA,UAAA,EAAA,CAAA;kBALvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,wBAAwB;AAClC,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,MAAK,WAAY,CAAC,EAAE,CAAC;AACpF,iBAAA;;;ACrDD;AAEA;;ACFA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-com",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "license": "MIT",
5
5
  "description": "A modern Angular component library built with signals, Tailwind CSS, and semantic design tokens",
6
6
  "keywords": [
@@ -48,9 +48,39 @@
48
48
  "sideEffects": [
49
49
  "*.css"
50
50
  ],
51
- "module": "fesm2022/ngx-com.mjs",
52
- "typings": "types/ngx-com.d.ts",
53
51
  "exports": {
52
+ "./styles/tokens.css": {
53
+ "style": "./styles/tokens.css",
54
+ "default": "./styles/tokens.css"
55
+ },
56
+ "./styles/themes.css": {
57
+ "style": "./styles/themes.css",
58
+ "default": "./styles/themes.css"
59
+ },
60
+ "./styles/dark.css": {
61
+ "style": "./styles/dark.css",
62
+ "default": "./styles/dark.css"
63
+ },
64
+ "./styles/animations.css": {
65
+ "style": "./styles/animations.css",
66
+ "default": "./styles/animations.css"
67
+ },
68
+ "./styles/utilities.css": {
69
+ "style": "./styles/utilities.css",
70
+ "default": "./styles/utilities.css"
71
+ },
72
+ "./styles/candy.css": {
73
+ "style": "./styles/candy.css",
74
+ "default": "./styles/candy.css"
75
+ },
76
+ "./styles/forest.css": {
77
+ "style": "./styles/forest.css",
78
+ "default": "./styles/forest.css"
79
+ },
80
+ "./styles/ocean.css": {
81
+ "style": "./styles/ocean.css",
82
+ "default": "./styles/ocean.css"
83
+ },
54
84
  "./package.json": {
55
85
  "default": "./package.json"
56
86
  },
@@ -210,5 +240,7 @@
210
240
  "types": "./types/ngx-com-utils.d.ts",
211
241
  "default": "./fesm2022/ngx-com-utils.mjs"
212
242
  }
213
- }
243
+ },
244
+ "module": "fesm2022/ngx-com.mjs",
245
+ "typings": "types/ngx-com.d.ts"
214
246
  }
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { TemplateRef, InputSignal, Signal, InputSignalWithTransform, TrackByFunction } from '@angular/core';
2
+ import { TemplateRef, InputSignal, Signal, InputSignalWithTransform, TrackByFunction, InjectionToken, OutputEmitterRef } from '@angular/core';
3
3
  import { VariantProps } from 'class-variance-authority';
4
4
 
5
5
  /**
@@ -259,39 +259,45 @@ declare const tableHeaderVariants: (props?: {
259
259
  }) => string;
260
260
  type TableHeaderVariants = VariantProps<typeof tableHeaderVariants>;
261
261
  /**
262
- * CVA variants for `<th>` header cells.
262
+ * CVA variants for the header `<tr>` — applies base styles to child `<th>` cells via child selectors.
263
263
  *
264
264
  * @tokens `--color-muted-foreground`
265
265
  */
266
- declare const tableHeaderCellVariants: (props?: {
266
+ declare const tableHeaderRowVariants: (props?: {
267
267
  density?: TableDensity;
268
268
  }) => string;
269
- type TableHeaderCellVariants = VariantProps<typeof tableHeaderCellVariants>;
269
+ type TableHeaderRowVariants = VariantProps<typeof tableHeaderRowVariants>;
270
270
  /**
271
- * CVA variants for `<tbody> <tr>` rows.
271
+ * CVA variants for `<tbody> <tr>` rows — includes row-level styles and child `<td>` cell styles.
272
272
  *
273
273
  * @tokens `--color-border-subtle`, `--color-muted`, `--color-muted-hover`
274
274
  */
275
275
  declare const tableRowVariants: (props?: {
276
276
  variant?: TableVariant;
277
- }) => string;
278
- type TableRowVariants = VariantProps<typeof tableRowVariants>;
279
- /**
280
- * CVA variants for `<td>` body cells.
281
- */
282
- declare const tableBodyCellVariants: (props?: {
283
277
  density?: TableDensity;
284
278
  }) => string;
285
- type TableBodyCellVariants = VariantProps<typeof tableBodyCellVariants>;
279
+ type TableRowVariants = VariantProps<typeof tableRowVariants>;
286
280
  /**
287
- * CVA variants for `<tfoot> <td>` footer cells.
281
+ * CVA variants for the footer `<tr>` — applies base styles to child `<td>` cells via child selectors.
288
282
  *
289
283
  * @tokens `--color-foreground`, `--color-border`
290
284
  */
291
- declare const tableFooterCellVariants: (props?: {
285
+ declare const tableFooterRowVariants: (props?: {
292
286
  density?: TableDensity;
293
287
  }) => string;
294
- type TableFooterCellVariants = VariantProps<typeof tableFooterCellVariants>;
288
+ type TableFooterRowVariants = VariantProps<typeof tableFooterRowVariants>;
289
+ /** @deprecated Use `tableHeaderRowVariants` instead. */
290
+ declare const tableHeaderCellVariants: typeof tableHeaderRowVariants;
291
+ /** @deprecated Use `tableHeaderRowVariants` instead. */
292
+ type TableHeaderCellVariants = TableHeaderRowVariants;
293
+ /** @deprecated Body cell styles are now part of `tableRowVariants`. */
294
+ declare const tableBodyCellVariants: typeof tableRowVariants;
295
+ /** @deprecated Body cell styles are now part of `tableRowVariants`. */
296
+ type TableBodyCellVariants = TableRowVariants;
297
+ /** @deprecated Use `tableFooterRowVariants` instead. */
298
+ declare const tableFooterCellVariants: typeof tableFooterRowVariants;
299
+ /** @deprecated Use `tableFooterRowVariants` instead. */
300
+ type TableFooterCellVariants = TableFooterRowVariants;
295
301
 
296
302
  /**
297
303
  * Declarative data table component using native HTML `<table>` semantics.
@@ -339,6 +345,7 @@ type TableFooterCellVariants = VariantProps<typeof tableFooterCellVariants>;
339
345
  */
340
346
  declare class ComTable<T> {
341
347
  private readonly destroyRef;
348
+ private readonly rowClickRef;
342
349
  /** The data to render — accepts a plain array or a ComDataSource. */
343
350
  readonly dataSource: InputSignal<ComTableDataSourceInput<T>>;
344
351
  /** Track function for `@for`. Defaults to tracking by index. */
@@ -369,23 +376,92 @@ declare class ComTable<T> {
369
376
  readonly renderData: Signal<readonly T[]>;
370
377
  /** @internal Header column names. */
371
378
  protected readonly headerColumns: Signal<string[]>;
372
- /** @internal Body column names. */
373
- protected readonly bodyColumns: Signal<string[]>;
379
+ /** @internal Body column names — public for ComRowClick event delegation. */
380
+ readonly bodyColumns: Signal<string[]>;
374
381
  /** @internal Footer column names. */
375
382
  protected readonly footerColumns: Signal<string[]>;
376
383
  /** @internal Whether the header should be sticky. */
377
384
  private readonly isSticky;
385
+ /** @internal Whether body rows are clickable (ComRowClick directive is active). */
386
+ protected readonly isRowClickable: Signal<boolean>;
378
387
  protected readonly containerClasses: Signal<string>;
379
388
  protected readonly tableClasses: Signal<string>;
380
389
  protected readonly theadClasses: Signal<string>;
381
- protected readonly thClasses: Signal<string>;
390
+ protected readonly headerTrClasses: Signal<string>;
382
391
  protected readonly trClasses: Signal<string>;
383
- protected readonly tdClasses: Signal<string>;
384
- protected readonly tfootTdClasses: Signal<string>;
392
+ protected readonly footerTrClasses: Signal<string>;
385
393
  constructor();
386
394
  static ɵfac: i0.ɵɵFactoryDeclaration<ComTable<any>, never>;
387
395
  static ɵcmp: i0.ɵɵComponentDeclaration<ComTable<any>, "com-table", ["comTable"], { "dataSource": { "alias": "dataSource"; "required": false; "isSignal": true; }; "trackByFn": { "alias": "trackByFn"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "density": { "alias": "density"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, ["columnDefs", "headerRowDef", "rowDef", "footerRowDef", "noDataRow"], never, true, never>;
388
396
  }
389
397
 
390
- export { ComArrayDataSource, ComCellDef, ComColumnDef, ComDataSource, ComFooterCellDef, ComFooterRowDef, ComHeaderCellDef, ComHeaderRowDef, ComNoDataRow, ComRowDef, ComTable, isDataSource, tableBodyCellVariants, tableContainerVariants, tableFooterCellVariants, tableHeaderCellVariants, tableHeaderVariants, tableRowVariants, tableVariants };
391
- export type { CellDefContext, ComTableDataSourceInput, TableBodyCellVariants, TableContainerVariants, TableDensity, TableFooterCellVariants, TableHeaderCellVariants, TableHeaderVariants, TableRowVariants, TableVariant, TableVariants };
398
+ /** Data context that ComTable pushes to ComRowClick to avoid circular DI. */
399
+ interface ComRowClickContext<T = unknown> {
400
+ readonly renderData: Signal<readonly T[]>;
401
+ readonly bodyColumns: Signal<string[]>;
402
+ }
403
+ /** Minimal interface that ComTable reads to detect an active row-click directive. */
404
+ interface ComRowClickRef<T = unknown> {
405
+ /** Whether row-click behavior is currently active (exists and not disabled). */
406
+ readonly isActive: Signal<boolean>;
407
+ /** Called by ComTable to provide data context — avoids circular injection. */
408
+ _setContext(ctx: ComRowClickContext<T>): void;
409
+ }
410
+ /**
411
+ * Injection token used by ComTable to optionally detect a ComRowClick directive.
412
+ * Breaks the circular dependency between ComTable and ComRowClick.
413
+ */
414
+ declare const COM_ROW_CLICK: InjectionToken<ComRowClickRef>;
415
+
416
+ /**
417
+ * Attribute directive that enables click-to-act on `<com-table>` body rows.
418
+ *
419
+ * Uses event delegation — a single click/keydown listener on the `<table>` element —
420
+ * rather than per-row bindings. When a user clicks or presses Enter/Space on a body row,
421
+ * the directive resolves the row data and emits it, unless the click originated from an
422
+ * excluded column's cell.
423
+ *
424
+ * @tokens `--color-ring`
425
+ *
426
+ * @example Basic
427
+ * ```html
428
+ * <com-table [dataSource]="users()" comRowClick (comRowClick)="openDetail($event)">
429
+ * ...
430
+ * </com-table>
431
+ * ```
432
+ *
433
+ * @example With column exclusion
434
+ * ```html
435
+ * <com-table [dataSource]="users()" comRowClick
436
+ * [comRowClickExclude]="['select', 'actions']"
437
+ * (comRowClick)="openDetail($event)">
438
+ * ...
439
+ * </com-table>
440
+ * ```
441
+ */
442
+ declare class ComRowClick<T = unknown> implements ComRowClickRef<T> {
443
+ private readonly elementRef;
444
+ private readonly renderer;
445
+ private readonly destroyRef;
446
+ private readonly document;
447
+ /** @internal Context pushed by ComTable — avoids circular DI. */
448
+ private context;
449
+ /** Column names whose cells do NOT trigger the row click output. */
450
+ readonly comRowClickExclude: InputSignal<string[]>;
451
+ /** Disables all row click behavior — removes cursor, tabindex, and event handling. */
452
+ readonly comRowClickDisabled: InputSignalWithTransform<boolean, unknown>;
453
+ /** Emits the row data object when a non-excluded cell is clicked or activated via keyboard. */
454
+ readonly comRowClick: OutputEmitterRef<T>;
455
+ /** Whether row-click behavior is currently active. */
456
+ readonly isActive: Signal<boolean>;
457
+ /** @internal Called by ComTable to provide data context. */
458
+ _setContext(ctx: ComRowClickContext<T>): void;
459
+ constructor();
460
+ private handleEvent;
461
+ private emitRow;
462
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComRowClick<any>, never>;
463
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComRowClick<any>, "com-table[comRowClick]", ["comRowClick"], { "comRowClickExclude": { "alias": "comRowClickExclude"; "required": false; "isSignal": true; }; "comRowClickDisabled": { "alias": "comRowClickDisabled"; "required": false; "isSignal": true; }; }, { "comRowClick": "comRowClick"; }, never, never, true, never>;
464
+ }
465
+
466
+ export { COM_ROW_CLICK, ComArrayDataSource, ComCellDef, ComColumnDef, ComDataSource, ComFooterCellDef, ComFooterRowDef, ComHeaderCellDef, ComHeaderRowDef, ComNoDataRow, ComRowClick, ComRowDef, ComTable, isDataSource, tableBodyCellVariants, tableContainerVariants, tableFooterCellVariants, tableFooterRowVariants, tableHeaderCellVariants, tableHeaderRowVariants, tableHeaderVariants, tableRowVariants, tableVariants };
467
+ export type { CellDefContext, ComRowClickRef, ComTableDataSourceInput, TableBodyCellVariants, TableContainerVariants, TableDensity, TableFooterCellVariants, TableFooterRowVariants, TableHeaderCellVariants, TableHeaderRowVariants, TableHeaderVariants, TableRowVariants, TableVariant, TableVariants };