Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeLin committed Oct 3, 2017
2 parents 530edd9 + 38d2ded commit aafc712
Show file tree
Hide file tree
Showing 8 changed files with 1,732 additions and 559 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
# 版本更新日志

## v1.0.17
- Bug Fix
- 修复`Uploader`组件包含Array.from存在的浏览器兼容性问题。([1963435](https://github.com/ZhonganTechENG/zarm/commit/8dca8a23b446c38d68e6da94d26b033417f644ff)

- Feature
- `Pull`组件新增属性loadDistance:触发上拉加载离底部的距离阀值。([167fef5](https://github.com/ZhonganTechENG/zarm/commit/196343524ad78d1929006a0eb7bbe58bd2befc66)


## v1.0.16
- Break Change
- Panel组件API调整,去除子组件Panel.Title和Panel.More, Panel.Header和Panel.Footer增加属性title和more。([9daa684](https://github.com/ZhonganTechENG/zarm/commit/7f3bfbdc30e4355566dad0d7f0c907a262611ca4)
- Radio 和 Checkbox 单独使用时的样式修改。
- styles目录结构调整,自定义主题方式变更。

- Bug Fix
- 修复`Picker`组件多列的value值一样时导致值错误的bug。([#71](https://github.com/ZhonganTechENG/zarm/pull/71)
- 修复`Picker`组件初始值在异步获取的情况下,点击取消后value丢失的bug。([#72](https://github.com/ZhonganTechENG/zarm/pull/72)
- 修复`SwipeAction`组件touchmove事件在安卓只执行一次的bug。([7f3bfbd](https://github.com/ZhonganTechENG/zarm/commit/8cb0620472523c196ed39523b2793db514f59d55)

- Feature
- 新增`Pull`组件


## v1.0.15
- Bug Fix
- 修复`Badge`组件没有载入原生属性的bug。([20a66f8](https://github.com/ZhonganTechENG/zarm/commit/32879261a694fe5a09820035217105e7b9fd3154)
- 修复`Input`组件maxLength属性没有载入的bug。([ef199da](https://github.com/ZhonganTechENG/zarm/commit/20a66f854b9d5b997c9ca29291a6a9ef6d54b60d)


## v1.0.14
- Break Change
- `Progress`组件type属性更名为shape,表示形状。([f2cccd5](https://github.com/ZhonganTechENG/zarm/commit/1b87e889e80df8b43ede6c4e07c19a0b1cc20e30)
Expand All @@ -13,12 +37,14 @@
- Bug Fix
- 修复`Mask``Icon`组件没有载入原生属性的bug。([f2cccd5](https://github.com/ZhonganTechENG/zarm/commit/1b87e889e80df8b43ede6c4e07c19a0b1cc20e30)


## v1.0.13
- Bug Fix
- 修复`SwipeAction`组件上下滑动时影响了页面scroll滚动的bug。([#69](https://github.com/ZhonganTechENG/zarm/pull/67)
- 修复`Input`组件计算输入字数长度产生性能问题的bug。([f385e48](https://github.com/ZhonganTechENG/zarm/commit/d22c652ef25e63accba306a0d3a58117616a1351))
- 修复`Input`组件showLength为true时初始长度未计算的bug。([c0c5c7f](https://github.com/ZhonganTechENG/zarm/commit/64e3bc308fac9347c9d87e4bc47f843e649f9c19)


## v1.0.11
- Feature
- `Checkbox`新增属性id,并调整文字的显示样式。([4149c01](https://github.com/ZhonganTechENG/zarm/commit/b7135ade392d6edfeb70f90b42ee056d0d969dde)
Expand All @@ -29,17 +55,20 @@
- Improve && Enhancement
- `Swipe`体验优化。循环轮播返回到第一个item时pagination位置更新在动画结束前就执行。([8270305](https://github.com/ZhonganTechENG/zarm/commit/3d8de9671d8d633bd729d4f28ce17d1e1fd4b512)


## v1.0.10
- Bug Fix
- 修复`Picker`dataSource属性改变不能更新的bug。([#67](https://github.com/ZhonganTechENG/zarm/pull/67)

- Feature
- `Picker`新增支持displayRender和displayAddon属性([#67](https://github.com/ZhonganTechENG/zarm/pull/67)


## v1.0.9
- Bug Fix
- 修复`Radio``Checkbox`作为非受控组件时,默认值属性`defaultValue``defaultChecked`不生效的bug。([5d67171](https://github.com/ZhonganTechENG/zarm/commit/02cf971669be6226fb7e148b13512fdc56832d78)


## v1.0.8
- Break Change
- `Stepper`新增onInputChange属性,input默认将不触发onChange事件而触发onInputChange事件。([c6eb5de](https://github.com/ZhonganTechENG/zarm/commit/c6eb5de9a235942b612d3ea1abd90b62e41bbecf))
Expand Down
11 changes: 7 additions & 4 deletions components/Pull/Pull.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ class Pull extends PureComponent {
}

onScroll() {
if (this.state.refreshState !== REFRESH_STATE.normal) return;
if (this.state.loadState !== LOAD_STATE.normal) return;
const { refreshState, loadState } = this.state;
if (refreshState !== REFRESH_STATE.normal) return;
if (loadState !== LOAD_STATE.normal) return;

const { onLoad } = this.props;
const { onLoad, loadDistance } = this.props;
if (!onLoad) return;

const bottom = this.pull.getBoundingClientRect().bottom;
Expand All @@ -70,7 +71,7 @@ class Pull extends PureComponent {

if (scrollHeight <= clientHeight) return;

if (bottom <= clientHeight) {
if (bottom <= clientHeight + loadDistance) {
typeof onLoad === 'function' && onLoad();
}
}
Expand Down Expand Up @@ -334,6 +335,7 @@ Pull.propTypes = {
refreshRender: PropTypes.func,
onRefresh: PropTypes.func,
loading: PropTypes.number,
loadDistance: PropTypes.number,
onLoad: PropTypes.func,
loadRender: PropTypes.func,
duration: PropTypes.number,
Expand All @@ -346,6 +348,7 @@ Pull.defaultProps = {
refreshInitDistance: 20,
refreshDistance: 50,
loading: LOAD_STATE.normal,
loadDistance: 10,
duration: 300,
stayTime: 2000,
};
Expand Down
2 changes: 1 addition & 1 deletion components/Uploader/Uploader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Uploader extends PureComponent {

handleChange(e) {
const { onChange, quality, multiple } = this.props;
const files = Array.from(e.target.files);
const files = [].slice.call(e.target.files);
const fileList = [];

const getFileInfo = (data) => {
Expand Down
9 changes: 5 additions & 4 deletions docs/zh-cn/components/Pull.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,15 @@ const LOAD_STATE = {
| :--- | :--- | :--- | :--- | :--- |
| prefixCls | string | za-pull | | 类名前缀 |
| className | string | | | 追加类名 |
| refreshing | bool | false | 是否正在刷新 |
| refreshing | number | 0 | 下拉刷新状态枚举(0-5) |下拉刷新的状态 |
| refreshInitDistance | number | 20 | | 下拉助跑距离 |
| refreshDistance | number | 60 | | 下拉距离阀值 |
| refreshDistance | number | 50 | | 触发下拉刷新离顶部的距离阀值 |
| refreshRender | func | | | 下拉各状态渲染的回调函数 |
| onRefresh | func | | | 达到阀值后释放触发刷新的回调函数 |
| loading | bool | false | 是否正在加载 |
| onLoad | func | | | 触发上拉加载后的回调函数 |
| loading | number | 0 | 上拉加载状态枚举(0-5) | 上拉加载的状态 |
| loadDistance | number | 10 | | 触发上拉加载离底部的距离阀值 |
| loadRender | func | | | 上拉各状态渲染的回调函数 |
| onLoad | func | | | 触发上拉加载后的回调函数 |
| duration | number | 300 | | 动画执行时间,单位:ms |
| stayTime | number | 2000 | | 加载成功停留时间 |

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zarm",
"version": "1.0.15",
"version": "1.0.17",
"description": "基于 React 的移动端UI库",
"tags": [
"zarm",
Expand Down Expand Up @@ -33,7 +33,7 @@
"start": "npm run deploy && npm run dev",
"clean": "rm -rf lib && rm -rf dist",
"dev": "webpack-dev-server --config scripts/webpack/config.dev.js",
"build:lib": "babel components --out-dir lib --presets=es2015,react,stage-0",
"build:lib": "babel components --out-dir lib --presets=env,react,stage-0",
"build:umd": "webpack --config scripts/webpack/config.umd.js && WEBPACK_ENV=production webpack --config scripts/webpack/config.umd.js",
"build": "npm run clean && npm run build:lib && npm run build:umd",
"deploy:build": "rm -rf assets && webpack --config scripts/webpack/config.site.js",
Expand All @@ -60,7 +60,7 @@
"babel-loader": "^7.0.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"babel-preset-react-hmre": "^1.1.1",
"babel-preset-stage-0": "^6.24.1",
Expand Down
27 changes: 26 additions & 1 deletion scripts/jest/preprocessor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
const babelJest = require('babel-jest');

const BROWSERS = [
'last 3 versions',
'ie >= 10',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 6',
'opera >= 12.1',
'ios >= 6',
'android >= 4.4',
'bb >= 10',
'and_uc 9.9',
];

module.exports = babelJest.createTransformer({
presets: ['es2015', 'react', 'stage-0'],
presets: [
[
'env',
{
targets: {
browsers: BROWSERS,
},
},
],
'react',
'stage-0',
],
});
55 changes: 28 additions & 27 deletions scripts/webpack/config.base.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

const BROWSERS = [
'last 3 versions',
'ie >= 10',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 6',
'opera >= 12.1',
'ios >= 6',
'android >= 4.4',
'bb >= 10',
'and_uc 9.9',
];

module.exports = {

output: {
Expand All @@ -19,7 +33,18 @@ module.exports = {
{
loader: 'babel-loader',
options: {
presets: ['es2015', 'react', 'stage-0'],
presets: [
[
'env',
{
targets: {
browsers: BROWSERS,
},
},
],
'react',
'stage-0',
],
plugins: [
'transform-runtime',
'add-module-exports',
Expand All @@ -40,19 +65,7 @@ module.exports = {
options: {
plugins: [
require('autoprefixer')({
browsers: [
'last 3 versions',
'ie >= 10',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 6',
'opera >= 12.1',
'ios >= 6',
'android >= 4.4',
'bb >= 10',
'and_uc 9.9',
],
browsers: BROWSERS,
}),
],
},
Expand All @@ -72,19 +85,7 @@ module.exports = {
options: {
plugins: [
require('autoprefixer')({
browsers: [
'last 3 versions',
'ie >= 10',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 6',
'opera >= 12.1',
'ios >= 6',
'android >= 4.4',
'bb >= 10',
'and_uc 9.9',
],
browsers: BROWSERS,
}),
],
},
Expand Down
Loading

0 comments on commit aafc712

Please sign in to comment.