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

dp-data-table

v2.0.0

Published

A simple and easy to customize data table with filter and sort functionalities. This component is build using React and can be directly used in static html as well.

Downloads

12

Readme

dp-data-table

dp Data Table is a simple ready to integrate component made in React using bootstrap styling.

Screenshot

dp Data Table

Integration

Here is a sample integration:

<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.0/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.0/react-dom.js"></script>
<script src="dist/dpDataTable.js"></script>
<script>
  window.RenderDpDataTable({
    selector: '#data-table-1',
    items: [.......]
  });
</script>

React Integration:

import React from 'react';
import DpDataTable from 'dp-data-table';

......

<DataTable items={[.......]} />

To have proper styling, include bootstrap.

Options

The options are passed in as props when used as a React component.

Option | Type | Description ----------|------------|------------ items | array | Collection of items to bind to the grid headers | array | array of keys and their matching Header names.[{'first_name' : 'First Name'}] hidePagination | boolean | Boolean to hide the pagination values. Setting this to true will show all items in same page. itemsPerPage | number | No of items per page. Default is 15. isLoading | boolean | Boolean to show the loading icon over the grid. iconClasses | object | An object with all the class names for the font icons used in the project. {LOADING: 'glyphicon glyphicon-refresh'}. Available options to override: LOADING, EDIT, DELETE, PAGE_PREV, PAGE_NEXT, FILTER, SORT_NONE, SORT_ASC, SORT_DESC
showFilter | boolean | Boolean to show the filter input filterableFields | array | Array of item property keys that can be made filterable. If not provided, all columns are filterable. onFiltering | function | Override function for filter. onFiltering({items, filterString}) showSort | boolean | Boolean to show column sort sortableFields | array | Array of column keys which can be sorted. showContextColor | boolean | Boolean to add context css to table row. Setting this to true will apply the __dp__contextCss property of item, to the row. onSorting | function | Override function to sortonDeleting({items, sortKey, sortOrder}) onEditing | function | Event handler for editing a row. The edit icon is enabled only when a function is supplied to this option.onEditing({item, index}) onDeleting | function | Event handler for deleting a row. The delete icon is enabled only when a function is supplied to this option.onDeleting({item, index}) onView | function | Event handler for viewing details of a row. The view icon is enabled only when a function is supplied to this option.onView({item, index}) onItemsChange | function | Event handler to get all changes that happen within the component. onItemChange(e)

Development

  • Development server npm start.
  • Continuously run tests on file changes npm run watch-test;
  • Run tests: npm test;
  • Build npm run build;