Merge remote-tracking branch 'eleme/dev' into carbon

# Conflicts:
#	examples/app.vue
#	examples/docs/en-US/tree.md
#	examples/docs/zh-CN/tree.md
#	examples/versions.json
#	packages/select/src/select.vue
#	packages/theme-default/package.json
pull/7292/head
Leopoldthecoder 2017-09-29 16:21:29 +08:00
commit 257473f305
26 changed files with 103 additions and 40 deletions

View File

@ -1,5 +1,28 @@
## Changelog ## Changelog
### 1.4.6
*2017-09-27*
- Fixed Slider's button jumping to previous position when clicked, #7190
- Fixed Tooltip `disabled` regression, #7198
- Fixed Cascader not correctly filter options when `props` is set, #7225
- Fixed an error when range typed DatePicker has an initial value of `[]`, #7233
### 1.4.5
*2017-09-24*
- Rate's `colors` attribute now supports dynamic updates, #6872 @lukaszb
- Fixed Tree not highlighting tree node whose value of `node-key` is 0, #6917
- Fixed initially disabled Dropdown not showing menu when it's enabled, #6969
- Added `hide-after` attribute for Tooltip, #6401 @ryatziv
- Fixed cancel button of TimePicker not cancel picked value when clicked, #7028
- Added `selectWhenUnmatched` attribute for Autocomplete, #6428 @ryatziv
- Fixed when `beforeUpload` of a file returns false, other files are aborted by Upload, #7077
- Fixed disabled dates of DatePicker in month view and year view not displayed correctly in the west hemisphere, #7114
- `default-value` of DatePicker now supports daterange type, #7073 @wacky6
### 1.4.4 ### 1.4.4
*2017-09-05* *2017-09-05*

View File

@ -1,5 +1,26 @@
## 更新日志 ## 更新日志
### 1.4.6
*2017-09-27*
- 修复点击 Slider 的按钮会使其返回上一个位置的问题,#7190
- 修复 Tooltip 无法正确切换 `disabled` 的问题,#7198
- 修复 Cascader 的过滤功能在配置了 `props` 的情况下的异常问题,#7225
- 修复 DatePicker 的范围选择在初始值为空数组时会报错的问题,#7233
### 1.4.5
*2017-09-24*
- Rate 的 `colors` 属性现在可以动态更新了,#6872 @lukaszb
- 修复 Tree 无法高亮 `node-key` 值为 0 的节点的问题,#6917
- 修复初始状态被禁用的 Dropdown 在取消禁用后无法弹出下拉菜单的问题,#6969
- Tooltip 新增 `hide-after` 属性,#6401 @ryatziv
- 修复 TimePicker 取消按钮无法正确取消所选值的问题,#7028
- Autocomplete 新增 `selectWhenUnmatched` 属性,#6428 @ryatziv
- 修复 Upload 中某个文件的 `beforeUpload` 返回 `false` 时会错误地取消其他文件上传的问题,#7077
- 修复 DatePicker 在西半球使用时月视图和年视图禁用日期显示错误的问题,#7114
- DatePicker 的 `default-value` 属性支持 daterange 模式,#7073 @wacky6
### 1.4.4 ### 1.4.4
*2017-09-05* *2017-09-05*

View File

