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

detail_row_editor

v2.0.1

Published

Vuetable extension which can be used to implement expanding editor row with save / cancel options.

Downloads

14

Readme

Vuetable-2 Detail row editor

Details row editor meant for Vuetable-2

Example image

Usage

Inside template

<vuetable ref="vuetable"
    ...
    detail-row-component="detail-row"
    ...
  ></vuetable>

Inside script

import DetailRowEditor from 'detail-row-editor/src/components/DetailRowEditor'
Vue.component('detail-row', DetailRowEditor);

Properties

Due to the fact that vuetable passes only two props to it's details row (rowData and rowIndex) any other properties needs to be passed this way


Vue.prototype.detailRowOptions = {
  onSave: (data) => {
  return new Promise((resolve) =>  {
      // Do stuff using data. Unless autoHideOnSaveOrCancel is set to false, the details row will be hidden when this promise is resolved
      resolve();
    });
  };
};

Name | Type | Default value | Description --- | --- | --- | --- autoRowUpdateAfterChange | boolean | true | If set to true, the parent row will be updated on every change autoRowUpdateAfterSave | boolean | true | If set to true, the parent row will be updated after save autoHideOnSaveOrCancel | boolean | true | If set to true, the details row will be automatically hidden after save / cancel onSave | function | null | Function which will be called on save. It takes data as an argument and it is required to return a Promise object. See example code for tips on error handling. onCancel | function | null | Function which will be called on cancel. It is required to return a Promise object. header | Component | null | Header component footer | Component | null | Custom footer component showFooter | boolean | true | Whenever footer (buttons) should be hidden buttonClasses | String | '' | Classes which will be added to save / cancel buttons (separated by space) boldLabel | boolean | false | Whenever field title should be bolded fields | array | [] | Must be set in order for editor to work

Field properties

Fields also should have certain properties specified in order to be editable.

Name | Type | Default value | Description --- | --- | --- | --- editable | boolean | false | Important! You must set this value to true in order for it to be editable type | String | text | Any valid HTML input type will do (note that no additional attributes will be added, so there is no point in specifying a radio type for example) detailRowComponent | Component | null | Custom field component. See example for more detailed informations

Example code

# clone project
git clone https://github.com/kamilbeben/detail-row-editor.git
cd detail-row-editor

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev