Comparing version 1.0.1 to 2.0.0
@@ -1,3 +0,1 @@ | ||
var table = require('./lib/Table'); | ||
module.exports = table; | ||
module.exports = require('./lib/Table'); |
@@ -6,8 +6,7 @@ /** @jsx React.DOM */ | ||
//表格列 | ||
var TableColumn = React.createClass({ | ||
render: function () { | ||
class TableColumn extends React.Component { | ||
render() { | ||
return (<th width={this.props.width}>{this.props.title}</th>); | ||
} | ||
}); | ||
} | ||
@@ -17,5 +16,4 @@ /** | ||
*/ | ||
var TableRow = React.createClass({ | ||
render: function () { | ||
class TableRow extends React.Component { | ||
render() { | ||
var self = this, | ||
@@ -30,4 +28,4 @@ columns = self.props.columns, | ||
text = record[col.dataIndex]; | ||
if (renderer){ | ||
text = renderer(text,record,index); | ||
if (renderer) { | ||
text = renderer(text, record, index); | ||
} | ||
@@ -38,7 +36,6 @@ cells.push(<td>{text}</td>); | ||
} | ||
}); | ||
} | ||
var Table = React.createClass({ | ||
_getColumns: function () { | ||
class Table extends React.Component { | ||
_getColumns() { | ||
var self = this, | ||
@@ -52,4 +49,5 @@ columns = self.props.columns, | ||
return rst; | ||
}, | ||
_getRows: function () { | ||
} | ||
_getRows() { | ||
var self = this, | ||
@@ -66,10 +64,14 @@ data = self.props.data, | ||
}, | ||
render: function () { | ||
} | ||
render() { | ||
var self = this, | ||
columns = self._getColumns(), | ||
rows = self._getRows(); | ||
var className = 'rc-table'; | ||
if (this.props.className) { | ||
className += ' ' + this.props.className; | ||
} | ||
return ( | ||
<table className={this.props.className}> | ||
<table className={className}> | ||
<thead> | ||
@@ -86,4 +88,4 @@ <tr> | ||
} | ||
}); | ||
} | ||
module.exports = Table; | ||
module.exports = Table; |
{ | ||
"name": "rc-table", | ||
"version": "1.0.1", | ||
"description": "", | ||
"keywords": ["react","table","rc-table"], | ||
"homepage": "https://github.com/react-component/table", | ||
"author": "dxq613@gmail.com", | ||
"version": "2.0.0", | ||
"description": "table ui component for react", | ||
"keywords": [ | ||
"react", | ||
"react-table" | ||
], | ||
"homepage": "http://github.com/react-component/table", | ||
"maintainers": [ | ||
"dxq613@gmail.com", | ||
"yiminghe@gmail.com" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/react-component/table.git" | ||
"url": "git@github.com:react-component/table.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/react-component/table/issues" | ||
"url": "http://github.com/react-component/table/issues" | ||
}, | ||
"licenses": "MIT", | ||
"spm": {}, | ||
"config":{ | ||
"port":8000 | ||
"spm": { | ||
"dependencies": { | ||
"react": "*" | ||
} | ||
}, | ||
"config": { | ||
"port": 8000 | ||
}, | ||
"scripts": { | ||
"start": "node --harmony server", | ||
"publish": "gulp tag", | ||
"lint": "gulp lint", | ||
"build": "rc-tools run build", | ||
"less": "rc-tools run less", | ||
"gh-pages": "rc-tools run gh-pages", | ||
"history": "rc-tools run history", | ||
"start": "node --harmony node_modules/.bin/rc-server", | ||
"publish": "rc-tools run tag && spm publish", | ||
"lint": "rc-tools run lint", | ||
"test": "", | ||
"browser-test": "mocha-phantomjs http://localhost:$npm_package_config_port/tests/runner.html", | ||
"browser-test-cover": "mocha-phantomjs -R node_modules/node-jscover/lib/reporters/mocha/console http://localhost:$npm_package_config_port/tests/runner.html?coverage" | ||
"saucelabs": "rc-tools run saucelabs", | ||
"browser-test": "rc-tools run browser-test", | ||
"browser-test-cover": "rc-tools run browser-test-cover" | ||
}, | ||
"devDependencies": { | ||
"es5-shim": "~4.0.5", | ||
"expect.js": "~0.3.1", | ||
"gh-changelog": "^1.0.5", | ||
"gulp": "^3.8.7", | ||
"gulp-jscs": "^1.1.0", | ||
"gulp-jshint": "^1.8.4", | ||
"gulp-jsx": "~0.6.0", | ||
"gulp-util": "^3.0.1", | ||
"jquery": "~1.11.1", | ||
"jshint": "^2.5.5", | ||
"jshint-stylish": "^0.4.0", | ||
"koa": "~0.13.0", | ||
"koa-body": "^0.4.0", | ||
"koa-jsx": "^1.1.3", | ||
"koa-modularize": "^2.0.0", | ||
"koa-mount": "~1.3.0", | ||
"koa-node-jscover": "^1.0.0", | ||
"koa-serve-index": "~1.0.1", | ||
"koa-static": "~1.4.7", | ||
"mocha": "~2.0.1", | ||
"modulex": "~1.7.0", | ||
"modulex-npm": "^2.0.0", | ||
"node-jscover": "^0.6.8", | ||
"node-jscover-coveralls": "^1.0.13", | ||
"jquery": "^1.11.2", | ||
"precommit-hook": "^1.0.7", | ||
"react": "~0.12.1", | ||
"react-tools": "~0.12.1", | ||
"simulate-dom-event": "^1.0.1" | ||
"rc-server": "^2.0.0", | ||
"rc-tools": "2.x", | ||
"react": "~0.13.0" | ||
}, | ||
"precommit": [ | ||
"lint" | ||
], | ||
"browserify-shim": { | ||
"react": "global:React", | ||
"jquery": "global:jQuery" | ||
}, | ||
"browserify": { | ||
"transform": [ | ||
[ | ||
"browserify-jsx" | ||
], | ||
[ | ||
"browserify-shim" | ||
] | ||
] | ||
}, | ||
"dependencies": { | ||
"browserify-shim": "^3.8.0", | ||
"browserify-jsx": "^0.1.0" | ||
} | ||
"lint", | ||
"less" | ||
] | ||
} |
@@ -29,2 +29,16 @@ # rc-table | ||
## Development | ||
``` | ||
npm install | ||
npm start | ||
``` | ||
## Example | ||
http://localhost:8000/examples/ | ||
online example: http://react-component.github.io/table/build/examples/ | ||
## Usage | ||
@@ -35,19 +49,17 @@ | ||
var columns = [ | ||
{title : 'header 1',dataIndex :'a', width:100}, | ||
{id: '123',title : 'header 2',dataIndex :'b', width:100}, | ||
{title : 'header 3',dataIndex : 'c',width:200}, | ||
{title : 'operate',dataIndex : '',renderer :function (value,obj) { | ||
return <a href="#">edit</a> | ||
}} | ||
]; | ||
var columns = [ | ||
{title : 'header 1',dataIndex :'a', width:100}, | ||
{id: '123',title : 'header 2',dataIndex :'b', width:100}, | ||
{title : 'header 3',dataIndex : 'c',width:200}, | ||
{title : 'operate',dataIndex : '',renderer :function (value,obj) { | ||
return <a href="#">edit</a> | ||
}} | ||
]; | ||
var data = [{a:'123'},{a:'cdd',b:'edd'},{a:'1333',c:'eee',d:2}]; | ||
var data = [{a:'123'},{a:'cdd',b:'edd'},{a:'1333',c:'eee',d:2}]; | ||
var table = React.renderComponent( | ||
<Table columns={columns} data={data} className="table"/>, | ||
document.getElementById('t1') | ||
); | ||
// use table | ||
React.renderComponent( | ||
<Table columns={columns} data={data} className="table"/>, | ||
document.getElementById('t1') | ||
); | ||
``` | ||
@@ -72,9 +84,2 @@ ## API | ||
## Development | ||
``` | ||
npm install | ||
npm start | ||
``` | ||
## Test Case | ||
@@ -86,9 +91,6 @@ | ||
http://localhost:8000/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:8004/tests/runner.html?coverage | ||
http://localhost:8000/node_modules/rc-server/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:8000/tests/runner.html?coverage | ||
## License | ||
rc-table is released under the MIT license. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
26310
0
6
19
325
92
0
1
1
- Removedbrowserify-jsx@^0.1.0
- Removedbrowserify-shim@^3.8.0
- RemovedJSONStream@1.3.5(transitive)
- Removedaccessory@1.1.0(transitive)
- Removedacorn@5.7.47.4.1(transitive)
- Removedacorn-node@1.8.2(transitive)
- Removedacorn-walk@7.2.0(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedap@0.2.0(transitive)
- Removedasn1.js@4.10.1(transitive)
- Removedassert@1.5.1(transitive)
- Removedast-types@0.9.6(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedbalanced-match@0.2.11.0.2(transitive)
- Removedbase62@0.1.1(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbn.js@4.12.15.2.1(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbrorand@1.1.0(transitive)
- Removedbrowser-pack@6.1.0(transitive)
- Removedbrowser-resolve@2.0.0(transitive)
- Removedbrowserify@17.0.1(transitive)
- Removedbrowserify-aes@1.2.0(transitive)
- Removedbrowserify-cipher@1.0.1(transitive)
- Removedbrowserify-des@1.0.2(transitive)
- Removedbrowserify-jsx@0.1.0(transitive)
- Removedbrowserify-rsa@4.1.1(transitive)
- Removedbrowserify-shim@3.8.16(transitive)
- Removedbrowserify-sign@4.2.3(transitive)
- Removedbrowserify-zlib@0.2.0(transitive)
- Removedbuffer@5.2.1(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedbuffer-xor@1.0.3(transitive)
- Removedbuiltin-status-codes@3.0.0(transitive)
- Removedcached-path-relative@1.1.0(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcipher-base@1.0.4(transitive)
- Removedcombine-source-map@0.8.0(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcommoner@0.10.8(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconcat-stream@1.6.2(transitive)
- Removedconsole-browserify@1.2.0(transitive)
- Removedconstants-browserify@1.0.0(transitive)
- Removedconvert-source-map@1.1.3(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedcreate-ecdh@4.0.4(transitive)
- Removedcreate-hash@1.2.0(transitive)
- Removedcreate-hmac@1.1.7(transitive)
- Removedcrypto-browserify@3.12.1(transitive)
- Removeddash-ast@1.0.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removeddefined@1.0.1(transitive)
- Removeddeps-sort@2.0.1(transitive)
- Removeddes.js@1.1.0(transitive)
- Removeddetective@3.1.04.7.15.2.1(transitive)
- Removeddiffie-hellman@5.0.3(transitive)
- Removeddomain-browser@1.2.0(transitive)
- Removeddot-parts@1.0.1(transitive)
- Removedduplexer2@0.1.4(transitive)
- Removedelliptic@6.6.0(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedescodegen@1.1.0(transitive)
- Removedesprima@1.0.43.1.3(transitive)
- Removedesprima-fb@3001.1.0-dev-harmony-fb8001.1001.0-dev-harmony-fb(transitive)
- Removedestraverse@1.5.1(transitive)
- Removedesutils@1.0.0(transitive)
- Removedevents@3.3.0(transitive)
- Removedevp_bytestokey@1.0.3(transitive)
- Removedexposify@0.5.0(transitive)
- Removedfast-safe-stringify@2.1.1(transitive)
- Removedfind-parent-dir@0.3.1(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-assigned-identifiers@1.2.0(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedglob@5.0.157.2.3(transitive)
- Removedglobo@1.1.0(transitive)
- Removedgopd@1.0.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-require@1.2.2(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhash-base@3.0.4(transitive)
- Removedhash.js@1.1.7(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhmac-drbg@1.0.1(transitive)
- Removedhtmlescape@1.1.1(transitive)
- Removedhttps-browserify@1.0.0(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedieee754@1.2.1(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.32.0.4(transitive)
- Removedinline-source-map@0.6.3(transitive)
- Removedinsert-module-globals@7.2.1(transitive)
- Removedis-arguments@1.1.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedis-defined@1.0.0(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedisarray@0.0.11.0.0(transitive)
- Removedjsonparse@1.3.1(transitive)
- Removedjstransform@8.2.0(transitive)
- Removedlabeled-stream-splicer@2.0.2(transitive)
- Removedlodash.memoize@3.0.4(transitive)
- Removedmap-obj@1.0.1(transitive)
- Removedmd5.js@1.3.5(transitive)
- Removedmiller-rabin@4.0.1(transitive)
- Removedminimalistic-assert@1.0.1(transitive)
- Removedminimalistic-crypto-utils@1.0.1(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedmkdirp-classic@0.5.3(transitive)
- Removedmodule-deps@6.2.3(transitive)
- Removedmothership@0.3.0(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedobject-keys@0.4.01.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-browserify@0.3.0(transitive)
- Removedpako@1.0.11(transitive)
- Removedparents@1.0.1(transitive)
- Removedparse-asn1@5.1.7(transitive)
- Removedpatch-text@1.0.2(transitive)
- Removedpath-browserify@1.0.1(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpath-platform@0.11.15(transitive)
- Removedpbkdf2@3.1.2(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedprivate@0.1.8(transitive)
- Removedprocess@0.11.10(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedpublic-encrypt@4.0.3(transitive)
- Removedpunycode@1.4.1(transitive)
- Removedq@1.5.1(transitive)
- Removedqs@6.13.0(transitive)
- Removedquerystring-es3@0.2.1(transitive)
- Removedrandombytes@2.1.0(transitive)
- Removedrandomfill@1.0.4(transitive)
- Removedreact-tools@0.12.2(transitive)
- Removedread-only-stream@2.0.0(transitive)
- Removedreadable-stream@1.0.341.1.142.3.83.6.2(transitive)
- Removedrecast@0.11.23(transitive)
- Removedrename-function-calls@0.1.1(transitive)
- Removedreplace-requires@1.0.4(transitive)
- Removedresolve@0.6.31.22.8(transitive)
- Removedripemd160@2.0.2(transitive)
- Removedsafe-buffer@5.1.25.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedsha.js@2.4.11(transitive)
- Removedshasum-object@1.0.0(transitive)
- Removedshell-quote@1.8.1(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedsimple-concat@1.0.1(transitive)
- Removedsource-map@0.1.310.1.430.5.7(transitive)
- Removedstream-browserify@3.0.0(transitive)
- Removedstream-combiner2@1.1.1(transitive)
- Removedstream-http@3.2.0(transitive)
- Removedstream-splicer@2.0.1(transitive)
- Removedstring_decoder@0.10.311.1.11.3.0(transitive)
- Removedsubarg@1.0.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedsyntax-error@1.4.0(transitive)
- Removedternary@1.0.0(transitive)
- Removedthrough@2.3.8(transitive)
- Removedthrough2@0.4.20.6.52.0.5(transitive)
- Removedtimers-browserify@1.4.2(transitive)
- Removedtransformify@0.1.2(transitive)
- Removedtty-browserify@0.0.1(transitive)
- Removedtypedarray@0.0.6(transitive)
- Removedumd@3.0.3(transitive)
- Removedundeclared-identifiers@1.1.3(transitive)
- Removedurl@0.11.4(transitive)
- Removedutil@0.10.40.12.5(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedvm-browserify@1.1.2(transitive)
- Removedwhich-typed-array@1.1.15(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedxtend@2.1.24.0.2(transitive)