Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
ffad3ab
Merge remote-tracking branch 'remote_origin/master'
blavenie May 12, 2020
497218e
Upgrade to Angular 9 - fix #45
blavenie May 12, 2020
9b8934f
Upgrade dev deps, to Angular 9 - fix #45
blavenie May 12, 2020
056b1e7
Fix compilation (use ngcc)
blavenie May 12, 2020
09bda8b
- CHange tsonfig, to target es2015 (instead of es5) - fix #36
blavenie May 12, 2020
e4a1967
Upgrade to @angular/cli@9.1.6
blavenie May 18, 2020
f22627a
Fix build error "could not be resolved to an NgModule class" on angul…
blavenie May 18, 2020
931851d
Upgrade to Angular 10
blavenie Jul 7, 2020
c84d253
Remove dependency to 'rxjs/internal/operators'
blavenie Jul 10, 2020
16c0c39
- Update Angular libs
blavenie Sep 21, 2020
b13d0a6
Fix Git URL
blavenie Sep 21, 2020
d356814
Chnage project name to '@e-is/ngx-material-table'
blavenie Sep 21, 2020
ad90fc3
Fix rollup build
blavenie Sep 21, 2020
e194ef9
[enh] Add example page
blavenie Sep 21, 2020
97291bc
Fix build (bad path in public_api.ts)
blavenie Sep 21, 2020
8f9bbae
Create release v0.10.2
blavenie Sep 21, 2020
3bfc959
Create release v0.11.0, for Angular 11
blavenie Dec 2, 2020
862e249
Create release v0.11.0, for Angular 11
blavenie Dec 2, 2020
e6b8307
Create release v0.11.0, for Angular 11
blavenie Dec 2, 2020
f0216c3
Create release v0.11.0, for Angular 11
blavenie Dec 2, 2020
1157131
Create release v0.11.1, using ng-packagr 11
blavenie Dec 2, 2020
30fa3f5
Create release v0.11.1, using ng-packagr 11
blavenie Dec 2, 2020
8f9ab99
Add publish config
blavenie Dec 2, 2020
970cedb
[enh] table-element.ts: add option restoreOriginalData on cancelOrDel…
LudovicPecquot Feb 25, 2021
b400b99
[enh] table-element.ts: remove option restoreOriginalData on cancelOr…
LudovicPecquot Feb 26, 2021
c2d9e15
update doc
LudovicPecquot Feb 26, 2021
c332aef
[enh] add TableDataSourceOptions
LudovicPecquot Feb 26, 2021
47ddbc0
[enh] remove duplicated option
LudovicPecquot Feb 26, 2021
8dd647d
[enh] update package version
LudovicPecquot Feb 26, 2021
634a658
[fix] don't set originalData at row instantiation
LudovicPecquot Feb 26, 2021
f3adf5d
[enh] table-data-source.ts: createNew accepts insertAt parameter to a…
LudovicPecquot Mar 31, 2021
f7c7f1f
[fix] update row ids on row moved
LudovicPecquot Mar 31, 2021
62daa5a
[fix] table-element-reactive-forms.ts: isValid() return real validato…
LudovicPecquot Apr 13, 2021
4a5062a
[fix] table-data-source.ts: better handling of new row when inserted
LudovicPecquot Apr 29, 2021
9346489
release 0.11.9
LudovicPecquot May 17, 2021
212e049
Update publish config
blavenie Jun 7, 2021
87eefb4
[fix] Fix publish scripts
blavenie Jun 7, 2021
1af4d5d
[enh] Delegate all row actions to source
blavenie Sep 2, 2022
e0f2247
[enh] Delegate all row actions to source
blavenie Sep 2, 2022
5de8df0
Release 0.12.0-rc6
blavenie Sep 2, 2022
2300f74
Release 0.12.0
blavenie Sep 6, 2022
ffba64c
[enh] add property row.dirty
blavenie Sep 12, 2022
5dce77b
Release 0.14.0-rc4
Oct 12, 2022
d8478a4
Release 0.14.0
Oct 12, 2022
e99d720
Release 0.14.1
Oct 12, 2022
305147e
[fix] Revert to rxjs 6.6.7
Oct 12, 2022
aa12830
Release 0.14.3
Oct 12, 2022
1c30bcb
Release 0.14.4
blavenie Oct 18, 2022
a6ac425
Release 0.14.5
blavenie Oct 25, 2022
d4ee911
[enh] Add changelog
blavenie Oct 25, 2022
4d8a990
[fix] Merge from master (for 0.12.1)
blavenie Oct 28, 2022
d4b54a1
Release 0.14.6
blavenie Oct 28, 2022
e3e5217
Release 0.14.7
blavenie Nov 21, 2022
506b6f8
Release 0.14.7
blavenie Nov 21, 2022
0384181
Release 0.14.8
blavenie Nov 21, 2022
20fdcae
Release 0.14.9
blavenie Nov 24, 2022
3c197d3
Release 0.14.9
blavenie Dec 29, 2022
c8ddbf3
Remove a console log
blavenie Dec 29, 2022
bad6cc4
Upgrade angular libs
blavenie Dec 29, 2022
fee4502
Upgrade angular 15
blavenie Dec 29, 2022
f89f132
Upgrade angular material 15
blavenie Dec 29, 2022
2a897c3
Release v0.15.0
blavenie Dec 29, 2022
e2613ae
release 0.14.11
LudovicPecquot Mar 24, 2023
abb51e3
release 0.14.12
LudovicPecquot Sep 4, 2023
98aecb9
upgrade libs (using legacy angular material)
LudovicPecquot Sep 5, 2023
ea2577d
Merge remote-tracking branch 'origin/upgrade_angular' into v0.15.x
indelog Nov 8, 2023
8b29089
Upgrade angular 16
indelog Nov 8, 2023
41c38d3
Upgrade angular 17
indelog Nov 24, 2023
65a352d
upgrade angular libs
LudovicPecquot Jan 25, 2024
3ff6aa0
upgrade libs and remove zonejs
LudovicPecquot Jan 26, 2024
def7f1b
Release 17.0.0
LudovicPecquot Feb 22, 2024
88805c3
enh(deps) upgrade to Angular 17.2.1
blavenie Mar 7, 2024
a79121d
enh(deps) upgrade to Angular 17.2.1
blavenie Mar 7, 2024
1b1431f
enh(deps) upgrade to Angular 17.2.1
blavenie Mar 7, 2024
41bbdca
Merge remote-tracking branch 'origin/master'
blavenie Mar 7, 2024
0a97ff7
fix(scrollable) Remove duplicated class AsyncTableElement
blavenie Jul 16, 2024
d4d13b9
Commit previous 17.2.0
blavenie Jul 16, 2024
fdc94cd
Release 17.2.1
blavenie Jul 16, 2024
9e29500
fix compilation error, by making ng-table-virtual-scroll optional
blavenie Jul 16, 2024
14b4f24
Release 17.2.2
blavenie Jul 16, 2024
cff1c99
fix compilation error, by making ng-table-virtual-scroll optional
blavenie Jul 16, 2024
2154cb3
Release 17.3.0
blavenie Jul 16, 2024
585ff04
Release 17.3.0
blavenie Jul 16, 2024
dbe2df2
wip(migration) Start Angular 18 migration
blavenie May 19, 2025
309cee2
enh(deps) Migrate to Angular 18
blavenie May 19, 2025
dd189ec
enh(deps) Migrate to Angular 18
blavenie May 19, 2025
2c4f032
[fix] `DataSource.createNew()` should always use the value of `insert…
blavenie Jun 3, 2025
a839150
[fix] `DataSource.createNew()` should always use the value of `insert…
blavenie Jun 3, 2025
488136a
Release 18.0.2
blavenie Jun 3, 2025
6b76d65
[fix] Fix error when calling `DataSource.addMany()` with `insertAt=null`
blavenie Jun 6, 2025
84dbbe3
Release 18.0.4 - Fix webpack version 5.94.0
blavenie Jul 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"root": true,
"ignorePatterns": [
"/dist/**/*.*",
"/doc/**/*.*",
"/resources/**/*.*",
"/scripts/**/*.*",
"/www/**/*.*",
"/src/**/*.test*.ts",
"index.html"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
// This is required if you use inline templates in Components
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"prettier/prettier": "off",
"@angular-eslint/component-class-suffix": "off",
"@angular-eslint/no-output-rename": "off",
"@angular-eslint/no-output-on-prefix": "warn",
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-types": "off",
"prefer-arrow/prefer-arrow-functions": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/member-ordering": [
"off",
{
"default": {
"memberTypes": [
// Index signature
"signature",

// Getters and Setters at the same rank
["get", "set", "field"],

// Static initialization
"static-initialization",

// Constructors
"constructor",

// Methods
"method"
]
}
}
],
"brace-style": [
"off",
"off"
],
"curly": "off",
"dot-notation": "off",
"id-blacklist": "off",
"id-match": "off",
"no-empty-function": "off",
"@typescript-eslint/no-shadow": [
"off",
{
"hoist": "all"
}
],
"no-trailing-spaces": "off",
"no-undef-init": "off",
"no-underscore-dangle": "off",
"no-unused-expressions": "error",
"no-use-before-define": "off",
"radix": "off",
"semi": "error",
"no-console": "off",
"max-len": "off",
"no-throw-literal": "off"
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended",
"plugin:prettier/recommended"
],
"rules": {}
}
]
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand All @@ -42,3 +43,8 @@ testem.log
# System Files
.DS_Store
Thumbs.db
/.local/

