Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-table-control

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-table-control

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/komarovalexander/react-table-control/blob/master/LICENSE) [![Build Status](https://travis-ci.com/komarovalexander/react-table-control.svg?token=9QUEx9r7MWqF44f9VDer

  • 0.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

GitHub license Build Status

This project is on pre-alpha stage. Stable version with documentation and finished styles will be available no later than January of 2020

React Table Control

The customizable, extendable, lightweight and free React Table Component

Can easily be included in react projects, never mind ts or js

// TODO Demo

Installation

npm

npm install react-table-control

yarn

yarn add react-table-control

Usage

A basic example

// TODO

API

Table

Properties

NameTypeDescription
columnsColumn[]Columns in table and their look and behaviour
dataany[]The data which is shown in Table's rows
editableCellsCell[]This property contains the array of cells which are being edited
editingModeEditingModeSets the table's editing mode
filterRowFilterCondition[]Sets filters for columns
groupsGroup[]Group's in the table
groupsExpandedTODOContains groups which are expanded in the grid
rowKeystringProperty of data's item which is used to identitify row
sortingModeSortingMode[]Sorting mode
search stringSpecifies the text which should be found in the data

Column

Describes column of table its look and behaviour Properties

NameTypeDescription
fieldstringSpecifies the property of data's object which value will be used in column
titlestringSpecifies the text of the header
dataTypeDataTypeSpecifies the type of column
sortDirectionSortDirectionSets the direction of sorting for the column
editorEditorFuncReturns an editor if cell is in editable mode
cellCellFuncReturns an custom cell if it is not in editable mode
widthnumber | stringSets the width of the column
textAlignTextAlignSets column's text alignment
searchSearchFuncOverrides the default search method for the cell. Executes if Table.search option is set
validationValidationFuncReturns the validation error string or does not return anything in case of passed validation

Cell

Describes the position of a cell in the table

Properties

NameTypeDescription
fieldstringThe field of
specific column
rowKeyValueanyData's key value of еру specific row

FilterCondition

Properties

NameTypeDescription
fieldstringThe filtered column's field
operatorstringOperator which will be applied for filtering
valueanyFiltered value

Group

Properties

NameTypeDescription
fieldstringThe grouped column's field

DataType

PropertyString value
Boolean'boolean'
Date'date'
Number'number'
Object'object'
String'string'

EditingMode

PropertyString valueDescription
None'none'Editing is disabled
Cell'cell'Data is edited by cell to cell, click by cell activates editing

SortDirection

PropertyString value
Ascend'ascend'
Descend'descend'

SortingMode

PropertyString value
None'none'
Single'single'

TextAlign

PropertyString value
Center'center'
Left'left'
Right'right'

EditorFunc

(props: ICellEditorProps) => any;

Function which obtains ICellEditorProps as parameter and returns React component which should be shown instead of default editor.

CellFunc

(props: ICellContentProps) => any;

Function which obtains ICellContentProps as parameter and returns React component which should be shown instead of cell content.

SearchFunc

(searchText?: string, rowData?: any, column?: Column) => boolean;

Function which obtains searchText?: string, rowData?: any, column?: Column - as parameters and returns boolean value which is true if cell's value is matched with searched value and false otherwise.

ValidationFunc

(value: any, rowData: any) => string | void;

Function which obtains value of specific cell and row - as parameters and returns validation error string or does not return anything in case of passed validation.

ICellEditorProps

Properties

NameTypeDescription
columnColumnsettings of the column in which editor is shown
rowDataanydata of the row in which editor is shown
close() => voidcall this method to close editor
onValueChange(newValue: any) => voidcall this method to change value of the row: onValueChange({ ...rowData, ...{ [field]: value } })

ICellEditorProps

Properties

NameTypeDescription
columnColumnsettings of the column in which editor is shown
openEditor() => voidcall this method to open editor of the cell
rowDataanydata of the row in which editor is shown

FAQs

Package last updated on 08 Dec 2019

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