Skip to content

Commit

Permalink
update react15.x
Browse files Browse the repository at this point in the history
  • Loading branch information
wb-fjp324710 committed Oct 18, 2017
1 parent ef876e5 commit aa71566
Show file tree
Hide file tree
Showing 31 changed files with 406 additions and 353 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ spm_modules
.happypack
dist
build
coverage
assets/**/*.css
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
bower_components/
*.cfg
node_modules/
coverage/
nohup.out
*.iml
.idea/
Expand Down
13 changes: 11 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ language: node_js

sudo: false

addons:
apt:
packages:
- xvfb

notification:
email:
- [email protected]
Expand All @@ -17,6 +22,11 @@ before_install:
exit
fi
phantomjs --version
install:
- export DISPLAY=':99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- npm install


script:
- |
Expand All @@ -25,7 +35,6 @@ script:
else
npm run $TEST_TYPE
fi
env:
matrix:
- TEST_TYPE=test
Expand All @@ -34,4 +43,4 @@ env:

matrix:
allow_failures:
- env: "TEST_TYPE=saucelabs"
- env: "TEST_TYPE=saucelabs"
26 changes: 13 additions & 13 deletions demo/GridDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* All rights reserved.
*/

const Button = require('uxcore-button');
const React = require('react');
import Button from 'uxcore-button';

const Table = require('../src');
import React from 'react';
import Table from '../src';

const urlPrefix = 'http://30.6.61.25:3000/';

Expand Down Expand Up @@ -50,21 +50,21 @@ class Demo extends React.Component {
{
dataKey: 'id',
title: 'ID',
width: 50,
width: '50px',
hidden: true,
},
{
dataKey: 'country',
// fixed: true,
title: '国家',
width: 200,
width: '200px',
ordered: true,
hidden: true,
},
{
dataKey: 'city',
title: '城市',
width: 150,
width: '150px',
ordered: true,
message: '都是中国城市',
hidden: true,
Expand All @@ -80,12 +80,12 @@ class Demo extends React.Component {
{
dataKey: 'email',
title: 'Email',
width: 200,
width: '200px',
ordered: true,
}, {
dataKey: 'action1',
title: '操作1',
width: 200,
width: '200px',
rightFixed: true,
type: 'action',
actions: [{
Expand All @@ -109,7 +109,7 @@ class Demo extends React.Component {
}, {
dataKey: 'action',
title: '链接',
width: 100,
width: '100px',
render: () => <div><a>111</a></div>,
},
];
Expand Down Expand Up @@ -161,17 +161,17 @@ class Demo extends React.Component {
{
dataKey: 'class',
title: '分类',
width: 200,
width: '200px',
},
{
dataKey: 'dep',
title: '部门',
width: 200,
width: '200px',
},
{
dataKey: 'person',
title: '采购员',
width: 200,
width: '200px',
},
],
jsxdata: {
Expand Down Expand Up @@ -207,4 +207,4 @@ class Demo extends React.Component {
}
}

module.exports = Demo;
export default Demo;
20 changes: 11 additions & 9 deletions demo/GridEditDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
* All rights reserved.
*/

const Validator = require('uxcore-validator');
const Button = require('uxcore-button');
const Constants = require('uxcore-const');
const React = require('react');
const deepcopy = require('lodash/cloneDeep');
import Validator from 'uxcore-validator';

const Table = require('../src');
import Button from 'uxcore-button';
import Constants from 'uxcore-const';
import React from 'react';
import deepcopy from 'lodash/cloneDeep';
import Table from '../src';
// const Select = require('uxcore-select2');
// const RadioGroup = require('uxcore-radiogroup');
// const RadioField = require('./RadioField');
Expand Down Expand Up @@ -55,6 +55,8 @@ class Demo extends React.Component {
data: mockData,
showOtherColumn: false,
};
this.getTableValues = this.getTableValues.bind(this);
this.handleDataChange = this.handleDataChange.bind(this);
}


Expand Down Expand Up @@ -312,11 +314,11 @@ class Demo extends React.Component {
return (
<div>
<Table {...renderProps} ref={(c) => { this.table = c; }} />
<Button onClick={me.getTableValues.bind(me)}>获取 Table 的值</Button>
<Button onClick={me.handleDataChange.bind(me)}>更改 Data</Button>
<Button onClick={me.getTableValues}>获取 Table 的值</Button>
<Button onClick={me.handleDataChange}>更改 Data</Button>
</div>
);
}
}

module.exports = Demo;
export default Demo;
8 changes: 4 additions & 4 deletions demo/GridViewModeDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* All rights reserved.
*/

const React = require('react');
const Button = require('uxcore-button');
import React from 'react';

const Table = require('../src');
import Button from 'uxcore-button';
import Table from '../src';

const urlPrefix = window.urlPrefix || 'http://30.9.174.1:3000/';
const mockData = {
Expand Down Expand Up @@ -148,4 +148,4 @@ class Demo extends React.Component {
}
}

module.exports = Demo;
export default Demo;
11 changes: 5 additions & 6 deletions demo/RadioField.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const assign = require('object-assign');
const RadioGroup = require('uxcore-radiogroup');
const React = require('react');

const Table = require('../src');
import assign from 'object-assign';
import RadioGroup from 'uxcore-radiogroup';
import React from 'react';
import Table from '../src';

const CellField = Table.CellField;

Expand Down Expand Up @@ -50,4 +49,4 @@ RadioField.propTypes = assign({}, CellField.propTypes);

RadioField.defaultProps = assign({}, CellField.defaultProps);

module.exports = RadioField;
export default RadioField;
29 changes: 15 additions & 14 deletions demo/TableGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
* Copyright 2014-2015, Uxcore Team, Alinw.
* All rights reserved.
*/
const Table = require('../src');
const Button = require('uxcore-button');
const React = require('react');

import Button from 'uxcore-button';
import React from 'react';
import Table from '../src';
// const urlPrefix = 'http://30.9.174.1:3000/';

// 第一列为radio的demo
Expand Down Expand Up @@ -41,20 +42,20 @@ class Demo extends React.Component {
{
dataKey: 'id',
title: 'ID',
width: 50,
width: '50px',
},
{
dataKey: 'country',
title: '国家',
width: 200,
width: '200px',
ordered: true,
},
],
},
{
dataKey: 'city',
title: () => '城市',
width: 150,
width: '150px',
ordered: true,
message: '都是中国城市',
},
Expand All @@ -72,12 +73,12 @@ class Demo extends React.Component {
{
dataKey: 'id',
title: 'ID',
width: 50,
width: '50px',
},
{
dataKey: 'country',
title: '国家',
width: 200,
width: '200px',
ordered: true,
},
],
Expand All @@ -88,12 +89,12 @@ class Demo extends React.Component {
{
dataKey: 'id',
title: 'ID',
width: 50,
width: '50px',
},
{
dataKey: 'country',
title: '国家',
width: 200,
width: '200px',
ordered: true,
},
],
Expand All @@ -104,12 +105,12 @@ class Demo extends React.Component {
{
dataKey: 'id',
title: 'ID',
width: 50,
width: '50px',
},
{
dataKey: 'country',
title: '国家',
width: 200,
width: '200px',
ordered: true,
},
],
Expand Down Expand Up @@ -167,7 +168,7 @@ class Demo extends React.Component {
});
},
},
width: 800,
width: '800px',
showSearch: true,
showColumnPicker: true,
fetchUrl,
Expand All @@ -194,4 +195,4 @@ class Demo extends React.Component {
}
}

