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

vuex-table

v2.0.0

Published

> Vuex-table is a Vue component created in order to easily fit in any Vue (even Vuex or Typescript) project. > It consists on a table representation of informations whose data can be provided both from frontend or backend.

Downloads

78

Readme

Vuex-table

Vuex-table is a Vue component created in order to easily fit in any Vue (even Vuex or Typescript) project. It consists on a table representation of informations whose data can be provided both from frontend or backend.

NEW ! Vuex-table is now coded on Vue.js and Typescript (see Documentation)

Features ⚙

  • Sorting

    Rows can be sorted according to column field (ex. sorting names alphabetically )

    Image from Gyazo

  • Selection

    Rows can checked one by one or all at once by clicking on checkbox.

    Image from Gyazo

  • Search

    Rows which match with user input in searchbar will be displayed, so that user can easily find the information he/she is looking for.

    Image from Gyazo

  • Pagination

    For better browsing on data, a maximum number of rows is displayed and others can be shown just by changing page.

    Image from Gyazo

  • Show/Hide details

    Each row may contain details that users can show and hide by clicking on the icon.

    Image from Gyazo

  • Show/Hide columns

    Each column can be hidden or shown by clicking on the appropriate checkbox.

    Image from Gyazo

  • Responsive

    Vuex-table is responsive, with simple and intuitive mobile User Experience.

    Image from Gyazo

Language Support (i18n)

Vuex-table is conceived to be translated in all languages. In order to properly set your default language you need the following elements:

  • ISO 639-1 code in lowercase of the language (i.e. en for English, fr for French, etc)
  • A script or JSON containing all translations for each language you'd like to add

Example (for setting German):

// externalLangs.js 

export default {
    "de":
        {
            "search": "Geben Sie Ihren Suchbegriff ein", 
            "previous": "Vorheriges Item", 
            "next": "Nächstes Item"
        }      
    } 

Then you can change your default language like this

import ExternalVuexTableLangs from '../langs/externalLangs.js;

<vuex-table current-lang="de" :langs='ExternalVuexTableLangs' />

Documentation 📔

Documentation is in the docs directory. You can find here online documentation.

Quick start 🚀

Pss...it's easy! 😎

Install

npm install --save vuex-table

or

yarn add vuex-table

To install dependencies

npm install

Import

import Vue from 'vue';
import VuexTable from 'vuex-table';
 
Vue.use(VuexTable);

Example

<template>
    <vuex-table
        :headers="state.headers"
        :data="state.data"
        :selectable-columns="true"
        :selected-columns.sync="state.selectedColumns"
        :selected-rows.sync="state.selectedRows"
        :enable-details="true"
        :items-per-page="state.itemsPerPage"
        :current-page.sync ="state.currentPage"
    >
        <template slot-scope="props">
             {{props.data}}
        </template>
        <template slot="details" slot-scope="props">
            <span>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut consequatur cupiditate deserunt eligendi eveniet iste iure, labore minus natus nostrum numquam pariatur placeat porro quia repellat veniam vero voluptatem voluptates.</span>
        </template>
    </vuex-table>
</template>

API

Properties

Name | Description | Type | Values | Default --- | --- | --- | --- | ---
backend-pagination | Use asynchronous data fetching from any API or backend | boolean | - | false backend-sorting | Use asynchronous data sorting from any API or backend | boolean | - | false current-lang | Current lang of the table | string | ISO 639-1 | en current-page | Current page showed when initializing the table | number | - | 1 data | Data passed to the table | Object[] | required | -
default-sort-direction | Sort direction by default | string | asc OR desc | asc details | All opened detail slots by default | number[] | - | [] enable-details | Enable detail slots for each row | boolean | - | false headers | Headers of the table | Object[] | required | - is-sortable | Allow columns to be sorted | boolean | - | true langs | Extra langs added by the user (see related section) | Object | - | {} paginated | Enable pagination | boolean | - | true selectable-columns | Allow columns to be selected | boolean | - | false selectable-rows | Allow rows to be selected | boolean | - | false selected-columns | Selected columns when initializing the table | number[] | - | [] selected-rows | Selected rows when initializing the table | number[] | - | [] total | Total number of items (for pagination) | number | required | -

Slots

Slot name | Description | Props (if scoped) --- | --- | --- default | Default slot rendered for each cell | field: string, row: number, column: number, header: Object, data: any
details | Row detail (collapsible) | row: number

Events

Event name | Description | Parameters --- | --- | --- sort | Triggered when a sort is requested | header: Object, currentSortDirection: asc OR desc
next-card | Triggered in mobile mode when the next item is requested | oldCard: number, newCard: number previous-card | Triggered in mobile mode when the previous item is requested | oldCard: number, newCard: number details-open | Triggered when a detail slot is opened | index: number details-close | Triggered when a detail slot is closed | index: number selected-row | Triggered when a row is selected or de-selected | selection: number[], newlySelectedRow: number (-1 if all is selected), isDeselected: boolean selected-column | Triggered when a column is selected or de-selected | selection: number[], newlySelectedRow: number (-1 if all is selected), isDeselected: boolean page-change | Triggered the current page change | oldPage: number, newPage: number

Collaborators 👩🏻‍💻👨🏼‍💻

Superpitch team

License

Code released under MIT license.

Copyright (c) 2019, Superpitch.