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

bp-smart-forms

v0.2.0

Published

A modern, feature-rich Angular data grid component built on PrimeNG, with sorting, filtering, pagination and dynamic cell renderers.

Readme

bp-smart-forms

A modern, feature-rich Angular data grid component built on PrimeNG, with server-side-friendly sorting, filtering, pagination, and dynamic cell renderers.

Installation

npm install bp-smart-forms primeng @primeuix/themes

Peer Dependencies:

  • @angular/core, @angular/common, and @angular/forms (^21.2.0+)
  • primeng (^21.1.9+)

Setup

1. Configure PrimeNG Theme

In your app.config.ts, import and configure PrimeNG with a theme:

import { providePrimeNG } from 'primeng/config';
import { Aura } from '@primeuix/themes';

export const appConfig: ApplicationConfig = {
  providers: [
    providePrimeNG({
      theme: {
        preset: Aura,
        options: {
          darkModeSelector: '.dark',
        }
      }
    })
  ]
};

2. Import PrimeIcons CSS

Add to your global styles.scss:

@import '@primeuix/icons/index.css';

Note: Tailwind CSS is not required by this library — it's only used in this repository's demo app.

Usage

Import the SmartGridModernizedComponent and use it as a standalone component:

import { SmartGridModernizedComponent, DynamicColDef } from 'bp-smart-forms';

@Component({
  selector: 'app-my-grid',
  standalone: true,
  imports: [SmartGridModernizedComponent],
  template: `
    <bp-smart-grid-modernized
      [(data)]="gridData"
      [(columns)]="gridColumns"
      [(loading)]="isLoading"
      [storageName]="'my-grid-state'"
      (onRowClick)="onRowSelected($event)"
    />
  `
})
export class MyGridComponent {
  gridData: any[] = [];
  isLoading = false;

  gridColumns: DynamicColDef[] = [
    { field: 'name', header: 'Name', sortable: true, filterable: true },
    { field: 'email', header: 'Email', sortable: true, filterable: true },
    { field: 'createdAt', header: 'Created', type: 'date', sortable: true }
  ];

  onRowSelected(row: any): void {
    console.log('Row clicked:', row);
  }
}

Component API

SmartGridModernizedComponent

Inputs

| Input | Type | Description | |-------|------|-------------| | data | T[] | Array of data items to display in the grid. | | columns | DynamicColDef[] | Required. Column definitions. See DynamicColDef interface below. | | loading | boolean | Show loading spinner when true. | | height | string | Grid height (default: '1000px'). | | title | string | Optional grid title. | | storageName | string | Required. Key for persisting grid state (sorting, filters, pagination) to localStorage. | | tableState | CustomTableState | Current table state (sorts, filters, pagination). | | totalRecords | number | Total record count for pagination. | | placeholder | string | Search input placeholder (default: 'Saisir...'). | | customComponents | { [key: string]: Type<ICellRendererAngularComp> } | Map of custom cell renderer components. | | itemRendererComponent | Type<ICellRendererAngularComp> | Default component for rendering custom cells. | | itemRendererComponentParams | any | Params to pass to the custom cell renderer. | | itemPropertyName | string | Property name to pass to the item renderer. | | lineItemComponent | Type<ICellRendererAngularComp> | Custom component for rendering row items. | | styleClass | string | Additional CSS class for styling the grid. |

Outputs

| Output | Type | Description | |--------|------|-------------| | onRowClick | EventEmitter<T \| T[] \| undefined> | Emitted when a row is clicked. |

Exported Types

DynamicColDef

Configuration for a single column:

interface DynamicColDef {
  field: string;                           // Data field name
  header: string;                          // Column header text
  sortable?: boolean;                      // Enable sorting
  sortField?: string;                      // Override field used for sorting
  filterable?: boolean;                    // Enable filtering
  type?: 'text' | 'date' | 'number' | 'boolean' | 'select' | 'custom' | 'array';
  filterMatchMode?: string | string[] | { [key: string]: string };
  specialFilter?: boolean;                 // Custom filter logic
  valueFormatter?: (data: any) => string; // Format cell value for display
  cellRenderer?: Type<ICellRendererAngularComp> | string; // Custom cell component
  cellRendererParams?: any;                // Params for cell renderer
  width?: string;                          // Column width (e.g., '150px', '20%')
  options?: any[];                         // Select filter options
  fetchOptions?: () => Observable<any[]>; // Async option loader
  optionLabel?: string;                    // Select option label field
  optionValue?: string;                    // Select option value field
}

Other Exported Types

  • SmartGridModernizedComponent<T> — Main grid component
  • CustomSortComponent — Sort indicator component
  • ICellRendererAngularComp — Interface for custom cell renderers
  • SortOrder — Type for sort direction (-1 | 0 | 1)
  • SortCriterion — Sort definition (field + order)
  • CustomTableState — Table state (pagination, sorting, filters)
  • INITIAL_STATE — Default table state constant
  • DATE_FILTER_MATCH_MODES — Predefined date filter options

License

MIT