Skip to content

Commit ed4102a

Browse files
committed
Remove propTypes dependency, add options to README
1 parent 31f9c5f commit ed4102a

File tree

4 files changed

+24
-19
lines changed

4 files changed

+24
-19
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ npm install --save react-html-table-to-excel
1919
* Set desired class name and id for styling
2020
* Supported IE 11
2121

22+
## Options
23+
24+
A list of available properties can be found below. These must be passed to the containing `ReactHTMLTableToExcel` component.
25+
26+
Property | Type | Description
27+
----- | ----- | -----
28+
**table** | *string* | ID attribute of HTML table element.
29+
**filename** | *string* | Name of Excel file.
30+
**sheet** | *string* | Name of Excel sheet.
31+
**id** | *string* | ID attribute of button element.
32+
**className** | *string* | Class attribute of button element.
33+
**buttonText** | *string* | Button text.
34+
35+
2236
## Example
2337

2438
```javascript

index.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ var _react = require('react');
1010

1111
var _react2 = _interopRequireDefault(_react);
1212

13-
var _propTypes = require('prop-types');
14-
15-
var _propTypes2 = _interopRequireDefault(_propTypes);
16-
1713
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1814

1915
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -24,12 +20,12 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
2420

2521

2622
var propTypes = {
27-
table: _propTypes2.default.string.isRequired,
28-
filename: _propTypes2.default.string.isRequired,
29-
sheet: _propTypes2.default.string.isRequired,
30-
id: _propTypes2.default.string,
31-
className: _propTypes2.default.string,
32-
buttonText: _propTypes2.default.string
23+
table: _react.PropTypes.string.isRequired,
24+
filename: _react.PropTypes.string.isRequired,
25+
sheet: _react.PropTypes.string.isRequired,
26+
id: _react.PropTypes.string,
27+
className: _react.PropTypes.string,
28+
buttonText: _react.PropTypes.string
3329
};
3430

3531
var ReactHTMLTableToExcel = function (_Component) {

package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@
2828
"babel-cli": "^6.24.1",
2929
"babel-preset-es2015": "^6.24.1",
3030
"babel-preset-react": "^6.24.1",
31-
"babel-preset-stage-0": "^6.24.1"
31+
"babel-preset-stage-0": "^6.24.1",
32+
"react": "^15.5.4"
3233
},
33-
"dependencies": {
34-
"prop-types": "^15.5.7"
35-
},
36-
"peerDependencies": {
37-
"react": "^15.5.0"
38-
}
34+
"dependencies": {}
3935
}

src/ReactHTMLTableToExcel.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* global window, document */
2-
import React, {Component} from 'react';
3-
import PropTypes from 'prop-types';
2+
import React, {Component, PropTypes} from 'react';
43

54
const propTypes = {
65
table: PropTypes.string.isRequired,

0 commit comments

Comments
 (0)