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-bootstrap4-table-tools

v3.2.2

Published

Angular validation plugin for Bootstrap 4.

Downloads

6

Readme

Angular TableTools Plugin

Plugin that makes working with tables easier. Through various set of directives it enables you to easily create a pagination, sort table data, filter it and many more.

It uses Bootstrap 4 and Font Awesome for better presentation.

See Live Demo for an example.

Prerequisites

Installation

yarn add angular-bootstrap4-table-tools
yarn install

Configuration

Language strings and other defaults are configurable through the TableToolsConfig service.

class AppComponent {
	constructor(config: TableToolsConfigService) {
		config.perPage = 10;
	}
}

Usage

See Live Demo and its source code to better understand all of available components and its usage.

Basic usage

Create an tableTools instance via TableToolsService.create(config) method. Table data should be an array of objects.

This instance needs to be bound to your table container via [tableTools] directive.

Filtered data is available via instance.data property which is an Observable.

tableToolsInstance: ITableTools<T>; // pass your row type as generic argument

this.tableToolsInstance = tableToolsService.create({
	collection: [] // table data
});
<div [tableTools]="tableToolsInstance">
	<div *ngFor="let d of tableToolsInstance.data | async">
		{{d}}
	</div>
</div>

You can change the default order of data using order property in instance or its config.

You can change number of rows per page and allowed per-page options using perPage and perPageOptions properties.

Sorting

Use ttSort="field_name" directive on column headers to enable column sorting. Order will be changed on click. Clicking with shift key enables sorting by multiple columns.

Data filtering

Use tt-search component to create a search component (input). Typing text inside it will filter the data leaving only rows that match given search string (row is matched if any of its object values matches the search string).

You can add data filters via filters property using TtFilterGroup and TtFilter classes that extend FormGroup and FormControl respectively only difference being that TtFilter first argument is a filter config object.

filters: new TtFilterGroup({
	firstName: new TtFilter(),
	lastName: new TtFilter(),
	idMore: new TtFilter({
		field: 'id',
		operator: '>'
	}),
	idLess: new TtFilter({
		field: 'id',
		operator: '<'
	}),
	genderMale: new TtFilter({
		field: 'gender',
		or: true
	}),
	genderFemale: new TtFilter({
		field: 'gender',
		or: true
	})
})

Pagination

Use tt-pagination component to create pagination.

Use tt-per-page component to create a component that allows user to change default results per page number.

Select rows

You can use <tt-select [item]="row"> component inside each row to create a checkbox that allows user to select given row.

Use tt-select-all component to create a checkbox that selects/deselects all checkboxes created by tt-select.

Selected rows can be fetched by using instance.selected.getSelected() method.

Export (requires angular-bootstrap4)

Use tt-export component to create a component that allows user to easily export currently visible data. Export takes data from HTML, so it's exported in a format that is visible in browser.

Server-side processing

Use url and resolver properties to process data on server-side.