Merge branch 'dev' into carbon

pull/6043/head
Leopoldthecoder 2017-07-24 19:13:02 +08:00
commit 1cecdbc057
12 changed files with 158 additions and 18 deletions

View File

@ -1,5 +1,66 @@
## Changelog ## Changelog
### 1.4.0 Boron
*2017-07-21*
#### New features:
- Message
- `message` attribute now supports VNode, #5463 (by @egyptik)
- ColorPicker
- Added `active-change` event, #5775
- Popover
- Added `open-delay` attribute, #5842 (by @kaungmyatlwin)
- Table
- A third parameter `value` is passed to `formatter`, #5709 (by @haledeng)
- Tree
- Added `disabled` attribute, #5937
- Menu
- Added `collapse` attribute, #5941
- Select
- Added `value-key` attribute, #5897
#### Fixes:
- DatePicker
- i18n failure for some texts, #5485
- returning a non-zero millisecond value when initial value is empty, #5663
- `disabledDate` affecting undesired date, #4946 (by @liyangworld)
- Steps
- style problems when a step is dynamically added or removed, #5456 (by @elfman)
- Table
- highlight row misplaced when an expandable Table has fixed table columns, #5471 (by @elfman)
- `classList` not supported in some browsers, #5613 (by @flynntsc)
- Select
- single Select unable to scroll to the selected item when the dropdown menu pops up, #5564by @wacky6
- Radio
- border radius lost in RadioGroups with only one Radio, #5646 (by @YYvanYang)
- Upload
- unable to reselect previously deleted file when `auto-upload` is false, #5706
- delete button still visible and functioning when `disabled`, #5841
- compatibility issue with Vue 2.4 `key`, #5872
- MessageBox
- clicking cancel buttons getting resolved when not invoked as a `confirm` or `prompt`, #5658
- Rate
- active icons not reflecting decimal part of initial value, #5785
- Pagination
- compatibility issue of total page display with vue-i18n@6.x, #5796 (by @mario56)
- apostrophe incorrectly showing up when current page is one page less than total page, #5861 (by @openks)
- Loading
- style problems when bound to invisible elements, #5649 (by @xiongzixiao)
- Cascader
- text in the input box not vertically aligned, #5819 (by @jianzhi92)
- Tree
- `setCheckedKeys` and `setCheckedNodes` in lazy mode, #5937
- loading all descendent nodes when a parent node is checked in lazy mode, #5963
- Form
- label named slot not working when `label` is not assigned on FormItem, #5921
- Tooltip
- not working in Vue 2.4.x when the triggering element is a custom component, #5916
#### Breaking changes:
- Select
- when value is an object, `value-key` is required as its unique identity key, #5897
### 1.3.7 ### 1.3.7
*2017-06-18* *2017-06-18*

View File

@ -1,5 +1,66 @@
## 更新日志 ## 更新日志
### 1.4.0 Boron
*2017-07-21*
#### 新特性:
- Message
- `message` 属性支持 VNode#5463by @egyptik
- ColorPicker
- 新增 `active-change` 事件,#5775
- Popover
- 新增 `open-delay` 属性,#5842by @kaungmyatlwin
- Table
- `formatter` 新增 `value` 参数,#5709by @haledeng
- Tree
- 新增 `disabled` 属性,#5937
- Menu
- 新增 `collapse` 属性,#5941
- Select
- 新增 `value-key` 属性,#5897
#### 修复:
- DatePicker
- 部分内部文案不受 i18n 控制的问题,#5485
- 初始值为空时,选择时间后的返回值毫秒部分不为零的问题,#5663
- `disabledDate` 范围被扩大的问题,#4946by @liyangworld
- Steps
- 动态增减步骤后的样式错误,#5456by @elfman
- Table
- 带有固定列且可展开时,鼠标 hover 高亮行错位的问题,#5471by @elfman
- 部分浏览器不支持 `classList` 的问题,#5613by @flynntsc
- Select
- 单选时打开下拉框有时无法定位到已选中项的问题,#5564by @wacky6
- 多选时 Vue 2.4.x 报错的问题,#5897
- Radio
- RadioGroup 内只有一个 Radio 时的圆角丢失问题,#5646by @YYvanYang
- Upload
- `auto-upload` 为 false 时,无法选择之前删除的文件的问题,#5706
- `disabled` 时删除按钮仍可见并可操作的问题,#5841
- 兼容 Vue 2.4 `key` 不能是对象的问题,#5872
- MessageBox
- 非 `confirm``prompt` 情况下点击取消按钮仍然被 resolve 的问题,#5658
- Rate
- 初始值带有小数时,激活的 icon 不显示小数部分的问题,#5785
- Pagination
- 总页数的 i18n 不与 vue-i18n@6.x 兼容的问题,#5796by @mario56
- 当前页为最大页数减一时,错误地显示省略号的问题,#5861by @openks
- Loading
- 不可见元素绑定 Loading 时的样式错误,#5649by @xiongzixiao
- Cascader
- 输入框中的文字未垂直居中的问题,#5819by @jianzhi92
- Tree
- 在 lazy 模式下 `setCheckedKeys``setCheckedNodes` 方法的 bug#5937
- 在 lazy 模式下勾选父级节点会一次性加载全部后代节点的问题,#5963
- Form
- 未在 FormItem 上指定 `label`label 的具名 slot 失效的问题,#5921
- Tooltip
- Vue 2.4.x 下触发元素为自定义组件时不工作的问题,#5916
#### 非兼容性更新:
- Select
- 值为对象类型时,需要提供一个 `value-key` 作为唯一性标识,#5897
### 1.3.7 ### 1.3.7
*2017-06-18* *2017-06-18*

