diff --git a/.webpackrc.js b/.webpackrc.js index db3421fdb639facd98464d9cb2150b2e5ac72645..ce65d3112aa8f882423aac5cf1518f6f5c4470b0 100755 --- a/.webpackrc.js +++ b/.webpackrc.js @@ -3,7 +3,6 @@ const path = require('path'); export default { entry: 'src/index.js', extraBabelPlugins: [ - 'transform-decorators-legacy', ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }], ], env: { diff --git a/package.json b/package.json index ac8c29c9ac5ade7a58a35cc4e1f3953b141916f5..f2f8eebd5fab233e1322c4af22a46dad5c660737 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "1.2.1", + "version": "1.3.0", "description": "An out-of-box UI solution for enterprise applications", "private": true, "scripts": { @@ -55,7 +55,6 @@ "babel-plugin-dva-hmr": "^0.4.1", "babel-plugin-import": "^1.6.7", "babel-plugin-module-resolver": "^3.1.1", - "babel-plugin-transform-decorators-legacy": "^1.3.4", "cross-env": "^5.1.1", "cross-port-killer": "^1.0.1", "enzyme": "^3.1.0", diff --git a/src/components/Charts/ChartCard/index.js b/src/components/Charts/ChartCard/index.js index c7875b06e2788fcd385daff879b820fc560a6a5e..c3ee1865eebea037cdd7302d00d4f93f9d56af33 100644 --- a/src/components/Charts/ChartCard/index.js +++ b/src/components/Charts/ChartCard/index.js @@ -7,7 +7,7 @@ import styles from './index.less'; const renderTotal = total => { let totalDom; switch (typeof total) { - case undefined: + case 'undefined': totalDom = null; break; case 'function': diff --git a/src/components/Charts/Pie/index.js b/src/components/Charts/Pie/index.js index ac7248d75fd30a12b13a9c6fb12cb43fe72aaff7..0d0dc3c5d174a2ddf374eeccd36d947bda94249f 100644 --- a/src/components/Charts/Pie/index.js +++ b/src/components/Charts/Pie/index.js @@ -19,7 +19,7 @@ export default class Pie extends Component { }; componentDidMount() { - this.getLengendData(); + this.getLegendData(); this.resize(); window.addEventListener('resize', this.resize); } @@ -33,7 +33,7 @@ export default class Pie extends Component { legendData: [...this.state.legendData], }, () => { - this.getLengendData(); + this.getLegendData(); } ); } @@ -49,7 +49,7 @@ export default class Pie extends Component { }; // for custom lengend view - getLengendData = () => { + getLegendData = () => { if (!this.chart) return; const geom = this.chart.getAllGeoms()[0]; // 获取所有的图形 const items = geom.get('dataArray') || []; // 获取图形对应的 diff --git a/src/components/Charts/TimelineChart/index.js b/src/components/Charts/TimelineChart/index.js index f00c9bb69af17f677c5b35742ae3538a9b3b726a..e7ab6b11dea63b237f423855757371bc5fcb3516 100644 --- a/src/components/Charts/TimelineChart/index.js +++ b/src/components/Charts/TimelineChart/index.js @@ -71,8 +71,8 @@ export default class TimelineChart extends React.Component { const timeScale = { type: 'time', - tickCount: 10, - mask: 'HH:MM', + tickInterval: 60 * 60 * 1000, + mask: 'HH:mm', range: [0, 1], }; diff --git a/src/components/Charts/index.js b/src/components/Charts/index.js index 0fbf014436a8eec5a0d443ac91d465765c69d1cc..cacedbce496cd2b4c1ddc986c68a817b9bdc094c 100644 --- a/src/components/Charts/index.js +++ b/src/components/Charts/index.js @@ -15,7 +15,24 @@ import TimelineChart from './TimelineChart'; const yuan = val => `¥ ${numeral(val).format('0,0')}`; +const Charts = { + yuan, + Bar, + Pie, + Gauge, + Radar, + MiniBar, + MiniArea, + MiniProgress, + ChartCard, + Field, + WaterWave, + TagCloud, + TimelineChart, +}; + export { + Charts as default, yuan, Bar, Pie, diff --git a/src/components/Charts/index.md b/src/components/Charts/index.md index e292a247dce27f04cf3a9a244a42490dfab97c2d..cb7c9c96e191d47fe2dac084c25cb194f3c169c0 100644 --- a/src/components/Charts/index.md +++ b/src/components/Charts/index.md @@ -1,5 +1,5 @@ --- -title: +title: en-US: Charts zh-CN: Charts subtitle: 图表 @@ -59,7 +59,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https |----------|------------------------------------------|-------------|-------| | title | 图表标题 | ReactNode\|string | - | | color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` | -| margin | 图表内部间距 | array | \[32, 0, 32, 40\] | +| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` | | height | 图表高度 | number | - | | data | 数据 | array<{x, y}> | - | | autoLabel | 在宽度不足时,自动隐藏 x 轴的 label | boolean | `true` | @@ -72,7 +72,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https | color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` | | height | 图表高度 | number | - | | hasLegend | 是否显示 legend | boolean | `false` | -| margin | 图表内部间距 | array | \[24, 0, 24, 0\] | +| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` | | percent | 占比 | number | - | | tooltip | 是否显示 tooltip | boolean | true | | valueFormat | 显示值的格式化函数 | function | - | @@ -87,7 +87,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https | title | 图表标题 | ReactNode\|string | - | | height | 图表高度 | number | - | | hasLegend | 是否显示 legend | boolean | `false` | -| margin | 图表内部间距 | array | \[24, 30, 16, 30\] | +| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` | | data | 图标数据 | array<{name,label,value}> | - | ### Gauge