@simple-table/angular 4.2.2 → 4.2.4

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
@@ -36,10 +36,40 @@ npm install @simple-table/angular
36
36
 
37
37
  ## Building with Angular
38
38
 
39
- - Standalone `SimpleTableComponent` with the `<simple-table>` selector — drop it into the `imports` array of any Angular 17+ standalone component
40
- - Use Angular components for cell renderers, header renderers, footer renderers, and more
41
- - Access the imperative `TableAPI` via `(tableReady)` output or `@ViewChild` for sorting, filtering, pagination, export, and more
42
- - Types and APIs are exported from this package; works with Ivy, signals, and TypeScript strict mode
39
+ - Import `SimpleTableImports` on the page. That brings in `<simple-table>` plus `stCell`, `stEmpty`, `stHeader`, and the other template directives.
40
+ - Keep columns in TypeScript. Put custom cells, empty UI, and headers in the page template (`stCell="status"`, `stEmpty`).
41
+ - Bind events the Angular way: `(sortChange)`, `(rowSelectionChange)`, `(cellEdit)`. The older `[onSortChange]` inputs still work; if you bind both, both run.
42
+ - `class` on `<simple-table>` styles the Angular host. `[className]` styles the inner grid (`.simple-table-root`). They are not merged.
43
+ - `provideSimpleTable()` is optional. Angular already provides what the table needs.
44
+ - Access the imperative `TableAPI` via `(tableReady)` or `@ViewChild`.
45
+ - You can still pass Angular component classes as `cellRenderer` on a column. A matching `stCell` on the page wins.
46
+
47
+ ```html
48
+ <simple-table
49
+ [rows]="employees"
50
+ [columns]="columns"
51
+ [getRowId]="getRowId"
52
+ (sortChange)="onSort($event)"
53
+ >
54
+ <ng-template stCell="status" let-row let-value="value">
55
+ <span class="badge">{{ value }}</span>
56
+ </ng-template>
57
+
58
+ <ng-template stEmpty>
59
+ No people yet.
60
+ <button type="button" (click)="add()">Add</button>
61
+ </ng-template>
62
+ </simple-table>
63
+ ```
64
+
65
+ ```ts
66
+ @Component({
67
+ standalone: true,
68
+ imports: [SimpleTableImports],
69
+ templateUrl: "./people.component.html",
70
+ })
71
+ export class PeopleComponent { /* rows, columns, handlers */ }
72
+ ```
43
73
 
44
74
  ## Features
45
75