Commit 2835ffae authored by jim's avatar jim

merge master

parents deccafe6 df0ffd6d
{
"parser": "babel-eslint",
"extends": ["airbnb", "prettier"],
"env": {
"browser": true,
"node": true,
"es6": true,
"mocha": true,
"jest": true,
"jasmine": true
},
"rules": {
"generator-star-spacing": [0],
"consistent-return": [0],
"react/forbid-prop-types": [0],
"react/jsx-filename-extension": [1, { "extensions": [".js"] }],
"global-require": [1],
"import/prefer-default-export": [0],
"react/jsx-no-bind": [0],
"react/prop-types": [0],
"react/prefer-stateless-function": [0],
"react/jsx-wrap-multilines": [
"error",
{
"declaration": "parens-new-line",
"assignment": "parens-new-line",
"return": "parens-new-line",
"arrow": "parens-new-line",
"condition": "parens-new-line",
"logical": "parens-new-line",
"prop": "ignore"
}
],
"no-else-return": [0],
"no-restricted-syntax": [0],
"import/no-extraneous-dependencies": [0],
"no-use-before-define": [0],
"jsx-a11y/no-static-element-interactions": [0],
"jsx-a11y/no-noninteractive-element-interactions": [0],
"jsx-a11y/click-events-have-key-events": [0],
"jsx-a11y/anchor-is-valid": [0],
"no-nested-ternary": [0],
"arrow-body-style": [0],
"import/extensions": [0],
"no-bitwise": [0],
"no-cond-assign": [0],
"import/no-unresolved": [0],
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "ignore"
}
],
"object-curly-newline": [0],
"function-paren-newline": [0],
"no-restricted-globals": [0],
"require-yield": [1]
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"settings": {
"polyfills": ["fetch", "promises"]
}
}
module.exports = {
parser: 'babel-eslint',
extends: ['airbnb', 'prettier'],
env: {
browser: true,
node: true,
es6: true,
mocha: true,
jest: true,
jasmine: true,
},
rules: {
'generator-star-spacing': [0],
'consistent-return': [0],
'react/forbid-prop-types': [0],
'react/jsx-filename-extension': [1, { extensions: ['.js'] }],
'global-require': [1],
'import/prefer-default-export': [0],
'react/jsx-no-bind': [0],
'react/prop-types': [0],
'react/prefer-stateless-function': [0],
'react/jsx-wrap-multilines': [
'error',
{
declaration: 'parens-new-line',
assignment: 'parens-new-line',
return: 'parens-new-line',
arrow: 'parens-new-line',
condition: 'parens-new-line',
logical: 'parens-new-line',
prop: 'ignore',
},
],
'no-else-return': [0],
'no-restricted-syntax': [0],
'import/no-extraneous-dependencies': [0],
'no-use-before-define': [0],
'jsx-a11y/no-static-element-interactions': [0],
'jsx-a11y/no-noninteractive-element-interactions': [0],
'jsx-a11y/click-events-have-key-events': [0],
'jsx-a11y/anchor-is-valid': [0],
'no-nested-ternary': [0],
'arrow-body-style': [0],
'import/extensions': [0],
'no-bitwise': [0],
'no-cond-assign': [0],
'import/no-unresolved': [0],
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
},
],
'object-curly-newline': [0],
'function-paren-newline': [0],
'no-restricted-globals': [0],
'require-yield': [1],
},
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
settings: {
polyfills: ['fetch', 'promises'],
},
};
......@@ -2,7 +2,7 @@ import * as React from 'react';
export interface IChartCardProps {
title: React.ReactNode;
action?: React.ReactNode;
total?: React.ReactNode | function | number;
total?: React.ReactNode | number | (() => React.ReactNode | number);
footer?: React.ReactNode;
contentHeight?: number;
avatar?: React.ReactNode;
......
......@@ -10,7 +10,7 @@ export interface IPieProps {
x: string | string;
y: number;
}>;
total?: string | function;
total?: React.ReactNode | number | (() => React.ReactNode | number);
title?: React.ReactNode;
tooltip?: boolean;
valueFormat?: (value: string) => string | React.ReactNode;
......
......@@ -3,7 +3,7 @@ import classNames from 'classnames';
import { Row } from 'antd';
import styles from './index.less';
export default ({
const DescriptionList = ({
className,
title,
col = 3,
......@@ -27,3 +27,5 @@ export default ({
</div>
);
};
export default DescriptionList;
......@@ -17,7 +17,8 @@
}
.term {
line-height: 22px;
// Line-height is 22px IE dom height will calculate error
line-height: 20px;
padding-bottom: 16px;
margin-right: 8px;
color: @heading-color;
......
......@@ -4,7 +4,7 @@ import { Button } from 'antd';
import config from './typeConfig';
import styles from './index.less';
export default ({ className, linkElement = 'a', type, title, desc, img, actions, ...rest }) => {
const Exception = ({ className, linkElement = 'a', type, title, desc, img, actions, ...rest }) => {
const pageType = type in config ? type : '404';
const clsString = classNames(styles.exception, className);
return (
......@@ -33,3 +33,5 @@ export default ({ className, linkElement = 'a', type, title, desc, img, actions,
</div>
);
};
export default Exception;
import * as React from 'react';
export interface IGlobalFooterProps {
links?: Array<{
key?: string;
title: React.ReactNode;
href: string;
blankTarget?: boolean;
......
......@@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import styles from './index.less';
export default ({ className, links, copyright }) => {
const GlobalFooter = ({ className, links, copyright }) => {
const clsString = classNames(styles.globalFooter, className);
return (
<div className={clsString}>
......@@ -19,3 +19,5 @@ export default ({ className, links, copyright }) => {
</div>
);
};
export default GlobalFooter;
......@@ -5,7 +5,7 @@ import styles from './index.less';
const FormItem = Form.Item;
export default ({ className, ...rest }) => {
const LoginSubmit = ({ className, ...rest }) => {
const clsString = classNames(styles.submit, className);
return (
<FormItem>
......@@ -13,3 +13,5 @@ export default ({ className, ...rest }) => {
</FormItem>
);
};
export default LoginSubmit;
......@@ -3,7 +3,7 @@ import { Icon } from 'antd';
import classNames from 'classnames';
import styles from './index.less';
export default ({ theme, title, subTitle, total, subTotal, status, suffix, gap, ...rest }) => (
const NumberInfo = ({ theme, title, subTitle, total, subTotal, status, suffix, gap, ...rest }) => (
<div
className={classNames(styles.numberInfo, {
[styles[`numberInfo${theme}`]]: theme,
......@@ -26,3 +26,5 @@ export default ({ theme, title, subTitle, total, subTotal, status, suffix, gap,
</div>
</div>
);
export default NumberInfo;
......@@ -17,8 +17,18 @@ export function getBreadcrumb(breadcrumbNameMap, url) {
}
return breadcrumb || {};
}
export default class PageHeader extends PureComponent {
state = {
breadcrumb: null,
};
componentDidMount() {
this.getBreadcrumbDom();
}
componentWillReceiveProps() {
this.getBreadcrumbDom();
}
onChange = key => {
if (this.props.onTabChange) {
this.props.onTabChange(key);
......@@ -32,6 +42,12 @@ export default class PageHeader extends PureComponent {
breadcrumbNameMap: this.props.breadcrumbNameMap,
};
};
getBreadcrumbDom = () => {
const breadcrumb = this.conversionBreadcrumbList();
this.setState({
breadcrumb,
});
};
// Generated according to props
conversionFromProps = () => {
const { breadcrumbList, breadcrumbSeparator, linkElement = 'a' } = this.props;
......@@ -151,8 +167,8 @@ export default class PageHeader extends PureComponent {
tabDefaultActiveKey,
tabBarExtraContent,
} = this.props;
const clsString = classNames(styles.pageHeader, className);
const breadcrumb = this.conversionBreadcrumbList();
const activeKeyProps = {};
if (tabDefaultActiveKey !== undefined) {
activeKeyProps.defaultActiveKey = tabDefaultActiveKey;
......@@ -163,7 +179,7 @@ export default class PageHeader extends PureComponent {
return (
<div className={clsString}>
{breadcrumb}
{this.state.breadcrumb}
<div className={styles.detail}>
{logo && <div className={styles.logo}>{logo}</div>}
<div className={styles.main}>
......
......@@ -66,7 +66,8 @@
.content,
.extraContent,
.main {
flex: auto;
// IE auto is no have height
flex: 1;
}
.title,
......
......@@ -19,8 +19,8 @@ const getFlatMenuKeys = menuData => {
return keys;
};
export default props =>
props.isMobile || props.fixSiderbar ? (
const SiderMenuWrapper = props =>
props.isMobile ? (
<DrawerMenu
parent={null}
level={null}
......@@ -40,3 +40,5 @@ export default props =>
) : (
<SiderMenu {...props} flatMenuKeys={getFlatMenuKeys(props.menuData)} />
);
export default SiderMenuWrapper;
......@@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import styles from './index.less';
export default ({ title, children, last, block, grid, ...rest }) => {
const StandardFormRow = ({ title, children, last, block, grid, ...rest }) => {
const cls = classNames(styles.standardFormRow, {
[styles.standardFormRowBlock]: block,
[styles.standardFormRowLast]: last,
......@@ -20,3 +20,5 @@ export default ({ title, children, last, block, grid, ...rest }) => {
</div>
);
};
export default StandardFormRow;
......@@ -3,7 +3,8 @@
.container {
display: flex;
flex-direction: column;
min-height: 100%;
height: 100vh;
overflow: auto;
background: #f0f2f5;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment