Parcourir la source

Merge branch 'master' into v2

jim il y a 7 ans
Parent
commit
f9533343dc

+ 0 - 1
.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: {

+ 1 - 2
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",

+ 1 - 1
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':

+ 3 - 3
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') || []; // 获取图形对应的

+ 2 - 2
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],
     };
 

+ 17 - 0
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,

+ 4 - 4
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