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

angular-switchable-grid

v2.0.0

Published

[![npm version](https://badge.fury.io/js/angular-switchable-grid.svg)](https://badge.fury.io/js/angular-switchable-grid) [![npm all downloads](https://img.shields.io/npm/dt/angular-switchable-grid.svg)](https://badge.fury.io/js/angular-switchable-grid) [!

Downloads

75

Readme

Angular Switchable Grid

npm version npm all downloads npm week downloads npm month downloads npm  year downloads npm license

A simple grid for angular, Which can be switched between typical List view and a tile block view

Demo

https://sanuradhag.github.io/angular-switchable-grid/

Installation

Install through npm;

npm install --save angular-switchable-grid

Then import GridModule and include it in your apps for module.

import { Component, NgModule } from '@angular/core';
import { GridModule } from 'angular-switchable-grid';
 
@NgModule({
  imports: [
    GridModule
  ]
})
export class MyModule {}

Then add angular-switchable-grid to your app template.

<angular-switchable-grid
  [data]="data"
  [columns]="columnTitles"
  [enableSelection]="true"
  [enableMultiSelect]="true"
  [filterBy]="'first_name'"
  [filterTerm]="filterTerm"
  [enableSort]="true"
  [isGridView]="isGridView"
  [noDataTemplate]="null"
  (getSelectedItems)="getSelectedItems($event)">

  <ng-template let-item>
    <div>{{item.id}}</div>
    <div>{{item.first_name}}</div>
    <div>{{item.last_name}}</div>
    <div>{{item.email}}</div>
    <div>{{item.gender}}</div>
    <div>{{item.ip_address}}</div>
  </ng-template>

</angular-switchable-grid>

Styles

Style guide will be added soon.

Documentation

angular-switchable-grid properties.

Property| Input/Output| Default value | Description | -------| --------|-------|:--------------| |[data]| Input | [] - empty array |The data to be displayed in the grid.| |[columns]| Input| [] - empty array | Titles of the columns in the grid. Type should be Array<{ property: string, displayName: string, width?: string }>| |[enableSelection]| Input| false| Enable the selection of the rows of the grid.| |[enableMultiSelect]| Input| false| Enable the multiple selection of the rows of the grid.| |[filterBy]| Input| '' - empty string| Grid will be filtered by this key.| |[filterTerm]| Input| '' - empty string| Grid will filter its's content by the filterBy and will display only the items which are similar to the this.| |[enableSort]| Input | false |Enables sorting in the grid| |[enablePagination]| Input | false |Enables pagination in the grid| |[isGridView]| Input | false |If sets to true, Grid's view will be changed to Tile view from List view.| |[noDataTemplate]| Input | Simple text 'No Data' | The template that will be displayed when there is no data.| |(getSelectedItems)| Output | [] - empty array | Will emit the selected items when user is selecting items from the grid.|

And should pass a template for the row template.

 <ng-template let-item>
        <div>{{item.id}}</div>
        <div>{{item.first_name}}</div>
        <div>{{item.last_name}}</div>
        <div>{{item.email}}</div>
        <div>{{item.gender}}</div>
        <div>{{item.ip_address}}</div>
 </ng-template>
 

Public methods that can be used to access features of the grid.

exportAsExcelFile() - Export the grid data to a excel file.
selectAll() - Select all the items in the grid.
deselectAll() - Deselect all selected item in the grid.

ToDo

  • Grid pagination.
  • Lazy loading.

Any suggestions?

Drop me a e-mail [email protected].

Or open a new issue in https://github.com/sanuradhag/angular-switchable-grid/issues

Contributors

Anuradha Gunasekara| Brion Mario| | :---: | :---: |

License

This software is licensed under the MIT license