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

@quanzo/vue-table

v1.0.4

Published

Table - component for Vue.js ============================

Downloads

1

Readme

Table - component for Vue.js

The component allows you to display tabular data. Sort by columns. Select lines. Edit data directly in the table. Block columns or rows from changing.

Demo

 

Install via NPM

npm i --save-dev @quanzo/vue-table

Load from CDN

You can load specific version of package from jsDelivr CDN.

<script src="https://cdn.jsdelivr.net/npm/@quanzo/vue-table"></script>

 

Methods provided by the component Table

| provide | return | description | |----------------------------------------|---------------|----------------------------------------------------------------------------------------------------------------------------| | registerEventListener(eventName, func) | | | | load(tableData) | | Upload new data to the table. | | getColumnConfig(col) | Object | | | isRow(row) | boolean | Checks for row presence | | isCell(row, col) | boolean | Checks for cell presence | | cell(row, col) | mixed | | | setCell(row, col, value) | boolean | | | rows() | integer | Total count rows in table | | row(row) | array|object | Get row data | | setRow(row, value) | boolean | Set row data. Value is array or object/ | | insertRow(afterRow, ...value) | | Insert rows after row. afterRow =-1 then insert at the beginning of the array | | deleteRow(row, count = 1) | | Delete lines starting from this | | getCellClasses(row, col) | string | Get cell classes | | getRowClasses | string | Get row classes | | setCellClasses(row, col, classes) | | Set cell classes | | setRowClasses(row, classes) | | Set row classes | | getChecked() | array | Returns the status checked of each row in an array. Array index - line number. Value - if checked = true, other = false | | checkRow(row, status = null) | boolean | Get or set selection mark. If status == true/false - set or reset mark | | blockRow | boolean | Set or reset row lock. If the line is locked, then its editing is prohibited. If status == true/false - set or reset block | | | | |

 

Events

| event | $emit | event params | description | |---------------------|--------|-------------------------------------------------------------------------|-----------------------------------------------------| | event-end-edit-cell | yes | {row: ..., col: ..., initial: ..., result: ..., data: ...} | The event will be triggered after editing the cell. | | event-sort-table | yes | [{col: ..., direct: "asc|desc"}, ... {col: ..., direct: "asc|desc"} ] | The event will be triggered after sorting. | | event-checked | yes | {current: []} | The event will be triggered after checked row. | | | | | |

 

Options

| param | type | default | sample | description | |---------------|---------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| | data | array | [] | | Data to display in the table. Array of strings. A string can be an array or a data object. | | columns | array | false | [”ID”, “Name”, “Family”] | Data on the columns of the table. If an array, then these are the column headers. If the object is advanced settings. If not, column headers will not be displayed. | | columns | object | false | {ID: {name:”Identify”, enableEdit: false, enableSort: false, type:”number”}, town: {name:”Company town”, enableEdit: true, enableSort: true, type: “select”, options: {msk: “Moscow”, spb: “Snakt-Petersburg”}}} | Данные по колонкам таблицы. Если массив, то это заголовки колонок. Если объект - то это расширенные настройки. Если нет - заголовоки колонок выведены не будут. | | useUndo | boolean | true | | Activate ctrl+z | | defEnableEdit | boolean | true | | Default value enableEdit param for column | | enableEdit | boolean | true | | Enable/disable edit all cell | | defEnableSort | boolean | true | | Default value enableSort param for column | | enableSort | boolean | true | | Enable/disable all row in table | | enableChecked | boolean | true | | Whether or not line marking is available. | | sort | array | [] | [{col:”name”, direct:”asc”}, {col:”id”, direct:”desc”}] | | | checkedRows | array | [] | [false, true] | Checked row number 1. | | blockedRows | array | [] | [false, false, true] | Block row number 2 | | cellClasses | array | [] | | | | rowClasses | array | [] | [”marked checked”, ”not-marked”, “”, “”] | | | | | | | |

 

Available types of columns

type = string

...
name: {
    name:”User name”,
    enableEdit: false,
    enableSort: false,
    type:”string”, // or do not set the parameter
    default: "" // or not set
}
...

type = number

...
id: {
    name:”Identify”,
    enableEdit: false,
    enableSort: false,
    type:”number”,
    default: 0 // or not set
}
...

type = select

...
town: {
    name:”Company town”,
    enableEdit: true,
    enableSort: true,
    type: “select”,
    options: {
        msk: “Moscow”,
        spb: “Sankt-Petersburg”
    },
    default: "spb"
}
...

type = image

edit as string, view as image