@ -18,13 +18,9 @@
> A Vue.js 2.0 UI Toolkit for Web. > A Vue.js 2.0 UI Toolkit for Web.
<p align="center"> <a target='_blank' rel='nofollow' href='https://app.codesponsor.io/link/bD3dKbdDE2F7Ky9LUN1kjTFK/ElemeFE/element'>
<b>Special thanks to the generous sponsorship by:</b> <img alt='Sponsor' width='888' height='68' src='https://app.codesponsor.io/embed/bD3dKbdDE2F7Ky9LUN1kjTFK/ElemeFE/element.svg' />
<br><br>
<a href="https://laravist.com">
<img width="300px" src="https://fuss10.elemecdn.com/4/87/c072c1651b0efd1c5cde39bc8b422png.png">
</a > </a >
</p>
## Links ## Links
- [Home Page](http://element.eleme.io/) - [Home Page](http://element.eleme.io/)

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -99,6 +99,10 @@
line-height: 26px; line-height: 26px;
margin-top: 15px; margin-top: 15px;
} }
#code-sponsor-widget {
margin: 50px 0 0 -20px;
}
} }
.nav-dropdown-list { .nav-dropdown-list {
width: 120px; width: 120px;
@ -154,6 +158,7 @@
</template> </template>
</li> </li>
</ul> </ul>
<div id="code-sponsor-widget"></div>
</div> </div>
</template> </template>
<script> <script>

View File

@ -957,7 +957,7 @@ Only one node among the same level can be expanded at one time.
| --------- | ---------------------------------------- | ------ | --------------- | ------- | | --------- | ---------------------------------------- | ------ | --------------- | ------- |
| label | specify which key of node object is used as the node's label | string, function(data, node) | — | — | | label | specify which key of node object is used as the node's label | string, function(data, node) | — | — |
| children | specify which node object is used as the node's subtree | string, function(data, node) | — | — | | children | specify which node object is used as the node's subtree | string, function(data, node) | — | — |
| disabled | specify which node's checkbox disabled | boolean, function(data, node) | — | — | | disabled | specify which key of node object represents if node's checkbox is disabled | boolean, function(data, node) | — | — |
| isLeaf | specify whether the node is a leaf node | boolean, function(data, node) | — | — | | isLeaf | specify whether the node is a leaf node | boolean, function(data, node) | — | — |
### Method ### Method

View File

@ -270,8 +270,8 @@
} }
}, },
handleClick() { handleClick(row) {
console.log('click'); console.log(row);
}, },
handleEdit(index, row) { handleEdit(index, row) {
@ -707,7 +707,7 @@
label="操作" label="操作"
width="100"> width="100">
<template scope="scope"> <template scope="scope">
<el-button @click="handleClick" type="text" size="small">查看</el-button> <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
<el-button type="text" size="small">编辑</el-button> <el-button type="text" size="small">编辑</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -717,8 +717,8 @@
<script> <script>
export default { export default {
methods: { methods: {
handleClick() { handleClick(row) {
console.log(1); console.log(row);
} }
}, },

View File

@ -956,7 +956,7 @@
| -------- | ----------------- | ------ | ---- | ---- | | -------- | ----------------- | ------ | ---- | ---- |
| label | 指定节点标签为节点对象的某个属性值 | string, function(data, node) | — | — | | label | 指定节点标签为节点对象的某个属性值 | string, function(data, node) | — | — |
| children | 指定子树为节点对象的某个属性值 | string, function(data, node) | — | — | | children | 指定子树为节点对象的某个属性值 | string, function(data, node) | — | — |
| disabled | 指定节点选择框是否禁用 | boolean, function(data, node) | — | — | | disabled | 指定节点选择框是否禁用为节点对象的某个属性值 | boolean, function(data, node) | — | — |
| isLeaf | 指定节点是否为叶子节点 | boolean, function(data, node) | — | — | | isLeaf | 指定节点是否为叶子节点 | boolean, function(data, node) | — | — |
### 方法 ### 方法

View File

@ -9,6 +9,7 @@
</head> </head>
<body> <body>
<div id="app"></div><% if (process.env.NODE_ENV === 'production') { %> <div id="app"></div><% if (process.env.NODE_ENV === 'production') { %>
<script src="https://app.codesponsor.io/scripts/qFcVkt4f3DQEg4zrwINGVg?theme=light&height=250&width=240"></script>
<script src="//cdn.jsdelivr.net/npm/vue@2.3.0/dist/vue.runtime.min.js"></script> <script src="//cdn.jsdelivr.net/npm/vue@2.3.0/dist/vue.runtime.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/vue-router@2.1.1/dist/vue-router.min.js"></script><% } %> <script src="//cdn.jsdelivr.net/npm/vue-router@2.1.1/dist/vue-router.min.js"></script><% } %>
</body> </body>

View File

@ -1,6 +1,6 @@
{ {
"name": "element-ui", "name": "element-ui",
"version": "1.4.4", "version": "1.4.6",
"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

@ -41,7 +41,6 @@
options: { options: {
default() { default() {
return { return {
forceAbsolute: true,
gpuAcceleration: false gpuAcceleration: false
}; };
} }

View File

@ -10,9 +10,13 @@
arr.forEach(item => { arr.forEach(item => {
const itemCopy = {}; const itemCopy = {};
configurableProps.forEach(prop => { configurableProps.forEach(prop => {
const propName = props[prop] || prop; let name = props[prop];
const value = item[propName]; let value = item[name];
if (value !== undefined) itemCopy[propName] = value; if (value === undefined) {
name = prop;
value = item[name];
}
if (value !== undefined) itemCopy[name] = value;
}); });
if (Array.isArray(item[childrenProp])) { if (Array.isArray(item[childrenProp])) {
itemCopy[childrenProp] = copyArray(item[childrenProp], props); itemCopy[childrenProp] = copyArray(item[childrenProp], props);

View File

@ -155,7 +155,7 @@
const calcDefaultValue = defaultValue => { const calcDefaultValue = defaultValue => {
if (Array.isArray(defaultValue)) { if (Array.isArray(defaultValue)) {
return new Date(defaultValue[0]); return defaultValue[0] ? new Date(defaultValue[0]) : new Date();
} else { } else {
return new Date(defaultValue); return new Date(defaultValue);
} }

View File

@ -496,7 +496,7 @@
dateFormat() { dateFormat() {
if (this.format) { if (this.format) {
return this.format.replace('HH:mm', '').replace(':ss', '').trim(); return this.format.replace('HH', '').replace(':mm', '').replace(':ss', '').trim();
} else { } else {
return 'yyyy-MM-dd'; return 'yyyy-MM-dd';
} }

View File

@ -217,11 +217,11 @@
}, },
getRules() { getRules() {
var formRules = this.form.rules; var formRules = this.form.rules;
var selfRuels = this.rules; var selfRules = this.rules;
formRules = formRules ? formRules[this.prop] : []; formRules = formRules ? formRules[this.prop] : [];
return [].concat(selfRuels || formRules || []); return [].concat(selfRules || formRules || []);
}, },
getFilteredRule(trigger) { getFilteredRule(trigger) {
var rules = this.getRules(); var rules = this.getRules();

View File

@ -1,10 +1,10 @@
import Vue from 'vue'; import Vue from 'vue';
import { addClass, removeClass, getStyle } from 'element-ui/src/utils/dom'; import { addClass, removeClass, getStyle } from 'element-ui/src/utils/dom';
let Mask = Vue.extend(require('./loading.vue')); const Mask = Vue.extend(require('./loading.vue'));
exports.install = Vue => { exports.install = Vue => {
if (Vue.prototype.$isServer) return; if (Vue.prototype.$isServer) return;
let toggleLoading = (el, binding) => { const toggleLoading = (el, binding) => {
if (binding.value) { if (binding.value) {
Vue.nextTick(() => { Vue.nextTick(() => {
if (binding.modifiers.fullscreen) { if (binding.modifiers.fullscreen) {
@ -20,7 +20,7 @@ exports.install = Vue => {
el.originalPosition = getStyle(document.body, 'position'); el.originalPosition = getStyle(document.body, 'position');
['top', 'left'].forEach(property => { ['top', 'left'].forEach(property => {
let scroll = property === 'top' ? 'scrollTop' : 'scrollLeft'; const scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] + 'px'; el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] + 'px';
}); });
['height', 'width'].forEach(property => { ['height', 'width'].forEach(property => {
@ -51,7 +51,7 @@ exports.install = Vue => {
} }
} }
}; };
let insertDom = (parent, el, binding) => { const insertDom = (parent, el, binding) => {
if (!el.domVisible && getStyle(el, 'display') !== 'none' && getStyle(el, 'visibility') !== 'hidden') { if (!el.domVisible && getStyle(el, 'display') !== 'none' && getStyle(el, 'visibility') !== 'hidden') {
Object.keys(el.maskStyle).forEach(property => { Object.keys(el.maskStyle).forEach(property => {
el.mask.style[property] = el.maskStyle[property]; el.mask.style[property] = el.maskStyle[property];
@ -75,7 +75,7 @@ exports.install = Vue => {
Vue.directive('loading', { Vue.directive('loading', {
bind: function(el, binding) { bind: function(el, binding) {
let mask = new Mask({ const mask = new Mask({
el: document.createElement('div'), el: document.createElement('div'),
data: { data: {
text: el.getAttribute('element-loading-text'), text: el.getAttribute('element-loading-text'),

View File

@ -29,7 +29,6 @@
popperOptions: { popperOptions: {
default() { default() {
return { return {
forceAbsolute: true,
gpuAcceleration: false gpuAcceleration: false
}; };
} }

View File

@ -152,6 +152,7 @@
this.startX = event.clientX; this.startX = event.clientX;
} }
this.startPosition = parseFloat(this.currentPosition); this.startPosition = parseFloat(this.currentPosition);
this.newPosition = this.startPosition;
}, },
onDragging(event) { onDragging(event) {

View File

View File

@ -48,8 +48,7 @@ export default {
data() { data() {
return { return {
timeoutPending: null, timeoutPending: null
handlerAdded: false
}; };
}, },
@ -94,11 +93,10 @@ export default {
const nativeOn = vnode.data.nativeOn = vnode.data.nativeOn || {}; const nativeOn = vnode.data.nativeOn = vnode.data.nativeOn || {};
data.staticClass = this.concatClass(data.staticClass, 'el-tooltip'); data.staticClass = this.concatClass(data.staticClass, 'el-tooltip');
if (this.handlerAdded) return vnode; on.mouseenter = this.addEventHandle(on.mouseenter, this.show);
on.mouseenter = this.addEventHandle(on.mouseenter, () => { this.setExpectedState(true); this.handleShowPopper(); }); on.mouseleave = this.addEventHandle(on.mouseleave, this.hide);
on.mouseleave = this.addEventHandle(on.mouseleave, () => { this.setExpectedState(false); this.debounceClose(); }); nativeOn.mouseenter = this.addEventHandle(nativeOn.mouseenter, this.show);
nativeOn.mouseenter = this.addEventHandle(nativeOn.mouseenter, () => { this.setExpectedState(true); this.handleShowPopper(); }); nativeOn.mouseleave = this.addEventHandle(nativeOn.mouseleave, this.hide);
nativeOn.mouseleave = this.addEventHandle(nativeOn.mouseleave, () => { this.setExpectedState(false); this.debounceClose(); });
return vnode; return vnode;
}, },
@ -108,9 +106,24 @@ export default {
}, },
methods: { methods: {
show() {
this.setExpectedState(true);
this.handleShowPopper();
},
hide() {
this.setExpectedState(false);
this.debounceClose();
},
addEventHandle(old, fn) { addEventHandle(old, fn) {
this.handlerAdded = true; if (!old) {
return old ? Array.isArray(old) ? old.concat(fn) : [old, fn] : fn; return fn;
} else if (Array.isArray(old)) {
return old.indexOf(fn) > -1 ? old : old.concat(fn);
} else {
return old === fn ? old : [old, fn];
}
}, },
concatClass(a, b) { concatClass(a, b) {

View File

@ -54,7 +54,8 @@ const getPropertyFromData = function(node, prop) {
} else if (typeof config === 'string') { } else if (typeof config === 'string') {
return data[config]; return data[config];
} else if (typeof config === 'undefined') { } else if (typeof config === 'undefined') {
return ''; const dataProp = data[prop];
return dataProp === undefined ? '' : dataProp;
} }
}; };

View File

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