module.exports = Demo;
export default Demo;
21 changes: 11 additions & 10 deletions demo/TreeGridDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
* All rights reserved.
*/

const Table = require('../src');
const React = require('react');
import React from 'react';
import Table from '../src';


const urlPrefix = window.urlPrefix || 'http://30.9.174.1:3000/';

Expand All @@ -25,13 +26,13 @@ class Demo extends React.Component {
{
dataKey: 'id',
title: 'ID',
width: 50,
width: '50px',
hidden: true,
},
{
dataKey: 'country',
title: '国家国家国家国家',
width: 200,
width: '200px',
ordered: true,
type: 'money',
fixed: true,
Expand All @@ -40,7 +41,7 @@ class Demo extends React.Component {
{
dataKey: 'city',
title: '城市',
width: 150,
width: '150px',
},
{
dataKey: 'firstName',
Expand All @@ -53,13 +54,13 @@ class Demo extends React.Component {
{
dataKey: 'email',
title: 'Email',
width: 200,
width: '200px',
ordered: true,
},
{
title: '操作',
type: 'action',
width: 200,
width: '200px',
actions: [
{
title: '上移',
Expand All @@ -74,8 +75,8 @@ class Demo extends React.Component {
];

const renderProps = {
height: 400,
width: 1000,
height: '400px',
width: '1000px',
showSearch: true,
levels: 2,
fetchUrl: `${urlPrefix}demo/data.json`,
Expand All @@ -95,4 +96,4 @@ class Demo extends React.Component {
}
}

module.exports = Demo;
export default Demo;
Loading

0 comments on commit aa71566

Please sign in to comment.