@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 +34 -4
- package/dist/fesm2022/simple-table-angular.mjs +768 -106
- package/dist/fesm2022/simple-table-angular.mjs.map +1 -1
- package/dist/index.d.ts +151 -25
- package/dist/index.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -36,10 +36,40 @@ npm install @simple-table/angular
|
|
|
36
36
|
|
|
37
37
|
## Building with Angular
|
|
38
38
|
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
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
|
|