# npm/yarn
yarn.lock
package-lock.json
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.local
.husky
.angular
dist
doc
node_modules
scripts
www
17 changes: 17 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"trailingComma": "es5",
"semi": true,
"singleQuote": true,
"printWidth": 150,
"tabWidth": 2,
"overrides": [
{
"files": "src/app/**/*.html",
"options": {
"parser": "angular",
"htmlWhitespaceSensitivity": "ignore",
"printWidth": 120
}
}
]
}
95 changes: 53 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
# Angular4 material table (angular4+)
# Angular material table (Angular 10+)

**Forked from [angular4-material-table](https://github.com/irossimoline/angular4-material-table)**

This project extends `@angular/cdk` data-table, also used in `@angular/material` table.

It extends `@angular/cdk/collections` DataSource in order to include a row structure, allowing row creation, inline row edition, deletion and validation.

Supported angular versions:
- Angular 4 (v0.1.8)
- Angular 5 (v0.2.0)
- Angular 6 (v0.6.0)
- Angular 7 (v0.7.0)
- Angular 8 (v0.8.0)

![angular4-material-table](https://i.imgur.com/ufilXlv.gif)
- Angular 17 (v17.x)
- 17.3 (v17.3.x)
- 17.2 (v17.2.x)
- Angular 16 (v0.16.0)
- Angular 15 (v0.15.0)
- Angular 14 (v0.14.0)
- Angular 11 (v0.11.0 and v0.12.0)
- Angular 10 (v0.10.0)
- Angular <= 9: Please use [angular4-material-table](https://github.com/irossimoline/angular4-material-table)

![@e-is/ngx-material-table](https://i.imgur.com/ufilXlv.gif)

## Installation

To install the package run:

`npm install angular4-material-table`
`npm install @e-is/ngx-material-table`

## Example

Example of using `angular4-material-table`:
Example of using `@e-is/ngx-material-table`:

![angular4-material-table](https://i.imgur.com/vncajJG.png)
![@e-is/ngx-material-table](https://i.imgur.com/vncajJG.png)

![Other example](https://i.imgur.com/5ed814s.png)

Expand All @@ -44,7 +50,7 @@ class TableElement<T> {
id: number;
editing: boolean;
currentData?: T;
originalData: T;
originalData?: T;
source: TableDataSource<T>;
validator: FormGroup; // Used only in reactive forms.

Expand All @@ -71,23 +77,23 @@ class TableDataSource<T> {

createNew(): void;

getRow(id: number): TableElement<T>;
getRow(id: number): AsyncTableElement<T>;
}
```

### Angular4 material table example

Angular 4 material table use example:
![Example of angular4-material-table use](https://i.imgur.com/ath56FU.png)
Angular material table use example:
![Example of @e-is/ngx-material-table use](https://i.imgur.com/ath56FU.png)

[See this package in action](https://stackblitz.com/edit/angular-tj9f6y)

#### Optional libraries
Optional libraries used in the example:
```
"@angular/material": "2.0.0-beta.12",
"@angular/forms": "4.4.4", // <- For inline validation
"font-awesome": "4.7.0"
"@angular/material": "16.2.11",
"@angular/forms": 16.2.12", // <- For inline validation
"material-design-icons": "^3.0.1"
```

#### person-list-reactive-forms.component.html
Expand All @@ -98,16 +104,16 @@ Optional libraries used in the example:
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
<mat-cell *matCellDef="let row">
<mat-form-field floatPlaceholder="{{ row.editing ? 'float' : 'never'}}">
<input [formControl]="row.validator.controls['name']" placeholder="Name" matInput>
<mat-form-field [floatLabel]="row.editing ? 'auto' : 'never'">
<input matInput [formControl]="row.validator.controls['name']" placeholder="Name">
</mat-form-field>
</mat-cell>
</ng-container>
<ng-container matColumnDef="age">
<mat-header-cell *matHeaderCellDef> Age </mat-header-cell>
<mat-cell *matCellDef="let row">
<mat-form-field floatPlaceholder="{{ row.editing ? 'float' : 'never'}}">
<input [formControl]="row.validator.controls['age']" type="number" placeholder="Age" matInput>
<mat-form-field [floatLabel]="row.editing ? 'auto' : 'never'">
<input matInput [formControl]="row.validator.controls['age']" type="number" placeholder="Age">
</mat-form-field>
</mat-cell>
</ng-container>
Expand All @@ -116,15 +122,16 @@ Optional libraries used in the example:
<button mat-icon-button color="accent" (click)="dataSource.createNew()"><i class="fa fa-plus mat-icon"></i></button>
</mat-header-cell>
<mat-cell *matCellDef="let row">
<button *ngIf="!row.editing" mat-icon-button color="primary" focusable="false" (click)="row.startEdit()">
<i class="fa fa-pencil mat-icon"></i>
</button>
<button *ngIf="row.editing" mat-icon-button color="primary" focusable="false" (click)="row.confirmEditCreate()">
<i class="fa fa-check mat-icon"></i>
</button>
<button mat-icon-button color="primary" focusable="false" (click)="row.cancelOrDelete()">
<i class="fa fa-times mat-icon"></i>
</button>
<button *ngIf="!row.editing" mat-icon-button color="primary" (click)="row.startEdit()">
<mat-icon>edit</mat-icon>
</button>
<button *ngIf="row.editing" mat-icon-button color="primary" (click)="row.confirmEditCreate()">
<mat-icon>done</mat-icon>
</button>
<button mat-icon-button color="primary" (click)="row.cancelOrDelete()">
<mat-icon *ngIf="row.editing">undo</mat-icon>
<mat-icon *ngIf="!row.editing">delete</mat-icon>
</button>
</mat-cell>
</ng-container>

Expand All @@ -141,15 +148,15 @@ Optional libraries used in the example:
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
<mat-cell *matCellDef="let row">
<mat-form-field floatPlaceholder="{{ row.editing ? 'float' : 'never'}}">
<mat-form-field [floatLabel]="row.editing ? 'float' : 'never'">
<input [(ngModel)]="row.currentData.name" placeholder="Name" [disabled]="!row.editing" matInput>
</mat-form-field>
</mat-cell>
</ng-container>
<ng-container matColumnDef="age">
<mat-header-cell *matHeaderCellDef> Age </mat-header-cell>
<mat-cell *matCellDef="let row">
<mat-form-field floatPlaceholder="{{ row.editing ? 'float' : 'never'}}">
<mat-form-field [floatLabel]="row.editing ? 'float' : 'never'">
<input type="number" [(ngModel)]="row.currentData.age" placeholder="Age" [disabled]="!row.editing" matInput>
</mat-form-field>
</mat-cell>
Expand All @@ -159,15 +166,16 @@ Optional libraries used in the example:
<button mat-icon-button color="accent" (click)="dataSource.createNew()"><i class="fa fa-plus mat-icon"></i></button>
</mat-header-cell>
<mat-cell *matCellDef="let row">
<button *ngIf="!row.editing" mat-icon-button color="primary" focusable="false" (click)="row.startEdit()">
<i class="fa fa-pencil mat-icon"></i>
</button>
<button *ngIf="row.editing" mat-icon-button color="primary" focusable="false" (click)="row.confirmEditCreate()">
<i class="fa fa-check mat-icon"></i>
</button>
<button mat-icon-button color="primary" focusable="false" (click)="row.cancelOrDelete()">
<i class="fa fa-times mat-icon"></i>
</button>
<button *ngIf="!row.editing" mat-icon-button color="primary" (click)="row.startEdit()">
<mat-icon>edit</mat-icon>
</button>
<button *ngIf="row.editing" mat-icon-button color="primary" (click)="row.confirmEditCreate()">
<mat-icon>done</mat-icon>
</button>
<button mat-icon-button color="primary" (click)="row.cancelOrDelete()">
<mat-icon *ngIf="row.editing">undo</mat-icon>
<mat-icon *ngIf="!row.editing">delete</mat-icon>
</button>
</mat-cell>
</ng-container>

Expand Down Expand Up @@ -226,5 +234,8 @@ class PersonValidatorService implements ValidatorService {
Any suggestion or contribution will be appreciated.


## Change log

See [Change log](./doc/changelog.md)


Loading