npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ebrin-kanga/ng-datatable

v0.0.1

Published

Bibliothèque Angular de composant tableau de données avec pagination, tri, recherche et sélection.

Readme

Datatable

Bibliothèque Angular de composant tableau de données avec pagination, tri, recherche et sélection.

Installation

npm install @ebrin-kanga/ng-datatable primeicons
# ou
pnpm add @ebrin-kanga/ng-datatable primeicons

Dépendances peer

  • @angular/animations ^18.0.0
  • @angular/common ^18.0.0
  • @angular/core ^18.0.0
  • @angular/forms ^18.0.0
  • primeicons ^7.0.0 (pour les icônes de tri et pagination)

Note: Le template utilise des classes Tailwind CSS. Assurez-vous que votre projet a Tailwind configuré.

Utilisation

Import dans votre composant

import { DatatableComponent, DataTableColumn } from '@ebrin-kanga/ng-datatable';

@Component({
  standalone: true,
  imports: [DatatableComponent],
  template: `
    <lib-datatable
      [columns]="columns"
      [data]="data"
      title="Ma liste"
      [pagination]="true"
      (action)="onAction($event)"
    ></lib-datatable>
  `
})
export class MyComponent {
  columns: DataTableColumn[] = [
    { key: 'id', label: 'ID', sortable: true },
    { key: 'name', label: 'Nom', sortable: true },
    { key: 'amount', label: 'Montant', format: 'currency', islastLine: true }
  ];
  data = [
    { id: 1, name: 'Item 1', amount: 1000 },
    { id: 2, name: 'Item 2', amount: 2500 }
  ];

  onAction(event: { type: string; row: any }) {
    console.log(event);
  }
}

Configuration des colonnes

| Propriété | Type | Description | |-----------|------|-------------| | key | string | Clé de la donnée (supporte user.name pour les chemins imbriqués) | | label | string | Libellé de l'en-tête | | sortable | boolean | Active le tri sur la colonne | | format | string | 'number', 'number:2', 'currency', 'date', 'datetime', 'percentage' | | islastLine | boolean | Affiche une ligne de total/somme en bas | | lastLineValue | (data) => string | number | Fonction personnalisée pour la ligne de total | | minWidth | string | Largeur minimale (ex: '100px') | | maxWidth | string | Largeur maximale |

Slots de contenu

<lib-datatable [columns]="columns" [data]="data">
  <!-- Actions au-dessus du tableau -->
  <div data-table-actions-sup>
    <button>Action supérieure</button>
  </div>
  <!-- Actions à côté de la recherche -->
  <div data-table-actions>
    <button>Filtre</button>
  </div>
  <!-- Indicateur de chargement personnalisé (nécessite DataTableLoadingDirective) -->
  <div data-table-loading>
    <app-loading></app-loading>
  </div>
</lib-datatable>

Pagination côté serveur

serverSidePagination = true;
totalElements = 100;
currentPage = 1;
currentPageSize = 10;

// Écouter les événements
onPageChange(page: number) { /* ... */ }
onPageSizeChange(size: number) { /* ... */ }
onSearchChange(term: string) { /* ... */ }
onSortChange(event: { key: string; direction: 'asc' | 'desc' }) { /* ... */ }

Build

ng build datatable

Les artifacts sont dans dist/datatable.

Tests

ng test datatable