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-table-nested

v1.30.13-rc

Published

The ngx-table-nested angular library provides a powerful nested table built on top of `@swimlane/ngx-datatable` with the ability to collapse rows to display a second table with a different column configuration than the parent. It allows you to create fle

Downloads

295

Readme

Logo

Description

The ngx-table-nested angular library provides a powerful nested table built on top of @swimlane/ngx-datatable with the ability to collapse rows to display a second table with a different column configuration than the parent. It allows you to create flexible and organised user interfaces to display hierarchical and structured data.

Badge Badge Badge

🌒 Content

📖 Requirements

brew install node 
npm install -g @angular/cli 
npm install @swimlane/ngx-datatable 

🪤 Usage

[!IMPORTANT] you need to have installed @swimlane/ngx-datatatable

Once you have installed ngx-table-nested, you can import it in your AppModule:


import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {NgxDatatableModule} from '@swimlane/ngx-datatable';
import {AppComponent} from './app.component';
import {NgxDatatableModule} from '@swimlane/ngx-datatable';
// Import your TableNestedComponent
import {TableNestedComponent} from 'ngx-table-nested';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    NgxDatatableModule,
    // Specify TableNestedComponent as an import
    TableNestedComponent
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
}


Or you can import it in your AppComponent (for this example):

import {Component, inject} from '@angular/core';
import {NgxDatatableModule} from '@swimlane/ngx-datatable';
import {TableNestedComponent} from '@ngx-table-nested';
import {NgxDatatableModule} from '@swimlane/ngx-datatable';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  standalone: true,
  imports: [NgxDatatableModule, TableNestedComponent],
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
}

Configure styles

  • Now, let's import lib styles, include default nested-table CSS file into your `angular.json file:
  {
    "styles": [
      "node_modules/@nebular/theme/styles/prebuilt/default.css"
    ]
}

In your html

  • HTML

<ngx-table-nested
  [theme]="lightTheme"
  [dataTable]="data"
  [columns]="columnConfig"
  [childrenKey]="'ingredients'"
  [childrenColumns]="childrenColumnConfig"
  [actionConfig]="actionConfig"
/>

🛠 Features

  • Use simplify
  • Nested tables with different (or the same) column configurations
  • Light/Dark theme support
  • Client side render
  • Standalone components standards
  • Jasmine test on 83% coverage
  • Column template support (images, tags, text, buttons, icons)

🌐 API

Components

TableNestedComponent

  • Inputs

| Input | Default | Type | Description | |-----------|-----------|--------------------|-------------------------------------| | dataTable | undefined | TableConfigModel | Configuration data for the table | | limit | 5 | number | Number of rows of show in the table | | theme | light | TableThemeEnum | Theme of the table |


  • Outputs

| Output | Default | Type | Description | |--------------------|---------|------------------------------------|---------------------------------------------------------------| | onRowClick | | EventEmitter<TableEventRowClick> | Callback to invoke when row is clicked on | | onRowClickChildren | | EventEmitter<TableEventRowClick> | Callback to invoke when the row of the child table is clicked |


TableBasicComponent

  • Inputs

| Input | Default | Type | Description | |-----------|-----------|--------------------|-------------------------------------| | dataTable | undefined | TableConfigModel | Configuration data for the table | | limit | 5 | number | Number of rows of show in the table | | theme | light | TableThemeEnum | Theme of the table |


  • Outputs

| Output | Default | Type | Description | |------------|---------|------------------------------------|-------------------------------------------| | onRowClick | | EventEmitter<TableEventRowClick> | Callback to invoke when row is clicked on |


Enums

  • ContentTypeColumnEnum
enum ContentTypeColumnEnum {
  'icon' = 'icon',
  'tag' = 'tag',
  'text' = 'text',
  'image' = 'image'
}
  • ActionTypeEnum
enum ActionTypeEnum {
  update = 'update',
  delete = 'delete',
  create = 'create',
  positive = 'positive',
  negative = 'negative',
}
  • TableThemeEnum
enum TableThemeEnum {
  'light' = 'light',
  'dark' = 'dark'
}

Interface

  • TableEventRowClick

| properties | Default | Type | Description | |------------|----------|------------------|----------------------------------------| | type | update | ActionTypeEnum | Type defining the action | | row | any | T | Generic type received by the interface |


  • TableColumnModel

| properties | Default | Type | Description | |------------|-------------|-------------------------|---------------------------------| | field | undefined | string | property to display in the cell | | header | undefined | string | text in column header | | sort | false | boolean | enable sorting | | resize | false | boolean | enable resize | | grow | 1 | number | column width in fraction | | type | text | ContentTypeColumnEnum | column type |


  • TableIconActionColumnModel

| properties | Default | Type | Description | |------------|-------------|----------|-------------| | icon | undefined | string | icon name | | class | undefined | string | icon class |


  • TableActionColumnModel

| properties | Default | Type | Description | |------------|-------------|------------------------------|----------------------------------------| | label | undefined | string | text in button | | icon | undefined | TableIconActionColumnModel | icon in button | | type | update | ActionTypeEnum | type of action | | tooltip | undefined | string | tooltip to show | | click | undefined | Function | function that invokes after the click |


  • TableActioneConfigModel

| properties | Default | Type | Description | |------------|------------|----------------------------|------------------------| | data | [] | TableActionColumnModel[] | list of actions | | header | Acciones | string | text in header column |


  • TableMessageConfigModel

| properties | Default | Type | Description | |------------|-------------|----------|------------------------------------------| | empty | undefined | string | is displayed when there is no data | | error | undefined | string | is displayed when an error has occurred |


  • TableExtraConfigModel

| properties | Default | Type | Description | |------------|-------------|----------------------------|---------------------| | actions | undefined | TableActioneConfigModel | actions config | | messages | undefined | TableMessageConfigModel | messages config | | config | undefined | TableCellViewConfigModel | column types config | | selection | undefined | SelectionType | section type | | sortType | single | SortType | sort type | | columnMode | flex | ColumnMode | column mode type |


  • TableChildrenConfigModel

| properties | Default | Type | Description | |------------|-------------|-------------------------|-------------| | field | undefined | string | | | columns | [] | TableColumnModel[] | | | extra | undefined | TableExtraConfigModel | | | limit | 5 | number | |


  • TableConfigModel

| properties | Default | Type | Description | |------------|-------------|----------------------------|-------------| | data | children | T | | | columns | [] | TableColumnModel[] | | | extra | undefined | TableExtraConfigModel | | | children | 5 | TableChildrenConfigModel | |


🚀 Building

Generate installer file (.tgz) locally

  • Install dependency locally

npm install 
  • Compile library

ng build ngx-table-nested 
  • Generate installer

npm pack ngx-table-nested 

📈 Stats

Most Used Languages

GitHub Langs