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

@universis/ngx-tables

v6.2.0

Published

An implementation of [datatables.net](https://github.com/DataTables/DataTables) for [Universis project](https://gitlab.com/universis) applications.

Downloads

294

Readme

@universis/ngx-tables

An implementation of datatables.net for Universis project applications.

Installation

Install @universis/ngx-tables in an angular cli by executing:

npm i @universis/ngx-tables

Important note: Don't forget to install peer dependencies also.

Usage

Import TablesModule:

# app.module.ts
import { TablesModule } from '@universis/ngx-tables';
...
imports: [
  CommonModule,
  BrowserModule,
  HttpClientModule,
  TranslateModule.forRoot(),
  SharedModule.forRoot(),
  RouterModule,
  ...
  ...
  TablesModule
],

Add AdvancedTableComponent:

<app-advanced-table #table [config]="tableConfiguration"></app-advanced-table>

and load a table configuration:

export const TABLE1_COFIGURATION = {
  "title": "Students",
  "model": "Students",
  "searchExpression":"indexof(person/familyName, '${text}') ge 0 or indexof(person/givenName, '${text}') ge 0",
  "selectable": false,
  "multipleSelect": false,
  "columns": [
    {
      "name":"id",
      "property": "id",
      "hidden": true
    },
    {
      "name":"person/familyName",
      "property": "familyName",
      "title":"Family Name"
    },
    {
      "name":"person/givenName",
      "property": "givenName",
      "title":"Given Name"
    },
    ...
  ],
  "criteria": [
    {
      "name": "studentName",
      "filter": "(indexof(person/familyName, '${value}') ge 0 or indexof(person/givenName, '${value}') ge 0)",
      "type": "text"
    },
    {
      "name": "username",
      "filter": "(indexof(user/name, '${value}') ge 0)",
      "type": "text"
    },
    ...
  ],
  "searches": [
  ],
  "defaults":{
    "filter": "studentStatus/alternateName eq eq 'active'"
  },
  "paths" : [
  ]
}

Use this configuration in component:

# table1.component.ts
import {TABLE1_COFIGURATION} from './table1.configuration';
@Component({
  selector: 'app-table1',
  templateUrl: './table1.component.html'
})
export class Table1Component implements OnInit {
  
  public tableConfiguration: any = TABLE1_COFIGURATION;
  public filter: any = {};
  
  constructor() {
  }

  ngOnInit() {
  }

}

AdvancedTableComponent uses table configuration to load data from the given model and draw datatable. Use AdvancedTableComponent.configSrc to load table configuration from a json file.

<app-advanced-table #table [autoLoad]=false [configSrc]="'/assets/tables/table3.config.json'"></app-advanced-table>

AdvancedSearchComponent enables search operation against a loaded datatable.

<app-advanced-table-search #advancedSearch [mergeQueryParams]="true" [(filter)]="filter.value" [collapsed]="false" [showMore]="true" [table]="table">
 <advanced-search>
      <app-advanced-search-form [formSrc]="'/assets/tables/table2.search.json'" #search [(filter)]="filter.value"></app-advanced-search-form>
  </advanced-search>
</app-advanced-table-search>

AdvancedSearchComponent has a simple text box for text search based on AdvancedTableComponent#config.searchExpression expression.

AdvancedSearchComponent may also have an advanced search form for searching by using lookup tables, numbers, booleans etc.