View File

@ -2,7 +2,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<div class="footer-main"> <div class="footer-main">
<p class="footer-main-title">Element {{ version }} Beryllium</p> <p class="footer-main-title">Element {{ version }} Boron</p>
<a href="https://github.com/ElemeFE/element/issues" class="footer-main-link" target="_blank">{{ langConfig.feedback }}</a> <a href="https://github.com/ElemeFE/element/issues" class="footer-main-link" target="_blank">{{ langConfig.feedback }}</a>
<a :href="`https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.${ lang }.md`" class="footer-main-link" target="_blank">{{ langConfig.contribution }}</a> <a :href="`https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.${ lang }.md`" class="footer-main-link" target="_blank">{{ langConfig.contribution }}</a>
<a :href="`https://eleme.github.io/element-react/#/${ lang }/quick-start`" class="footer-main-link" target="_blank">Element-React</a> <a :href="`https://eleme.github.io/element-react/#/${ lang }/quick-start`" class="footer-main-link" target="_blank">Element-React</a>

View File

@ -17,7 +17,7 @@
} }
}, 1000); }, 1000);
}; };
var validaePass = (rule, value, callback) => { var vaildatePass = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('Please input the password')); callback(new Error('Please input the password'));
} else { } else {
@ -27,7 +27,7 @@
callback(); callback();
} }
}; };
var validaePass2 = (rule, value, callback) => { var validatePass2 = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('Please input the password again')); callback(new Error('Please input the password again'));
} else if (value !== this.ruleForm2.pass) { } else if (value !== this.ruleForm2.pass) {
@ -101,10 +101,10 @@
}, },
rules2: { rules2: {
pass: [ pass: [
{ validator: validaePass, trigger: 'blur' } { validator: validatePass, trigger: 'blur' }
], ],
checkPass: [ checkPass: [
{ validator: validaePass2, trigger: 'blur' } { validator: validatePass2, trigger: 'blur' }
], ],
age: [ age: [
{ validator: checkAge, trigger: 'blur' } { validator: checkAge, trigger: 'blur' }
@ -549,7 +549,7 @@ Form component allows you to verify your data, helping you find and correct erro
} }
}, 1000); }, 1000);
}; };
var validaePass = (rule, value, callback) => { var validatePass = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('Please input the password')); callback(new Error('Please input the password'));
} else { } else {
@ -559,7 +559,7 @@ Form component allows you to verify your data, helping you find and correct erro
callback(); callback();
} }
}; };
var validaePass2 = (rule, value, callback) => { var validatePass2 = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('Please input the password again')); callback(new Error('Please input the password again'));
} else if (value !== this.ruleForm2.pass) { } else if (value !== this.ruleForm2.pass) {
@ -576,10 +576,10 @@ Form component allows you to verify your data, helping you find and correct erro
}, },
rules2: { rules2: {
pass: [ pass: [
{ validator: validaePass, trigger: 'blur' } { validator: validatePass, trigger: 'blur' }
], ],
checkPass: [ checkPass: [
{ validator: validaePass2, trigger: 'blur' } { validator: validatePass2, trigger: 'blur' }
], ],
age: [ age: [
{ validator: checkAge, trigger: 'blur' } { validator: checkAge, trigger: 'blur' }

View File

@ -1 +1 @@
{"1.0.9":"1.0","1.1.6":"1.1","1.2.9":"1.2","1.3.7":"1.3","1.4.0-beta.1":"1.4"} {"1.0.9":"1.0","1.1.6":"1.1","1.2.9":"1.2","1.3.7":"1.3","1.4.0":"1.4"}

View File

@ -1,6 +1,6 @@
{ {
"name": "element-ui", "name": "element-ui",
"version": "1.4.0-beta.1", "version": "1.4.0",
"description": "A Component Library for Vue.js.", "description": "A Component Library for Vue.js.",
"main": "lib/element-ui.common.js", "main": "lib/element-ui.common.js",
"files": [ "files": [

View File

@ -22,7 +22,7 @@
import scrollIntoView from 'element-ui/src/utils/scroll-into-view'; import scrollIntoView from 'element-ui/src/utils/scroll-into-view';
const parseTime = function(time) { const parseTime = function(time) {
const values = ('' || time).split(':'); const values = (time || '').split(':');
if (values.length >= 2) { if (values.length >= 2) {
const hours = parseInt(values[0], 10); const hours = parseInt(values[0], 10);
const minutes = parseInt(values[1], 10); const minutes = parseInt(values[1], 10);

View File

@ -1,6 +1,6 @@
{ {
"name": "element-theme-default", "name": "element-theme-default",
"version": "1.4.0-beta.1", "version": "1.4.0",
"description": "Element component default theme.", "description": "Element component default theme.",
"main": "lib/index.css", "main": "lib/index.css",
"style": "lib/index.css", "style": "lib/index.css",

View File

@ -42,6 +42,22 @@ const reInitChecked = function(node) {
} }
}; };
const initLazyLoadChild = node => {
const childNodes = node.childNodes;
if (node.checked) {
for (let i = 0, j = childNodes.length; i < j; i++) {
const child = childNodes[i];
if (!child.disabled) {
child.checked = true;
}
}
}
const parent = node.parent;
if (!parent || parent.level === 0) return;
reInitChecked(parent);
};
const getPropertyFromData = function(node, prop) { const getPropertyFromData = function(node, prop) {
const props = node.store.props; const props = node.store.props;
const data = node.data || {}; const data = node.data || {};
@ -245,6 +261,7 @@ export default class Node {
if (this.shouldLoadData()) { if (this.shouldLoadData()) {
this.loadData((data) => { this.loadData((data) => {
if (data instanceof Array) { if (data instanceof Array) {
initLazyLoadChild(this);
done(); done();
} }
}); });
@ -290,8 +307,8 @@ export default class Node {
value = false; value = false;
} }
const handleDescendants = () => { const handleDescendants = (lazy) => {
if (deep) { if (deep && !lazy) {
const childNodes = this.childNodes; const childNodes = this.childNodes;
for (let i = 0, j = childNodes.length; i < j; i++) { for (let i = 0, j = childNodes.length; i < j; i++) {
const child = childNodes[i]; const child = childNodes[i];
@ -310,7 +327,7 @@ export default class Node {
if (!this.store.checkStrictly && this.shouldLoadData()) { if (!this.store.checkStrictly && this.shouldLoadData()) {
// Only work on lazy load data. // Only work on lazy load data.
this.loadData(() => { this.loadData(() => {
handleDescendants(); handleDescendants(true);
}, { }, {
checked: value !== false checked: value !== false
}); });

View File

@ -19,6 +19,7 @@
v-model="node.checked" v-model="node.checked"
:indeterminate="node.indeterminate" :indeterminate="node.indeterminate"
:disabled="!!node.disabled" :disabled="!!node.disabled"
@click.native.stop
@change="handleCheckChange"> @change="handleCheckChange">
</el-checkbox> </el-checkbox>
<span <span

View File

@ -36,7 +36,7 @@ Vue.component('el-upload', ElUpload)
| data | 可选参数, 上传时附带的额外参数 | object | — | — | | data | 可选参数, 上传时附带的额外参数 | object | — | — |
| name | 可选参数, 上传的文件字段名 | string | — | file | | name | 可选参数, 上传的文件字段名 | string | — | file |
| with-credentials | 支持发送 cookie 凭证信息 | boolean | — | false | | with-credentials | 支持发送 cookie 凭证信息 | boolean | — | false |
| show-upload-list | 是否显示已上传文件列表 | boolean | — | true | | show-file-list | 是否显示已上传文件列表 | boolean | — | true |
| type | 上传控件类型 | string | select,drag | select | | type | 上传控件类型 | string | select,drag | select |
| accept | 可选参数, 接受上传的[文件类型](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept)thumbnail-mode 模式下此参数无效)| string | — | — | | accept | 可选参数, 接受上传的[文件类型](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept)thumbnail-mode 模式下此参数无效)| string | — | — |
| on-preview | 可选参数, 点击已上传的文件链接时的钩子, 可以通过 file.response 拿到服务端返回数据 | function(file) | — | — | | on-preview | 可选参数, 点击已上传的文件链接时的钩子, 可以通过 file.response 拿到服务端返回数据 | function(file) | — | — |

View File

@ -158,7 +158,7 @@ if (typeof window !== 'undefined' && window.Vue) {
}; };
module.exports = { module.exports = {
version: '1.4.0-beta.1', version: '1.4.0',
locale: locale.use, locale: locale.use,
i18n: locale.i18n, i18n: locale.i18n,
install, install,