Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
cube-ui
提交
e55bbfe7
C
cube-ui
项目概览
DiDi
/
cube-ui
10 个月 前同步成功
通知
34
Star
9078
Fork
1508
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cube-ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e55bbfe7
编写于
11月 07, 2019
作者:
D
dolymood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(lint): fix lint errors
上级
63f524f9
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
51 addition
and
63 deletion
+51
-63
example/data/ease.js
example/data/ease.js
+3
-3
package-lock.json
package-lock.json
+13
-33
src/common/helpers/debug.js
src/common/helpers/debug.js
+1
-1
src/common/helpers/util.js
src/common/helpers/util.js
+2
-2
src/common/lang/date.js
src/common/lang/date.js
+4
-2
src/components/date-picker/date-picker.vue
src/components/date-picker/date-picker.vue
+6
-6
src/components/time-picker/time-picker.vue
src/components/time-picker/time-picker.vue
+6
-4
src/components/validator/validator.vue
src/components/validator/validator.vue
+4
-4
test/unit/specs/image-preview.spec.js
test/unit/specs/image-preview.spec.js
+1
-1
test/unit/specs/locale.spec.js
test/unit/specs/locale.spec.js
+1
-1
test/unit/specs/radio.spec.js
test/unit/specs/radio.spec.js
+7
-3
test/unit/specs/recycle-list.spec.js
test/unit/specs/recycle-list.spec.js
+1
-1
test/unit/specs/toast.spec.js
test/unit/specs/toast.spec.js
+1
-1
test/unit/specs/validator.spec.js
test/unit/specs/validator.spec.js
+1
-1
未找到文件。
example/data/ease.js
浏览文件 @
e55bbfe7
export
const
ease
=
{
// easeOutQuint
// easeOutQuint
swipe
:
{
style
:
'
cubic-bezier(0.23, 1, 0.32, 1)
'
,
fn
:
function
(
t
)
{
return
1
+
(
--
t
*
t
*
t
*
t
*
t
)
}
},
// easeOutQuard
// easeOutQuard
swipeBounce
:
{
style
:
'
cubic-bezier(0.25, 0.46, 0.45, 0.94)
'
,
fn
:
function
(
t
)
{
return
t
*
(
2
-
t
)
}
},
// easeOutQuart
// easeOutQuart
bounce
:
{
style
:
'
cubic-bezier(0.165, 0.84, 0.44, 1)
'
,
fn
:
function
(
t
)
{
...
...
package-lock.json
浏览文件 @
e55bbfe7
...
...
@@ -3127,8 +3127,7 @@
"version"
:
"0.3.4"
,
"resolved"
:
"https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz"
,
"integrity"
:
"sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog=="
,
"dev"
:
true
,
"optional"
:
true
"dev"
:
true
},
"cssstyle"
:
{
"version"
:
"0.2.37"
,
...
...
@@ -5243,8 +5242,7 @@
"version"
:
"2.1.1"
,
"resolved"
:
"https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz"
,
"integrity"
:
"sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
,
"dev"
:
true
,
"optional"
:
true
"dev"
:
true
},
"aproba"
:
{
"version"
:
"1.2.0"
,
...
...
@@ -5268,15 +5266,13 @@
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz"
,
"integrity"
:
"sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
,
"dev"
:
true
,
"optional"
:
true
"dev"
:
true
},
"brace-expansion"
:
{
"version"
:
"1.1.11"
,
"resolved"
:
"https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz"
,
"integrity"
:
"sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"balanced-match"
:
"^1.0.0"
,
"concat-map"
:
"0.0.1"
...
...
@@ -5293,22 +5289,19 @@
"version"
:
"1.1.0"
,
"resolved"
:
"https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz"
,
"integrity"
:
"sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
,
"dev"
:
true
,
"optional"
:
true
"dev"
:
true
},
"concat-map"
:
{
"version"
:
"0.0.1"
,
"resolved"
:
"https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
,
"integrity"
:
"sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
,
"dev"
:
true
,
"optional"
:
true
"dev"
:
true
},
"console-control-strings"
:
{
"version"
:
"1.1.0"
,
"resolved"
:
"https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz"
,
"integrity"
:
"sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
,
"dev"
:
true
,
"optional"
:
true
"dev"
:
true
},
"core-util-is"
:
{
"version"
:
"1.0.2"
,
...
...
@@ -5439,8 +5432,7 @@
"version"
:
"2.0.3"
,
"resolved"
:
"https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
,
"integrity"
:
"sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
,
"dev"
:
true
,
"optional"
:
true
"dev"
:
true
},
"ini"
:
{
"version"
:
"1.3.5"
,
...
...
@@ -5454,7 +5446,6 @@
"resolved"
:
"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz"
,
"integrity"
:
"sha1-754xOG8DGn8NZDr4L95QxFfvAMs="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"number-is-nan"
:
"^1.0.0"
}
...
...
@@ -5471,7 +5462,6 @@
"resolved"
:
"https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz"
,
"integrity"
:
"sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"brace-expansion"
:
"^1.1.7"
}
...
...
@@ -5480,15 +5470,13 @@
"version"
:
"0.0.8"
,
"resolved"
:
"https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"
,
"integrity"
:
"sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
,
"dev"
:
true
,
"optional"
:
true
"dev"
:
true
},
"minipass"
:
{
"version"
:
"2.2.4"
,
"resolved"
:
"https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz"
,
"integrity"
:
"sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g=="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"safe-buffer"
:
"^5.1.1"
,
"yallist"
:
"^3.0.0"
...
...
@@ -5509,7 +5497,6 @@
"resolved"
:
"https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz"
,
"integrity"
:
"sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"minimist"
:
"0.0.8"
}
...
...
@@ -5598,8 +5585,7 @@
"version"
:
"1.0.1"
,
"resolved"
:
"https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz"
,
"integrity"
:
"sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
,
"dev"
:
true
,
"optional"
:
true
"dev"
:
true
},
"object-assign"
:
{
"version"
:
"4.1.1"
,
...
...
@@ -5613,7 +5599,6 @@
"resolved"
:
"https://registry.npmjs.org/once/-/once-1.4.0.tgz"
,
"integrity"
:
"sha1-WDsap3WWHUsROsF9nFC6753Xa9E="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"wrappy"
:
"1"
}
...
...
@@ -5709,8 +5694,7 @@
"version"
:
"5.1.1"
,
"resolved"
:
"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz"
,
"integrity"
:
"sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
,
"dev"
:
true
,
"optional"
:
true
"dev"
:
true
},
"safer-buffer"
:
{
"version"
:
"2.1.2"
,
...
...
@@ -5752,7 +5736,6 @@
"resolved"
:
"https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz"
,
"integrity"
:
"sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"code-point-at"
:
"^1.0.0"
,
"is-fullwidth-code-point"
:
"^1.0.0"
,
...
...
@@ -5774,7 +5757,6 @@
"resolved"
:
"https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz"
,
"integrity"
:
"sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8="
,
"dev"
:
true
,
"optional"
:
true
,
"requires"
:
{
"ansi-regex"
:
"^2.0.0"
}
...
...
@@ -5823,15 +5805,13 @@
"version"
:
"1.0.2"
,
"resolved"
:
"https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz"
,
"integrity"
:
"sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
,
"dev"
:
true
,
"optional"
:
true
"dev"
:
true
},
"yallist"
:
{
"version"
:
"3.0.2"
,
"resolved"
:
"https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz"
,
"integrity"
:
"sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k="
,
"dev"
:
true
,
"optional"
:
true
"dev"
:
true
}
}
},
...
...
@@ -8501,7 +8481,7 @@
},
"onetime"
:
{
"version"
:
"1.1.0"
,
"resolved"
:
"http
s
://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz"
,
"resolved"
:
"http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz"
,
"integrity"
:
"sha1-ofeDj4MUxRbwXs78vEzP4EtO14k="
,
"dev"
:
true
},
...
...
src/common/helpers/debug.js
浏览文件 @
e55bbfe7
export
const
warn
=
function
(
msg
,
componentName
)
{
/* istanbul ignore if */
/* istanbul ignore if */
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
const
component
=
componentName
?
`<
${
componentName
}
> `
:
''
console
.
error
(
`[Cube warn]:
${
component
}${
msg
}
`
)
...
...
src/common/helpers/util.js
浏览文件 @
e55bbfe7
...
...
@@ -158,7 +158,7 @@ function processComponentName(Component, { prefix = '', firstUpperCase = false }
const
name
=
Component
.
name
const
pureName
=
name
.
replace
(
/^cube-/i
,
''
)
let
camelizeName
=
`
${
camelize
(
`
${
prefix
}${
pureName
}
`
)}
`
/* istanbul ignore if */
/* istanbul ignore if */
if
(
firstUpperCase
)
{
camelizeName
=
camelizeName
.
charAt
(
0
).
toUpperCase
()
+
camelizeName
.
slice
(
1
)
}
...
...
@@ -170,7 +170,7 @@ function parsePath (obj, path = '') {
let
result
=
obj
for
(
let
i
=
0
;
i
<
segments
.
length
;
i
++
)
{
const
key
=
segments
[
i
]
/* istanbul ignore if */
/* istanbul ignore if */
if
(
isUndef
(
result
[
key
]))
{
result
=
''
break
...
...
src/common/lang/date.js
浏览文件 @
e55bbfe7
...
...
@@ -16,8 +16,10 @@ function formatType(type, format, value, regExpAttributes) {
if
(
new
RegExp
(
regExpMap
[
type
],
regExpAttributes
).
test
(
format
))
{
const
replaceStr
=
type
===
'
year
'
?
value
.
toString
().
substr
(
4
-
RegExp
.
$1
.
length
)
:
(
RegExp
.
$1
.
length
===
1
)
?
value
:
pad
(
value
)
?
value
.
toString
().
substr
(
4
-
RegExp
.
$1
.
length
)
:
(
RegExp
.
$1
.
length
===
1
)
?
value
:
pad
(
value
)
format
=
format
.
replace
(
RegExp
.
$1
,
replaceStr
)
}
...
...
src/components/date-picker/date-picker.vue
浏览文件 @
e55bbfe7
...
...
@@ -133,18 +133,18 @@
},
minArray
()
{
return
this
.
min
instanceof
Date
?
dateToArray
(
this
.
min
).
slice
(
this
.
startIndex
,
this
.
startIndex
+
this
.
columnCount
)
:
this
.
min
?
dateToArray
(
this
.
min
).
slice
(
this
.
startIndex
,
this
.
startIndex
+
this
.
columnCount
)
:
this
.
min
},
maxArray
()
{
return
this
.
max
instanceof
Date
?
dateToArray
(
this
.
max
).
slice
(
this
.
startIndex
,
this
.
startIndex
+
this
.
columnCount
)
:
this
.
max
?
dateToArray
(
this
.
max
).
slice
(
this
.
startIndex
,
this
.
startIndex
+
this
.
columnCount
)
:
this
.
max
},
valueArray
()
{
return
this
.
value
instanceof
Date
?
dateToArray
(
this
.
value
).
slice
(
this
.
startIndex
,
this
.
startIndex
+
this
.
columnCount
)
:
this
.
value
?
dateToArray
(
this
.
value
).
slice
(
this
.
startIndex
,
this
.
startIndex
+
this
.
columnCount
)
:
this
.
value
},
data
()
{
const
data
=
[]
...
...
src/components/time-picker/time-picker.vue
浏览文件 @
e55bbfe7
...
...
@@ -274,15 +274,17 @@
// calculate hourIndex
const
hour
=
valueDate
.
getHours
()
const
beginHour
=
dayIndex
===
0
?
this
.
showNow
?
this
.
minTime
.
getHours
()
-
1
:
this
.
minTime
.
getHours
()
:
0
?
this
.
showNow
?
this
.
minTime
.
getHours
()
-
1
:
this
.
minTime
.
getHours
()
:
0
const
hourIndex
=
hour
-
beginHour
// calculate minuteIndex
const
minute
=
this
.
minuteStepRule
(
valueDate
.
getMinutes
()
/
this
.
minuteStepNumber
)
const
beginMinute
=
!
dayIndex
&&
(
this
.
showNow
?
hourIndex
===
1
:
!
hourIndex
)
?
this
.
minuteStepRule
(
this
.
minTime
.
getMinutes
()
/
this
.
minuteStepNumber
)
:
0
?
this
.
minuteStepRule
(
this
.
minTime
.
getMinutes
()
/
this
.
minuteStepNumber
)
:
0
const
minuteIndex
=
minute
-
beginMinute
this
.
selectedIndex
=
[
dayIndex
,
hourIndex
,
minuteIndex
]
...
...
src/components/validator/validator.vue
浏览文件 @
e55bbfe7
...
...
@@ -214,10 +214,10 @@
this
.
validating
=
false
results
.
forEach
(({
key
,
valid
,
ret
})
=>
{
const
msg
=
this
.
messages
[
key
]
?
isFunc
(
this
.
messages
[
key
])
?
this
.
messages
[
key
](
ret
,
valid
)
:
this
.
messages
[
key
]
:
this
.
findMessage
(
key
,
configRules
[
key
],
configRules
.
type
,
model
)
?
isFunc
(
this
.
messages
[
key
])
?
this
.
messages
[
key
](
ret
,
valid
)
:
this
.
messages
[
key
]
:
this
.
findMessage
(
key
,
configRules
[
key
],
configRules
.
type
,
model
)
if
(
isValid
&&
!
valid
)
{
isValid
=
false
this
.
msg
=
msg
...
...
test/unit/specs/image-preview.spec.js
浏览文件 @
e55bbfe7
...
...
@@ -209,7 +209,7 @@ describe('ImagePreview', () => {
// but becomes false in the same tick in safari
vm
.
$nextTick
(()
=>
{
expect
(
itemScroll
.
enabled
)
.
to
.
be
.
false
.
to
.
be
.
false
})
expect
(
slideScroll
.
enabled
)
.
to
.
be
.
true
...
...
test/unit/specs/locale.spec.js
浏览文件 @
e55bbfe7
...
...
@@ -32,7 +32,7 @@ describe('Locale', () => {
Locale
.
use
(
'
en-US
'
,
enUSMessages
)
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
_cancelTxt
)
.
to
.
equal
(
'
Cancel
'
)
.
to
.
equal
(
'
Cancel
'
)
done
()
})
})
...
...
test/unit/specs/radio.spec.js
浏览文件 @
e55bbfe7
...
...
@@ -153,9 +153,13 @@ function createRadioGroup(horizontal = false) {
function
createUserDefaltSlotRadioGroup
(
vModelGroup
=
true
)
{
const
vm
=
createVue
({
template
:
`
<cube-radio-group
${
vModelGroup
?
`v-model="selected"`
:
''
}
:options="options" class="my-radio" position="right" :horizontal="true">
<cube-radio-group
${
vModelGroup
?
`v-model="selected"`
:
''
}
:options="options"
class="my-radio"
position="right"
:horizontal="true"
>
<cube-radio
v-for="(option, idx) in options"
:key="idx"
...
...
test/unit/specs/recycle-list.spec.js
浏览文件 @
e55bbfe7
...
...
@@ -19,7 +19,7 @@ describe('RecycleList', () => {
it
(
'
requires onFetch function to return a Promise
'
,
()
=>
{
vm
=
createRecycleList
()
expect
(
vm
.
onFetch
()
instanceof
window
.
Promise
)
.
to
.
equal
(
true
)
.
to
.
equal
(
true
)
})
it
(
'
render correct count data
'
,
(
done
)
=>
{
vm
=
createRecycleList
(
true
)
...
...
test/unit/specs/toast.spec.js
浏览文件 @
e55bbfe7
...
...
@@ -133,7 +133,7 @@ describe('Toast', () => {
expect
(
ins
.
$el
.
className
)
.
to
.
include
(
'
my-toast
'
)
expect
(
ins
.
$el
.
querySelector
(
'
.cube-toast-tip
'
).
textContent
)
.
to
.
equal
(
'
toast api content
'
)
.
to
.
equal
(
'
toast api content
'
)
ins
.
remove
()
expect
(
ins
.
$el
.
parentElement
)
.
to
.
be
.
null
...
...
test/unit/specs/validator.spec.js
浏览文件 @
e55bbfe7
...
...
@@ -46,7 +46,7 @@ describe('Validator', () => {
const
msgEl
=
el
.
querySelector
(
'
.cube-validator-msg-def
'
)
setTimeout
(()
=>
{
expect
(
el
.
className
)
.
to
.
include
(
'
cube-validator_invalid
'
)
.
to
.
include
(
'
cube-validator_invalid
'
)
expect
(
msgEl
.
textContent
)
.
to
.
equal
(
'
必填
'
)
expect
(
vm
.
result
.
asyncRule
.
valid
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录