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

portlogics-grid

v1.0.4

Published

@silevis/reactgrid library enhanced with additional tree-structure-view features

Downloads

24

Readme

Portlogics-grid · MIT license NPM badge

This is a React grid component library fit well with tree-structured data. Almost all concepts of this library were heavily inspired by @silevis/reactgrid.

English | 한국어

Docs

This library heavily rely on @silevis/reactgrid. You can find basic concepts and implements down below.

Added Concepts

To handle and show tree-view grid, we added some additional properties and actions on the original.

enableGroupSelection property

The basic range and row selection feature are already provided by default. In this grid library you can also leverage the group selection feature so you can provide better visibility to your users.

The way how enableGroupSelection property works is similar to the existing enableRowSelection. But there are few steps you should do.

First, You should enable enableGroupSelection property on your ReactGrid Component.

<ReactGrid
  {...props}
  enableRowSelection
  enableColumnSelection
  enableGroupSelection
/>

Second, You have to provide row data with groupId property which is different from the existing one.

export interface Row<TCell extends Cell = DefaultCellTypes> {
  /** Unique `Id` in all rows array */
  readonly rowId: Id;
  /** Array of `Cell` objects */
  readonly cells: TCell[];
  /** Height of each grid row (in default set to `25` in px) */
  readonly height?: number;
  /**
   * Property that allows row to change is position in grid,
   * default: `false` (row reorder implementation is on the developer's side)
   */
  readonly reorderable?: boolean;
  /**
   * Property when you want to enable grouped selection on your grid.
   * you should provide the same groupId to multiple rows if you want to group and focus them together.
   */
  readonly groupId?: number;
}

So the data should be look like this:

[
    {
        "rowId": "header",
        "cells": [
            {
                "type": "header",
                "text": "ColumnA"
            },
            {
                "type": "header",
                "text": "ColumnB"
            },
            {
                "type": "header",
                "text": "ColumnC"
            },
        ],
    },
    {
        "rowId": 0,
        "groupId": 0,
        "cells": [
            {
                "type": "text",
                "text": "A1"
            },
            {
                "type": "text",
                "text": "B1"
            },
            {
                "type": "text",
                "text": "C1"
            },
        ],
    },
    {
        "rowId": 1,
        "groupId": 0,
        "cells": [
            {
                "type": "text",
                "text": "A1"
            },
            {
                "type": "text",
                "text": "B1"
            },
            {
                "type": "text",
                "text": "C2"
            },
        ],
    },
    {
        "rowId": 2,
        "groupId": 0,
        "cells": [
            {
                "type": "text",
                "text": "A1"
            },
            {
                "type": "text",
                "text": "B1"
            },
            {
                "type": "text",
                "text": "C3"
            },
        ],
    },
]

If multiple Row objects have the same groupId, clicking a cell in that group will select all the rows together.