Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
43ecb881
Commit
43ecb881
authored
Sep 14, 2017
by
Leopoldthecoder
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into carbon
# Conflicts: # packages/date-picker/src/panel/time.vue
parents
e8516d63
36d4f0a6
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
340 additions
and
116 deletions
+340
-116
CHANGELOG.en-US.md
CHANGELOG.en-US.md
+9
-0
CHANGELOG.zh-CN.md
CHANGELOG.zh-CN.md
+8
-0
examples/docs/en-US/slider.md
examples/docs/en-US/slider.md
+1
-0
examples/docs/en-US/tooltip.md
examples/docs/en-US/tooltip.md
+1
-0
examples/docs/zh-CN/slider.md
examples/docs/zh-CN/slider.md
+1
-0
examples/docs/zh-CN/tree.md
examples/docs/zh-CN/tree.md
+1
-1
examples/versions.json
examples/versions.json
+1
-1
package.json
package.json
+1
-1
packages/date-picker/src/basic/month-table.vue
packages/date-picker/src/basic/month-table.vue
+2
-8
packages/date-picker/src/panel/time.vue
packages/date-picker/src/panel/time.vue
+14
-1
packages/dropdown/src/dropdown.vue
packages/dropdown/src/dropdown.vue
+9
-6
packages/loading/src/index.js
packages/loading/src/index.js
+11
-11
packages/pagination/src/pagination.js
packages/pagination/src/pagination.js
+11
-1
packages/rate/src/main.vue
packages/rate/src/main.vue
+10
-8
packages/select/src/select.vue
packages/select/src/select.vue
+2
-3
packages/slider/src/main.vue
packages/slider/src/main.vue
+5
-0
packages/table/src/table-header.js
packages/table/src/table-header.js
+1
-1
packages/theme-default/package.json
packages/theme-default/package.json
+1
-1
packages/theme-default/src/table.css
packages/theme-default/src/table.css
+4
-0
packages/tooltip/src/main.js
packages/tooltip/src/main.js
+26
-1
packages/tree/src/model/node.js
packages/tree/src/model/node.js
+1
-1
src/index.js
src/index.js
+1
-1
src/locale/lang/es.js
src/locale/lang/es.js
+43
-43
src/locale/lang/he.js
src/locale/lang/he.js
+104
-0
src/locale/lang/ru-RU.js
src/locale/lang/ru-RU.js
+5
-5
src/locale/lang/ua.js
src/locale/lang/ua.js
+8
-8
src/utils/clickoutside.js
src/utils/clickoutside.js
+3
-1
test/unit/specs/loading.spec.js
test/unit/specs/loading.spec.js
+8
-2
test/unit/specs/pagination.spec.js
test/unit/specs/pagination.spec.js
+1
-0
test/unit/specs/rate.spec.js
test/unit/specs/rate.spec.js
+34
-0
test/unit/specs/select.spec.js
test/unit/specs/select.spec.js
+13
-11
No files found.
CHANGELOG.en-US.md
View file @
43ecb881
## Changelog
## Changelog
### 1.4.4
*2017-09-05*
-
Fixed all months disabled in DatePicker month view when
`disabledDate`
is set, #6768 @qingdengyue
-
Added
`debounce`
attribute for Slider, #6820 @langgo
-
Fixed value of Pagination jumper can be bigger than the total page count, #6842 @huguangju
-
Fixed TimePicker's focus slipping away when selecting hour to 23 with mouse scroll, #6719 @qingdengyue
### 1.4.3
### 1.4.3
*2017-08-25*
*2017-08-25*
...
...
CHANGELOG.zh-CN.md
View file @
43ecb881
## 更新日志
## 更新日志
### 1.4.4
*2017-09-05*
-
修复设置了
`disabledDate`
的 DatePicker 在月视图下全部不可选的问题,#6768 @qingdengyue
-
Slider 新增
`debounce`
属性,#6820 @langgo
-
修复 Pagination 的 jumper 中可以输入比最大页数更大的数字的问题,#6842 @huguangju
-
修复 TimePicker 的小时数难以通过滚动的方式选中 23 时的问题,#6719 @qingdengyue
### 1.4.3
### 1.4.3
*2017-08-25*
*2017-08-25*
...
...
examples/docs/en-US/slider.md
View file @
43ecb881
...
@@ -213,6 +213,7 @@ Selecting a range of values is supported.
...
@@ -213,6 +213,7 @@ Selecting a range of values is supported.
| range | whether to select a range | boolean | — | false |
| range | whether to select a range | boolean | — | false |
| vertical | vertical mode | boolean | — | false |
| vertical | vertical mode | boolean | — | false |
| height | Slider height, required in vertical mode | String | — | — |
| height | Slider height, required in vertical mode | String | — | — |
|debounce| debounce delay when typing, in millisecond, works when
`show-input`
is true | number | — | 300 |
## Events
## Events
| Event Name | Description | Parameters |
| Event Name | Description | Parameters |
...
...
examples/docs/en-US/tooltip.md
View file @
43ecb881
...
@@ -213,3 +213,4 @@ Disabled form elements are not supported in tooltip, see more information at [MD
...
@@ -213,3 +213,4 @@ Disabled form elements are not supported in tooltip, see more information at [MD
| manual | whether to control Tooltip manually.
`mouseenter`
and
`mouseleave`
won't have effects if set to
`true`
| boolean | — | false |
| manual | whether to control Tooltip manually.
`mouseenter`
and
`mouseleave`
won't have effects if set to
`true`
| boolean | — | false |
| popper-class | custom class name for Tooltip's popper | string | — | — |
| popper-class | custom class name for Tooltip's popper | string | — | — |
| enterable | whether the mouse can enter the tooltip | Boolean | — | true |
| enterable | whether the mouse can enter the tooltip | Boolean | — | true |
| hide-after | timeout in milliseconds to hide tooltip | number | — | 0 |
examples/docs/zh-CN/slider.md
View file @
43ecb881
...
@@ -237,6 +237,7 @@
...
@@ -237,6 +237,7 @@
| range | 是否为范围选择 | boolean | — | false |
| range | 是否为范围选择 | boolean | — | false |
| vertical | 是否竖向模式 | boolean | — | false |
| vertical | 是否竖向模式 | boolean | — | false |
| height | Slider 高度,竖向模式时必填 | String | — | — |
| height | Slider 高度,竖向模式时必填 | String | — | — |
| debounce | 输入时的去抖延迟,毫秒,仅在
`show-input`
等于true时有效 | number | — | 300 |
### Events
### Events
| 事件名称 | 说明 | 回调参数 |
| 事件名称 | 说明 | 回调参数 |
...
...
examples/docs/zh-CN/tree.md
View file @
43ecb881
...
@@ -935,7 +935,7 @@
...
@@ -935,7 +935,7 @@
| --------------------- | ---------------------------------------- | --------------------------- | ---- | ----- |
| --------------------- | ---------------------------------------- | --------------------------- | ---- | ----- |
| data | 展示数据 | array | — | — |
| data | 展示数据 | array | — | — |
| empty-text | 内容为空的时候展示的文本 | String | — | — |
| empty-text | 内容为空的时候展示的文本 | String | — | — |
| node-key | 每个树节点用来作为唯一标识的属性,整
颗
树应该是唯一的 | String | — | — |
| node-key | 每个树节点用来作为唯一标识的属性,整
棵
树应该是唯一的 | String | — | — |
| props | 配置选项,具体看下表 | object | — | — |
| props | 配置选项,具体看下表 | object | — | — |
| load | 加载子树数据的方法 | function(node, resolve) | — | — |
| load | 加载子树数据的方法 | function(node, resolve) | — | — |
| render-content | 树节点的内容区的渲染 Function | Function(h, { node } | — | — |
| render-content | 树节点的内容区的渲染 Function | Function(h, { node } | — | — |
...
...
examples/versions.json
View file @
43ecb881
{
"1.0.9"
:
"1.0"
,
"1.1.6"
:
"1.1"
,
"1.2.9"
:
"1.2"
,
"1.3.7"
:
"1.3"
,
"1.4.3"
:
"1.4"
}
{
"1.0.9"
:
"1.0"
,
"1.1.6"
:
"1.1"
,
"1.2.9"
:
"1.2"
,
"1.3.7"
:
"1.3"
,
"1.4.4"
:
"1.4"
}
\ No newline at end of file
\ No newline at end of file
package.json
View file @
43ecb881
{
{
"name"
:
"element-ui"
,
"name"
:
"element-ui"
,
"version"
:
"1.4.
3
"
,
"version"
:
"1.4.
4
"
,
"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"
:
[
...
...
packages/date-picker/src/basic/month-table.vue
View file @
43ecb881
...
@@ -78,18 +78,12 @@
...
@@ -78,18 +78,12 @@
while
(
date
<
nextMonth
)
{
while
(
date
<
nextMonth
)
{
if
(
this
.
disabledDate
(
date
))
{
if
(
this
.
disabledDate
(
date
))
{
date
=
new
Date
(
date
.
getTime
()
+
8.64e7
);
date
=
new
Date
(
date
.
getTime
()
+
8.64e7
);
flag
=
true
;
}
else
{
}
else
{
flag
=
false
;
break
;
break
;
}
}
}
}
// There is a bug of Chrome.
// For example:
// var date = new Date('1988-04-01 00:00:00') Fri Apr 01 1988 00:00:00 GMT+0800 (CST)
// date.setMonth(4) Sun May 01 1988 00:00:00 GMT+0900 (CDT)
// Sometimes the time zone will change.
if
(
date
-
nextMonth
<
8.64e7
)
{
flag
=
true
;
}
}
}
style
.
disabled
=
flag
;
style
.
disabled
=
flag
;
...
...
packages/date-picker/src/panel/time.vue
View file @
43ecb881
...
@@ -56,6 +56,9 @@
...
@@ -56,6 +56,9 @@
visible
(
val
)
{
visible
(
val
)
{
this
.
currentVisible
=
val
;
this
.
currentVisible
=
val
;
if
(
val
)
{
if
(
val
)
{
this
.
oldHours
=
this
.
hours
;
this
.
oldMinutes
=
this
.
minutes
;
this
.
oldSeconds
=
this
.
seconds
;
this
.
$nextTick
(()
=>
this
.
$refs
.
spinner
.
emitSelectRange
(
'
hours
'
));
this
.
$nextTick
(()
=>
this
.
$refs
.
spinner
.
emitSelectRange
(
'
hours
'
));
}
}
},
},
...
@@ -98,6 +101,9 @@
...
@@ -98,6 +101,9 @@
hours
:
0
,
hours
:
0
,
minutes
:
0
,
minutes
:
0
,
seconds
:
0
,
seconds
:
0
,
oldHours
:
0
,
oldMinutes
:
0
,
oldSeconds
:
0
,
selectableRange
:
[],
selectableRange
:
[],
currentDate
:
this
.
$options
.
defaultValue
||
this
.
date
||
new
Date
(),
currentDate
:
this
.
$options
.
defaultValue
||
this
.
date
||
new
Date
(),
currentVisible
:
this
.
visible
||
false
,
currentVisible
:
this
.
visible
||
false
,
...
@@ -119,7 +125,14 @@
...
@@ -119,7 +125,14 @@
},
},
handleCancel
()
{
handleCancel
()
{
this
.
$emit
(
'
pick
'
);
this
.
currentDate
.
setHours
(
this
.
oldHours
);
this
.
currentDate
.
setMinutes
(
this
.
oldMinutes
);
this
.
currentDate
.
setSeconds
(
this
.
oldSeconds
);
this
.
hours
=
this
.
currentDate
.
getHours
();
this
.
minutes
=
this
.
currentDate
.
getMinutes
();
this
.
seconds
=
this
.
currentDate
.
getSeconds
();
const
date
=
new
Date
(
limitRange
(
this
.
currentDate
,
this
.
selectableRange
,
'
HH:mm:ss
'
));
this
.
$emit
(
'
pick
'
,
date
);
},
},
handleChange
(
date
)
{
handleChange
(
date
)
{
...
...
packages/dropdown/src/dropdown.vue
View file @
43ecb881
...
@@ -45,7 +45,8 @@
...
@@ -45,7 +45,8 @@
data
()
{
data
()
{
return
{
return
{
timeout
:
null
,
timeout
:
null
,
visible
:
false
visible
:
false
,
triggerElm
:
null
};
};
},
},
...
@@ -63,37 +64,39 @@
...
@@ -63,37 +64,39 @@
methods
:
{
methods
:
{
show
()
{
show
()
{
if
(
this
.
triggerElm
.
disabled
)
return
;
clearTimeout
(
this
.
timeout
);
clearTimeout
(
this
.
timeout
);
this
.
timeout
=
setTimeout
(()
=>
{
this
.
timeout
=
setTimeout
(()
=>
{
this
.
visible
=
true
;
this
.
visible
=
true
;
},
250
);
},
250
);
},
},
hide
()
{
hide
()
{
if
(
this
.
triggerElm
.
disabled
)
return
;
clearTimeout
(
this
.
timeout
);
clearTimeout
(
this
.
timeout
);
this
.
timeout
=
setTimeout
(()
=>
{
this
.
timeout
=
setTimeout
(()
=>
{
this
.
visible
=
false
;
this
.
visible
=
false
;
},
150
);
},
150
);
},
},
handleClick
()
{
handleClick
()
{
if
(
this
.
triggerElm
.
disabled
)
return
;
this
.
visible
=
!
this
.
visible
;
this
.
visible
=
!
this
.
visible
;
},
},
initEvent
()
{
initEvent
()
{
let
{
trigger
,
show
,
hide
,
handleClick
,
splitButton
}
=
this
;
let
{
trigger
,
show
,
hide
,
handleClick
,
splitButton
}
=
this
;
let
triggerElm
=
splitButton
this
.
triggerElm
=
splitButton
?
this
.
$refs
.
trigger
.
$el
?
this
.
$refs
.
trigger
.
$el
:
this
.
$slots
.
default
[
0
].
elm
;
:
this
.
$slots
.
default
[
0
].
elm
;
if
(
triggerElm
.
disabled
)
return
;
if
(
trigger
===
'
hover
'
)
{
if
(
trigger
===
'
hover
'
)
{
triggerElm
.
addEventListener
(
'
mouseenter
'
,
show
);
t
his
.
t
riggerElm
.
addEventListener
(
'
mouseenter
'
,
show
);
triggerElm
.
addEventListener
(
'
mouseleave
'
,
hide
);
t
his
.
t
riggerElm
.
addEventListener
(
'
mouseleave
'
,
hide
);
let
dropdownElm
=
this
.
$slots
.
dropdown
[
0
].
elm
;
let
dropdownElm
=
this
.
$slots
.
dropdown
[
0
].
elm
;
dropdownElm
.
addEventListener
(
'
mouseenter
'
,
show
);
dropdownElm
.
addEventListener
(
'
mouseenter
'
,
show
);
dropdownElm
.
addEventListener
(
'
mouseleave
'
,
hide
);
dropdownElm
.
addEventListener
(
'
mouseleave
'
,
hide
);
}
else
if
(
trigger
===
'
click
'
)
{
}
else
if
(
trigger
===
'
click
'
)
{
triggerElm
.
addEventListener
(
'
click
'
,
handleClick
);
t
his
.
t
riggerElm
.
addEventListener
(
'
click
'
,
handleClick
);
}
}
},
},
handleMenuItemClick
(
command
,
instance
)
{
handleMenuItemClick
(
command
,
instance
)
{
...
...
packages/loading/src/index.js
View file @
43ecb881
...
@@ -19,21 +19,21 @@ LoadingConstructor.prototype.originalPosition = '';
...
@@ -19,21 +19,21 @@ LoadingConstructor.prototype.originalPosition = '';
LoadingConstructor
.
prototype
.
originalOverflow
=
''
;
LoadingConstructor
.
prototype
.
originalOverflow
=
''
;
LoadingConstructor
.
prototype
.
close
=
function
()
{
LoadingConstructor
.
prototype
.
close
=
function
()
{
if
(
this
.
fullscreen
&&
this
.
originalOverflow
!==
'
hidden
'
)
{
document
.
body
.
style
.
overflow
=
this
.
originalOverflow
;
}
if
(
this
.
fullscreen
||
this
.
body
)
{
document
.
body
.
style
.
position
=
this
.
originalPosition
;
}
else
{
this
.
target
.
style
.
position
=
this
.
originalPosition
;
}
if
(
this
.
fullscreen
)
{
if
(
this
.
fullscreen
)
{
fullscreenLoading
=
undefined
;
fullscreenLoading
=
undefined
;
}
}
this
.
$on
(
'
after-leave
'
,
_
=>
{
this
.
$on
(
'
after-leave
'
,
_
=>
{
this
.
$el
&&
if
(
this
.
fullscreen
&&
this
.
originalOverflow
!==
'
hidden
'
)
{
this
.
$el
.
parentNode
&&
document
.
body
.
style
.
overflow
=
this
.
originalOverflow
;
this
.
$el
.
parentNode
.
removeChild
(
this
.
$el
);
}
if
(
this
.
fullscreen
||
this
.
body
)
{
document
.
body
.
style
.
position
=
this
.
originalPosition
;
}
else
{
this
.
target
.
style
.
position
=
this
.
originalPosition
;
}
if
(
this
.
$el
&&
this
.
$el
.
parentNode
)
{
this
.
$el
.
parentNode
.
removeChild
(
this
.
$el
);
}
this
.
$destroy
();
this
.
$destroy
();
});
});
this
.
visible
=
false
;
this
.
visible
=
false
;
...
...
packages/pagination/src/pagination.js
View file @
43ecb881
...
@@ -192,16 +192,25 @@ export default {
...
@@ -192,16 +192,25 @@ export default {
handleFocus
(
event
)
{
handleFocus
(
event
)
{
this
.
oldValue
=
event
.
target
.
value
;
this
.
oldValue
=
event
.
target
.
value
;
},
},
handleBlur
({
target
})
{
this
.
reassignMaxValue
(
target
);
},
handleKeyUp
(
event
)
{
handleKeyUp
(
event
)
{
const
key
=
event
.
key
||
''
;
const
key
=
event
.
key
||
''
;
const
keyCode
=
event
.
keyCode
||
''
;
const
keyCode
=
event
.
keyCode
||
''
;
if
((
key
&&
key
===
'
Enter
'
)
||
(
keyCode
&&
keyCode
===
13
))
{
if
((
key
&&
key
===
'
Enter
'
)
||
(
keyCode
&&
keyCode
===
13
))
{
this
.
reassignMaxValue
(
event
.
target
);
this
.
handleChange
({
target
:
event
.
target
});
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
;
},
reassignMaxValue
(
target
)
{
if
(
+
target
.
value
>
this
.
$parent
.
internalPageCount
)
{
target
.
value
=
this
.
$parent
.
internalPageCount
;
}
}
}
},
},
...
@@ -213,11 +222,12 @@ export default {
...
@@ -213,11 +222,12 @@ export default {
class
=
"
el-pagination__editor
"
class
=
"
el-pagination__editor
"
type
=
"
number
"
type
=
"
number
"
min
=
{
1
}
min
=
{
1
}
max
=
{
this
.
internalPageCount
}
max
=
{
this
.
$parent
.
internalPageCount
}
value
=
{
this
.
$parent
.
internalCurrentPage
}
value
=
{
this
.
$parent
.
internalCurrentPage
}
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
-
blur
=
{
this
.
handleBlur
}
on
-
keyup
=
{
this
.
handleKeyUp
}
on
-
keyup
=
{
this
.
handleKeyUp
}
number
/>
number
/>
{
this
.
t
(
'
el.pagination.pageClassifier
'
)
}
{
this
.
t
(
'
el.pagination.pageClassifier
'
)
}
...
...
packages/rate/src/main.vue
View file @
43ecb881
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
data
()
{
data
()
{
return
{
return
{
classMap
:
{},
classMap
:
{},
colorMap
:
{},
pointerAtLeftHalf
:
true
,
pointerAtLeftHalf
:
true
,
currentValue
:
this
.
value
,
currentValue
:
this
.
value
,
hoverIndex
:
-
1
hoverIndex
:
-
1
...
@@ -159,6 +158,16 @@
...
@@ -159,6 +158,16 @@
return
this
.
getValueFromMap
(
this
.
currentValue
,
this
.
classMap
);
return
this
.
getValueFromMap
(
this
.
currentValue
,
this
.
classMap
);
},
},
colorMap
()
{
return
{
lowColor
:
this
.
colors
[
0
],
mediumColor
:
this
.
colors
[
1
],
highColor
:
this
.
colors
[
2
],
voidColor
:
this
.
voidColor
,
disabledVoidColor
:
this
.
disabledVoidColor
};
},
activeColor
()
{
activeColor
()
{
return
this
.
getValueFromMap
(
this
.
currentValue
,
this
.
colorMap
);
return
this
.
getValueFromMap
(
this
.
currentValue
,
this
.
colorMap
);
},
},
...
@@ -274,13 +283,6 @@
...
@@ -274,13 +283,6 @@
voidClass
:
this
.
voidIconClass
,
voidClass
:
this
.
voidIconClass
,
disabledVoidClass
:
this
.
disabledVoidIconClass
disabledVoidClass
:
this
.
disabledVoidIconClass
};
};
this
.
colorMap
=
{
lowColor
:
this
.
colors
[
0
],
mediumColor
:
this
.
colors
[
1
],
highColor
:
this
.
colors
[
2
],
voidColor
:
this
.
voidColor
,
disabledVoidColor
:
this
.
disabledVoidColor
};
}
}
};
};
</
script
>
</
script
>
packages/select/src/select.vue
View file @
43ecb881
...
@@ -660,8 +660,7 @@
...
@@ -660,8 +660,7 @@
},
},
getValueKey
(
item
)
{
getValueKey
(
item
)
{
const
type
=
typeof
item
.
value
;
if
(
Object
.
prototype
.
toString
.
call
(
item
.
value
).
toLowerCase
()
!==
'
[object object]
'
)
{
if
(
type
===
'
number
'
||
type
===
'
string
'
)
{
return
item
.
value
;
return
item
.
value
;
}
else
{
}
else
{
return
getValueByPath
(
item
.
value
,
this
.
valueKey
);
return
getValueByPath
(
item
.
value
,
this
.
valueKey
);
...
@@ -677,7 +676,6 @@
...
@@ -677,7 +676,6 @@
if
(
!
this
.
multiple
&&
Array
.
isArray
(
this
.
value
))
{
if
(
!
this
.
multiple
&&
Array
.
isArray
(
this
.
value
))
{
this
.
$emit
(
'
input
'
,
''
);
this
.
$emit
(
'
input
'
,
''
);
}
}
this
.
setSelected
();
this
.
debouncedOnInputChange
=
debounce
(
this
.
debounce
,
()
=>
{
this
.
debouncedOnInputChange
=
debounce
(
this
.
debounce
,
()
=>
{
this
.
onInputChange
();
this
.
onInputChange
();
...
@@ -700,6 +698,7 @@
...
@@ -700,6 +698,7 @@
this
.
inputWidth
=
this
.
$refs
.
reference
.
$el
.
getBoundingClientRect
().
width
;
this
.
inputWidth
=
this
.
$refs
.
reference
.
$el
.
getBoundingClientRect
().
width
;
}
}
});
});
this
.
setSelected
();
},
},
beforeDestroy
()
{
beforeDestroy
()
{
...
...
packages/slider/src/main.vue
View file @
43ecb881
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
:controls=
"showInputControls"
:controls=
"showInputControls"
:min=
"min"
:min=
"min"
:max=
"max"
:max=
"max"
:debounce=
"debounce"
size=
"small"
>
size=
"small"
>
</el-input-number>
</el-input-number>
<div
class=
"el-slider__runway"
<div
class=
"el-slider__runway"
...
@@ -102,6 +103,10 @@
...
@@ -102,6 +103,10 @@
},
},
height
:
{
height
:
{
type
:
String
type
:
String
},
debounce
:
{
type
:
Number
,
default
:
300
}
}
},
},
...
...
packages/table/src/table-header.js
View file @
43ecb881
...
@@ -102,7 +102,7 @@ export default {
...
@@ -102,7 +102,7 @@ export default {
on
-
mouseout
=
{
this
.
handleMouseOut
}
on
-
mouseout
=
{
this
.
handleMouseOut
}
on
-
mousedown
=
{
(
$event
)
=>
this
.
handleMouseDown
(
$event
,
column
)
}
on
-
mousedown
=
{
(
$event
)
=>
this
.
handleMouseDown
(
$event
,
column
)
}
on
-
click
=
{
(
$event
)
=>
this
.
handleHeaderClick
(
$event
,
column
)
}
on
-
click
=
{
(
$event
)
=>
this
.
handleHeaderClick
(
$event
,
column
)
}
class
=
{
[
column
.
id
,
column
.
order
,
column
.
headerAlign
,
column
.
className
||
''
,
rowIndex
===
0
&&
this
.
isCellHidden
(
cellIndex
,
columns
)
?
'
is-hidden
'
:
''
,
!
column
.
children
?
'
is-leaf
'
:
''
,
column
.
labelClassName
]
}
>
class
=
{
[
column
.
id
,
column
.
order
,
column
.
headerAlign
,
column
.
className
||
''
,
rowIndex
===
0
&&
this
.
isCellHidden
(
cellIndex
,
columns
)
?
'
is-hidden
'
:
''
,
!
column
.
children
?
'
is-leaf
'
:
''
,
column
.
labelClassName
,
column
.
sortable
?
'
is-sortable
'
:
''
]
}
>
<
div
class
=
{
[
'
cell
'
,
column
.
filteredValue
&&
column
.
filteredValue
.
length
>
0
?
'
highlight
'
:
''
,
column
.
labelClassName
]
}
>
<
div
class
=
{
[
'
cell
'
,
column
.
filteredValue
&&
column
.
filteredValue
.
length
>
0
?
'
highlight
'
:
''
,
column
.
labelClassName
]
}
>
{
{
column
.
renderHeader
column
.
renderHeader
...
...
packages/theme-default/package.json
View file @
43ecb881
{
{
"name"
:
"element-theme-default"
,
"name"
:
"element-theme-default"
,
"version"
:
"1.4.
3
"
,
"version"
:
"1.4.
4
"
,
"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"
,
...
...
packages/theme-default/src/table.css
View file @
43ecb881
...
@@ -136,6 +136,10 @@
...
@@ -136,6 +136,10 @@
border-bottom
:
1px
solid
var
(
--table-border-color
);
border-bottom
:
1px
solid
var
(
--table-border-color
);
}
}
&
th
.is-sortable
{
cursor
:
pointer
;
}
@modifier
border
{
@modifier
border
{
&
th
,
td
{
&
th
,
td
{
border-right
:
1px
solid
var
(
--table-border-color
);
border-right
:
1px
solid
var
(
--table-border-color
);
...
...
packages/tooltip/src/main.js
View file @
43ecb881
...
@@ -39,9 +39,20 @@ export default {
...
@@ -39,9 +39,20 @@ export default {
enterable
:
{
enterable
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
true
default
:
true
},
hideAfter
:
{
type
:
Number
,
default
:
0
}
}
},
},
data
()
{
return
{
timeoutPending
:
null
,
handlerAdded
:
false
};
},
beforeCreate
()
{
beforeCreate
()
{
if
(
this
.
$isServer
)
return
;
if
(
this
.
$isServer
)
return
;
...
@@ -77,7 +88,7 @@ export default {
...
@@ -77,7 +88,7 @@ export default {
if
(
!
this
.
$slots
.
default
||
!
this
.
$slots
.
default
.
length
)
return
this
.
$slots
.
default
;
if
(
!
this
.
$slots
.
default
||
!
this
.
$slots
.
default
.
length
)
return
this
.
$slots
.
default
;
const
vnode
=
getFirstComponentChild
(
this
.
$slots
.
default
);
const
vnode
=
getFirstComponentChild
(
this
.
$slots
.
default
);
if
(
!
vnode
)
return
vnode
;
if
(
!
vnode
||
this
.
handlerAdded
)
return
vnode
;
const
data
=
vnode
.
data
=
vnode
.
data
||
{};
const
data
=
vnode
.
data
=
vnode
.
data
||
{};
const
on
=
vnode
.
data
.
on
=
vnode
.
data
.
on
||
{};
const
on
=
vnode
.
data
.
on
=
vnode
.
data
.
on
||
{};
const
nativeOn
=
vnode
.
data
.
nativeOn
=
vnode
.
data
.
nativeOn
||
{};
const
nativeOn
=
vnode
.
data
.
nativeOn
=
vnode
.
data
.
nativeOn
||
{};
...
@@ -97,6 +108,7 @@ export default {
...
@@ -97,6 +108,7 @@ export default {
methods
:
{
methods
:
{
addEventHandle
(
old
,
fn
)
{
addEventHandle
(
old
,
fn
)
{
this
.
handlerAdded
=
true
;
return
old
?
Array
.
isArray
(
old
)
?
old
.
concat
(
fn
)
:
[
old
,
fn
]
:
fn
;
return
old
?
Array
.
isArray
(
old
)
?
old
.
concat
(
fn
)
:
[
old
,
fn
]
:
fn
;
},
},
...
@@ -111,15 +123,28 @@ export default {
...
@@ -111,15 +123,28 @@ export default {
this
.
timeout
=
setTimeout
(()
=>
{
this
.
timeout
=
setTimeout
(()
=>
{
this
.
showPopper
=
true
;
this
.
showPopper
=
true
;
},
this
.
openDelay
);
},
this
.
openDelay
);
if
(
this
.
hideAfter
>
0
)
{
this
.
timeoutPending
=
setTimeout
(()
=>
{
this
.
showPopper
=
false
;
},
this
.
hideAfter
);
}
},
},
handleClosePopper
()
{
handleClosePopper
()
{
if
(
this
.
enterable
&&
this
.
expectedState
||
this
.
manual
)
return
;
if
(
this
.
enterable
&&
this
.
expectedState
||
this
.
manual
)
return
;
clearTimeout
(
this
.
timeout
);
clearTimeout
(
this
.
timeout
);
if
(
this
.
timeoutPending
)
{
clearTimeout
(
this
.
timeoutPending
);
}
this
.
showPopper
=
false
;
this
.
showPopper
=
false
;
},
},
setExpectedState
(
expectedState
)
{
setExpectedState
(
expectedState
)
{
if
(
expectedState
===
false
)
{
clearTimeout
(
this
.
timeoutPending
);
}
this
.
expectedState
=
expectedState
;
this
.
expectedState
=
expectedState
;
}
}
}
}
...
...
packages/tree/src/model/node.js
View file @
43ecb881
...
@@ -118,7 +118,7 @@ export default class Node {
...
@@ -118,7 +118,7 @@ export default class Node {
this
.
expand
(
null
,
store
.
autoExpandParent
);
this
.
expand
(
null
,
store
.
autoExpandParent
);
}
}
if
(
key
&&
store
.
currentNodeKey
&&
this
.
key
===
store
.
currentNodeKey
)
{
if
(
key
&&
store
.
currentNodeKey
!==
undefined
&&
this
.
key
===
store
.
currentNodeKey
)
{
store
.
currentNode
=
this
;
store
.
currentNode
=
this
;
}
}
...
...
src/index.js
View file @
43ecb881
...
@@ -168,7 +168,7 @@ if (typeof window !== 'undefined' && window.Vue) {
...
@@ -168,7 +168,7 @@ if (typeof window !== 'undefined' && window.Vue) {
};
};
module
.
exports
=
{
module
.
exports
=
{
version
:
'
1.4.
3
'
,
version
:
'
1.4.
4
'
,
locale
:
locale
.
use
,
locale
:
locale
.
use
,
i18n
:
locale
.
i18n
,
i18n
:
locale
.
i18n
,
install
,
install
,
...
...
src/locale/lang/es.js
View file @
43ecb881
...
@@ -2,56 +2,56 @@ export default {
...
@@ -2,56 +2,56 @@ export default {
el
:
{
el
:
{
colorpicker
:
{
colorpicker
:
{
confirm
:
'
Confirmar
'
,
confirm
:
'
Confirmar
'
,
clear
:
'
Limpi
ar
'
clear
:
'
Despej
ar
'
},
},
datepicker
:
{
datepicker
:
{
now
:
'
Ahora
'
,
now
:
'
Ahora
'
,
today
:
'
Hoy
'
,
today
:
'
Hoy
'
,
cancel
:
'
Cancelar
'
,
cancel
:
'
Cancelar
'
,
clear
:
'
Limpi
ar
'
,
clear
:
'
Despej
ar
'
,
confirm
:
'
Confirmar
'
,
confirm
:
'
Confirmar
'
,
selectDate
:
'
Seleccionar fecha
'
,
selectDate
:
'
Seleccionar fecha
'
,
selectTime
:
'
Seleccionar hora
'
,
selectTime
:
'
Seleccionar hora
'
,
startDate
:
'
Fecha
de Inicio
'
,
startDate
:
'
Fecha
Incial
'
,
startTime
:
'
Hora
de Inicio
'
,
startTime
:
'
Hora
Inicial
'
,
endDate
:
'
Fecha Final
'
,
endDate
:
'
Fecha Final
'
,
endTime
:
'
Hora Final
'
,
endTime
:
'
Hora Final
'
,
year
:
'
Año
'
,
year
:
'
Año
'
,
month1
:
'
E
nero
'
,
month1
:
'
e
nero
'
,
month2
:
'
F
ebrero
'
,
month2
:
'
f
ebrero
'
,
month3
:
'
M
arzo
'
,
month3
:
'
m
arzo
'
,
month4
:
'
A
bril
'
,
month4
:
'
a
bril
'
,
month5
:
'
M
ayo
'
,
month5
:
'
m
ayo
'
,
month6
:
'
J
unio
'
,
month6
:
'
j
unio
'
,
month7
:
'
J
ulio
'
,
month7
:
'
j
ulio
'
,
month8
:
'
A
gosto
'
,
month8
:
'
a
gosto
'
,
month9
:
'
S
eptiembre
'
,
month9
:
'
s
eptiembre
'
,
month10
:
'
O
ctubre
'
,
month10
:
'
o
ctubre
'
,
month11
:
'
N
oviembre
'
,
month11
:
'
n
oviembre
'
,
month12
:
'
D
iciembre
'
,
month12
:
'
d
iciembre
'
,
// week: 'semana',
// week: 'semana',
weeks
:
{
weeks
:
{
sun
:
'
D
om
'
,
sun
:
'
d
om
'
,
mon
:
'
L
un
'
,
mon
:
'
l
un
'
,
tue
:
'
M
ar
'
,
tue
:
'
m
ar
'
,
wed
:
'
M
ié
'
,
wed
:
'
m
ié
'
,
thu
:
'
J
ue
'
,
thu
:
'
j
ue
'
,
fri
:
'
V
ie
'
,
fri
:
'
v
ie
'
,
sat
:
'
S
áb
'
sat
:
'
s
áb
'
},
},
months
:
{
months
:
{
jan
:
'
E
ne
'
,
jan
:
'
e
ne
'
,
feb
:
'
F
eb
'
,
feb
:
'
f
eb
'
,
mar
:
'
M
ar
'
,
mar
:
'
m
ar
'
,
apr
:
'
A
br
'
,
apr
:
'
a
br
'
,
may
:
'
M
ay
'
,
may
:
'
m
ay
'
,
jun
:
'
J
un
'
,
jun
:
'
j
un
'
,
jul
:
'
J
ul
'
,
jul
:
'
j
ul
'
,
aug
:
'
A
go
'
,
aug
:
'
a
go
'
,
sep
:
'
S
ep
'
,
sep
:
'
s
ep
'
,
oct
:
'
O
ct
'
,
oct
:
'
o
ct
'
,
nov
:
'
N
ov
'
,
nov
:
'
n
ov
'
,
dec
:
'
D
ic
'
dec
:
'
d
ic
'
}
}
},
},
select
:
{
select
:
{
...
@@ -67,7 +67,7 @@ export default {
...
@@ -67,7 +67,7 @@ export default {
},
},
pagination
:
{
pagination
:
{
goto
:
'
Ir a
'
,
goto
:
'
Ir a
'
,
pagesize
:
'
/p
a
gina
'
,
pagesize
:
'
/p
á
gina
'
,
total
:
'
Total {total}
'
,
total
:
'
Total {total}
'
,
pageClassifier
:
''
pageClassifier
:
''
},
},
...
@@ -84,9 +84,9 @@ export default {
...
@@ -84,9 +84,9 @@ export default {
table
:
{
table
:
{
emptyText
:
'
Sin Datos
'
,
emptyText
:
'
Sin Datos
'
,
confirmFilter
:
'
Confirmar
'
,
confirmFilter
:
'
Confirmar
'
,
resetFilter
:
'
Limp
iar
'
,
resetFilter
:
'
Reinic
iar
'
,
clearFilter
:
'
Todo
'
,
clearFilter
:
'
Despejar
'
,
sumText
:
'
Sum
'
// to be translated
sumText
:
'
Sum
a
'
},
},
tree
:
{
tree
:
{
emptyText
:
'
Sin Datos
'
emptyText
:
'
Sin Datos
'
...
@@ -94,10 +94,10 @@ export default {
...
@@ -94,10 +94,10 @@ export default {
transfer
:
{
transfer
:
{
noMatch
:
'
No hay datos que coincidan
'
,
noMatch
:
'
No hay datos que coincidan
'
,
noData
:
'
Sin datos
'
,
noData
:
'
Sin datos
'
,
titles
:
[
'
List
1
'
,
'
List 2
'
],
// to be translated
titles
:
[
'
List
a 1
'
,
'
Lista 2
'
],
filterPlaceholder
:
'
Enter keyword
'
,
// to be translated
filterPlaceholder
:
'
Ingresar palabra clave
'
,
noCheckedFormat
:
'
{total}
items
'
,
// to be translated
noCheckedFormat
:
'
{total}
artículos
'
,
hasCheckedFormat
:
'
{checked}/{total}
checked
'
// to be translated
hasCheckedFormat
:
'
{checked}/{total}
revisados
'
}
}
}
}
};
};
src/locale/lang/he.js
0 → 100644
View file @
43ecb881
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: '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
:
'
/page
'
,
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
}
}
};
src/locale/lang/ru-RU.js
View file @
43ecb881
...
@@ -87,7 +87,7 @@ export default {
...
@@ -87,7 +87,7 @@ export default {
confirmFilter
:
'
Подтвердить
'
,
confirmFilter
:
'
Подтвердить
'
,
resetFilter
:
'
Сбросить
'
,
resetFilter
:
'
Сбросить
'
,
clearFilter
:
'
Все
'
,
clearFilter
:
'
Все
'
,
sumText
:
'
Sum
'
// to be translated
sumText
:
'
Сумма
'
},
},
tree
:
{
tree
:
{
emptyText
:
'
Нет данных
'
emptyText
:
'
Нет данных
'
...
@@ -95,10 +95,10 @@ export default {
...
@@ -95,10 +95,10 @@ export default {
transfer
:
{
transfer
:
{
noMatch
:
'
Совпадений не найдено
'
,
noMatch
:
'
Совпадений не найдено
'
,
noData
:
'
Нет данных
'
,
noData
:
'
Нет данных
'
,
titles
:
[
'
List 1
'
,
'
List 2
'
],
// to be translated
titles
:
[
'
Список 1
'
,
'
Список 2
'
],
filterPlaceholder
:
'
Enter keyword
'
,
// to be translated
filterPlaceholder
:
'
Введите ключевое слово
'
,
noCheckedFormat
:
'
{total}
items
'
,
// to be translated
noCheckedFormat
:
'
{total}
пунктов
'
,
hasCheckedFormat
:
'
{checked}/{total}
checked
'
// to be translated
hasCheckedFormat
:
'
{checked}/{total}
выбрано
'
}
}
}
}
};
};
src/locale/lang/ua.js
View file @
43ecb881
...
@@ -57,7 +57,7 @@ export default {
...
@@ -57,7 +57,7 @@ export default {
select
:
{
select
:
{
loading
:
'
Завантаження
'
,
loading
:
'
Завантаження
'
,
noMatch
:
'
Співпадінь не знайдено
'
,
noMatch
:
'
Співпадінь не знайдено
'
,
noData
:
'
Нема даних
'
,
noData
:
'
Нема
є
даних
'
,
placeholder
:
'
Обрати
'
placeholder
:
'
Обрати
'
},
},
cascader
:
{
cascader
:
{
...
@@ -83,22 +83,22 @@ export default {
...
@@ -83,22 +83,22 @@ export default {
continue
:
'
Продовжити
'
continue
:
'
Продовжити
'
},
},
table
:
{
table
:
{
emptyText
:
'
Нема даних
'
,
emptyText
:
'
Нема
є
даних
'
,
confirmFilter
:
'
Підтвердити
'
,
confirmFilter
:
'
Підтвердити
'
,
resetFilter
:
'
Скинути
'
,
resetFilter
:
'
Скинути
'
,
clearFilter
:
'
Все
'
,
clearFilter
:
'
Все
'
,
sumText
:
'
Sum
'
// to be translated
sumText
:
'
Сума
'
},
},
tree
:
{
tree
:
{
emptyText
:
'
Нема даних
'
emptyText
:
'
Нема
є
даних
'
},
},
transfer
:
{
transfer
:
{
noMatch
:
'
Співпадінь не знайдено
'
,
noMatch
:
'
Співпадінь не знайдено
'
,
noData
:
'
Обрати
'
,
noData
:
'
Обрати
'
,
titles
:
[
'
List 1
'
,
'
List 2
'
],
// to be translated
titles
:
[
'
Список 1
'
,
'
Список 2
'
],
filterPlaceholder
:
'
Enter keyword
'
,
// to be translated
filterPlaceholder
:
'
Введіть ключове слово
'
,
noCheckedFormat
:
'
{total}
items
'
,
// to be translated
noCheckedFormat
:
'
{total}
пунктів
'
,
hasCheckedFormat
:
'
{checked}/{total}
checked
'
// to be translated
hasCheckedFormat
:
'
{checked}/{total}
вибрано
'
}
}
}
}
};
};
src/utils/clickoutside.js
View file @
43ecb881
...
@@ -5,6 +5,7 @@ const nodeList = [];
...
@@ -5,6 +5,7 @@ const nodeList = [];
const
ctx
=
'
@@clickoutsideContext
'
;
const
ctx
=
'
@@clickoutsideContext
'
;
let
startClick
;
let
startClick
;
let
seed
=
0
;
!
Vue
.
prototype
.
$isServer
&&
on
(
document
,
'
mousedown
'
,
e
=>
(
startClick
=
e
));
!
Vue
.
prototype
.
$isServer
&&
on
(
document
,
'
mousedown
'
,
e
=>
(
startClick
=
e
));
...
@@ -21,7 +22,8 @@ let startClick;
...
@@ -21,7 +22,8 @@ let startClick;
*/
*/
export
default
{
export
default
{
bind
(
el
,
binding
,
vnode
)
{
bind
(
el
,
binding
,
vnode
)
{
const
id
=
nodeList
.
push
(
el
)
-
1
;
nodeList
.
push
(
el
);
const
id
=
seed
++
;
const
documentHandler
=
function
(
mouseup
=
{},
mousedown
=
{})
{
const
documentHandler
=
function
(
mouseup
=
{},
mousedown
=
{})
{
if
(
!
vnode
.
context
||
if
(
!
vnode
.
context
||
!
mouseup
.
target
||
!
mouseup
.
target
||
...
...
test/unit/specs/loading.spec.js
View file @
43ecb881
...
@@ -184,7 +184,7 @@ describe('Loading', () => {
...
@@ -184,7 +184,7 @@ describe('Loading', () => {
expect
(
loadingInstance
.
visible
).
to
.
false
;
expect
(
loadingInstance
.
visible
).
to
.
false
;
});
});
it
(
'
target
'
,
()
=>
{
it
(
'
target
'
,
done
=>
{
vm
=
createVue
({
vm
=
createVue
({
template
:
`
template
:
`
<div class="loading-container"></div>
<div class="loading-container"></div>
...
@@ -192,8 +192,14 @@ describe('Loading', () => {
...
@@ -192,8 +192,14 @@ describe('Loading', () => {
},
true
);
},
true
);
loadingInstance
=
Loading
({
target
:
'
.loading-container
'
});
loadingInstance
=
Loading
({
target
:
'
.loading-container
'
});
let
mask
=
document
.
querySelector
(
'
.el-loading-mask
'
);
let
mask
=
document
.
querySelector
(
'
.el-loading-mask
'
);
let
container
=
document
.
querySelector
(
'
.loading-container
'
);
expect
(
mask
).
to
.
exist
;
expect
(
mask
).
to
.
exist
;
expect
(
mask
.
parentNode
).
to
.
equal
(
document
.
querySelector
(
'
.loading-container
'
));
expect
(
mask
.
parentNode
).
to
.
equal
(
container
);
loadingInstance
.
close
();
setTimeout
(()
=>
{
expect
(
container
.
style
.
position
).
to
.
equal
(
'
relative
'
);
done
();
},
200
);
});
});
it
(
'
body
'
,
()
=>
{
it
(
'
body
'
,
()
=>
{
...
...
test/unit/specs/pagination.spec.js
View file @
43ecb881
...
@@ -219,6 +219,7 @@ describe('Pagination', () => {
...
@@ -219,6 +219,7 @@ describe('Pagination', () => {
triggerEvent
(
input
,
'
change
'
);
triggerEvent
(
input
,
'
change
'
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
vm
.
page
).
to
.
equal
(
10
);
expect
(
vm
.
page
).
to
.
equal
(
10
);
expect
(
input
.
value
).
to
.
equal
(
'
10
'
);
input
.
value
=
'
我好帅
'
;
input
.
value
=
'
我好帅
'
;
triggerEvent
(
input
,
'
change
'
);
triggerEvent
(
input
,
'
change
'
);
...
...
test/unit/specs/rate.spec.js
View file @
43ecb881
...
@@ -95,6 +95,40 @@ describe('Rate', () => {
...
@@ -95,6 +95,40 @@ describe('Rate', () => {
expect
(
thirdIcon
.
style
.
color
).
to
.
equal
(
'
rgb(255, 153, 0)
'
);
expect
(
thirdIcon
.
style
.
color
).
to
.
equal
(
'
rgb(255, 153, 0)
'
);
});
});
it
(
'
colors are updated after prop is changed
'
,
done
=>
{
vm
=
createVue
({
template
:
`
<div>
<el-rate v-model="value" :colors="colors"></el-rate>
</div>
`
,
computed
:
{
colors
()
{
if
(
this
.
muted
)
{
return
[
'
#999
'
,
'
#999
'
,
'
#999
'
];
}
else
{
return
[
'
#99A9BF
'
,
'
#F7BA2A
'
,
'
#FF9900
'
];
}
}
},
data
()
{
return
{
value
:
4
,
muted
:
false
};
}
},
true
);
setTimeout
(()
=>
{
vm
.
muted
=
true
;
vm
.
$nextTick
(()
=>
{
const
thirdIcon
=
vm
.
$el
.
querySelectorAll
(
'
.el-rate__item
'
)[
2
].
querySelector
(
'
.el-rate__icon
'
);
expect
(
thirdIcon
.
style
.
color
).
to
.
equal
(
'
rgb(153, 153, 153)
'
);
done
();
});
},
10
);
});
it
(
'
threshold
'
,
()
=>
{
it
(
'
threshold
'
,
()
=>
{
vm
=
createVue
({
vm
=
createVue
({
template
:
`
template
:
`
...
...
test/unit/specs/select.spec.js
View file @
43ecb881
...
@@ -572,20 +572,22 @@ describe('Select', () => {
...
@@ -572,20 +572,22 @@ describe('Select', () => {
}
}
}
}
},
true
);
},
true
);
const
tagCloseIcons
=
vm
.
$el
.
querySelectorAll
(
'
.el-tag__close
'
);
expect
(
vm
.
value
.
length
).
to
.
equal
(
2
);
expect
(
vm
.
value
.
length
).
to
.
equal
(
2
);
tagCloseIcons
[
1
].
click
();
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
vm
.
value
.
length
).
to
.
equal
(
1
);
const
tagCloseIcons
=
vm
.
$el
.
querySelectorAll
(
'
.el-tag__close
'
);
expect
(
window
.
console
.
log
.
callCount
).
to
.
equal
(
1
);
tagCloseIcons
[
1
].
click
();
tagCloseIcons
[
0
].
click
();
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
vm
.
value
.
length
).
to
.
equal
(
0
);
expect
(
vm
.
value
.
length
).
to
.
equal
(
1
);
expect
(
window
.
console
.
log
.
callCount
).
to
.
equal
(
2
);
expect
(
window
.
console
.
log
.
callCount
).
to
.
equal
(
1
);
window
.
console
.
log
.
restore
();
tagCloseIcons
[
0
].
click
();
done
();
setTimeout
(()
=>
{
},
100
);
expect
(
vm
.
value
.
length
).
to
.
equal
(
0
);
},
100
);
expect
(
window
.
console
.
log
.
callCount
).
to
.
equal
(
2
);
window
.
console
.
log
.
restore
();
done
();
},
50
);
},
50
);
},
50
);
});
});
it
(
'
multiple limit
'
,
done
=>
{
it
(
'
multiple limit
'
,
done
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment