From fba1af02e4ebe0bfc06306bf12284f210626948d Mon Sep 17 00:00:00 2001 From: Ethan_Wan Date: Wed, 4 Jul 2018 10:35:25 +0800 Subject: [PATCH 01/38] feat: instead of dva/dynamic using react-loadable --- package.json | 1 + src/common/router.js | 30 ++++++++++++++++-------------- src/index.less | 10 +++++----- src/router.js | 7 +------ 4 files changed, 23 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index b5f49b19..1c372b6f 100755 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "mockjs": "^1.0.1-beta3", "prettier": "1.13.5", "pro-download": "^1.0.1", + "react-loadable": "^5.4.0", "redbox-react": "^1.5.0", "regenerator-runtime": "^0.12.0", "roadhog": "^2.4.2", diff --git a/src/common/router.js b/src/common/router.js index e7312c48..25379fb9 100644 --- a/src/common/router.js +++ b/src/common/router.js @@ -1,6 +1,7 @@ -import { createElement } from 'react'; -import dynamic from 'dva/dynamic'; +import React, { createElement } from 'react'; +import { Spin } from 'antd'; import pathToRegexp from 'path-to-regexp'; +import Loadable from 'react-loadable'; import { getMenuData } from './menu'; let routerDataCache; @@ -13,15 +14,17 @@ const modelNotExisted = (app, model) => // wrapper of dynamic const dynamicWrapper = (app, models, component) => { + // register models + models.forEach(model => { + if (modelNotExisted(app, model)) { + // eslint-disable-next-line + app.model(require(`../models/${model}`).default); + } + }); + // () => require('module') // transformed by babel-plugin-dynamic-import-node-sync if (component.toString().indexOf('.then(') < 0) { - models.forEach(model => { - if (modelNotExisted(app, model)) { - // eslint-disable-next-line - app.model(require(`../models/${model}`).default); - } - }); return props => { if (!routerDataCache) { routerDataCache = getRouterData(app); @@ -33,12 +36,8 @@ const dynamicWrapper = (app, models, component) => { }; } // () => import('module') - return dynamic({ - app, - models: () => - models.filter(model => modelNotExisted(app, model)).map(m => import(`../models/${m}.js`)), - // add routerData prop - component: () => { + return Loadable({ + loader: () => { if (!routerDataCache) { routerDataCache = getRouterData(app); } @@ -51,6 +50,9 @@ const dynamicWrapper = (app, models, component) => { }); }); }, + loading: () => { + return ; + }, }); }; diff --git a/src/index.less b/src/index.less index 5cfe914a..3a277746 100644 --- a/src/index.less +++ b/src/index.less @@ -18,14 +18,14 @@ body { -moz-osx-font-smoothing: grayscale; } -.globalSpin { - width: 100%; - margin: 40px 0 !important; -} - // temp fix for https://github.com/ant-design/ant-design/commit/a1fafb5b727b62cb0be29ce6e9eca8f579d4f8b7 :global { .ant-spin-container { overflow: visible !important; } + + .global-spin { + width: 100%; + margin: 40px 0 !important; + } } diff --git a/src/router.js b/src/router.js index 15e2634a..9eb5a116 100644 --- a/src/router.js +++ b/src/router.js @@ -1,18 +1,13 @@ import React from 'react'; import { routerRedux, Route, Switch } from 'dva/router'; -import { LocaleProvider, Spin } from 'antd'; +import { LocaleProvider } from 'antd'; import zhCN from 'antd/lib/locale-provider/zh_CN'; -import dynamic from 'dva/dynamic'; import { getRouterData } from './common/router'; import Authorized from './utils/Authorized'; import { getQueryPath } from './utils/utils'; -import styles from './index.less'; const { ConnectedRouter } = routerRedux; const { AuthorizedRoute } = Authorized; -dynamic.setDefaultLoadingComponent(() => { - return ; -}); function RouterConfig({ history, app }) { const routerData = getRouterData(app); From e1e0a7d22ec4caa2df51a78681b527e0cda42d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Thu, 5 Jul 2018 10:45:03 +0800 Subject: [PATCH 02/38] style: Card should not use Spin --- src/components/Charts/ChartCard/index.js | 10 +++------- src/components/Charts/ChartCard/index.less | 4 ---- src/routes/Dashboard/Analysis.js | 4 ++++ 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/components/Charts/ChartCard/index.js b/src/components/Charts/ChartCard/index.js index c3ee1865..5f74de50 100644 --- a/src/components/Charts/ChartCard/index.js +++ b/src/components/Charts/ChartCard/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Card, Spin } from 'antd'; +import { Card } from 'antd'; import classNames from 'classnames'; import styles from './index.less'; @@ -64,12 +64,8 @@ const ChartCard = ({ ); return ( - - { - - {content} - - } + + {content} ); }; diff --git a/src/components/Charts/ChartCard/index.less b/src/components/Charts/ChartCard/index.less index fa2eb16d..bee44938 100644 --- a/src/components/Charts/ChartCard/index.less +++ b/src/components/Charts/ChartCard/index.less @@ -72,7 +72,3 @@ margin-top: 20px; } } - -.spin :global(.ant-spin-container) { - overflow: visible; -} diff --git a/src/routes/Dashboard/Analysis.js b/src/routes/Dashboard/Analysis.js index 6ffb6df7..82c3a615 100644 --- a/src/routes/Dashboard/Analysis.js +++ b/src/routes/Dashboard/Analysis.js @@ -261,6 +261,7 @@ export default class Analysis extends Component { @@ -284,6 +285,7 @@ export default class Analysis extends Component { @@ -300,6 +302,7 @@ export default class Analysis extends Component { @@ -316,6 +319,7 @@ export default class Analysis extends Component { From 9bf818a9ea78e2a1a7f3b74a3fed10990a25fb7e Mon Sep 17 00:00:00 2001 From: niko <644506165@qq.com> Date: Mon, 9 Jul 2018 17:58:13 +0800 Subject: [PATCH 03/38] Add overflow-wrap & wordWrap for ? character break line. Fix: #1767 (#1808) --- src/components/Ellipsis/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/Ellipsis/index.js b/src/components/Ellipsis/index.js index 8cae96a5..01083bda 100644 --- a/src/components/Ellipsis/index.js +++ b/src/components/Ellipsis/index.js @@ -8,6 +8,11 @@ import styles from './index.less'; const isSupportLineClamp = document.body.style.webkitLineClamp !== undefined; +const TooltipOverlayStyle = { + overflowWrap: 'break-word', + wordWrap: 'break-word', +}; + export const getStrFullLength = (str = '') => { return str.split('').reduce((pre, cur) => { const charCode = cur.charCodeAt(0); @@ -54,7 +59,7 @@ const EllipsisText = ({ text, length, tooltip, fullWidthRecognition, ...other }) if (tooltip) { return ( - + {displayText} {tail} @@ -223,7 +228,7 @@ export default class Ellipsis extends Component {
{tooltip ? ( - + {children} ) : ( @@ -244,7 +249,7 @@ export default class Ellipsis extends Component {
{tooltip ? ( - + {childNode} ) : ( From 2a761d4d916c48dbd2cc77522b426968ec1da6cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Thu, 12 Jul 2018 09:52:46 +0800 Subject: [PATCH 04/38] bugfix: change version to 1.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1c372b6f..44ef6a59 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "2.0.0-beta.1", + "version": "1.3.0", "description": "An out-of-box UI solution for enterprise applications", "private": true, "scripts": { From 53c4e7a6c318986ef4d38c13da1b4672c54c7143 Mon Sep 17 00:00:00 2001 From: Leonardo Farroco Date: Sat, 14 Jul 2018 01:42:02 -0300 Subject: [PATCH 05/38] Update README.md (#1844) wording and minor grammar adjustments --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ea7bfaa7..fe990de3 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,12 @@ We need your help: https://github.com/ant-design/ant-design-pro/issues/120 - :gem: **Neat Design**: Follow [Ant Design specification](http://ant.design/) - :triangular_ruler: **Common Templates**: Typical templates for enterprise applications - :rocket: **State of The Art Development**: Newest development stack of React/dva/antd -- :iphone: **Responsive**: Designed for varies of screen size +- :iphone: **Responsive**: Designed for variable screen sizes - :art: **Theming**: Customizable theme with simple config - :globe_with_meridians: **International**: Built-in i18n solution -- :gear: **Best Practice**: Solid workflow make your code health +- :gear: **Best Practices**: Solid workflow to make your code healthy - :1234: **Mock development**: Easy to use mock development solution -- :white_check_mark: **UI Test**: Fly safely with unit test and e2e test +- :white_check_mark: **UI Test**: Fly safely with unit and e2e tests ## Templates @@ -84,7 +84,7 @@ $ mkdir pro-demo && cd pro-demo $ pro new ``` -More instruction at [documentation](http://pro.ant.design/docs/getting-started). +More instructions at [documentation](http://pro.ant.design/docs/getting-started). ## Compatibility @@ -92,8 +92,8 @@ Modern browsers and IE11. ## Contributing -Any Contribution of following ways will be welcome: +Any type of contribution is welcome, here are some examples of how you may contribute to this project: - Use Ant Design Pro in your daily work. -- Submit [issue](http://github.com/ant-design/ant-design-pro/issues) to report bug or ask questions. -- Propose [pull request](http://github.com/ant-design/ant-design-pro/pulls) to improve our code. +- Submit [issues](http://github.com/ant-design/ant-design-pro/issues) to report bugs or ask questions. +- Propose [pull requests](http://github.com/ant-design/ant-design-pro/pulls) to improve our code. From ecbd99dfbb93acfe4b24c68d0e6c56583faefd92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Sun, 15 Jul 2018 20:09:40 +0800 Subject: [PATCH 06/38] Optimization: delete externals --- .webpackrc.js | 1 - src/index.ejs | 2 -- 2 files changed, 3 deletions(-) diff --git a/.webpackrc.js b/.webpackrc.js index 8515c0b4..cf91d6d6 100755 --- a/.webpackrc.js +++ b/.webpackrc.js @@ -10,7 +10,6 @@ export default { }, externals: { '@antv/data-set': 'DataSet', - bizcharts: 'BizCharts', rollbar: 'rollbar', }, alias: { diff --git a/src/index.ejs b/src/index.ejs index c2df6f13..6d0be3b7 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -7,8 +7,6 @@ Ant Design Pro - - From 4e7864747e3bb5a505f64f5ee9f6cf24e5e1997f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Mon, 16 Jul 2018 09:30:27 +0800 Subject: [PATCH 07/38] Optimization: Use non-confused CDN --- src/index.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ejs b/src/index.ejs index 6d0be3b7..25318638 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -8,7 +8,7 @@ Ant Design Pro - + From 7d68af16df55eaa9cf39195caa8bbd19ac9b721e Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 16 Jul 2018 16:35:42 +0800 Subject: [PATCH 08/38] Add hostWhiteList for rollbar --- src/rollbar.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rollbar.js b/src/rollbar.js index f333309f..b62df996 100644 --- a/src/rollbar.js +++ b/src/rollbar.js @@ -6,6 +6,7 @@ if (location.host === 'preview.pro.ant.design') { accessToken: '033ca6d7c0eb4cc1831cf470c2649971', captureUncaught: true, captureUnhandledRejections: true, + hostWhiteList: ['ant.design'], payload: { environment: 'production', }, From e3cb9b2d50aade2e03a804e550db2c02eae08cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E4=BC=9F=E8=8D=A3?= Date: Mon, 16 Jul 2018 14:31:23 +0800 Subject: [PATCH 09/38] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BE=A7=E8=BE=B9?= =?UTF-8?q?=E6=A0=8F=E8=8F=9C=E5=8D=95=E4=B8=8D=E8=83=BD=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SiderMenu/SiderMenu.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/SiderMenu/SiderMenu.js b/src/components/SiderMenu/SiderMenu.js index aab2aaff..fb8f1a76 100644 --- a/src/components/SiderMenu/SiderMenu.js +++ b/src/components/SiderMenu/SiderMenu.js @@ -51,7 +51,6 @@ export const getMenuMatchKeys = (flatMenuKeys, paths) => export default class SiderMenu extends PureComponent { constructor(props) { super(props); - this.menus = props.menuData; this.flatMenuKeys = getFlatMenuKeys(props.menuData); this.state = { openKeys: this.getDefaultCollapsedSubMenus(props), @@ -197,7 +196,7 @@ export default class SiderMenu extends PureComponent { }; isMainMenu = key => { - return this.menus.some(item => key && (item.key === key || item.path === key)); + return this.props.menuData.some(item => key && (item.key === key || item.path === key)); }; handleOpenChange = openKeys => { @@ -247,7 +246,7 @@ export default class SiderMenu extends PureComponent { selectedKeys={selectedKeys} style={{ padding: '16px 0', width: '100%' }} > - {this.getNavMenuItems(this.menus)} + {this.getNavMenuItems(this.props.menuData)} ); From 4903acb4084bccec60cba339c24b46bbc5018355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E4=BC=9F=E8=8D=A3?= Date: Mon, 16 Jul 2018 18:01:39 +0800 Subject: [PATCH 10/38] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BE=A7=E8=BE=B9?= =?UTF-8?q?=E6=A0=8F=E8=8F=9C=E5=8D=95=E4=B8=8D=E8=83=BD=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SiderMenu/SiderMenu.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/SiderMenu/SiderMenu.js b/src/components/SiderMenu/SiderMenu.js index fb8f1a76..5d26bfd8 100644 --- a/src/components/SiderMenu/SiderMenu.js +++ b/src/components/SiderMenu/SiderMenu.js @@ -196,7 +196,8 @@ export default class SiderMenu extends PureComponent { }; isMainMenu = key => { - return this.props.menuData.some(item => key && (item.key === key || item.path === key)); + const { menuData } = this.props; + return menuData.some(item => key && (item.key === key || item.path === key)); }; handleOpenChange = openKeys => { @@ -208,7 +209,7 @@ export default class SiderMenu extends PureComponent { }; render() { - const { logo, collapsed, onCollapse } = this.props; + const { logo, menuData, collapsed, onCollapse } = this.props; const { openKeys } = this.state; // Don't show popup menu when it is been collapsed const menuProps = collapsed @@ -246,7 +247,7 @@ export default class SiderMenu extends PureComponent { selectedKeys={selectedKeys} style={{ padding: '16px 0', width: '100%' }} > - {this.getNavMenuItems(this.props.menuData)} + {this.getNavMenuItems(menuData)} ); From 529dff86a6b57b2be88a28d69383c0b054e09e6c Mon Sep 17 00:00:00 2001 From: eruca Date: Mon, 16 Jul 2018 00:22:51 +0100 Subject: [PATCH 11/38] =?UTF-8?q?=E5=87=8F=E5=B0=91=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E5=8F=8A=E4=BF=AE=E6=AD=A3=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=96=87=E6=A1=A3=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SiderMenu/SiderMenu.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/SiderMenu/SiderMenu.js b/src/components/SiderMenu/SiderMenu.js index 5d26bfd8..8c2f77d1 100644 --- a/src/components/SiderMenu/SiderMenu.js +++ b/src/components/SiderMenu/SiderMenu.js @@ -13,18 +13,19 @@ const { SubMenu } = Menu; // icon: 'http://demo.com/icon.png', // icon: , const getIcon = icon => { - if (typeof icon === 'string' && icon.indexOf('http') === 0) { - return icon; - } if (typeof icon === 'string') { + if (icon.indexOf('http') === 0) { + return icon; + } return ; } + return icon; }; /** * Recursively flatten the data - * [{path:string},{path:string}] => {path,path2} + * [{path:string},{path:string}] => [path,path2] * @param menu */ export const getFlatMenuKeys = menu => From ae3857515dee4956e6a919aac185fa420116a728 Mon Sep 17 00:00:00 2001 From: gentlecoder <610249080@qq.com> Date: Thu, 19 Jul 2018 14:50:27 +0800 Subject: [PATCH 12/38] remove unused closing tag (#1876) --- src/index.ejs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.ejs b/src/index.ejs index 25318638..f765d460 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -7,7 +7,6 @@ Ant Design Pro - From c294c85bf16e0162298ec16d3d568be1bed65ac1 Mon Sep 17 00:00:00 2001 From: yoyo837 Date: Mon, 23 Jul 2018 11:49:59 +0800 Subject: [PATCH 13/38] FooterToolBar width is fixed at 100% when using rc-drawer SliderMenu. --- src/components/FooterToolbar/index.js | 34 ++++++++++++++++++++++++++- src/routes/Forms/AdvancedForm.js | 24 +------------------ 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/src/components/FooterToolbar/index.js b/src/components/FooterToolbar/index.js index d5ce75b8..d43f72fb 100644 --- a/src/components/FooterToolbar/index.js +++ b/src/components/FooterToolbar/index.js @@ -1,12 +1,44 @@ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import classNames from 'classnames'; import styles from './index.less'; export default class FooterToolbar extends Component { + static contextTypes = { + isMobile: PropTypes.bool, + }; + + state = { + width: undefined, + }; + + componentDidMount() { + window.addEventListener('resize', this.resizeFooterToolbar); + this.resizeFooterToolbar(); + } + + componentWillUnmount() { + window.removeEventListener('resize', this.resizeFooterToolbar); + } + + resizeFooterToolbar = () => { + const sider = document.querySelector('.ant-layout-sider'); + if (sider == null) { + return; + } + const { isMobile } = this.context; + const width = isMobile ? null : `calc(100% - ${sider.style.width})`; + const { width: stateWidth } = this.state; + if (stateWidth !== width) { + this.setState({ width }); + } + }; + render() { const { children, className, extra, ...restProps } = this.props; + const { width } = this.state; return ( -
+
{extra}
{children}
diff --git a/src/routes/Forms/AdvancedForm.js b/src/routes/Forms/AdvancedForm.js index 6ab2bfb9..94bc3c54 100644 --- a/src/routes/Forms/AdvancedForm.js +++ b/src/routes/Forms/AdvancedForm.js @@ -58,29 +58,7 @@ const tableData = [ ]; class AdvancedForm extends PureComponent { - state = { - width: '100%', - }; - - componentDidMount() { - window.addEventListener('resize', this.resizeFooterToolbar); - } - - componentWillUnmount() { - window.removeEventListener('resize', this.resizeFooterToolbar); - } - - resizeFooterToolbar = () => { - const sider = document.querySelectorAll('.ant-layout-sider')[0]; - const width = `calc(100% - ${sider.style.width})`; - const { width: stateWidth } = this.state; - if (stateWidth !== width) { - this.setState({ width }); - } - }; - render() { - const { width: stateWidth } = this.state; const { form, dispatch, submitting } = this.props; const { getFieldDecorator, validateFieldsAndScroll, getFieldsError } = form; const validate = () => { @@ -289,7 +267,7 @@ class AdvancedForm extends PureComponent { initialValue: tableData, })()} - + {getErrorInfo()}
- {tabList && - tabList.length && ( - - {tabList.map(item => )} - - )} + {(tabList && tabList.length) ? ( + + {tabList.map(item => )} + + ) : null}
); } From 0196493ae0120e93f97ddd04f71ef17fee4f6df8 Mon Sep 17 00:00:00 2001 From: KJlmfe Date: Thu, 2 Aug 2018 21:51:28 +0800 Subject: [PATCH 24/38] refactor: connect,Form.create use decorator --- src/layouts/BasicLayout.js | 15 +++++++-------- src/routes/Forms/AdvancedForm.js | 12 ++++++------ src/routes/Forms/StepForm/Step1.js | 9 ++++----- src/routes/Forms/StepForm/Step3.js | 9 ++++----- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index 0f17b4ec..4fcdac68 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -88,7 +88,13 @@ enquireScreen(b => { isMobile = b; }); -class BasicLayout extends React.PureComponent { +@connect(({ user, global = {}, loading }) => ({ + currentUser: user.currentUser, + collapsed: global.collapsed, + fetchingNotices: loading.effects['global/fetchNotices'], + notices: global.notices, +})) +export default class BasicLayout extends React.PureComponent { static childContextTypes = { location: PropTypes.object, breadcrumbNameMap: PropTypes.object, @@ -301,10 +307,3 @@ class BasicLayout extends React.PureComponent { ); } } - -export default connect(({ user, global = {}, loading }) => ({ - currentUser: user.currentUser, - collapsed: global.collapsed, - fetchingNotices: loading.effects['global/fetchNotices'], - notices: global.notices, -}))(BasicLayout); diff --git a/src/routes/Forms/AdvancedForm.js b/src/routes/Forms/AdvancedForm.js index 94bc3c54..5b5f03a1 100644 --- a/src/routes/Forms/AdvancedForm.js +++ b/src/routes/Forms/AdvancedForm.js @@ -57,7 +57,12 @@ const tableData = [ }, ]; -class AdvancedForm extends PureComponent { +@connect(({ global, loading }) => ({ + collapsed: global.collapsed, + submitting: loading.effects['form/submitAdvancedForm'], +})) +@Form.create() +export default class AdvancedForm extends PureComponent { render() { const { form, dispatch, submitting } = this.props; const { getFieldDecorator, validateFieldsAndScroll, getFieldsError } = form; @@ -277,8 +282,3 @@ class AdvancedForm extends PureComponent { ); } } - -export default connect(({ global, loading }) => ({ - collapsed: global.collapsed, - submitting: loading.effects['form/submitAdvancedForm'], -}))(Form.create()(AdvancedForm)); diff --git a/src/routes/Forms/StepForm/Step1.js b/src/routes/Forms/StepForm/Step1.js index 5082c1a3..03062009 100644 --- a/src/routes/Forms/StepForm/Step1.js +++ b/src/routes/Forms/StepForm/Step1.js @@ -15,8 +15,11 @@ const formItemLayout = { }, }; +@connect(({ form }) => ({ + data: form.step, +})) @Form.create() -class Step1 extends React.PureComponent { +export default class Step1 extends React.PureComponent { render() { const { form, dispatch, data } = this.props; const { getFieldDecorator, validateFields } = form; @@ -108,7 +111,3 @@ class Step1 extends React.PureComponent { ); } } - -export default connect(({ form }) => ({ - data: form.step, -}))(Step1); diff --git a/src/routes/Forms/StepForm/Step3.js b/src/routes/Forms/StepForm/Step3.js index 9a8d6d46..196e0155 100644 --- a/src/routes/Forms/StepForm/Step3.js +++ b/src/routes/Forms/StepForm/Step3.js @@ -5,7 +5,10 @@ import { routerRedux } from 'dva/router'; import Result from 'components/Result'; import styles from './style.less'; -class Step3 extends React.PureComponent { +@connect(({ form }) => ({ + data: form.step, +})) +export default class Step3 extends React.PureComponent { render() { const { dispatch, data } = this.props; const onFinish = () => { @@ -67,7 +70,3 @@ class Step3 extends React.PureComponent { ); } } - -export default connect(({ form }) => ({ - data: form.step, -}))(Step3); From ff744a3771624a916488bc7607de0421f78a2d3d Mon Sep 17 00:00:00 2001 From: Alex Agafonov Date: Thu, 2 Aug 2018 21:41:47 +0300 Subject: [PATCH 25/38] Russian README file added --- README.ru-RU.md | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 README.ru-RU.md diff --git a/README.ru-RU.md b/README.ru-RU.md new file mode 100644 index 00000000..51063c6a --- /dev/null +++ b/README.ru-RU.md @@ -0,0 +1,99 @@ +Русский | [English](./README.md) | [简体中文](./README.zh-CN.md) + +# Ant Design Pro + +[![](https://img.shields.io/travis/ant-design/ant-design-pro/master.svg?style=flat-square)](https://travis-ci.org/ant-design/ant-design-pro) +[![Build status](https://ci.appveyor.com/api/projects/status/67fxu2by3ibvqtat/branch/master?svg=true)](https://ci.appveyor.com/project/afc163/ant-design-pro/branch/master) +[![Dependencies](https://img.shields.io/david/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro) +[![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro#info=devDependencies&view=list) +[![Gitter](https://badges.gitter.im/ant-design/ant-design-pro.svg)](https://gitter.im/ant-design/ant-design-pro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) + +UI-решение "из коробки" для корпоративных приложений как React boilerplate + +![](https://gw.alipayobjects.com/zos/rmsportal/xEdBqwSzvoSapmnSnYjU.png) + +- Демо: http://preview.pro.ant.design +- Домашняя страница: http://pro.ant.design +- Документация: http://pro.ant.design/docs/getting-started +- История изменений: http://pro.ant.design/docs/changelog +- FAQ: http://pro.ant.design/docs/faq +- Китайское зеркало сайта: http://ant-design-pro.gitee.io + +## Поиск переводчиков :loudspeaker: + +Нам нужна ваша помощь: https://github.com/ant-design/ant-design-pro/issues/120 + +## Возможности + +- :gem: **Neat Design**: Follow [Ant Design specification](http://ant.design/) +- :triangular_ruler: **Common Templates**: Typical templates for enterprise applications +- :rocket: **State of The Art Development**: Newest development stack of React/dva/antd +- :iphone: **Responsive**: Designed for variable screen sizes +- :art: **Theming**: Customizable theme with simple config +- :globe_with_meridians: **International**: Built-in i18n solution +- :gear: **Best Practices**: Solid workflow to make your code healthy +- :1234: **Mock development**: Easy to use mock development solution +- :white_check_mark: **UI Test**: Fly safely with unit and e2e tests + +## Шаблоны + +``` +- Dashboard + - Analytic + - Monitor + - Workspace +- Form + - Basic Form + - Step Form + - Advanced From +- List + - Standard Table + - Standard List + - Card List + - Search List (Project/Applications/Article) +- Profile + - Simple Profile + - Advanced Profile +- Result + - Success + - Failed +- Exception + - 403 + - 404 + - 500 +- User + - Login + - Register + - Register Result +``` + +## Использование + +```bash +$ git clone https://github.com/ant-design/ant-design-pro.git --depth=1 +$ cd ant-design-pro +$ npm install +$ npm start # visit http://localhost:8000 +``` + +Or you can use the command tool: [ant-design-pro-cli](https://github.com/ant-design/ant-design-pro-cli) + +```bash +$ npm install ant-design-pro-cli -g +$ mkdir pro-demo && cd pro-demo +$ pro new +``` + +More instructions at [documentation](http://pro.ant.design/docs/getting-started). + +## Совместимость + +Modern browsers and IE11. + +## Распространение + +Any type of contribution is welcome, here are some examples of how you may contribute to this project: + +- Use Ant Design Pro in your daily work. +- Submit [issues](http://github.com/ant-design/ant-design-pro/issues) to report bugs or ask questions. +- Propose [pull requests](http://github.com/ant-design/ant-design-pro/pulls) to improve our code. From 8900d03e79bf94b7249486a409e76ba4020cdd8a Mon Sep 17 00:00:00 2001 From: Alex Agafonov Date: Thu, 2 Aug 2018 22:01:13 +0300 Subject: [PATCH 26/38] Russian README translation added --- README.ru-RU.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.ru-RU.md b/README.ru-RU.md index 51063c6a..a3dd14fb 100644 --- a/README.ru-RU.md +++ b/README.ru-RU.md @@ -25,15 +25,15 @@ UI-решение "из коробки" для корпоративных при ## Возможности -- :gem: **Neat Design**: Follow [Ant Design specification](http://ant.design/) -- :triangular_ruler: **Common Templates**: Typical templates for enterprise applications -- :rocket: **State of The Art Development**: Newest development stack of React/dva/antd -- :iphone: **Responsive**: Designed for variable screen sizes -- :art: **Theming**: Customizable theme with simple config -- :globe_with_meridians: **International**: Built-in i18n solution -- :gear: **Best Practices**: Solid workflow to make your code healthy -- :1234: **Mock development**: Easy to use mock development solution -- :white_check_mark: **UI Test**: Fly safely with unit and e2e tests +- :gem: **Аккуратный дизайн**: Посмотрите [спецификацию Ant Design](http://ant.design/) +- :triangular_ruler: **Общие шаблоны**: Стандартные шаблоны для корпоративных приложений +- :rocket: **Разработка, как искусство**: Новейший стек технологий React/dva/antd +- :iphone: **Отзывчивая верстка**: Создан для экранов разных размеров +- :art: **Темизация**: Возможность изменения темы с помощью конфигурации +- :globe_with_meridians: **Мультиязычность**: Встроенное i18n решение +- :gear: **Лучшие практики**: Надежные процессы для хорошего кода +- :1234: **Разработка по шиблону**: Простое в использовании решение для разработки +- :white_check_mark: **UI тесты**: Разрабатывайте безопасно с юнит и e2e тестами ## Шаблоны @@ -76,7 +76,7 @@ $ npm install $ npm start # visit http://localhost:8000 ``` -Or you can use the command tool: [ant-design-pro-cli](https://github.com/ant-design/ant-design-pro-cli) +Также можно использовать инструмент командной строки: [ant-design-pro-cli](https://github.com/ant-design/ant-design-pro-cli) ```bash $ npm install ant-design-pro-cli -g @@ -84,16 +84,16 @@ $ mkdir pro-demo && cd pro-demo $ pro new ``` -More instructions at [documentation](http://pro.ant.design/docs/getting-started). +Больше информации в [документации](http://pro.ant.design/docs/getting-started). ## Совместимость -Modern browsers and IE11. +Современные браузеры и IE11. ## Распространение -Any type of contribution is welcome, here are some examples of how you may contribute to this project: +Любые варианты распространения приветствуются! Вот несколько примероы того, как вы можете помочь распространению проекта: -- Use Ant Design Pro in your daily work. -- Submit [issues](http://github.com/ant-design/ant-design-pro/issues) to report bugs or ask questions. -- Propose [pull requests](http://github.com/ant-design/ant-design-pro/pulls) to improve our code. +- Использовать Ant Design Pro в ежедневной работе. +- Создавать [задачи](http://github.com/ant-design/ant-design-pro/issues) заводить баги или отвечать на вопросы. +- Делать [pull-реквесты](http://github.com/ant-design/ant-design-pro/pulls) для совершенствования нашего кода. From 53b49177008a322f94343d84fb5463d60a472223 Mon Sep 17 00:00:00 2001 From: Alex Agafonov Date: Thu, 2 Aug 2018 22:05:29 +0300 Subject: [PATCH 27/38] Added link to russian README file to all README --- README.md | 2 +- README.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fe990de3..f37af7a6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -English | [简体中文](./README.zh-CN.md) +[Русский](./README.ru-RU.md) | English | [简体中文](./README.zh-CN.md) # Ant Design Pro diff --git a/README.zh-CN.md b/README.zh-CN.md index 030d506c..22e18395 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,4 +1,4 @@ -[English](./README.md) | 简体中文 +[Русский](./README.ru-RU.md) | [English](./README.md) | 简体中文 # Ant Design Pro From d7b4f8005561585fc0fac3610a04bedb299d7cd1 Mon Sep 17 00:00:00 2001 From: Yun Chen Date: Thu, 2 Aug 2018 12:33:00 +0800 Subject: [PATCH 28/38] [BugFix] Fix chart data type and requirement By watching TimelineChart Example: [Charts Demo](https://pro.ant.design/components/Charts#scaffold-src-components-Charts-demo-mini-area) ```javascript const chartData = []; for (let i = 0; i < 20; i += 1) { chartData.push({ x: (new Date().getTime()) + (1000 * 60 * 30 * i), y1: Math.floor(Math.random() * 100) + 1000, y2: Math.floor(Math.random() * 100) + 10, }); } ``` 1. X-Axis (Timeline): The type should be like `number`. 2. Y-Axis (Value): The y2 may not be required if I just want to draw y1 only. --- src/components/Charts/TimelineChart/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Charts/TimelineChart/index.d.ts b/src/components/Charts/TimelineChart/index.d.ts index d9312fe6..40b94325 100644 --- a/src/components/Charts/TimelineChart/index.d.ts +++ b/src/components/Charts/TimelineChart/index.d.ts @@ -1,11 +1,11 @@ import * as React from 'react'; export interface ITimelineChartProps { data: Array<{ - x: string; - y1: string; - y2: string; + x: number; + y1: number; + y2?: number; }>; - titleMap: { y1: string; y2: string }; + titleMap: { y1: string; y2?: string }; padding?: [number, number, number, number]; height?: number; style?: React.CSSProperties; From 11df35979ff5229c9a673657e466fe78847bcf23 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 4 Aug 2018 19:26:31 +0800 Subject: [PATCH 29/38] update browser support table --- README.md | 6 +++++- README.ru-RU.md | 4 ++++ README.zh-CN.md | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f37af7a6..08a4a950 100644 --- a/README.md +++ b/README.md @@ -86,10 +86,14 @@ $ pro new More instructions at [documentation](http://pro.ant.design/docs/getting-started). -## Compatibility +## Browsers support Modern browsers and IE11. +| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | +| --------- | --------- | --------- | --------- | --------- | +| IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions + ## Contributing Any type of contribution is welcome, here are some examples of how you may contribute to this project: diff --git a/README.ru-RU.md b/README.ru-RU.md index a3dd14fb..6110c1ab 100644 --- a/README.ru-RU.md +++ b/README.ru-RU.md @@ -90,6 +90,10 @@ $ pro new Современные браузеры и IE11. +| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | +| --------- | --------- | --------- | --------- | --------- | +| IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions + ## Распространение Любые варианты распространения приветствуются! Вот несколько примероы того, как вы можете помочь распространению проекта: diff --git a/README.zh-CN.md b/README.zh-CN.md index 22e18395..c309441e 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -82,10 +82,14 @@ $ pro new 更多信息请参考 [使用文档](http://pro.ant.design/docs/getting-started)。 -## 兼容性 +## 支持环境 现代浏览器及 IE11。 +| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | +| --------- | --------- | --------- | --------- | --------- | +| IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions + ## 参与贡献 我们非常欢迎你的贡献,你可以通过以下方式和我们一起共建 :smiley:: From 189e6c5c599b1cf23570d15b016704ec36793056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Sun, 5 Aug 2018 11:30:11 +0800 Subject: [PATCH 30/38] Features: add buttonText on Login.Captcha --- .gitignore | 2 +- src/components/Login/LoginItem.js | 8 ++++++-- src/components/Login/index.d.ts | 1 + src/components/Login/index.en-US.md | 1 + src/components/Login/index.zh-CN.md | 1 + src/components/PageHeader/index.js | 6 ++++-- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index c8978582..e0a60f36 100755 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies -/node_modules +**/node_modules # roadhog-api-doc ignore /src/utils/request-temp.js _roadhog-api-doc diff --git a/src/components/Login/LoginItem.js b/src/components/Login/LoginItem.js index 2412ff01..05d94638 100644 --- a/src/components/Login/LoginItem.js +++ b/src/components/Login/LoginItem.js @@ -15,6 +15,10 @@ function generator({ defaultProps, defaultRules, type }) { updateActive: PropTypes.func, }; + static defaultProps = { + buttonText: '获取验证码', + }; + constructor(props) { super(props); this.state = { @@ -55,7 +59,7 @@ function generator({ defaultProps, defaultRules, type }) { const { getFieldDecorator } = form; const options = {}; let otherProps = {}; - const { onChange, defaultValue, rules, name, ...restProps } = this.props; + const { onChange, defaultValue, buttonText, rules, name, ...restProps } = this.props; const { count } = this.state; options.rules = rules || defaultRules; if (onChange) { @@ -82,7 +86,7 @@ function generator({ defaultProps, defaultRules, type }) { size="large" onClick={this.onGetCaptcha} > - {count ? `${count} s` : '获取验证码'} + {count ? `${count} s` : buttonText} diff --git a/src/components/Login/index.d.ts b/src/components/Login/index.d.ts index cd88a8b6..9c072867 100644 --- a/src/components/Login/index.d.ts +++ b/src/components/Login/index.d.ts @@ -19,6 +19,7 @@ export interface LoginItemProps { style?: React.CSSProperties; onGetCaptcha?: () => void; placeholder?: string; + buttonText?: React.ReactNode; } export class LoginItem extends React.Component {} diff --git a/src/components/Login/index.en-US.md b/src/components/Login/index.en-US.md index bc38579f..42b5b219 100644 --- a/src/components/Login/index.en-US.md +++ b/src/components/Login/index.en-US.md @@ -39,6 +39,7 @@ Apart from the above properties, Login.Username also support all properties of a Property | Description | Type | Default ----|------|-----|------ onGetCaptcha | callback on getting a new Captcha | () => void | - +buttonText | text on getting a new Captcha | ReactNode | - Apart from the above properties, _Login.Captcha_ support the same properties with _Login.UserName_. diff --git a/src/components/Login/index.zh-CN.md b/src/components/Login/index.zh-CN.md index 98f0f624..2ae84ceb 100644 --- a/src/components/Login/index.zh-CN.md +++ b/src/components/Login/index.zh-CN.md @@ -40,6 +40,7 @@ rules | 校验规则,同 Form getFieldDecorator(id, options) 中 [option.rules 参数 | 说明 | 类型 | 默认值 ----|------|-----|------ onGetCaptcha | 点击获取校验码的回调 | () => void | - +buttonText | 点击获取校验码的说明文字 | ReactNode | - 除上述属性以外,Login.Captcha 支持的属性与 Login.UserName 相同。 diff --git a/src/components/PageHeader/index.js b/src/components/PageHeader/index.js index 59d56fc5..7a602da0 100644 --- a/src/components/PageHeader/index.js +++ b/src/components/PageHeader/index.js @@ -221,14 +221,16 @@ export default class PageHeader extends PureComponent { - {(tabList && tabList.length) ? ( + {tabList && tabList.length ? ( - {tabList.map(item => )} + {tabList.map(item => ( + + ))} ) : null} From 77ce0fdf1ad3397d7bf453194f2bd38a13270b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Sun, 5 Aug 2018 12:04:02 +0800 Subject: [PATCH 31/38] doc:Modify the error of the document --- src/components/Login/index.en-US.md | 2 +- src/components/Login/index.zh-CN.md | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/Login/index.en-US.md b/src/components/Login/index.en-US.md index 42b5b219..a091b0e2 100644 --- a/src/components/Login/index.en-US.md +++ b/src/components/Login/index.en-US.md @@ -39,7 +39,7 @@ Apart from the above properties, Login.Username also support all properties of a Property | Description | Type | Default ----|------|-----|------ onGetCaptcha | callback on getting a new Captcha | () => void | - -buttonText | text on getting a new Captcha | ReactNode | - +buttonText | text on getting a new Captcha | ReactNode | '获取验证码' Apart from the above properties, _Login.Captcha_ support the same properties with _Login.UserName_. diff --git a/src/components/Login/index.zh-CN.md b/src/components/Login/index.zh-CN.md index 2ae84ceb..333ecb78 100644 --- a/src/components/Login/index.zh-CN.md +++ b/src/components/Login/index.zh-CN.md @@ -32,15 +32,14 @@ name | 控件标记,提交数据中同样以此为 key | String | - rules | 校验规则,同 Form getFieldDecorator(id, options) 中 [option.rules 的规则](getFieldDecorator(id, options)) | object[] | - 除上述属性以外,Login.UserName 还支持 antd.Input 的所有属性,并且自带默认的基础配置,包括 `placeholder` `size` `prefix` 等,这些基础配置均可被覆盖。 - -### Login.Password、Login.Mobile 同 Login.UserName +## Login.Password、Login.Mobile 同 Login.UserName ### Login.Captcha 参数 | 说明 | 类型 | 默认值 ----|------|-----|------ onGetCaptcha | 点击获取校验码的回调 | () => void | - -buttonText | 点击获取校验码的说明文字 | ReactNode | - +buttonText | 点击获取校验码的说明文字 | ReactNode | '获取验证码' 除上述属性以外,Login.Captcha 支持的属性与 Login.UserName 相同。 From d69249d6997df916312464ffd8204778107ace4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Sun, 5 Aug 2018 15:01:19 +0800 Subject: [PATCH 32/38] upgrade antd version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f631aa19..4daaea14 100755 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "dependencies": { "@antv/data-set": "^0.8.0", "@babel/polyfill": "^7.0.0-beta.36", - "antd": "3.7.3", + "antd": "^3.8.0", "bizcharts": "^3.1.10", "bizcharts-plugin-slider": "^2.0.1", "classnames": "^2.2.5", From 0dc582209775f0b6a1d01d0cbcde7846d1aa5924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Sun, 5 Aug 2018 17:10:11 +0800 Subject: [PATCH 33/38] up version to 1.4.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4daaea14..fa724ec6 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "1.3.0", + "version": "1.4.0", "description": "An out-of-box UI solution for enterprise applications", "private": true, "scripts": { From 5f54badd2b9ee31b2a31378596e269f46486075c Mon Sep 17 00:00:00 2001 From: Sean Bao Date: Mon, 6 Aug 2018 19:01:24 +0800 Subject: [PATCH 34/38] Fix header search debounce enter --- src/components/HeaderSearch/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/HeaderSearch/index.js b/src/components/HeaderSearch/index.js index b67901fc..3f393642 100644 --- a/src/components/HeaderSearch/index.js +++ b/src/components/HeaderSearch/index.js @@ -65,18 +65,18 @@ export default class HeaderSearch extends PureComponent { }); }; - debouncePressEnter() { - const { onPressEnter } = this.props; - const { value } = this.state; - onPressEnter(value); - } - // NOTE: 不能小于500,如果长按某键,第一次触发auto repeat的间隔是500ms,小于500会导致触发2次 @Bind() @Debounce(500, { leading: true, trailing: false, }) + debouncePressEnter() { + const { onPressEnter } = this.props; + const { value } = this.state; + onPressEnter(value); + } + render() { const { className, placeholder, ...restProps } = this.props; const { searchMode, value } = this.state; From 12e12e8426fa572653dda02ee4d69833f137535c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Tue, 7 Aug 2018 18:26:40 +0800 Subject: [PATCH 35/38] up version to 1.4.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fa724ec6..5081f6c3 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "1.4.0", + "version": "1.4.1", "description": "An out-of-box UI solution for enterprise applications", "private": true, "scripts": { From 8b2b78e64d026e684b6eaf249638056e62d961ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Fri, 10 Aug 2018 07:45:06 +0800 Subject: [PATCH 36/38] fix #1981 change import function --- src/components/NoticeIcon/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/NoticeIcon/index.d.ts b/src/components/NoticeIcon/index.d.ts index 52c4dea3..c36ef001 100644 --- a/src/components/NoticeIcon/index.d.ts +++ b/src/components/NoticeIcon/index.d.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import NoticeIconTab, { INoticeIconData } from './NoticeIconTab'; export interface INoticeIconProps { From a2368883a54e792faea4a6531f3de53b6bcf2e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Fri, 10 Aug 2018 09:04:52 +0800 Subject: [PATCH 37/38] use drawer repalce rc-drawer --- .stylelintrc | 1 + package.json | 11 +++++------ src/components/SiderMenu/index.js | 19 ++++++++----------- src/routes/List/TableList.js | 4 ++-- src/routes/List/TableList.less | 1 + 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index a883e81c..65945123 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -13,6 +13,7 @@ "function-parentheses-newline-inside": null, "function-max-empty-lines": null, "function-whitespace-after": null, + "no-missing-end-of-source-newline": null, "number-leading-zero": null, "number-no-trailing-zeros": null, "rule-empty-line-before": null, diff --git a/package.json b/package.json index 5081f6c3..a3a222ed 100755 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "prettier": "prettier --write ./src/**/**/**/*" }, "dependencies": { - "@antv/data-set": "^0.8.0", + "@antv/data-set": "^0.9.0", "@babel/polyfill": "^7.0.0-beta.36", "antd": "^3.8.0", "bizcharts": "^3.1.10", @@ -38,7 +38,6 @@ "path-to-regexp": "^2.1.0", "prop-types": "^15.5.10", "qs": "^6.5.0", - "rc-drawer": "^1.2.0", "react": "^16.4.1", "react-container-query": "^0.11.0", "react-document-title": "^2.0.3", @@ -56,7 +55,7 @@ "babel-plugin-transform-decorators-legacy": "^1.3.4", "cross-env": "^5.1.1", "cross-port-killer": "^1.0.1", - "enzyme": "^3.1.0", + "enzyme": "^3.4.1", "eslint": "^5.0.0", "eslint-config-airbnb": "^17.0.0", "eslint-config-prettier": "^2.9.0", @@ -70,15 +69,15 @@ "husky": "^0.14.3", "lint-staged": "^7.2.0", "mockjs": "^1.0.1-beta3", - "prettier": "1.14.0", + "prettier": "1.14.2", "pro-download": "^1.0.1", - "react-loadable": "^5.4.0", + "react-loadable": "^5.5.0", "redbox-react": "^1.5.0", "regenerator-runtime": "^0.12.0", "roadhog": "^2.4.2", "roadhog-api-doc": "^1.1.2", "stylelint": "^9.2.1", - "stylelint-config-prettier": "^3.0.4", + "stylelint-config-prettier": "^4.0.0", "stylelint-config-standard": "^18.0.0" }, "optionalDependencies": { diff --git a/src/components/SiderMenu/index.js b/src/components/SiderMenu/index.js index e1f060cf..07b7ea10 100644 --- a/src/components/SiderMenu/index.js +++ b/src/components/SiderMenu/index.js @@ -1,25 +1,22 @@ -import 'rc-drawer/assets/index.css'; import React from 'react'; -import DrawerMenu from 'rc-drawer'; +import { Drawer } from 'antd'; import SiderMenu from './SiderMenu'; const SiderMenuWrapper = props => { const { isMobile, collapsed } = props; return isMobile ? ( - } - onHandleClick={() => { - props.onCollapse(!collapsed); + { + onClose={() => { props.onCollapse(true); }} > - + ) : ( ); diff --git a/src/routes/List/TableList.js b/src/routes/List/TableList.js index c84f1f3b..a3e4e8ec 100644 --- a/src/routes/List/TableList.js +++ b/src/routes/List/TableList.js @@ -295,7 +295,7 @@ export default class TableList extends PureComponent {
- +
@@ -305,7 +305,7 @@ export default class TableList extends PureComponent { 收起 - +
); diff --git a/src/routes/List/TableList.less b/src/routes/List/TableList.less index 60405f26..f3d627ea 100644 --- a/src/routes/List/TableList.less +++ b/src/routes/List/TableList.less @@ -30,6 +30,7 @@ } } .submitButtons { + display: block; white-space: nowrap; margin-bottom: 24px; } From c26ff4286c3409d9b421974c359b077437e8c511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Fri, 10 Aug 2018 09:13:57 +0800 Subject: [PATCH 38/38] The order of modification is the same as the menu --- src/routes/List/List.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/List/List.js b/src/routes/List/List.js index 6dbf62f8..44bc4fa7 100644 --- a/src/routes/List/List.js +++ b/src/routes/List/List.js @@ -30,14 +30,14 @@ export default class SearchList extends Component { key: 'articles', tab: '文章', }, - { - key: 'applications', - tab: '应用', - }, { key: 'projects', tab: '项目', }, + { + key: 'applications', + tab: '应用', + }, ]; const mainSearch = (