# table-reactive-generator

> An example module

Latest version **0.0.4** (published 2019-04-11) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install table-reactive-generator
pnpm add table-reactive-generator
yarn add table-reactive-generator
bun add table-reactive-generator
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2019-04-11 |
| First published | 2019-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 23.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | raulalr |

## Links

- npm: https://www.npmjs.com/package/table-reactive-generator
- npm.io page: https://npm.io/package/table-reactive-generator

## Recent versions

- 0.0.4 (latest) — 2019-04-11
- 0.0.3 — 2019-04-11
- 0.0.2 — 2019-04-11
- 0.0.1 — 2019-04-11
- 0.0.0 — 2019-04-11

## README

# AngularZero

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.7.1.

## @Input variables

The component has this entry variables format:

### classMap
classMap contains the class classes that will add style the table
```typescript
    classMap = ['class1', 'class2', 'class3' ...];
```

### dataSource
dataSource contains the data that filled the rows
```typescript
    dataSource = [
        { data1: 'data1'},
        { data2: 'data2'}
    ];
```

### dataColumnsTable
dataColumnsTable contains the data that filled the th and sort options. The name of column will be the same that sortArtibute
```typescript
    interface TableCell {
        label: string; // Name of column
        name: string; // Name of dataSource instance
        sort?: boolean; //Is sorteable
    }
    dataColumnsTable: TableCell[] = [
        { 
            label: 'DATA1';
            name: 'data1';
            sort: true;
        },
        { 
            label: 'DATA2';
            name: 'data2';
        },
    ];
``` 

### rowClick
rowClick contains the function which will be excute when you click in row
```typescript
    rowClick:Function = function() { }
```

### sortOptions
sortOptions contains the configuration of sort
```typescript
    interface SortOption {
        activeSort?: string; // Default active column
        direction?: SortDirection; // Direction of sort
        sortChange?: Function; // It contains the function which will be execute when sort is clicked
    }
```

## Installation
Install package: npm i --save table-reactive-generator

Imports the component module

Inject component in HTML
```html
<app-table-generator [classMap]="" [dataSource]="" [dataColumnsTable]="" [rowClick]="" [sortOptions]=""></app-table-generator>
```

---
_Source: https://npm.io/package/table-reactive-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
