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

vue-grid-table

v0.0.4

Published

A Vue.js Table Component with resizable columns and a sticky table head

Downloads

53

Readme

vue-grid-table

  • https://github.com/3zbumban/vue-grid-table
  • https://www.npmjs.com/package/vue-grid-table

Installation

npm i vue-grid-table -S
<template>
    <div>
        <vue-grid-table :data="sampleData"></vue-grid-table>
    </div>
</template>

<script>
import vueGridTable from 'vue-grid-table'

export default {
  data () {
    return {
      sampleData // [{}, {}, {}, ...] 
      // this musst be an array with objects, 
      // the objekt keys are going to be the table headers 
      // and values are going to be the entries in the table
      // this is maybe not the best data structure 
      // and is maybe going to be changed in the future
    }
  },
  components: {
    vueGridTable
  }
}
</script>

props:

  • data:
    • description: the data that should go into the table, object keys are getting used as table headers, values going into the table columns
    • type: Array of objects
    • notice: you have to take care that the objects in the array are uniform so the component cn work correctly
  • COLUMN_MIN:
    • description: minimum value a column can be resized to as a number (of pixels)
    • type: Number
    • notice: the number you provide is going to be seet to a pixel value
    • default: 50 -> ('50px')
  • HANDLE_WIDTH:
    • description: the width of the resize handle in pixels
    • type: String
    • notice: you have to provide a string value in this form '10px'
    • default: '10px'
  • LAST_CELL_MAX:
    • description: this is the value that gets set as the second argument for the minmax(COLUMN_MIN, LAST_CELL_MAX) of the last grid-template item
    • type: String
    • notice: this is just to make it possible to customize the behavior of the last column his prop might be unnesessary
    • default: 'auto'

CSS

  • Theese are (most liekely) the css selectors you need to customize your table.
  • modifying these or espacially other css might brake the component
/* table headers*/
th {
  background: #6c7ae0; 
  text-align: left;
  font-weight: normal;
  font-size: 1.1rem;
  color: white;
  user-select: none;
}

/* last table header color*/
th:last-child {
  background-color: yellowgreen;
}

/* text color inside table */
td {
    color: #808080;
}

/* color pattern effect */
tr:nth-child(even) td {
  background: #f8f6ff;
}

.resize-handle {
  opacity: 0;
  cursor: e-resize;
}

/* resize handle while resizing */
.resize-handle:hover,
/* The following selector is needed so the handle is visible during
resize even if the mouse isn't over the handle anymore */
.header--being-resized .resize-handle {
  opacity: 0.5;
}

/* the one beeing resized now */
.header--being-resized {
  background-color: yellow;
}

/* when hovering resizable th */
th:hover .resize-handle {
  opacity: 0.3;
}