mirror of https://github.com/ElemeFE/element
Merge branch 'dev' into carbon
commit
e3aa5ac594
|
@ -1,5 +1,21 @@
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### 1.4.2
|
||||||
|
|
||||||
|
*2017-08-09*
|
||||||
|
|
||||||
|
- Fixed Select marking option of `value` equal to `0` as selected when the initial value is null and bound to an object-typed value, #6143
|
||||||
|
- Fixed Step style issue when `status` is `error`, #6155 @wacky6
|
||||||
|
- Fixed Cascader selecting parent item when moving mouse quickly after clicking a leaf item, #6199
|
||||||
|
- Fixed Menu not hiding submenus when collapsed, #6200
|
||||||
|
- Fixed status of the inner native input of Switch not syncing with the component, #6205 @wacky6
|
||||||
|
- Fixed wrong button positioning of Slider after window is resized, #6263
|
||||||
|
- Fixed Autocomplete not hiding dropdown menu on blur, #6256
|
||||||
|
- Fixed hitting enter on jumper of Pagination not trigger page change event in IE, #6306 @qingdengyue
|
||||||
|
- Fixed InputNumber style issue when its `size` is `large` or `small`, #6310 @JeremyWuuuuu
|
||||||
|
- Fixed i18n failure for some texts in DatePicker, #6328
|
||||||
|
- Fixed Slider value changing to minimum when its button is clicked, #6359
|
||||||
|
|
||||||
### 1.4.1
|
### 1.4.1
|
||||||
|
|
||||||
*2017-07-28*
|
*2017-07-28*
|
||||||
|
|
|
@ -1,5 +1,20 @@
|
||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
|
### 1.4.2
|
||||||
|
*2017-08-09*
|
||||||
|
|
||||||
|
- 修复绑定值为对象类型时,初始值为 null 的 Select 会选中 value 为 `0` 的问题,#6143
|
||||||
|
- 修复 `status` 为 `error` 的 Step 样式问题,#6155 @wacky6
|
||||||
|
- 修复当 Cascader 的 `expand-trigger` 为 `hover` 时,点击选择条目后快速移动会再次选到父级元素的问题,#6199
|
||||||
|
- 修复 Menu 在 collaspse 时不能收起子级菜单的问题,#6200
|
||||||
|
- 修复 Switch 内部的原生 input 状态与组件不同步的问题,#6205 @wacky6
|
||||||
|
- 修复 Slider 在 resize 窗口后滑块位置不准的问题,#6263
|
||||||
|
- 修复 Autocomplete 在 blur 时不会收起下拉框的问题,#6256
|
||||||
|
- 修复 Pagination 的 jumper 在 IE 下敲击回车无法触发翻页的问题,#6306 @qingdengyue
|
||||||
|
- 修复 InputNumber 当 `size` 为 `large` 和 `small` 时的样式问题,#6310 @JeremyWuuuuu
|
||||||
|
- 修复 DatePicker 的部分格式化文字 i18n 不生效的问题,#6328
|
||||||
|
- 修复点击 Slider 的滑块会使其移动至起点的问题,#6359
|
||||||
|
|
||||||
### 1.4.1
|
### 1.4.1
|
||||||
*2017-07-28*
|
*2017-07-28*
|
||||||
|
|
||||||
|
|
|
@ -221,6 +221,6 @@ Clicking each dropdown item fires an event whose parameter is assigned by each i
|
||||||
### Dropdown Menu Item Attributes
|
### Dropdown Menu Item Attributes
|
||||||
| Attribute | Description | Type | Accepted Values | Default |
|
| Attribute | Description | Type | Accepted Values | Default |
|
||||||
|------------- |---------------- |---------------- |---------------------- |-------- |
|
|------------- |---------------- |---------------- |---------------------- |-------- |
|
||||||
| command | a command to be dispatched to Dropdown's `command` callback | string | — | — |
|
| command | a command to be dispatched to Dropdown's `command` callback | string/number/object | — | — |
|
||||||
| disabled | whether the item is disabled | boolean | — | false |
|
| disabled | whether the item is disabled | boolean | — | false |
|
||||||
| divided | whether a divider is displayed | boolean | — | false |
|
| divided | whether a divider is displayed | boolean | — | false |
|
||||||
|
|
|
@ -205,6 +205,7 @@ Currently Element ships with the following languages:
|
||||||
<li>Afrikaans (af-ZA)</li>
|
<li>Afrikaans (af-ZA)</li>
|
||||||
<li>Estonian (ee)</li>
|
<li>Estonian (ee)</li>
|
||||||
<li>Slovenian (sl)</li>
|
<li>Slovenian (sl)</li>
|
||||||
|
<li>Arabic (ar)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
If your target language is not included, you are more than welcome to contribute: just add another language config [here](https://github.com/ElemeFE/element/tree/master/src/locale/lang) and create a pull request.
|
If your target language is not included, you are more than welcome to contribute: just add another language config [here](https://github.com/ElemeFE/element/tree/master/src/locale/lang) and create a pull request.
|
||||||
|
|
|
@ -221,6 +221,6 @@
|
||||||
### Dropdown Menu Item Attributes
|
### Dropdown Menu Item Attributes
|
||||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||||
|------------- |---------------- |---------------- |---------------------- |-------- |
|
|------------- |---------------- |---------------- |---------------------- |-------- |
|
||||||
| command | 指令 | string | — | — |
|
| command | 指令 | string/number/object | — | — |
|
||||||
| disabled | 禁用 | boolean | — | false |
|
| disabled | 禁用 | boolean | — | false |
|
||||||
| divided | 显示分割线 | boolean | — | false |
|
| divided | 显示分割线 | boolean | — | false |
|
||||||
|
|
|
@ -217,6 +217,7 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
|
||||||
<li>南非荷兰语(af-ZA)</li>
|
<li>南非荷兰语(af-ZA)</li>
|
||||||
<li>爱沙尼亚语(ee)</li>
|
<li>爱沙尼亚语(ee)</li>
|
||||||
<li>斯洛文尼亚语(sl)</li>
|
<li>斯洛文尼亚语(sl)</li>
|
||||||
|
<li>阿拉伯语(ar)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
如果你需要使用其他的语言,欢迎贡献 PR:只需在 [这里](https://github.com/ElemeFE/element/tree/master/src/locale/lang) 添加一个语言配置文件即可。
|
如果你需要使用其他的语言,欢迎贡献 PR:只需在 [这里](https://github.com/ElemeFE/element/tree/master/src/locale/lang) 添加一个语言配置文件即可。
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
</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="//cdnjs.cloudflare.com/ajax/libs/vue/2.3.0/vue.runtime.min.js"></script>
|
<script src="//cdn.jsdelivr.net/npm/vue@2.3.0/dist/vue.runtime.min.js"></script>
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/vue-router/2.1.1/vue-router.min.js"></script><% } %>
|
<script src="//cdn.jsdelivr.net/npm/vue-router@2.1.1/dist/vue-router.min.js"></script><% } %>
|
||||||
</body>
|
</body>
|
||||||
<% if (process.env.NODE_ENV === 'production') { %><script>
|
<% if (process.env.NODE_ENV === 'production') { %><script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"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.0.9":"1.0","1.1.6":"1.1","1.2.9":"1.2","1.3.7":"1.3","1.4.2":"1.4"}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "element-ui",
|
"name": "element-ui",
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"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": [
|
||||||
|
|
|
@ -2,13 +2,7 @@
|
||||||
<div class="el-autocomplete" v-clickoutside="close">
|
<div class="el-autocomplete" v-clickoutside="close">
|
||||||
<el-input
|
<el-input
|
||||||
ref="input"
|
ref="input"
|
||||||
:value="value"
|
v-bind="$props"
|
||||||
:disabled="disabled"
|
|
||||||
:placeholder="placeholder"
|
|
||||||
:name="name"
|
|
||||||
:size="size"
|
|
||||||
:icon="icon"
|
|
||||||
:on-icon-click="onIconClick"
|
|
||||||
@compositionstart.native="handleComposition"
|
@compositionstart.native="handleComposition"
|
||||||
@compositionupdate.native="handleComposition"
|
@compositionupdate.native="handleComposition"
|
||||||
@compositionend.native="handleComposition"
|
@compositionend.native="handleComposition"
|
||||||
|
@ -18,6 +12,7 @@
|
||||||
@keydown.up.native.prevent="highlight(highlightedIndex - 1)"
|
@keydown.up.native.prevent="highlight(highlightedIndex - 1)"
|
||||||
@keydown.down.native.prevent="highlight(highlightedIndex + 1)"
|
@keydown.down.native.prevent="highlight(highlightedIndex + 1)"
|
||||||
@keydown.enter.native.prevent="handleKeyEnter"
|
@keydown.enter.native.prevent="handleKeyEnter"
|
||||||
|
@keydown.native.tab="close"
|
||||||
>
|
>
|
||||||
<template slot="prepend" v-if="$slots.prepend">
|
<template slot="prepend" v-if="$slots.prepend">
|
||||||
<slot name="prepend"></slot>
|
<slot name="prepend"></slot>
|
||||||
|
|
|
@ -3,12 +3,13 @@ import { t } from 'element-ui/src/locale';
|
||||||
|
|
||||||
const weeks = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
|
const weeks = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
|
||||||
const months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
|
const months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
|
||||||
|
const getI18nSettings = () => {
|
||||||
dateUtil.i18n = {
|
return {
|
||||||
dayNamesShort: weeks.map(week => t(`el.datepicker.weeks.${ week }`)),
|
dayNamesShort: weeks.map(week => t(`el.datepicker.weeks.${ week }`)),
|
||||||
dayNames: weeks.map(week => t(`el.datepicker.weeks.${ week }`)),
|
dayNames: weeks.map(week => t(`el.datepicker.weeks.${ week }`)),
|
||||||
monthNamesShort: months.map(month => t(`el.datepicker.months.${ month }`)),
|
monthNamesShort: months.map(month => t(`el.datepicker.months.${ month }`)),
|
||||||
monthNames: months.map((month, index) => t(`el.datepicker.month${ index + 1 }`))
|
monthNames: months.map((month, index) => t(`el.datepicker.month${ index + 1 }`))
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const newArray = function(start, end) {
|
const newArray = function(start, end) {
|
||||||
|
@ -36,11 +37,11 @@ export const isDate = function(date) {
|
||||||
export const formatDate = function(date, format) {
|
export const formatDate = function(date, format) {
|
||||||
date = toDate(date);
|
date = toDate(date);
|
||||||
if (!date) return '';
|
if (!date) return '';
|
||||||
return dateUtil.format(date, format || 'yyyy-MM-dd');
|
return dateUtil.format(date, format || 'yyyy-MM-dd', getI18nSettings());
|
||||||
};
|
};
|
||||||
|
|
||||||
export const parseDate = function(string, format) {
|
export const parseDate = function(string, format) {
|
||||||
return dateUtil.parse(string, format || 'yyyy-MM-dd');
|
return dateUtil.parse(string, format || 'yyyy-MM-dd', getI18nSettings());
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getDayCountOfMonth = function(year, month) {
|
export const getDayCountOfMonth = function(year, month) {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
mixins: [Emitter],
|
mixins: [Emitter],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
command: null,
|
command: {},
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
divided: Boolean
|
divided: Boolean
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,71 +13,9 @@
|
||||||
</el-menu-collapse-transition>
|
</el-menu-collapse-transition>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Vue from 'vue';
|
|
||||||
import emitter from 'element-ui/src/mixins/emitter';
|
import emitter from 'element-ui/src/mixins/emitter';
|
||||||
import { addClass, removeClass, hasClass } from 'element-ui/src/utils/dom';
|
import { addClass, removeClass, hasClass } from 'element-ui/src/utils/dom';
|
||||||
|
|
||||||
Vue.component('el-menu-collapse-transition', {
|
|
||||||
functional: true,
|
|
||||||
render(createElement, context) {
|
|
||||||
const data = {
|
|
||||||
props: {
|
|
||||||
mode: 'out-in'
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
beforeEnter(el) {
|
|
||||||
el.style.opacity = 0.2;
|
|
||||||
},
|
|
||||||
|
|
||||||
enter(el) {
|
|
||||||
addClass(el, 'el-opacity-transition');
|
|
||||||
el.style.opacity = 1;
|
|
||||||
},
|
|
||||||
|
|
||||||
afterEnter(el) {
|
|
||||||
removeClass(el, 'el-opacity-transition');
|
|
||||||
el.style.opacity = '';
|
|
||||||
},
|
|
||||||
|
|
||||||
beforeLeave(el) {
|
|
||||||
if (!el.dataset) el.dataset = {};
|
|
||||||
|
|
||||||
if (hasClass(el, 'el-menu--collapse')) {
|
|
||||||
removeClass(el, 'el-menu--collapse');
|
|
||||||
el.dataset.oldOverflow = el.style.overflow;
|
|
||||||
el.dataset.scrollWidth = el.scrollWidth;
|
|
||||||
addClass(el, 'el-menu--collapse');
|
|
||||||
}
|
|
||||||
|
|
||||||
el.style.width = el.scrollWidth + 'px';
|
|
||||||
el.style.overflow = 'hidden';
|
|
||||||
},
|
|
||||||
|
|
||||||
leave(el) {
|
|
||||||
if (!hasClass(el, 'el-menu--collapse')) {
|
|
||||||
addClass(el, 'horizontal-collapse-transition');
|
|
||||||
el.style.width = '64px';
|
|
||||||
} else {
|
|
||||||
addClass(el, 'horizontal-collapse-transition');
|
|
||||||
el.style.width = el.dataset.scrollWidth + 'px';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
afterLeave(el) {
|
|
||||||
removeClass(el, 'horizontal-collapse-transition');
|
|
||||||
if (hasClass(el, 'el-menu--collapse')) {
|
|
||||||
el.style.width = el.dataset.scrollWidth + 'px';
|
|
||||||
} else {
|
|
||||||
el.style.width = '64px';
|
|
||||||
}
|
|
||||||
el.style.overflow = el.dataset.oldOverflow;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return createElement('transition', data, context.children);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ElMenu',
|
name: 'ElMenu',
|
||||||
|
|
||||||
|
@ -91,6 +29,69 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
'el-menu-collapse-transition': {
|
||||||
|
functional: true,
|
||||||
|
render(createElement, context) {
|
||||||
|
const data = {
|
||||||
|
props: {
|
||||||
|
mode: 'out-in'
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
beforeEnter(el) {
|
||||||
|
el.style.opacity = 0.2;
|
||||||
|
},
|
||||||
|
|
||||||
|
enter(el) {
|
||||||
|
addClass(el, 'el-opacity-transition');
|
||||||
|
el.style.opacity = 1;
|
||||||
|
},
|
||||||
|
|
||||||
|
afterEnter(el) {
|
||||||
|
removeClass(el, 'el-opacity-transition');
|
||||||
|
el.style.opacity = '';
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeLeave(el) {
|
||||||
|
if (!el.dataset) el.dataset = {};
|
||||||
|
|
||||||
|
if (hasClass(el, 'el-menu--collapse')) {
|
||||||
|
removeClass(el, 'el-menu--collapse');
|
||||||
|
el.dataset.oldOverflow = el.style.overflow;
|
||||||
|
el.dataset.scrollWidth = el.scrollWidth;
|
||||||
|
addClass(el, 'el-menu--collapse');
|
||||||
|
}
|
||||||
|
|
||||||
|
el.style.width = el.scrollWidth + 'px';
|
||||||
|
el.style.overflow = 'hidden';
|
||||||
|
},
|
||||||
|
|
||||||
|
leave(el) {
|
||||||
|
if (!hasClass(el, 'el-menu--collapse')) {
|
||||||
|
addClass(el, 'horizontal-collapse-transition');
|
||||||
|
el.style.width = '64px';
|
||||||
|
} else {
|
||||||
|
addClass(el, 'horizontal-collapse-transition');
|
||||||
|
el.style.width = el.dataset.scrollWidth + 'px';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
afterLeave(el) {
|
||||||
|
removeClass(el, 'horizontal-collapse-transition');
|
||||||
|
if (hasClass(el, 'el-menu--collapse')) {
|
||||||
|
el.style.width = el.dataset.scrollWidth + 'px';
|
||||||
|
} else {
|
||||||
|
el.style.width = '64px';
|
||||||
|
}
|
||||||
|
el.style.overflow = el.dataset.oldOverflow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return createElement('transition', data, context.children);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
mode: {
|
mode: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -134,6 +135,9 @@
|
||||||
},
|
},
|
||||||
defaultOpeneds(value) {
|
defaultOpeneds(value) {
|
||||||
this.openedMenus = value;
|
this.openedMenus = value;
|
||||||
|
},
|
||||||
|
collapse(value) {
|
||||||
|
if (value) this.openedMenus = [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -189,7 +189,13 @@ export default {
|
||||||
handleFocus(event) {
|
handleFocus(event) {
|
||||||
this.oldValue = event.target.value;
|
this.oldValue = event.target.value;
|
||||||
},
|
},
|
||||||
|
handleKeyUp(event) {
|
||||||
|
const key = event.key || '';
|
||||||
|
const keyCode = event.keyCode || '';
|
||||||
|
if ((key && key === 'Enter') || (keyCode && keyCode === 13)) {
|
||||||
|
this.handleChange({ target: event.target });
|
||||||
|
}
|
||||||
|
},
|
||||||
handleChange({ target }) {
|
handleChange({ target }) {
|
||||||
this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(target.value);
|
this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(target.value);
|
||||||
this.oldValue = null;
|
this.oldValue = null;
|
||||||
|
@ -209,6 +215,7 @@ export default {
|
||||||
domProps-value={ this.$parent.internalCurrentPage }
|
domProps-value={ this.$parent.internalCurrentPage }
|
||||||
on-change={ this.handleChange }
|
on-change={ this.handleChange }
|
||||||
on-focus={ this.handleFocus }
|
on-focus={ this.handleFocus }
|
||||||
|
on-keyup={ this.handleKeyUp }
|
||||||
number/>
|
number/>
|
||||||
{ this.t('el.pagination.pageClassifier') }
|
{ this.t('el.pagination.pageClassifier') }
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -141,10 +141,10 @@
|
||||||
let diff = 0;
|
let diff = 0;
|
||||||
if (this.vertical) {
|
if (this.vertical) {
|
||||||
this.currentY = event.clientY;
|
this.currentY = event.clientY;
|
||||||
diff = (this.startY - this.currentY) / this.$parent.$sliderSize * 100;
|
diff = (this.startY - this.currentY) / this.$parent.sliderSize * 100;
|
||||||
} else {
|
} else {
|
||||||
this.currentX = event.clientX;
|
this.currentX = event.clientX;
|
||||||
diff = (this.currentX - this.startX) / this.$parent.$sliderSize * 100;
|
diff = (this.currentX - this.startX) / this.$parent.sliderSize * 100;
|
||||||
}
|
}
|
||||||
this.newPosition = this.startPosition + diff;
|
this.newPosition = this.startPosition + diff;
|
||||||
this.setPosition(this.newPosition);
|
this.setPosition(this.newPosition);
|
||||||
|
@ -169,6 +169,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
setPosition(newPosition) {
|
setPosition(newPosition) {
|
||||||
|
if (newPosition === null) return;
|
||||||
if (newPosition < 0) {
|
if (newPosition < 0) {
|
||||||
newPosition = 0;
|
newPosition = 0;
|
||||||
} else if (newPosition > 100) {
|
} else if (newPosition > 100) {
|
||||||
|
|
|
@ -46,7 +46,6 @@
|
||||||
<script type="text/babel">
|
<script type="text/babel">
|
||||||
import ElInputNumber from 'element-ui/packages/input-number';
|
import ElInputNumber from 'element-ui/packages/input-number';
|
||||||
import SliderButton from './button.vue';
|
import SliderButton from './button.vue';
|
||||||
import { getStyle } from 'element-ui/src/utils/dom';
|
|
||||||
import Emitter from 'element-ui/src/mixins/emitter';
|
import Emitter from 'element-ui/src/mixins/emitter';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -115,7 +114,8 @@
|
||||||
firstValue: null,
|
firstValue: null,
|
||||||
secondValue: null,
|
secondValue: null,
|
||||||
oldValue: null,
|
oldValue: null,
|
||||||
dragging: false
|
dragging: false,
|
||||||
|
sliderSize: 1
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -223,19 +223,21 @@
|
||||||
if (this.disabled || this.dragging) return;
|
if (this.disabled || this.dragging) return;
|
||||||
if (this.vertical) {
|
if (this.vertical) {
|
||||||
const sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
|
const sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
|
||||||
this.setPosition((sliderOffsetBottom - event.clientY) / this.$sliderSize * 100);
|
this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
|
||||||
} else {
|
} else {
|
||||||
const sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
|
const sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
|
||||||
this.setPosition((event.clientX - sliderOffsetLeft) / this.$sliderSize * 100);
|
this.setPosition((event.clientX - sliderOffsetLeft) / this.sliderSize * 100);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
resetSize() {
|
||||||
|
if (this.$refs.slider) {
|
||||||
|
this.sliderSize = this.$refs.slider[`client${ this.vertical ? 'Height' : 'Width' }`];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
$sliderSize() {
|
|
||||||
return parseInt(getStyle(this.$refs.slider, (this.vertical ? 'height' : 'width')), 10);
|
|
||||||
},
|
|
||||||
|
|
||||||
stops() {
|
stops() {
|
||||||
if (this.step === 0) {
|
if (this.step === 0) {
|
||||||
process.env.NODE_ENV !== 'production' &&
|
process.env.NODE_ENV !== 'production' &&
|
||||||
|
@ -320,6 +322,12 @@
|
||||||
}
|
}
|
||||||
this.oldValue = this.firstValue;
|
this.oldValue = this.firstValue;
|
||||||
}
|
}
|
||||||
|
this.resetSize();
|
||||||
|
window.addEventListener('resize', this.resetSize);
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
window.removeEventListener('resize', this.resetSize);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -80,6 +80,10 @@ export default {
|
||||||
currentStatus() {
|
currentStatus() {
|
||||||
return this.status || this.internalStatus;
|
return this.status || this.internalStatus;
|
||||||
},
|
},
|
||||||
|
prevStatus() {
|
||||||
|
const prevStep = this.$parent.steps[this.index - 1];
|
||||||
|
return prevStep ? prevStep.currentStatus : 'wait';
|
||||||
|
},
|
||||||
isLast: function() {
|
isLast: function() {
|
||||||
const parent = this.$parent;
|
const parent = this.$parent;
|
||||||
return parent.steps[parent.steps.length - 1] === this;
|
return parent.steps[parent.steps.length - 1] === this;
|
||||||
|
@ -114,7 +118,7 @@ export default {
|
||||||
|
|
||||||
if (val > this.index) {
|
if (val > this.index) {
|
||||||
this.internalStatus = this.$parent.finishStatus;
|
this.internalStatus = this.$parent.finishStatus;
|
||||||
} else if (val === this.index) {
|
} else if (val === this.index && this.prevStatus !== 'error') {
|
||||||
this.internalStatus = this.$parent.processStatus;
|
this.internalStatus = this.$parent.processStatus;
|
||||||
} else {
|
} else {
|
||||||
this.internalStatus = 'wait';
|
this.internalStatus = 'wait';
|
||||||
|
@ -129,7 +133,7 @@ export default {
|
||||||
|
|
||||||
style.transitionDelay = 150 * this.index + 'ms';
|
style.transitionDelay = 150 * this.index + 'ms';
|
||||||
if (status === this.$parent.processStatus) {
|
if (status === this.$parent.processStatus) {
|
||||||
step = 50;
|
step = this.currentStatus !== 'error' ? 50 : 0;
|
||||||
} else if (status === 'wait') {
|
} else if (status === 'wait') {
|
||||||
step = 0;
|
step = 0;
|
||||||
style.transitionDelay = (-150 * this.index) + 'ms';
|
style.transitionDelay = (-150 * this.index) + 'ms';
|
||||||
|
|
|
@ -111,6 +111,7 @@
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
checked() {
|
checked() {
|
||||||
|
this.$refs.input.checked = this.checked;
|
||||||
if (this.onColor || this.offColor) {
|
if (this.onColor || this.offColor) {
|
||||||
this.setBackgroundColor();
|
this.setBackgroundColor();
|
||||||
}
|
}
|
||||||
|
@ -118,8 +119,8 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleChange(event) {
|
handleChange(event) {
|
||||||
this.$emit('change', !this.checked ? this.onValue : this.offValue);
|
|
||||||
this.$emit('input', !this.checked ? this.onValue : this.offValue);
|
this.$emit('input', !this.checked ? this.onValue : this.offValue);
|
||||||
|
this.$emit('change', !this.checked ? this.onValue : this.offValue);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
// set input's checked property
|
// set input's checked property
|
||||||
// in case parent refuses to change component's value
|
// in case parent refuses to change component's value
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
'el-table--fit': fit,
|
'el-table--fit': fit,
|
||||||
'el-table--striped': stripe,
|
'el-table--striped': stripe,
|
||||||
'el-table--border': border,
|
'el-table--border': border,
|
||||||
|
'el-table--hidden': isHidden,
|
||||||
'el-table--fluid-height': maxHeight,
|
'el-table--fluid-height': maxHeight,
|
||||||
'el-table--enable-row-hover': !store.states.isComplex,
|
'el-table--enable-row-hover': !store.states.isComplex,
|
||||||
'el-table--enable-row-transition': (store.states.data || []).length !== 0 && (store.states.data || []).length < 100
|
'el-table--enable-row-transition': (store.states.data || []).length !== 0 && (store.states.data || []).length < 100
|
||||||
|
@ -291,6 +292,9 @@
|
||||||
} else if (this.shouldUpdateHeight) {
|
} else if (this.shouldUpdateHeight) {
|
||||||
this.layout.updateHeight();
|
this.layout.updateHeight();
|
||||||
}
|
}
|
||||||
|
if (this.$el) {
|
||||||
|
this.isHidden = this.$el.clientWidth === 0;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -451,6 +455,7 @@
|
||||||
return {
|
return {
|
||||||
store,
|
store,
|
||||||
layout,
|
layout,
|
||||||
|
isHidden: false,
|
||||||
renderExpanded: null,
|
renderExpanded: null,
|
||||||
resizeProxyVisible: false
|
resizeProxyVisible: false
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,7 +21,7 @@ export const orderBy = function(array, sortKey, reverse, sortMethod) {
|
||||||
if (typeof reverse === 'string') {
|
if (typeof reverse === 'string') {
|
||||||
reverse = reverse === 'descending' ? -1 : 1;
|
reverse = reverse === 'descending' ? -1 : 1;
|
||||||
}
|
}
|
||||||
if (!sortKey) {
|
if (!sortKey && !sortMethod) {
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
const order = (reverse && reverse < 0) ? -1 : 1;
|
const order = (reverse && reverse < 0) ? -1 : 1;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "element-theme-default",
|
"name": "element-theme-default",
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"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",
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
width: 200px;
|
width: 200px;
|
||||||
|
|
||||||
& .el-input-number__increase, .el-input-number__decrease {
|
& .el-input-number__increase, .el-input-number__decrease {
|
||||||
line-height: var(--input-large-height);
|
line-height: calc(var(--input-large-height) - 2);
|
||||||
width: var(--input-large-height);
|
width: var(--input-large-height);
|
||||||
font-size: var(--input-large-font-size);
|
font-size: var(--input-large-font-size);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
width: 130px;
|
width: 130px;
|
||||||
|
|
||||||
& .el-input-number__increase, .el-input-number__decrease {
|
& .el-input-number__increase, .el-input-number__decrease {
|
||||||
line-height: var(--input-small-height);
|
line-height: calc(var(--input-small-height) - 2);
|
||||||
width: var(--input-small-height);
|
width: var(--input-small-height);
|
||||||
font-size: var(--input-small-font-size);
|
font-size: var(--input-small-font-size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,6 +146,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@modifier hidden {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
& th {
|
& th {
|
||||||
background-color: var(--table-header-background);
|
background-color: var(--table-header-background);
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
|
@ -158,7 +158,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
version: '1.4.1',
|
version: '1.4.2',
|
||||||
locale: locale.use,
|
locale: locale.use,
|
||||||
i18n: locale.i18n,
|
i18n: locale.i18n,
|
||||||
install,
|
install,
|
||||||
|
|
|
@ -0,0 +1,104 @@
|
||||||
|
export default {
|
||||||
|
el: {
|
||||||
|
colorpicker: {
|
||||||
|
confirm: 'موافق',
|
||||||
|
clear: 'إزالة'
|
||||||
|
},
|
||||||
|
datepicker: {
|
||||||
|
now: 'الآن',
|
||||||
|
today: 'اليوم',
|
||||||
|
cancel: 'إلغاء',
|
||||||
|
clear: 'إزالة',
|
||||||
|
confirm: 'موافق',
|
||||||
|
selectDate: 'أختر التاريخ',
|
||||||
|
selectTime: 'أختر الوقت',
|
||||||
|
startDate: 'تاريخ البدء',
|
||||||
|
startTime: 'وقت البدء',
|
||||||
|
endDate: 'تاريخ الانتهاء',
|
||||||
|
endTime: 'وقت الانتهاء',
|
||||||
|
year: '',
|
||||||
|
month1: 'يناير',
|
||||||
|
month2: 'فبراير',
|
||||||
|
month3: 'مارس',
|
||||||
|
month4: 'ابريل',
|
||||||
|
month5: 'مايو',
|
||||||
|
month6: 'يونيو',
|
||||||
|
month7: 'يوليو',
|
||||||
|
month8: 'أغسطس',
|
||||||
|
month9: 'سبتمبر',
|
||||||
|
month10: 'أكتوبر',
|
||||||
|
month11: 'نوفمبر',
|
||||||
|
month12: 'ديسمبر',
|
||||||
|
week: 'أسبوع',
|
||||||
|
weeks: {
|
||||||
|
sun: 'الأحد',
|
||||||
|
mon: 'الأثنين',
|
||||||
|
tue: 'الثلاثاء',
|
||||||
|
wed: 'الأربعاء',
|
||||||
|
thu: 'الخميس',
|
||||||
|
fri: 'الجمعة',
|
||||||
|
sat: 'السبت'
|
||||||
|
},
|
||||||
|
months: {
|
||||||
|
jan: 'يناير',
|
||||||
|
feb: 'فبراير',
|
||||||
|
mar: 'مارس',
|
||||||
|
apr: 'أبريل',
|
||||||
|
may: 'مايو',
|
||||||
|
jun: 'يونيو',
|
||||||
|
jul: 'يوليو',
|
||||||
|
aug: 'أغسطس',
|
||||||
|
sep: 'سبتمبر',
|
||||||
|
oct: 'أكتوبر',
|
||||||
|
nov: 'نوفمبر',
|
||||||
|
dec: 'ديسمبر'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
loading: 'جار التحميل',
|
||||||
|
noMatch: 'لايوجد بيانات مطابقة',
|
||||||
|
noData: 'لايوجد بيانات',
|
||||||
|
placeholder: 'أختر'
|
||||||
|
},
|
||||||
|
cascader: {
|
||||||
|
noMatch: 'لايوجد بيانات مطابقة',
|
||||||
|
loading: 'جار التحميل',
|
||||||
|
placeholder: 'أختر'
|
||||||
|
},
|
||||||
|
pagination: {
|
||||||
|
goto: 'أذهب إلى',
|
||||||
|
pagesize: '/صفحة',
|
||||||
|
total: 'الكل {total}',
|
||||||
|
pageClassifier: ''
|
||||||
|
},
|
||||||
|
messagebox: {
|
||||||
|
title: 'الرسالة',
|
||||||
|
confirm: 'موافق',
|
||||||
|
cancel: 'إلغاء',
|
||||||
|
error: 'مدخل غير صحيح'
|
||||||
|
},
|
||||||
|
upload: {
|
||||||
|
delete: 'حذف',
|
||||||
|
preview: 'عرض',
|
||||||
|
continue: 'إستمرار'
|
||||||
|
},
|
||||||
|
table: {
|
||||||
|
emptyText: 'لايوجد بيانات',
|
||||||
|
confirmFilter: 'تأكيد',
|
||||||
|
resetFilter: 'حذف',
|
||||||
|
clearFilter: 'الكل',
|
||||||
|
sumText: 'المجموع'
|
||||||
|
},
|
||||||
|
tree: {
|
||||||
|
emptyText: 'لايوجد بيانات'
|
||||||
|
},
|
||||||
|
transfer: {
|
||||||
|
noMatch: 'لايوجد بيانات مطابقة',
|
||||||
|
noData: 'لايوجد بيانات',
|
||||||
|
titles: ['قائمة 1', 'قائمة 2'], // to be translated
|
||||||
|
filterPlaceholder: 'ادخل كلمة', // to be translated
|
||||||
|
noCheckedFormat: '{total} عناصر', // to be translated
|
||||||
|
hasCheckedFormat: '{checked}/{total} مختار' // to be translated
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
|
@ -122,4 +122,22 @@ describe('Steps', () => {
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('step:status=error', done => {
|
||||||
|
vm = createVue(`
|
||||||
|
<el-steps :active="2" process-status="process" finish-status="success" direction="horizontal">
|
||||||
|
<el-step title="step1"></el-step>
|
||||||
|
<el-step title="step2" status="error"></el-step>
|
||||||
|
<el-step title="step3"></el-step>
|
||||||
|
</el-steps>
|
||||||
|
`);
|
||||||
|
|
||||||
|
vm.$nextTick(_ => {
|
||||||
|
const errorLine = vm.$el.querySelector('.el-step:nth-child(2) .el-step__line-inner');
|
||||||
|
expect(errorLine.getBoundingClientRect().width).to.equal(0);
|
||||||
|
const nextStep = vm.$el.querySelector('.el-step:nth-child(3) .el-step__head');
|
||||||
|
expect(nextStep.classList.contains('is-wait')).to.equal(true);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -175,4 +175,29 @@ describe('Switch', () => {
|
||||||
}, 10);
|
}, 10);
|
||||||
}, 10);
|
}, 10);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('sets checkbox value', done => {
|
||||||
|
vm = createVue({
|
||||||
|
template: `
|
||||||
|
<div>
|
||||||
|
<el-switch v-model="value"></el-switch>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
value: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
|
||||||
|
vm.value = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
expect(vm.$el.querySelector('input').checked).to.equal(true);
|
||||||
|
vm.value = false;
|
||||||
|
setTimeout(() => {
|
||||||
|
expect(vm.$el.querySelector('input').checked).to.equal(false);
|
||||||
|
done();
|
||||||
|
}, 10);
|
||||||
|
}, 10);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue