@enigmatry/entry-table
TypeScript icon, indicating that this package has built-in type declarations

1.15.1-preview.33 • Public • Published

Entry table

Reusable table component with context menu, sorting and paging.

Installation

npm install @enigmatry/entry-table

Basic Usage

Import the EntryTableModule in your feature.module or shared.module

import { EntryTableModule } from '@enigmatry/entry-table';

component.ts

import { PagedData, ContextMenuItem, ColumnDef } from '@enigmatry/entry-table';

@Component({
...
})
export class UserListComponent implements OnInit {

  @Input() data: PagedData<GetUsersResponseItem> | null;

  @Input() columns: ColumnDef[] = [];
  @Input() contextMenuItems: ContextMenuItem[] = [];

  constructor() { }

  ngOnInit(): void {
    this.columns = [
      { field: 'id', hide: true, sortable: true },
      { field: 'userName', header: `E-mail`, hide: false, sortable: true },
      { field: 'name', header: `Name`, hide: false, sortable: true },
      { field: 'createdOn', header: `Created on`, hide: false, sortable: true, type: 'date' },
      { field: 'updatedOn', header: `Updated on`, hide: false, sortable: true, type: 'date' }
    ];
    this.contextMenuItems = [
      { id: 'edit', name: `Edit`, icon: 'edit' }
    ];
  }
}

component.html

<entry-table
    [columns]="columns"
    [data]="data"
    [showPaginator]="true"
    [showContextMenu]="true"
    [contextMenuItems]="contextMenuItems"
    (pageChange)="pageChange.emit($event)"
    (sortChange)="sortChange.emit($event)"
    (rowSelectionChange)="selectionChange.emit($event)"
    (contextMenuItemSelected)="contextMenuItemSelected.emit($event)">
</entry-table>

Compatibility with Angular Versions

@enigmatry/entry-table Angular version
1.14.x = 14
1.15.x = 15

License

Apache-2 © Enigmatry

Readme

Keywords

none

Package Sidebar

Install

npm i @enigmatry/entry-table

Weekly Downloads

2

Version

1.15.1-preview.33

License

Apache-2.0

Unpacked Size

295 kB

Total Files

48

Last publish

Collaborators

  • typhoon41
  • edekoning
  • msljivic
  • avanwaas