Skip to content

Commit 451a8b8

Browse files
authored
v20.3.3 - Release
* Remove deprecated Angular Animations. * Allow for string object id. Move common functions to util folders. Fix template data returning in selected row data. * Version tick. README improvments.
1 parent 3e5d2bf commit 451a8b8

18 files changed

+287
-183
lines changed

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
<p align="center">
1+
<div align="center">
22
<a href="https://www.ProAngular.com" target="_blank">
33
<img src="https://raw.githubusercontent.com/ProAngular/pro-table/refs/heads/main/public/images/pro-angular-logo.png" />
44
</a>
55
<h1 align="center">
66
<a href="https://www.ProAngular.com" target="_blank">Pro Angular</a>: Table Component
77
</h1>
8-
</p>
8+
<p align="center">
9+
An abstraction of Angular Material’s table that speeds up development time and gives you quick access to features such as type safe columns, row selection, copy on click, expandable rows, intent based sorting, and more!
10+
</p>
11+
</div>
912

1013
<!---------------------------------------------------------------------------->
1114
<!---------------------------------------------------------------------------->
@@ -63,14 +66,15 @@ https://www.ProAngular.com/demos/pro-table
6366

6467
## Description <a name="description"></a>
6568

66-
`@proangular/pro-table` is a **type-safe, Angular 20–first abstraction** over
67-
Angular Material’s table. It’s designed for apps using **standalone components,
68-
signals, and the new control-flow syntax** so you can wire up robust data grids
69-
quickly without giving up control of your data model or rendering. The component
70-
keeps Material’s performance and accessibility surface, while adding
71-
strongly-typed columns, selection, copy-on-click, expandable detail rows, and a
72-
clean sorting contract that **emits intent** instead of mutating your data for
73-
you.
69+
`@proangular/pro-table` is a **type-safe, Angular abstraction** over Angular
70+
Material’s table. It’s designed for apps using **standalone components, signals,
71+
and the new control-flow syntax** so you can wire up data grids quickly without
72+
giving up control of your data model or rendering.
73+
74+
The component keeps Material’s performance, accessibility, and theming surface,
75+
while adding strongly-typed columns, selection, copy-on-click, expandable detail
76+
rows, and a clean sorting contract that **emits intent** instead of mutating
77+
data.
7478

7579
### Why it’s useful (technical)
7680

@@ -100,7 +104,7 @@ you.
100104
values. These affordances reduce the “glue code” you normally write around
101105
`MatTable`.
102106

103-
- **Built for Angular 20 patterns**
107+
- **Built for Angular 20+ patterns**
104108
Uses **OnPush** change detection, `@if/@for/@let` in templates, and small
105109
reactive streams (`BehaviorSubject/ReplaySubject` + `shareReplay`) to keep
106110
updates efficient. The example shows **signals** + `effect()` integrating

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@proangular/pro-table",
3-
"version": "20.3.2",
3+
"version": "20.3.3",
44
"description": "A rich, dynamic, and versatile table component based on Angular Material.",
55
"author": "Pro Angular <webmaster@proangular.com>",
66
"homepage": "https://www.proangular.com",

src/app/public/table/table-animations.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/app/public/table/table.component.html

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
column.minWidthPx ? column.minWidthPx + 'px' : undefined
5656
"
5757
>
58-
@let data = getData(dataSourceItem, column.key);
58+
@let data = getData(dataSourceItem, column.key, placeholderEmptyData);
5959
@switch (getTypeOf(data)) {
6060
@case ('datetime') {
6161
<span [title]="data | dateTime: 'MM/dd/yyyy, hh:mm a (ZZZZ)'">
@@ -107,37 +107,36 @@
107107
</td>
108108
</ng-container>
109109
}
110-
<ng-container matColumnDef="expandedDetail">
110+
<ng-container matColumnDef="expandableRow">
111111
<td
112112
mat-cell
113113
*matCellDef="let rowObjectData"
114114
[attr.colspan]="columnKeys?.length ?? 1"
115115
>
116116
<div
117117
class="expandable-row-details"
118-
[@collapseAnimation]="
119-
isRowExpanded(rowObjectData, expandableObject)
120-
? 'expanded'
121-
: 'collapsed'
122-
"
118+
[class.open]="isRowExpanded(rowObjectData, expandableObject)"
123119
>
124-
@if (
125-
expandableObject && isRowExpanded(rowObjectData, expandableObject)
126-
) {
127-
<div [@exitAnimation]>
128-
<ng-container
129-
*ngTemplateOutlet="
130-
expandableObject.templateRef;
131-
context: isNonEmptyObject(expandableObject.context)
132-
? expandableObject.context
133-
: null
134-
"
135-
></ng-container>
136-
</div>
137-
}
120+
<div>
121+
@if (
122+
expandableObject && isRowExpanded(rowObjectData, expandableObject)
123+
) {
124+
<div animate.leave="exp-leave">
125+
<ng-container
126+
*ngTemplateOutlet="
127+
expandableObject.templateRef;
128+
context: isNonEmptyObject(expandableObject.context)
129+
? expandableObject.context
130+
: null
131+
"
132+
></ng-container>
133+
</div>
134+
}
135+
</div>
138136
</div>
139137
</td>
140138
</ng-container>
139+
141140
<tr mat-header-row *matHeaderRowDef="columnKeys; sticky: stickyHeader"></tr>
142141
<tr
143142
mat-row
@@ -148,7 +147,7 @@
148147
<tr
149148
mat-row
150149
class="expandable-row"
151-
*matRowDef="let rowObjectData; columns: ['expandedDetail']"
150+
*matRowDef="let rowObjectData; columns: ['expandableRow']"
152151
></tr>
153152
<tr class="empty" *matNoDataRow>
154153
<td [attr.colspan]="columnKeys?.length || 0">

src/app/public/table/table.component.scss

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,22 @@ table {
6161

6262
> div.expandable-row-details {
6363
background-color: inherit;
64-
display: flex;
64+
display: grid;
65+
grid-template-rows: 0fr;
6566
overflow: hidden;
6667
width: 100%;
68+
transition: grid-template-rows 100ms ease-in;
6769

6870
> div {
71+
overflow: hidden;
6972
width: 100%;
7073
}
7174
}
75+
76+
> div.expandable-row-details.open {
77+
grid-template-rows: 1fr;
78+
transition: grid-template-rows 100ms ease-out;
79+
}
7280
}
7381
}
7482

@@ -109,3 +117,17 @@ p.loading {
109117
background: var(--mat-table-background-color);
110118
}
111119
}
120+
121+
/* Animations */
122+
123+
@keyframes exp-leave-hold {
124+
from {
125+
opacity: 1;
126+
}
127+
to {
128+
opacity: 1;
129+
}
130+
}
131+
.exp-leave {
132+
animation: exp-leave-hold 100ms linear both;
133+
}

0 commit comments

Comments
 (0)