Compare commits

...

19 Commits

Author SHA1 Message Date
Leopoldthecoder
219e84f32e [release] 1.4.11 2017-11-24 16:27:02 +08:00
Leopoldthecoder
cfd417d34c [build] 1.4.11 2017-11-24 16:27:02 +08:00
Leopoldthecoder
1d764db441 Changelog: update for 1.4.11 2017-11-24 16:22:39 +08:00
Leopoldthecoder
7afd93ac3d Table: fix high CPU consumption 2017-11-24 16:22:39 +08:00
Decade
61a937798f Pagination: reset invalid jumper value (#8408)
* fix pagination jumper value

* fix lint
2017-11-23 11:44:33 +08:00
Leopoldthecoder
744478b840 [release] 1.4.10 2017-11-14 11:10:03 +08:00
Leopoldthecoder
e457060908 [build] 1.4.10 2017-11-14 11:10:03 +08:00
Leopoldthecoder
3a31791630 Changelog: update for 1.4.10 2017-11-14 10:45:10 +08:00
wubaiqing
3f196a63d1 Select: fix variable error 2017-11-05 11:20:07 +08:00
wubaiqing
3a23ab7b01 Select: fix input height of mini size 2017-11-05 11:20:07 +08:00
Leopoldthecoder
9bad910664 Switch: fix an en doc typo 2017-11-04 09:28:29 +08:00
Leopoldthecoder
b8edd0be14 Menu: register el-tooltip 2017-11-03 13:20:54 +08:00
Leopoldthecoder
a6067defa7 [release] 1.4.9 2017-11-01 12:33:00 +08:00
Leopoldthecoder
c4ed89f32d [build] 1.4.9 2017-11-01 12:32:59 +08:00
Leopoldthecoder
a755fd98a3 Changelog: update for 1.4.9 2017-11-01 12:28:44 +08:00
Leopoldthecoder
4508f2a6c4 DatePicker: fix range in Chromium 53 - 57 2017-11-01 12:28:44 +08:00
Leopoldthecoder
9b6a21073b add CDN tips 2017-10-30 05:38:54 -05:00
Leopoldthecoder
b53dcd1766 lock CDN resource version for 1.x docs 2017-10-27 05:45:19 -05:00
Leopoldthecoder
2a745aa8bf Form: fix validateDisabled 2017-10-25 23:49:13 -05:00
25 changed files with 157 additions and 76 deletions

View File

@@ -1,5 +1,26 @@
## Changelog
### 1.4.11
*2017-11-24*
- Now Pagination's jumper will correct invalid page inputs, #8408 (by @decadef20)
- Fixed high CPU consumption caused by hidden Table, #8484
### 1.4.10
*2017-11-14*
- Fixed missing Tooltip registration in Menu, #7996
- Fixed console error of `clientHeight` when `disabled` of Select dynamically updates, #8018 (by @wubaiqing)
### 1.4.9
*2017-11-01*
- Fixed Form validating not triggered correctly in some conditions, #7744
- Fixed range selection of DatePicker not working in Chromium 53-57 browsers, #7927
### 1.4.8
*2017-10-24*

View File

@@ -1,5 +1,23 @@
## 更新日志
### 1.4.11
*2017-11-24*
- 修复 Pagination 的页码输入框不对非法值进行修正的问题,#8408by @decadef20
- 修复被隐藏的 Table 会造成 CPU 占用持续增加的问题,#8484
### 1.4.10
*2017-11-14*
- 修复单独引入 Menu 时找不到 Tooltip 的问题,#7996
- 修复 Select 的 `disabled` 属性变化时控制台关于 `clientHeight` 报错的问题,#8018by @wubaiqing
### 1.4.9
*2017-11-01*
- 修复某些情况下 Form 验证没有正确触发的问题,#7744
- 修复 DatePicker 的范围选择在内核为 Chromium 53-57 的浏览器中无法使用的问题,#7927
### 1.4.8
*2017-10-24*

View File

@@ -44,9 +44,7 @@ if [ "$TRAVIS_TAG" ]; then
SUB_FOLDER='1.4'
mkdir $SUB_FOLDER
rm -rf *.js *.css *.map static
rm -rf $SUB_FOLDER/**
cp -rf ../../examples/element-ui/** .
cp -rf ../../examples/element-ui/** $SUB_FOLDER/
git add -A .
git commit -m "$TRAVIS_COMMIT_MSG"

View File

@@ -8,9 +8,7 @@ git clone -b gh-pages https://github.com/ElemeFE/element.git && cd element
SUB_FOLDER='1.4'
mkdir $SUB_FOLDER
rm -rf *.js *.css *.map static
rm -rf $SUB_FOLDER/**
cp -rf ../../examples/element-ui/** .
cp -rf ../../examples/element-ui/** $SUB_FOLDER/
cd ../..

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env sh
git checkout dev
git checkout 1.x
if test -n "$(git status --porcelain)"; then
echo 'Unclean working tree. Commit or stash changes first.' >&2;

View File

@@ -1,6 +1,3 @@
git checkout master
git merge dev
#!/usr/bin/env sh
set -e
echo "Enter release version: "
@@ -19,11 +16,7 @@ then
echo "Releasing theme-default $VERSION ..."
cd packages/theme-default
npm version $VERSION --message "[release] $VERSION"
if [[ $VERSION =~ "beta" ]]
then
npm publish --tag beta
else
npm publish
npm publish
fi
cd ../..
@@ -33,16 +26,8 @@ then
npm version $VERSION --message "[release] $VERSION"
# publish
git push eleme master
git push eleme 1.x
git push eleme refs/tags/v$VERSION
git checkout dev
git rebase master
git push eleme dev
if [[ $VERSION =~ "beta" ]]
then
npm publish --tag beta
else
npm publish
fi
npm publish --tag legacy
fi

View File

@@ -259,11 +259,7 @@
const xhr = new XMLHttpRequest();
xhr.onreadystatechange = _ => {
if (xhr.readyState === 4 && xhr.status === 200) {
const versions = JSON.parse(xhr.responseText);
this.versions = Object.keys(versions).slice(-2).reduce((prev, next) => {
prev[next] = versions[next];
return prev;
}, {});
this.versions = JSON.parse(xhr.responseText);
}
};
xhr.open('GET', '/versions.json');

View File

@@ -145,8 +145,8 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
```html
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/element-ui"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/en.js"></script>
<script src="//unpkg.com/element-ui@1.4"></script>
<script src="//unpkg.com/element-ui@1.4/lib/umd/locale/en.js"></script>
<script>
ELEMENT.locale(ELEMENT.lang.en)
@@ -158,9 +158,9 @@ Compatible with `vue-i18n`
```html
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/vue-i18n/dist/vue-i18n.js"></script>
<script src="//unpkg.com/element-ui"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/zh-CN.js"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/en.js"></script>
<script src="//unpkg.com/element-ui@1.4"></script>
<script src="//unpkg.com/element-ui@1.4/lib/umd/locale/zh-CN.js"></script>
<script src="//unpkg.com/element-ui@1.4/lib/umd/locale/en.js"></script>
<script>
Vue.locale('en', ELEMENT.lang.en)

View File

@@ -3,22 +3,30 @@
### npm
Installing with npm is recommended and it works seamlessly with [webpack](https://webpack.js.org/).
:::tip
Note that this doc is for 1.x, so you need the `legacy` tag when installing.
:::
```shell
npm i element-ui -S
npm i element-ui@legacy -S
```
### CDN
Get the latest version from [unpkg.com/element-ui](https://unpkg.com/element-ui/) , and import JavaScript and CSS file in your page.
Get the latest version from [unpkg.com/element-ui](https://unpkg.com/element-ui@1.4/) , and import JavaScript and CSS file in your page.
```html
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
<link rel="stylesheet" href="https://unpkg.com/element-ui@1.4/lib/theme-default/index.css">
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://unpkg.com/element-ui@1.4/lib/index.js"></script>
```
:::tip
We recommend our users to lock Element's version when using CDN. For example, if you're using Element 1.4.8, you can lock CSS and JavaScript files like this: `https://unpkg.com/element-ui@1.4.8/lib/theme-default/index.css`, `https://unpkg.com/element-ui@1.4.8/lib/index.js`.
:::
### Hello world
If you are using CDN, a hello-world page is easy with Element. [Online Demo](http://codepen.io/QingWei-Li/pen/vXwJrY)
If you are using CDN, a hello-world page is easy with Element. [Online Demo](https://jsfiddle.net/hzfpyvg6/18/)
```html
<!DOCTYPE html>
@@ -26,7 +34,7 @@ If you are using CDN, a hello-world page is easy with Element. [Online Demo](htt
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
<link rel="stylesheet" href="https://unpkg.com/element-ui@1.4/lib/theme-default/index.css">
</head>
<body>
<div id="app">
@@ -37,9 +45,9 @@ If you are using CDN, a hello-world page is easy with Element. [Online Demo](htt
</div>
</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vue@2.5/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://unpkg.com/element-ui@1.4/lib/index.js"></script>
<script>
new Vue({
el: '#app',

View File

@@ -4,7 +4,7 @@ This part walks you through the process of using Element in a webpack project.
### Use Starter Kit
We provide a general [project template](https://github.com/ElementUI/element-starter) for you. For those who are familiar with [cooking](https://github.com/ElementUI/element-cooking-starter) or [Laravel](https://github.com/ElementUI/element-in-laravel-starter), we also provide corresponding templates, and you can download and use them as well.
We provide a general [project template](https://github.com/ElementUI/element-starter/tree/1.x) for you. For those who are familiar with [cooking](https://github.com/ElementUI/element-cooking-starter) or [Laravel](https://github.com/ElementUI/element-in-laravel-starter/tree/1.x), we also provide corresponding templates, and you can download and use them as well.
If you prefer not to use them, please read the following.
@@ -42,8 +42,8 @@ Typical configurations for these config files are:
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies": {
"element-ui": "^1.0.0",
"vue": "^2.1.6"
"element-ui": "legacy",
"vue": "2.5.2"
},
"devDependencies": {
"babel-core": "^6.0.0",

View File

@@ -114,8 +114,8 @@ Switch is used for switching between two opposing states.
----| ----| ----| ----|----
disabled | whether Switch is disabled | boolean | — | false
width | width of Switch | number | — | 58 (with text) / 46 (no text)
on-close-icon | class name of the icon displayed when in `on` state, overrides `on-text` | string | — | —
off-close-icon |class name of the icon displayed when in `off` state, overrides `off-text`| string | — | —
on-icon-class | class name of the icon displayed when in `on` state, overrides `on-text` | string | — | —
off-icon-class |class name of the icon displayed when in `off` state, overrides `off-text`| string | — | —
on-text | text displayed when in `on` state | string | — | ON
off-text | text displayed when in `off` state | string | — | OFF
on-value | switch value when in `on` state | boolean / string / number | — | true

View File

@@ -157,8 +157,8 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
```html
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/element-ui"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/en.js"></script>
<script src="//unpkg.com/element-ui@1.4"></script>
<script src="//unpkg.com/element-ui@1.4/lib/umd/locale/en.js"></script>
<script>
ELEMENT.locale(ELEMENT.lang.en)
@@ -170,9 +170,9 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
```html
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/vue-i18n/dist/vue-i18n.js"></script>
<script src="//unpkg.com/element-ui"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/zh-CN.js"></script>
<script src="//unpkg.com/element-ui/lib/umd/locale/en.js"></script>
<script src="//unpkg.com/element-ui@1.4"></script>
<script src="//unpkg.com/element-ui@1.4/lib/umd/locale/zh-CN.js"></script>
<script src="//unpkg.com/element-ui@1.4/lib/umd/locale/en.js"></script>
<script>
Vue.locale('en', ELEMENT.lang.en)

View File

@@ -3,22 +3,30 @@
### npm 安装
推荐使用 npm 的方式安装,它能更好地和 [webpack](https://webpack.js.org/) 打包工具配合使用。
:::tip
注意:这里是 1.x 的文档,因此使用 npm 安装时需要添加 `legacy` 标签。
:::
```shell
npm i element-ui -S
npm i element-ui@legacy -S
```
### CDN
目前可以通过 [unpkg.com/element-ui](https://unpkg.com/element-ui/) 获取到最新版本的资源,在页面上引入 js 和 css 文件即可开始使用。
目前可以通过 [unpkg.com/element-ui](https://unpkg.com/element-ui@1.4/) 获取到最新版本的资源,在页面上引入 js 和 css 文件即可开始使用。
```html
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
<link rel="stylesheet" href="https://unpkg.com/element-ui@1.4/lib/theme-default/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://unpkg.com/element-ui@1.4/lib/index.js"></script>
```
:::tip
我们建议使用 CDN 引入 Element 的用户在链接地址上锁定版本,以免将来 Element 升级时受到非兼容性更新的影响。例如,如需锁定版本为 1.4.8,则 CSS 和 JavaScript 文件的地址分别是 `https://unpkg.com/element-ui@1.4.8/lib/theme-default/index.css``https://unpkg.com/element-ui@1.4.8/lib/index.js`
:::
### Hello world
通过 CDN 的方式我们可以很容易地使用 Element 写出一个 Hello world 页面。[在线演示](http://codepen.io/QingWei-Li/pen/vXwJrY)
通过 CDN 的方式我们可以很容易地使用 Element 写出一个 Hello world 页面。[在线演示](https://jsfiddle.net/hzfpyvg6/18/)
```html
<!DOCTYPE html>
@@ -26,7 +34,7 @@ npm i element-ui -S
<head>
<meta charset="UTF-8">
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
<link rel="stylesheet" href="https://unpkg.com/element-ui@1.4/lib/theme-default/index.css">
</head>
<body>
<div id="app">
@@ -37,9 +45,9 @@ npm i element-ui -S
</div>
</body>
<!-- 先引入 Vue -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vue@2.5/dist/vue.js"></script>
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://unpkg.com/element-ui@1.4/lib/index.js"></script>
<script>
new Vue({
el: '#app',

View File

@@ -4,7 +4,7 @@
### 使用 Starter Kit
我们提供了通用的[项目模板](https://github.com/ElementUI/element-starter),你可以直接使用。对于熟悉 [cooking](https://github.com/ElementUI/element-cooking-starter) 或 [Laravel](https://github.com/ElementUI/element-in-laravel-starter) 的用户,我们也准备了相应的模板,同样可以直接下载使用。
我们提供了通用的[项目模板](https://github.com/ElementUI/element-starter/tree/1.x),你可以直接使用。对于熟悉 [cooking](https://github.com/ElementUI/element-cooking-starter) 或 [Laravel](https://github.com/ElementUI/element-in-laravel-starter/tree/1.x) 的用户,我们也准备了相应的模板,同样可以直接下载使用。
如果不希望使用我们提供的模板,请继续阅读。
@@ -42,8 +42,8 @@
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies": {
"element-ui": "^1.0.0",
"vue": "^2.1.6"
"element-ui": "legacy",
"vue": "2.5.2"
},
"devDependencies": {
"babel-core": "^6.0.0",

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.8":"1.4"}
{"1.0.9":"1.0","1.1.6":"1.1","1.2.9":"1.2","1.3.7":"1.3","1.4.11":"1.4"}

View File

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

View File

@@ -387,6 +387,13 @@
this.onPick && this.onPick(val);
this.maxDate = val.maxDate;
this.minDate = val.minDate;
// workaround for https://github.com/ElemeFE/element/issues/7539, should remove this block when we don't have to care about Chromium 55 - 57
setTimeout(() => {
this.maxDate = val.maxDate;
this.minDate = val.minDate;
}, 10);
if (!close || this.showTime) return;
this.handleConfirm();
},

View File

@@ -147,6 +147,7 @@
},
methods: {
validate(trigger, callback = noop) {
this.validateDisabled = false;
var rules = this.getFilteredRule(trigger);
if ((!rules || rules.length === 0) && !this._props.hasOwnProperty('required')) {
callback();

View File

@@ -23,6 +23,7 @@
</template>
<script>
import Menu from './menu-mixin';
import ElTooltip from 'element-ui/packages/tooltip';
import Emitter from 'element-ui/src/mixins/emitter';
export default {
@@ -30,6 +31,8 @@
componentName: 'ElMenuItem',
components: { ElTooltip },
mixins: [Menu, Emitter],
props: {

View File

@@ -203,6 +203,17 @@ export default {
handleChange({ target }) {
this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(target.value);
this.oldValue = null;
this.resetValueIfNeed(target);
},
resetValueIfNeed(target) {
const num = parseInt(target.value, 10);
if (!isNaN(num)) {
if (num < 1) {
target.value = 1;
} else {
this.reassignMaxValue(target);
}
}
},
reassignMaxValue(target) {
if (+target.value > this.$parent.internalPageCount) {

View File

@@ -495,7 +495,10 @@
if (!this.$refs.reference) return;
let inputChildNodes = this.$refs.reference.$el.childNodes;
let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0];
input.style.height = Math.max(this.$refs.tags.clientHeight + 6, sizeMap[this.size] || 36) + 'px';
const tags = this.$refs.tags;
input.style.height = this.selected.length === 0
? sizeMap[this.size] + 'px'
: Math.max(tags ? (tags.clientHeight + 6) : 0, sizeMap[this.size] || 36) + 'px';
if (this.visible && this.emptyText !== false) {
this.broadcast('ElSelectDropdown', 'updatePopper');
}

View File

@@ -4,7 +4,6 @@
'el-table--fit': fit,
'el-table--striped': stripe,
'el-table--border': border,
'el-table--hidden': isHidden,
'el-table--fluid-height': maxHeight,
'el-table--enable-row-hover': !store.states.isComplex,
'el-table--enable-row-transition': (store.states.data || []).length !== 0 && (store.states.data || []).length < 100
@@ -294,12 +293,6 @@
} else if (this.shouldUpdateHeight) {
this.layout.updateHeight();
}
if (this.$el) {
this.isHidden = this.$el.clientWidth === 0;
if (this.isHidden && this.layout.bodyWidth) {
setTimeout(() => this.doLayout());
}
}
});
}
},
@@ -460,7 +453,6 @@
return {
store,
layout,
isHidden: false,
renderExpanded: null,
resizeProxyVisible: false
};

View File

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

View File

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

View File

@@ -214,6 +214,7 @@ describe('Pagination', () => {
triggerEvent(input, 'change');
setTimeout(() => {
expect(vm.page).to.equal(1);
expect(input.value).to.equal('1');
input.value = 10000;
triggerEvent(input, 'change');
@@ -225,7 +226,38 @@ describe('Pagination', () => {
triggerEvent(input, 'change');
setTimeout(() => {
expect(vm.page).to.equal(1);
done();
expect(input.value).to.equal('1');
// 多次输入不在min-max区间内的数字
input.value = 0;
triggerEvent(input, 'change');
setTimeout(()=>{
expect(vm.page).to.equal(1);
expect(input.value).to.equal('1');
input.value = 0;
triggerEvent(input, 'change');
setTimeout(()=>{
expect(vm.page).to.equal(1);
expect(input.value).to.equal('1');
input.value = 1000;
triggerEvent(input, 'change');
setTimeout(()=>{
expect(vm.page).to.equal(10);
expect(input.value).to.equal('10');
input.value = 1000;
triggerEvent(input, 'change');
setTimeout(()=>{
expect(vm.page).to.equal(10);
expect(input.value).to.equal('10');
done();
}, 50);
}, 50);
}, 50);
}, 50);
}, 50);
}, 50);
}, 50);