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

@acpaas-ui/ngx-table

v6.0.10

Published

This module provides the components to build an _"Interactive Table"_

Downloads

97

Readme

@acpaas-ui/ngx-table

This module provides the components to build an "Interactive Table"

The module contains:

  • Table Component
    • Table Cell Component
  • Table Bar Component
    • auiTableBarItem
    • auiTableBarSearch
  • Column Selector component
  • Table Class
  • Table Helper Service

Usage

import { TableModule } from '@acpaas-ui/ngx-table';

Documentation

Visit our documentation site for full how-to docs and guidelines

Table module

API

| Name | Default value | Description | | ------------------------------------------ | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | @Input() rows: any[]; | [] | This option has to be an array of objects. | | @Input() columns: (TableColumn | string)[]; | [] | An array of TableColumns or an array of strings. Use this option to define and manage the columns of the table. | | @Input() loading: boolean; | false | Use this option to give the aui-table a loading state. To show the loading state set loading = true. | | @Input() responsive: boolean; | true | By default all tables are responsive. Set to false to disable this feature. | | @Input() hasClickAction: boolean; | false | By default a table row doesn't have a click action. Setting it to true enables this feature and emits the row's data via rowClicked. | | @Input() activeSorting: OrderBy; | - | This option has to be an array of objects. When you do not provide this property, column sorting buttons will be hidden. | | @Input() noDataMessage: string; | 'Loading data...' | The message to show when the table holds no data. | | @Input() loadDataMessage: string; | 'No data available.' | The message to show when the table is loading data. | | @Input() noColumnsMessage: string; | 'No columns available.' | The message to show when the table has no visible. | | @Output() orderBy: EventEmitter<any>; | - | This event will be fired when the user changes the sorting of the columns. | | @Output() rowClicked: EventEmitter<any>; | - | this event will be fired when the row gets clicked. |

Example

import { TableModule } from '@acpaas-ui/ngx-table';

@NgModule({
    imports: [
        TableModule
    ]
});

export class AppModule {};
import { Component } from '@angular/core';
import { Cell } from '@acpaas-ui/ngx-table';

@Component({
  template: `
    <button type="button" class="a-button has-icon" title="View {{ data?.firstName }}'s profile">
      <aui-icon name="ai-view-1"></aui-icon>
    </button>
  `,
})
export class TableActionComponent implements Cell {
  public data: any;
}
public columns: TableColumn[] = [
	{
		label: '#',
		value: 'id',
	},
	{
		label: 'First Name',
		value: 'firstName',
	},
	{
		label: 'Last Name',
		value: 'lastName',
	},
	{
		label: 'Registered',
		value: 'registeredAt',
		format: (value) => this.datePipe.transform(value, 'dd/MM/yyyy'),
	},
	{
		label: 'Actions',
		component: TableActionComponent,
	},
];

public rows = [
    {
        'id': 0,
        'firstName': 'Wyatt',
        'lastName': 'Cooper',
        'registeredAt': 'Sat Feb 07 1981 01:04:46 GMT+0000 (UTC)',
    },
    {
        'id': 1,
        'firstName': 'Mullen',
        'lastName': 'Ballard',
        'registeredAt': 'Fri Aug 31 2001 06:47:22 GMT+0000 (UTC)',
    },
    {
        'id': 2,
        'firstName': 'Sonia',
        'lastName': 'Bass',
        'registeredAt': 'Sat Jul 12 1975 16:00:43 GMT+0000 (UTC)',
    },
    {
        'id': 3,
        'firstName': 'Kristen',
        'lastName': 'Moore',
        'registeredAt': 'Mon Nov 09 2015 16:11:21 GMT+0000 (UTC)',
    },
    {
        'id': 4,
        'firstName': 'Moss',
        'lastName': 'Bowen',
        'registeredAt': 'Thu Aug 04 1977 05:52:52 GMT+0000 (UTC)',
    },
    {
        'id': 5,
        'firstName': 'Elaine',
        'lastName': 'Michael',
        'registeredAt': 'Wed Mar 30 1977 01:48:30 GMT+0000 (UTC)',
    },
    {
        'id': 6,
        'firstName': 'Jerri',
        'lastName': 'Hicks',
        'registeredAt': 'Wed Jul 10 2013 22:53:48 GMT+0000 (UTC)',
    },
    {
        'id': 7,
        'firstName': 'Sharron',
        'lastName': 'Castro',
        'registeredAt': 'Mon Sep 27 1976 07:55:10 GMT+0000 (UTC)',
    },
    {
        'id': 8,
        'firstName': 'Harriett',
        'lastName': 'Horton',
        'registeredAt': 'Wed Aug 18 2010 14:06:33 GMT+0000 (UTC)',
    },
    {
        'id': 9,
        'firstName': 'Griffin',
        'lastName': 'Navarro',
        'registeredAt': 'Tue Oct 24 2017 23:45:35 GMT+0000 (UTC)',
    },
];


public loading = false;

constructor(
	private datePipe: DatePipe
) { }
<aui-table
  noDataMessage="There is no data!"
  loadDataMessage="Loading..."
  noColumsMessage="There are no columns!"
  [loading]="loading"
  [columns]="columns"
  [rows]="rows"
>
</aui-table>

Contributing

Visit our Contribution Guidelines for more information on how to contribute.