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

crud-grid

v1.0.1

Published

Crud Grid is a data-table based on material table with CRUD operation.

Downloads

5

Readme

ChnimComponents

Crud Grid is a data-table based on material table with CRUD operation.

Feature

✅ Display data : generate columns dynamically from the given modelSchema.

✅ Add new item : generate forms match the model types (supported inputs : text, number, email, date and select).

✅ Edit item : generate inline forms match the model types to edit the selected row.

✅ Delete item : Delete the selected row.

✅ Filtering and pagination.

demo

https://stackblitz.com/edit/crud-grid-example

Usage

app.module.ts

import { CrudGridModule } from 'crud-grid';

@NgModule({
  ...
  imports: [
    CrudGridModule
    ...
  ],
...
})

app.component.html

<crud-grid [showFilter]="true" [modelSchema]="UserSchema" [dataSource]="dataSource" 
    (HandleRowEvent)="handleRowAction($event)"></crud-grid> 

app.component.ts

export class AppComponent {
  opt = [{ label: "male", value: "M", isSelected: true }, { label: "female", value: "F", isSelected: false }];
  dataSource: user[] = [
    new user(1, this.opt , "sami","kh", "[email protected]", "22 888 999"),
    new user(2, this.opt , "rami", "ba","[email protected]" ,"44 555 666"),
  ]
  UserSchema = { 
    id: "number",
    gender: { 
      type: "select",
       data: [
         { label: "male", value: "M", isSelected: false },
         { label: "female", value: "F", isSelected: false }
    ]},
    name: "text",
    lastName: "text",
    email: "text",
    phone: "text",
  }

  handleRowAction(row: user) {
    if (row.isDeleted) {
      this.dataSource = this.dataSource.filter(x => x.id !== row.id);
    }
    else if (row.isAdded) {
      console.log(this.dataSource)
      this.dataSource = [row, ...this.dataSource]
    }
    else if (row.isUpdated) {
      let ind = this.dataSource.findIndex(x => x.id === row.beforeUpdate.id);
      if (ind > -1){
        this.dataSource[ind] = row.afterUpdate;
      }
    }
  }
}

Models

Crud grid also provides a base model such as GridEntityBase and SelectData to use when defining the model to display in the grid.

for example :

export class user extends GridEntityBase {
  constructor(
    public id: number,
    public gender: SelectData[],
    public name: string,
    public lastName: string,
    public email: string,
    public phone: string,
  ) { super() }
}

Important note: the modelSchema and the model that represent the row of data must have the same property name (like userSchema and user in this example)

Configuration Options

Property | Type | Description | Default | required ---------|------|------------ | ------- | ------- @Input showFilter | boolean | Determines whether the input filter is display or not | false | false @Input dataSource | any[] | Data that will populate the table fields | undefined | true @Input modelSchema | any | An object to Determine the types of edit form or add form will be displayed | undefined | true @Output HandleRowEvent | EventEmitter | emits an object with supplementary metadata represents the modified row whether added, updated or deleted | - | -