New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sussol-react-table

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sussol-react-table

A Sussol themed wrapper and simple API for the blueprintjs table component

  • 0.1.23
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-84.62%
Maintainers
3
Weekly downloads
 
Created
Source

Build Status

sussol-react-table

A wrapper and simple API for using the blueprintjs data table

Installation

yarn add sussol-react-table

or

npm install sussol-react-table

Added Options

PropTypeDescription
cellAutoHeightObject | BooleanDefaults to false. If true, or an object of options is provided, the table will adjust the <Cell /> height to fit the length of the content. Use with wrapText: true inside coreCellProps for best results with no truncation.
cellDataKeyStringPass a key (object property) from your table data set as a string. The data's key will be used to access a value – the unique key. Good for selecting the table row and loading a corresponding component, based on the selected key. e.g. { ... code: 123456789, ...}
columnsArray[{ key: String, title: String, ?sortable: Boolean, ?align: "left|center|right" }] Column headers for the table.
coreCellPropsObjectPass any core Blueprint <Table /> props through.
tableDataArray[{ any }] Must contain at least the valid columns keys.
defaultColumnAlignString"left|center|right" The CSS text alignment for all table cells. Defaults to "left". A column's align key takes precedence.
defaultSortKeyStringThe default column key for sorting the table data. If no key is set, nothing is done. Be sure your data already exists when the component initialises (i.e. {this.state.data.length && ...).
defaultSortOrderString"asc|desc" If defaultSortKey is set, determines the default column sort direction on initialisation. Defaults to "asc".
coreEditableCellPropsObjectAn object of Blueprint <EditableCell /> props to pass through. All handler functions will be passed value: String, row: Number, { column:Number, columnKey:String }:Object, which differs slightly from the default implementation options.
loadingRowCountNumberIf set, table will show the core loading state for rows/cells equal to the value of loadingRowCount. Defaults to 0.

NOTE:

  • All other blueprintjs Table props are passed to its root <Table /> component.

Usage

import React from 'react';
import { SussolReactTable } from 'sussol-react-table';

const columns = [
  {
    key: 'name',
    title: 'Name',
    sortable: true,
  },
  {
    key: 'code',
    title: 'Code',
    sortable: true,
  },
  {
    key: 'group',
    title: 'Editable Column',
    editable: true,
  },
];

const data = [];
for (let i = 0; i < 100; i++) {
  data.push({ code: `code${i}`, name: `name${i}`, group: `group${i % 2}` });
}

export class App extends React.Component {
  render() {
    return (
      <div style={{ height: 400 }}>
        <h1>A Beautiful table</h1>
        <SussolReactTable
          columns={columns}
          tableData={data}
          cellDataKey="code"
        />
      </div>
    );
  }
}

Required style dependencies

You will need include the following styles via your index.html (or by bundling them). Make sure the path to styles is correct.

  • path/to/node_modules/@blueprintjs/core/dist/blueprint.css
  • path/to/node_modules/@blueprintjs/table/dist/table.css
  • path/to/node_modules/normalize.css/normalize.css (good for resetting to safe, base styles for most all browsers)

Testing locally via another project

  1. From inside sussol-react-table run yarn build
  2. From your project run yarn add file:path/to/sussol-react-table
  3. Run your project

Additional docs

Read up on the API for the blueprintjs table component.

FAQs

Package last updated on 07 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc