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

perm-table

v1.2.4

Published

Welcome to the PermTable component README! This document provides a comprehensive guide to understanding and utilizing the PermTable component within your React projects. PermTable is a powerful table interface designed for managing and displaying permiss

Downloads

22

Readme

PermTable Component

Welcome to the PermTable component README! This document provides a comprehensive guide to understanding and utilizing the PermTable component within your React projects. PermTable is a powerful table interface designed for managing and displaying permission data in a structured format.

Features

  • Dynamic Table Structure: Customize table structures with dynamic entity and action props.
  • Permission Management: Manage permissions effortlessly with intuitive checkbox controls.
  • Row Selection: Select rows of permissions for efficient management.
  • Accessibility: Accessible design with ARIA roles for improved screen reader support.

Dependencies

The PermTable component relies on the following dependencies:

  • css: Styling powered by css for enhanced customization.
  • React: Built with React for efficient component-based architecture.

Installation

To use the PermTable component, ensure that you have the following dependencies installed in your project:

Usage

To incorporate the PermTable component into your application, import it into your parent component and configure it with the required props. See the example below:

import React from 'react';
import PermTable from 'perm-table';

const App = () => {
  const handleRbacChange = (permissions) => {
    console.log(permissions);
  };

  return (
    <PermTable
      actions={['create', 'update', 'get', 'delete']}
      roles={['user', 'role', 'post', 'comment']}
      onRbacChange={handleRbacChange}
      rowSelectAll={true}
      permissions={['create_user','create_role']}
      rowSelectAllLabel={'All'}
      specialChar={'_'}
    />
  );
};

export default App;

Props

  • actions: An array of strings representing available actions for entities.
  • roles: An array of strings representing entities for permission management.
  • rowSelectAll: Boolean indicating whether to include a row selection checkbox.
  • rowSelectAllLabel: Label for the row selection checkbox.
  • specialChar: Character used to separate action and role.
  • onRbacChange: Callback function for handling permission changes.
  • permissions: Array containing all permissions.

Styling

Customize the appearance of PermTable using Antd's styling solutions and SCSS.

Contributing

Contributions to the perm-table are welcome! Please ensure that your code adheres to the existing coding style and maintains test coverage.

GitHub Repository

You can find the source code for the PermTable component on GitHub at https://github.com/Abdelkaderbzz/perm-table.

License

This project is licensed under the MIT License.