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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-material-dynamic-table

v1.0.15

Published

Componente angular dinâmico que ajuda a criar uma tabela utilizando o Angular material, de maneira fácil e rápida.

Downloads

73

Readme

Tabela dinâmica com Angular Material

Componente angular dinâmico que ajuda a criar uma tabela utilizando o Angular material, de maneira fácil e rápida.

Recursos

  • tabela com dados dinâmicos
  • botões de ações
  • paginação
  • ordenação de colunas

Depêndencias

| DynamicTable | Angular |
| ------------- |:-------------:| | 1.0.0 | 9.x |

Install

npm install ngx-material-dynamic-table --save

Setup

  1. Adicione o css dos icones o material ao seu , e o css de algum tema do material
@import "~material-design-icons/iconfont/material-icons.css";
@import "@angular/material/prebuilt-themes/deeppurple-amber.css";
  1. Adicione o DynamicTableModule ao seu NgModule, e também o browser animations
  import { CommonModule } from '@angular/common';
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

  import { NgxMaterialDynamicTableModule } from 'ngx-material-dynamic-table';

  @NgModule({
    imports: [
      CommonModule,
      BrowserAnimationsModule, // required animations module
      NgxMaterialDynamicTableModule // DynamicTable added
    ],
    bootstrap: [App],
    declarations: [App]
  })
  class MainModule {}

Como utilizar


  <ngx-material-dynamic-table
    [dataSource]="dataSource"
    [displayedColumns]="displayedColumns"
    [actions]="actions"
    [filter]="filter"
    (sendClick)="rowAction($event)"
  >
  </ngx-material-dynamic-table>
public displayedColumns: any = [{ column: 'id', title: 'id' }, { column: 'name', title: 'name' }, { column: 'email', title: 'email' }];
public actions = [{ column: 'read', title: 'read' }, { column: 'update', title: 'update' },{ column: 'delete', title: 'delete' }];
public filter = false;
public dataSource = [
  {
    'id': 1,
    'name': 'Leanne Graham',
    'username': 'Bret',
    'email': '[email protected]'
  },
  {
    'id': 2,
    'name': 'Ervin Howell',
    'username': 'Antonette',
    'email': '[email protected]'
  }   
];
rowAction(row){
  // you can create your callback functions after clicked in actions buttons
  console.log(row)
}

Propriedades

Obrigatórios

| propriedades | tipo | valor padrão | descrição
| ------------- |:-------------:|:-------------:|:-------------:| | Input() dataSource | [ ] any | [] | Deve ser a lista de linhas da dados, onde a chave é o nome da coluna e o valor, o valor exibido na linha correspondente a coluna | | Input() displayedColumns | [ ] < ColumnsConfig > | [] | Deve ser a lista de colunas que deverão ser exibidas na sua tabela, onde column = a coluna representada e title = nome a ser exibido |

Opcionais

| propriedades | tipo | valor padrão | descrição
| ------------- |:-------------:|:-------------:|:-------------:| | Input() actions | [ ] < ColumnsConfig > | [] | Lista de ações disponiveis que deverão esta disponivel nesta tabela (editar, deletar, etc) | | Input() filter | boolean | true | Se deve ser exibido um input de filtro na tabela | | Output() sendClick | EventEmitter | | Evento emitido ao clicar em uma das ações disponiveis da lista, envia a ação clicada e os valores da linha |

Configurações

| propriedades | tipo | valor padrão | descrição
| ------------- |:-------------:|:-------------:|:-------------:| | Input () buttonsConfig | Object < ButtonsConfig > | { read: { icon: 'search', name: 'read', tooltip: 'Visualizar' }, update: { icon: 'edit', name: 'edit', tooltip: 'Editar' }, delete: { icon: 'delete', name: 'delete', tooltip: 'Excluir' }, download: { icon: 'arrow_downward', name: 'download', tooltip: 'Download' }} | Objeto de configurações das ações disponvel no package da tabela dinamica, com o nome, icone, e texto do tooltip dos botões |

Interfaces

ColumnsConfig

| nome | descrição
| ------------- |:-------------:| | icon: string | classe do icone do botão | | name: string | nome da coluna | | tooltip: string | nome de exibição |

ButtonsConfig

| nome | descrição
| ------------- |:-------------:| | column: string | nome de referencia da coluna no objeto dataSource | | title: string | nome da coluna a ser exibido |