浏览代码

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

Leopoldthecoder 8 年之前
父节点
当前提交
4f21221c0b

+ 13 - 0
CHANGELOG.en-US.md

@@ -1,5 +1,18 @@
 ## Changelog
 
+### 1.4.1
+
+*2017-07-28*
+
+- Fixed child nodes expanding when checking parent node in Tree, #6029
+- Fixed checking behavior error of Tree, #6034
+- Fixed FormItem not inheriting `label-width` as a Form's direct child, #6044
+- Fixed Menu incorrectly showing SubMenu in collapse mode, #6111
+- Fixed render order error of `v-if` controlled dynamic TabPanes, #6066
+- Fixed Popover still popping up after mouse leaves within `open-delay`, #6058 (by @laobubu)
+- Fixed delete buttons still rendered in file list of disabled Upload, #6091
+- Fixed background color error on hover of striped Table, #6024 (by @xtongs)
+
 ### 1.4.0 Boron
 
 *2017-07-21*

+ 12 - 0
CHANGELOG.zh-CN.md

@@ -1,5 +1,17 @@
 ## 更新日志
 
+### 1.4.1
+*2017-07-28*
+
+- 修复 Tree 勾选父节点会弹出子节点的问题,#6029
+- 修复 Tree 勾选逻辑错误,#6034
+- 修复作为 Form 直接子元素的 FormItem 不继承 `label-width` 的问题,#6044
+- 修复 collapse 模式下的 Menu 自动弹出子菜单的问题,#6111
+- 修复使用 `v-if` 的动态 TabPane 顺序错误的问题,#6066
+- 修复鼠标在 `open-delay` 时间内移开元素后,仍然会弹出 Popover 的问题,#6058(by @laobubu)
+- 修复禁用的 Upload 的文件列表仍然显示删除按钮并可操作的问题,#6091
+- 修复斑马纹的 Table 的背景色在 hover 时不正确的问题,#6024(by @xtongs)
+
 ### 1.4.0 Boron
 *2017-07-21*
 

+ 1 - 1
examples/docs/en-US/form.md

@@ -17,7 +17,7 @@
           }
         }, 1000);
       };
-      var vaildatePass = (rule, value, callback) => {
+      var validatePass = (rule, value, callback) => {
         if (value === '') {
           callback(new Error('Please input the password'));
         } else {

+ 1 - 1
examples/versions.json

@@ -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":"1.4"}
+{"1.0.9":"1.0","1.1.6":"1.1","1.2.9":"1.2","1.3.7":"1.3","1.4.1":"1.4"}

+ 1 - 1
package.json

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

+ 1 - 2
packages/select/src/option.vue

@@ -49,8 +49,7 @@
 
     computed: {
       isObject() {
-        const type = typeof this.value;
-        return type !== 'string' && type !== 'number' && type !== 'boolean';
+        return Object.prototype.toString.call(this.value).toLowerCase() === '[object object]';
       },
 
       currentLabel() {

+ 12 - 11
packages/select/src/select.vue

@@ -12,7 +12,7 @@
         <el-tag
           v-for="item in selected"
           :key="getValueKey(item)"
-          closable
+          :closable="!disabled"
           :hit="item.hitState"
           type="primary"
           @close="deleteTag($event, item)"
@@ -367,13 +367,16 @@
         }
       },
 
-      scrollToOption(className = 'selected') {
-        const menu = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
-        scrollIntoView(menu, menu.getElementsByClassName(className)[0]);
+      scrollToOption(option) {
+        const target = Array.isArray(option) && option[0] ? option[0].$el : option.$el;
+        if (this.$refs.popper && target) {
+          const menu = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
+          scrollIntoView(menu, target);
+        }
       },
 
       handleMenuEnter() {
-        this.$nextTick(() => this.scrollToOption());
+        this.$nextTick(() => this.scrollToOption(this.selected));
       },
 
       emitChange(val) {
@@ -384,8 +387,7 @@
 
       getOption(value) {
         let option;
-        const type = typeof value;
-        const isObject = type !== 'string' && type !== 'number' && type !== 'boolean';
+        const isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
         for (let i = this.cachedOptions.length - 1; i >= 0; i--) {
           const cachedOption = this.cachedOptions[i];
           const isEqual = isObject
@@ -551,12 +553,11 @@
           this.emitChange(option.value);
           this.visible = false;
         }
-        this.$nextTick(() => this.scrollToOption());
+        this.$nextTick(() => this.scrollToOption(option));
       },
 
       getValueIndex(arr = [], value) {
-        const type = typeof value;
-        const isObject = type !== 'string' && type !== 'number' && type !== 'boolean';
+        const isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
         if (!isObject) {
           return arr.indexOf(value);
         } else {
@@ -613,7 +614,7 @@
             }
           }
         }
-        this.$nextTick(() => this.scrollToOption('hover'));
+        this.$nextTick(() => this.scrollToOption(this.options[this.hoverIndex]));
       },
 
       selectOption() {

+ 3 - 1
packages/tabs/src/tabs.vue

@@ -61,7 +61,9 @@
         this.$emit('input', value);
       },
       addPanes(item) {
-        const index = this.$slots.default.indexOf(item.$vnode);
+        const index = this.$slots.default.filter(item => {
+          return item.elm.nodeType === 1 && /\bel-tab-pane\b/.test(item.elm.className);
+        }).indexOf(item.$vnode);
         this.panes.splice(index, 0, item);
       },
       removePanes(item) {

+ 1 - 1
packages/theme-default/package.json

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

+ 8 - 2
packages/theme-default/src/table.css

@@ -400,8 +400,14 @@
     }
 
     @e body {
-      tr.hover-row > td {
-        background-color: var(--color-extra-light-gray);
+      tr.hover-row {
+        &, &.el-table__row--striped {
+          &, &.current-row {
+            > td {
+              background-color: var(--color-extra-light-gray);
+            }
+          }
+        }
       }
 
       tr.current-row > td {

+ 5 - 0
packages/theme-default/src/upload.css

@@ -171,6 +171,11 @@
         }
       }
     }
+    @when disabled {
+      .el-upload-list__item:hover .el-upload-list__item-status-label {
+        display: block;
+      }
+    }
     @e item-name {
       color: var(--color-extra-light-black);
       display: block;

+ 6 - 2
packages/upload/src/upload-list.vue

@@ -1,7 +1,11 @@
 <template>
   <transition-group
     tag="ul"
-    :class="['el-upload-list', 'el-upload-list--' + listType]"
+    :class="[
+      'el-upload-list',
+      'el-upload-list--' + listType,
+      { 'is-disabled': disabled }
+    ]"
     name="el-list"
   >
     <li
@@ -24,7 +28,7 @@
           'el-icon-check': ['picture-card', 'picture'].indexOf(listType) > -1
         }"></i>
       </label>
-      <i class="el-icon-close" @click="$emit('remove', file)"></i>
+      <i class="el-icon-close" v-if="!disabled" @click="$emit('remove', file)"></i>
       <el-progress
         v-if="file.status === 'uploading'"
         :type="listType === 'picture-card' ? 'circle' : 'line'"

+ 1 - 1
src/index.js

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