@material-table/core
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Datatable for React based on https://material-ui.com/api/table/ with additional features", | ||
@@ -9,0 +9,0 @@ "main": "dist/index.js", |
260
README.md
@@ -1,255 +0,73 @@ | ||
## This is a *maintained* fork of [`material-table`](https://github.com/mbrn/material-table) | ||
[![Build Status](https://travis-ci.org/oze4/material-table-core.svg?branch=master)](https://travis-ci.org/oze4/material-table-core) | ||
This fork was started from [this](https://github.com/mbrn/material-table/commit/3031eab70105df8d88c17984ca5cea878a9eae3f) commit, which is version `1.57.2`. Versioning for this repo will start at `2.0.0` due to this. | ||
<b>This is a *maintained* <a href="#explain-fork">fork*</a> of <a href="https://github.com/mbrn/material-table">mbrn/material-table</a><code>v1.57.2</code></b><br/><small id="explain-fork">*fork means I downloaded the repo to .zip and started this repo with that code</small> | ||
## Why? | ||
# Table of Contents | ||
Over the past 8 months or so, `material-table` has been less than responsive. `material-table` appears to be slowly going away (nobody seems to be maintaining it anymore) and I was tired of spending my own time submitting PR's with no response. | ||
### About | ||
I even [asked to help them out](https://github.com/mbrn/material-table/issues/1171) but was ignored, so I am publishing my locally maintained fork. | ||
- [Why?](#why) | ||
- [Intent](#hmm) | ||
- [Goals](#goals) | ||
- [Want to help?](#want-to-help) | ||
## Demo's | ||
### Getting Started | ||
[You can check out live demos here](https://oze4.github.io/material-table-core/) | ||
- [Installation](#installation) | ||
- [Documentation](#documentation) | ||
--- | ||
## Original `README.md`: | ||
[`material-table` GitHub](https://github.com/mbrn/material-table) | ||
<p align="center" style="box-shadow: 2px 2px;"> | ||
<a href="https://material-table.com" rel="noopener" target="_blank" ><img width="200" src="https://raw.githubusercontent.com/mbrn/material-table.com/master/docs/assets/logo-back.png" alt="material-table"></a></p> | ||
</p> | ||
--- | ||
<h1 align="center">material-table</h1> | ||
<div align="center"> | ||
A simple and powerful Datatable for React based on [Material-UI Table](https://material-ui.com/api/table/) with some additional features. | ||
[![Build Status](https://travis-ci.org/mbrn/material-table.svg?branch=master)](https://travis-ci.org/mbrn/material-table) | ||
[![Financial Contributors on Open Collective](https://opencollective.com/material-table/all/badge.svg?label=financial+contributors)](https://opencollective.com/material-table) [![npm package](https://img.shields.io/npm/v/material-table/latest.svg)](https://www.npmjs.com/package/material-table) | ||
[![NPM Downloads](https://img.shields.io/npm/dm/material-table.svg?style=flat)](https://npmcharts.com/compare/material-table?minimal=true) | ||
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/mbrn/material-table.svg)](http://isitmaintained.com/project/mbrn/material-table "Average time to resolve an issue") | ||
[![Follow on Twitter](https://img.shields.io/twitter/follow/baranmehmet.svg?label=follow+baranmehmet)](https://twitter.com/baranmehmet) | ||
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/material-table/Lobby) | ||
</div> | ||
## Key features | ||
- [Actions](https://material-table.com/#/docs/features/actions) | ||
- [Component overriding](https://material-table.com/#/docs/features/component-overriding) | ||
- [Custom column rendering](https://material-table.com/#/docs/features/custom-column-rendering) | ||
- [Detail Panel](https://material-table.com/#/docs/features/detail-panel) | ||
- [Editable](https://material-table.com/#/docs/features/editable) | ||
- [Export](https://material-table.com/#/docs/features/export) | ||
- [Filtering](https://material-table.com/#/docs/features/filtering) | ||
- [Grouping](https://material-table.com/#/docs/features/grouping) | ||
- [Localization](https://material-table.com/#/docs/features/localization) | ||
- [Remote Data](https://material-table.com/#/docs/features/remote-data) | ||
- [Search](https://material-table.com/#/docs/features/search) | ||
- [Selection](https://material-table.com/#/docs/features/selection) | ||
- [Sorting](https://material-table.com/#/docs/features/sorting) | ||
- [Styling](https://material-table.com/#/docs/features/styling) | ||
- [Tree Data](https://material-table.com/#/docs/features/tree-data) | ||
- and more | ||
## Demo and documentation | ||
You can access all code examples and documentation on our site [**material-table.com**](https://material-table.com/). | ||
## Support material-table | ||
To support material-table visit [SUPPORT](https://www.patreon.com/mbrn) page. | ||
## Issue Prioritizing | ||
Issues would be prioritized according reactions count. `is:issue is:open sort:reactions-+1-desc` filter would be use. | ||
[List issues according to reaction score](https://github.com/mbrn/material-table/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc) | ||
## Prerequisites | ||
The minimum `React` version material-table supports is `^16.8.5` since material-table `v1.36.1`. This is due to utilising [`react-beautiful-dnd`](https://github.com/atlassian/react-beautiful-dnd) for drag & drop functionality which uses hooks. | ||
If you use an older version of react we suggest to upgrade your dependencies or use material-table `1.36.0`. | ||
## Installation | ||
#### 1.Install package | ||
- `npm install @material-table/core` | ||
- `yarn add @material-table/core` | ||
To install material-table with `npm`: | ||
Instead of using `material-table` for `import` statements, use `@material-table/core` - this code will remain 100% compatable with `material-table`, just change your import statements. | ||
npm install material-table --save | ||
npm install @material-ui/core --save | ||
To install material-table with `yarn`: | ||
yarn add material-table | ||
yarn add @material-ui/core | ||
#### 2.Add material icons | ||
There are two ways to use icons in material-table either import the material icons font via html OR import material icons and use the material-table `icons` prop. | ||
##### HTML | ||
```html | ||
<link | ||
rel="stylesheet" | ||
href="https://fonts.googleapis.com/icon?family=Material+Icons" | ||
/> | ||
```javascript | ||
// This | ||
import MaterialTable from "material-table"; | ||
// would become | ||
import MaterialTable /*, { MTableBodyRow, etc.. } */ from '@material-table/core'; | ||
``` | ||
OR | ||
## Why? | ||
##### Import Material icons | ||
Over the past 8 months or so, `material-table` has been less than responsive. `material-table` appears to be slowly going away (nobody seems to be maintaining it anymore) and I was tired of spending my own time submitting PR's with no response. I have also [seen](https://github.com/mbrn/material-table/issues/1896) others [express](https://github.com/mbrn/material-table/issues/1896) concern about this. | ||
Icons can be imported to be used in material-table offering more flexibility for customising the look and feel of material table over using a font library. | ||
I even [asked to help them out](https://github.com/mbrn/material-table/issues/1171) but was ignored, thus this fork was born. | ||
To install @material-ui/icons with `npm`: | ||
## Intent | ||
npm install @material-ui/icons --save | ||
My intent is not to rip off `material-table`. **I do not plan on making any dramatic changes to the codebase.** | ||
To install @material-ui/icons with `yarn`: | ||
Recently, [I have been very active](https://github.com/mbrn/material-table/issues?q=is%3Aissue+commenter%3Aoze4) in assisting with issues, most of the solutions to these issues are hacky and could be easily resolved within the codebase. Occassionally, the solution is as simple as updating/improving the docs. | ||
yarn add @material-ui/icons | ||
## Goals | ||
If your environment doesn't support tree-shaking, the **recommended** way to import the icons is the following: | ||
My goal is to chip away at the [746 open issues](https://github.com/mbrn/material-table/issues) and [69 open pull requests](https://github.com/mbrn/material-table/pulls), update documentation, [and make minor improvements](#demo) that help us all. | ||
```jsx | ||
import AddBox from "@material-ui/icons/AddBox"; | ||
import ArrowDownward from "@material-ui/icons/ArrowDownward"; | ||
``` | ||
I want to keep things as close to they are now so that if the author of `material-table`, [mehmet baran](https://twitter.com/baranmehmet), ever wants to merge this code, we could easily do that. I would gladly provide ownership of the [npm organization](https://docs.npmjs.com/orgs/), [@material-table](https://www.npmjs.com/package/@material-table/core), to him if he ever wanted to publish packages using this name. | ||
If your environment support tree-shaking you can also import the icons this way: | ||
```jsx | ||
import { AddBox, ArrowDownward } from "@material-ui/icons"; | ||
``` | ||
## Want to help? | ||
Note: Importing named exports in this way will result in the code for _every icon_ being included in your project, so is not recommended unless you configure [tree-shaking](https://webpack.js.org/guides/tree-shaking/). It may also impact Hot Module Reload performance. Source: [@material-ui/icons](https://github.com/mui-org/material-ui/blob/master/packages/material-ui-icons/README.md#imports) | ||
Gladly accepting "applications" :) ..but seriously, my goal is to be responsive (thanks COVID). I have no issue giving access/permission to those that wish to help improve this excellent product! | ||
Example | ||
## Demo | ||
```jsx | ||
import { forwardRef } from 'react'; | ||
[You can check out live demos here](https://oze4.github.io/material-table-core/) | ||
import AddBox from '@material-ui/icons/AddBox'; | ||
import ArrowDownward from '@material-ui/icons/ArrowDownward'; | ||
import Check from '@material-ui/icons/Check'; | ||
import ChevronLeft from '@material-ui/icons/ChevronLeft'; | ||
import ChevronRight from '@material-ui/icons/ChevronRight'; | ||
import Clear from '@material-ui/icons/Clear'; | ||
import DeleteOutline from '@material-ui/icons/DeleteOutline'; | ||
import Edit from '@material-ui/icons/Edit'; | ||
import FilterList from '@material-ui/icons/FilterList'; | ||
import FirstPage from '@material-ui/icons/FirstPage'; | ||
import LastPage from '@material-ui/icons/LastPage'; | ||
import Remove from '@material-ui/icons/Remove'; | ||
import SaveAlt from '@material-ui/icons/SaveAlt'; | ||
import Search from '@material-ui/icons/Search'; | ||
import ViewColumn from '@material-ui/icons/ViewColumn'; | ||
## Documentation | ||
const tableIcons = { | ||
Add: forwardRef((props, ref) => <AddBox {...props} ref={ref} />), | ||
Check: forwardRef((props, ref) => <Check {...props} ref={ref} />), | ||
Clear: forwardRef((props, ref) => <Clear {...props} ref={ref} />), | ||
Delete: forwardRef((props, ref) => <DeleteOutline {...props} ref={ref} />), | ||
DetailPanel: forwardRef((props, ref) => <ChevronRight {...props} ref={ref} />), | ||
Edit: forwardRef((props, ref) => <Edit {...props} ref={ref} />), | ||
Export: forwardRef((props, ref) => <SaveAlt {...props} ref={ref} />), | ||
Filter: forwardRef((props, ref) => <FilterList {...props} ref={ref} />), | ||
FirstPage: forwardRef((props, ref) => <FirstPage {...props} ref={ref} />), | ||
LastPage: forwardRef((props, ref) => <LastPage {...props} ref={ref} />), | ||
NextPage: forwardRef((props, ref) => <ChevronRight {...props} ref={ref} />), | ||
PreviousPage: forwardRef((props, ref) => <ChevronLeft {...props} ref={ref} />), | ||
ResetSearch: forwardRef((props, ref) => <Clear {...props} ref={ref} />), | ||
Search: forwardRef((props, ref) => <Search {...props} ref={ref} />), | ||
SortArrow: forwardRef((props, ref) => <ArrowDownward {...props} ref={ref} />), | ||
ThirdStateCheck: forwardRef((props, ref) => <Remove {...props} ref={ref} />), | ||
ViewColumn: forwardRef((props, ref) => <ViewColumn {...props} ref={ref} />) | ||
}; | ||
For now, the existing material-table docs are valid. | ||
<MaterialTable | ||
icons={tableIcons} | ||
... | ||
/> | ||
``` | ||
- [material-table README](https://github.com/mbrn/material-table/blob/master/README.md) | ||
- [material-table API Documentation](https://material-table.com) | ||
## Usage | ||
Here is a basic example of using material-table within a react application. | ||
```jsx | ||
import React, { Component } from "react"; | ||
import ReactDOM from "react-dom"; | ||
import MaterialTable from "material-table"; | ||
class App extends Component { | ||
render() { | ||
return ( | ||
<div style={{ maxWidth: "100%" }}> | ||
<MaterialTable | ||
columns={[ | ||
{ title: "Adı", field: "name" }, | ||
{ title: "Soyadı", field: "surname" }, | ||
{ title: "Doğum Yılı", field: "birthYear", type: "numeric" }, | ||
{ | ||
title: "Doğum Yeri", | ||
field: "birthCity", | ||
lookup: { 34: "İstanbul", 63: "Şanlıurfa" } | ||
} | ||
]} | ||
data={[ | ||
{ name: "Mehmet", surname: "Baran", birthYear: 1987, birthCity: 63 } | ||
]} | ||
title="Demo Title" | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
ReactDOM.render(<App />, document.getElementById("react-div")); | ||
``` | ||
## Contributing | ||
We'd love to have your helping hand on `material-table`! See [CONTRIBUTING.md](https://github.com/mbrn/material-table/blob/master/.github/CONTRIBUTING.md) for more information on what we're looking for and how to get started. | ||
If you have any sort of doubt, idea or just want to talk about the project, feel free to join [our chat on Gitter](https://gitter.im/material-table/Lobby) :) | ||
## Contributors | ||
### Code Contributors | ||
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. | ||
<a href="https://github.com/mbrn/material-table/graphs/contributors"><img src="https://opencollective.com/material-table/contributors.svg?width=890&button=false" /></a> | ||
### Financial Contributors | ||
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/material-table/contribute)] | ||
#### Individuals | ||
<a href="https://opencollective.com/material-table"><img src="https://opencollective.com/material-table/individuals.svg?width=890"></a> | ||
#### Organizations | ||
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/material-table/contribute)] | ||
<a href="https://opencollective.com/material-table/organization/0/website"><img src="https://opencollective.com/material-table/organization/0/avatar.svg"></a> | ||
<a href="https://opencollective.com/material-table/organization/1/website"><img src="https://opencollective.com/material-table/organization/1/avatar.svg"></a> | ||
<a href="https://opencollective.com/material-table/organization/2/website"><img src="https://opencollective.com/material-table/organization/2/avatar.svg"></a> | ||
<a href="https://opencollective.com/material-table/organization/3/website"><img src="https://opencollective.com/material-table/organization/3/avatar.svg"></a> | ||
<a href="https://opencollective.com/material-table/organization/4/website"><img src="https://opencollective.com/material-table/organization/4/avatar.svg"></a> | ||
<a href="https://opencollective.com/material-table/organization/5/website"><img src="https://opencollective.com/material-table/organization/5/avatar.svg"></a> | ||
<a href="https://opencollective.com/material-table/organization/6/website"><img src="https://opencollective.com/material-table/organization/6/avatar.svg"></a> | ||
<a href="https://opencollective.com/material-table/organization/7/website"><img src="https://opencollective.com/material-table/organization/7/avatar.svg"></a> | ||
<a href="https://opencollective.com/material-table/organization/8/website"><img src="https://opencollective.com/material-table/organization/8/avatar.svg"></a> | ||
<a href="https://opencollective.com/material-table/organization/9/website"><img src="https://opencollective.com/material-table/organization/9/avatar.svg"></a> | ||
## License | ||
This project is licensed under the terms of the [MIT license](/LICENSE). | ||
# [Please check out the original repository here](https://github.com/mbrn/material-table) |
275935
73