Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
fd3406bd
A
ant-design
项目概览
wanjj_1210
/
ant-design
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
fd3406bd
编写于
3月 30, 2016
作者:
B
Benjy Cui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
style: enable react/jsx-no-bind
上级
1fbfb677
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
63 addition
and
37 deletion
+63
-37
.eslintrc.json
.eslintrc.json
+0
-1
components/checkbox/Group.jsx
components/checkbox/Group.jsx
+1
-1
components/date-picker/demo/start-end.md
components/date-picker/demo/start-end.md
+8
-2
components/date-picker/demo/with-time-picker.md
components/date-picker/demo/with-time-picker.md
+8
-2
components/form/demo/validate-basic.md
components/form/demo/validate-basic.md
+13
-13
components/table/index.jsx
components/table/index.jsx
+4
-4
components/tabs/index.jsx
components/tabs/index.jsx
+1
-1
components/tag/demo/control.md
components/tag/demo/control.md
+1
-1
components/transfer/index.jsx
components/transfer/index.jsx
+25
-10
components/upload/uploadList.jsx
components/upload/uploadList.jsx
+2
-2
未找到文件。
.eslintrc.json
浏览文件 @
fd3406bd
...
...
@@ -31,7 +31,6 @@
"react/prefer-es6-class"
:
0
,
"react/prefer-stateless-function"
:
0
,
"react/jsx-closing-bracket-location"
:
0
,
"react/jsx-no-bind"
:
0
,
"no-param-reassign"
:
0
,
"no-return-assign"
:
0
,
"max-len"
:
0
,
...
...
components/checkbox/Group.jsx
浏览文件 @
fd3406bd
...
...
@@ -63,7 +63,7 @@ export default class CheckboxGroup extends React.Component {
options
.
map
(
option
=>
<
Checkbox
disabled
=
{
'
disabled
'
in
option
?
option
.
disabled
:
this
.
props
.
disabled
}
checked
=
{
this
.
state
.
value
.
indexOf
(
option
.
value
)
!==
-
1
}
onChange
=
{
this
.
toggleOption
.
bind
(
this
,
option
)
}
onChange
=
{
()
=>
this
.
toggleOption
(
option
)
}
className
=
"ant-checkbox-group-item"
key
=
{
option
.
value
}
>
{
option
.
label
}
</
Checkbox
>
...
...
components/date-picker/demo/start-end.md
浏览文件 @
fd3406bd
...
...
@@ -34,17 +34,23 @@ const DateRange = React.createClass({
[
field
]:
value
,
});
},
onStartChange
(
value
)
{
this
.
onChange
(
'
startValue
'
,
value
);
},
onEndChange
(
value
)
{
this
.
onChange
(
'
endValue
'
,
value
);
},
render
()
{
return
(
<
div
>
<
DatePicker
disabledDate
=
{
this
.
disabledStartDate
}
value
=
{
this
.
state
.
startValue
}
placeholder
=
"开始日期"
onChange
=
{
this
.
on
Change
.
bind
(
this
,
'
startValue
'
)
}
/>
onChange
=
{
this
.
on
StartChange
}
/>
<
DatePicker
disabledDate
=
{
this
.
disabledEndDate
}
value
=
{
this
.
state
.
endValue
}
placeholder
=
"结束日期"
onChange
=
{
this
.
on
Change
.
bind
(
this
,
'
endValue
'
)
}
/>
onChange
=
{
this
.
on
EndChange
}
/>
</
div
>
);
}
...
...
components/date-picker/demo/with-time-picker.md
浏览文件 @
fd3406bd
...
...
@@ -36,11 +36,17 @@ const DateTimePicker = React.createClass({
this
.
props
.
onSelect
(
this
.
result
);
}
},
handleDateChange
(
value
)
{
this
.
handleChange
(
'
date
'
,
value
);
},
handleTimeChange
(
value
)
{
this
.
handleChange
(
'
time
'
,
value
);
},
render
()
{
return
(
<
div
>
<
DatePicker
onChange
=
{
this
.
handle
Change
.
bind
(
null
,
'
date
'
)
}
/>
<
TimePicker
onChange
=
{
this
.
handle
Change
.
bind
(
null
,
'
time
'
)
}
/>
<
DatePicker
onChange
=
{
this
.
handle
DateChange
}
/>
<
TimePicker
onChange
=
{
this
.
handle
TimeChange
}
/>
</
div
>
);
}
...
...
components/form/demo/validate-basic.md
浏览文件 @
fd3406bd
...
...
@@ -15,7 +15,7 @@ function noop() {
return
false
;
}
class
BasicDemo
extends
React
.
Component
{
let
BasicDemo
=
React
.
createClass
(
{
getValidateStatus
(
field
)
{
const
{
isFieldValidating
,
getFieldError
,
getFieldValue
}
=
this
.
props
.
form
;
...
...
@@ -26,12 +26,12 @@ class BasicDemo extends React.Component {
}
else
if
(
getFieldValue
(
field
))
{
return
'
success
'
;
}
}
}
,
handleReset
(
e
)
{
e
.
preventDefault
();
this
.
props
.
form
.
resetFields
();
}
}
,
handleSubmit
(
e
)
{
e
.
preventDefault
();
...
...
@@ -43,7 +43,7 @@ class BasicDemo extends React.Component {
console
.
log
(
'
Submit!!!
'
);
console
.
log
(
values
);
});
}
}
,
userExists
(
rule
,
value
,
callback
)
{
if
(
!
value
)
{
...
...
@@ -57,7 +57,7 @@ class BasicDemo extends React.Component {
}
},
800
);
}
}
}
,
checkPass
(
rule
,
value
,
callback
)
{
const
{
validateFields
}
=
this
.
props
.
form
;
...
...
@@ -65,7 +65,7 @@ class BasicDemo extends React.Component {
validateFields
([
'
rePasswd
'
],
{
force
:
true
});
}
callback
();
}
}
,
checkPass2
(
rule
,
value
,
callback
)
{
const
{
getFieldValue
}
=
this
.
props
.
form
;
...
...
@@ -74,7 +74,7 @@ class BasicDemo extends React.Component {
}
else
{
callback
();
}
}
}
,
render
()
{
const
{
getFieldProps
,
getFieldError
,
isFieldValidating
}
=
this
.
props
.
form
;
...
...
@@ -100,7 +100,7 @@ class BasicDemo extends React.Component {
const
passwdProps
=
getFieldProps
(
'
passwd
'
,
{
rules
:
[
{
required
:
true
,
whitespace
:
true
,
message
:
'
请填写密码
'
},
{
validator
:
this
.
checkPass
.
bind
(
this
)
},
{
validator
:
this
.
checkPass
},
],
});
const
rePasswdProps
=
getFieldProps
(
'
rePasswd
'
,
{
...
...
@@ -109,7 +109,7 @@ class BasicDemo extends React.Component {
whitespace
:
true
,
message
:
'
请再次输入密码
'
,
},
{
validator
:
this
.
checkPass2
.
bind
(
this
)
,
validator
:
this
.
checkPass2
,
}],
});
const
textareaProps
=
getFieldProps
(
'
textarea
'
,
{
...
...
@@ -161,14 +161,14 @@ class BasicDemo extends React.Component {
</
FormItem
>
<
FormItem
wrapperCol
=
{
{
span
:
12
,
offset
:
7
}
}
>
<
Button
type
=
"primary"
onClick
=
{
this
.
handleSubmit
.
bind
(
this
)
}
>
确定
</
Button
>
<
Button
type
=
"primary"
onClick
=
{
this
.
handleSubmit
}
>
确定
</
Button
>
<
Button
type
=
"ghost"
onClick
=
{
this
.
handleReset
.
bind
(
this
)
}
>
重置
</
Button
>
<
Button
type
=
"ghost"
onClick
=
{
this
.
handleReset
}
>
重置
</
Button
>
</
FormItem
>
</
Form
>
);
}
}
}
,
}
);
BasicDemo
=
createForm
()(
BasicDemo
);
...
...
components/table/index.jsx
浏览文件 @
fd3406bd
...
...
@@ -314,7 +314,7 @@ let Table = React.createClass({
}
return
(
<
Radio
disabled
=
{
props
.
disabled
}
onChange
=
{
this
.
handleRadioSelect
.
bind
(
this
,
record
,
rowIndex
)
}
onChange
=
{
(
e
)
=>
this
.
handleRadioSelect
(
record
,
rowIndex
,
e
)
}
value
=
{
rowIndex
}
checked
=
{
checked
}
/>
);
},
...
...
@@ -334,7 +334,7 @@ let Table = React.createClass({
}
return
(
<
Checkbox
checked
=
{
checked
}
disabled
=
{
props
.
disabled
}
onChange
=
{
this
.
handleSelect
.
bind
(
this
,
record
,
rowIndex
)
}
/>
onChange
=
{
(
e
)
=>
this
.
handleSelect
(
record
,
rowIndex
,
e
)
}
/>
);
},
...
...
@@ -444,12 +444,12 @@ let Table = React.createClass({
<
div
className
=
"ant-table-column-sorter"
>
<
span
className
=
{
`ant-table-column-sorter-up
${
isAscend
?
'
on
'
:
'
off
'
}
`
}
title
=
"↑"
onClick
=
{
this
.
toggleSortOrder
.
bind
(
this
,
'
ascend
'
,
column
)
}
>
onClick
=
{
()
=>
this
.
toggleSortOrder
(
'
ascend
'
,
column
)
}
>
<
Icon
type
=
"caret-up"
/>
</
span
>
<
span
className
=
{
`ant-table-column-sorter-down
${
isDescend
?
'
on
'
:
'
off
'
}
`
}
title
=
"↓"
onClick
=
{
this
.
toggleSortOrder
.
bind
(
this
,
'
descend
'
,
column
)
}
>
onClick
=
{
()
=>
this
.
toggleSortOrder
(
'
descend
'
,
column
)
}
>
<
Icon
type
=
"caret-down"
/>
</
span
>
</
div
>
...
...
components/tabs/index.jsx
浏览文件 @
fd3406bd
...
...
@@ -49,7 +49,7 @@ export default class Tabs extends React.Component {
return
cloneElement
(
child
,
{
tab
:
<
div
>
{
child
.
props
.
tab
}
<
Icon
type
=
"cross"
onClick
=
{
this
.
removeTab
.
bind
(
this
,
child
.
key
)
}
/>
<
Icon
type
=
"cross"
onClick
=
{
(
e
)
=>
this
.
removeTab
(
child
.
key
,
e
)
}
/>
</
div
>,
key
:
child
.
key
||
index
,
});
...
...
components/tag/demo/control.md
浏览文件 @
fd3406bd
...
...
@@ -36,7 +36,7 @@ const App = React.createClass({
return
(
<
div
>
{
this
.
state
.
tags
.
map
(
tag
=>
<
Tag
key
=
{
tag
.
key
}
closable
afterClose
=
{
this
.
handleClose
.
bind
(
this
,
tag
.
key
)
}
>
{
tag
.
name
}
</
Tag
>
<
Tag
key
=
{
tag
.
key
}
closable
afterClose
=
{
()
=>
this
.
handleClose
(
tag
.
key
)
}
>
{
tag
.
name
}
</
Tag
>
)
}
<
div
>
<
Button
onClick
=
{
this
.
addTag
}
>
添加标签
</
Button
>
...
...
components/transfer/index.jsx
浏览文件 @
fd3406bd
...
...
@@ -95,6 +95,9 @@ export default class Transfer extends React.Component {
this
.
props
.
onChange
(
newTargetKeys
,
direction
,
moveKeys
);
}
moveToLeft
=
()
=>
this
.
moveTo
(
'
left
'
)
moveToRight
=
()
=>
this
.
moveTo
(
'
right
'
)
getGlobalCheckStatus
(
direction
)
{
const
{
leftDataSource
,
rightDataSource
}
=
this
.
splitDataSource
();
const
{
leftFilter
,
rightFilter
,
leftCheckedKeys
,
rightCheckedKeys
}
=
this
.
state
;
...
...
@@ -144,6 +147,9 @@ export default class Transfer extends React.Component {
});
}
handleLeftSelectAll
=
()
=>
this
.
handleSelectAll
(
'
left
'
)
handleRightSelectAll
=
()
=>
this
.
handleSelectAll
(
'
right
'
)
handleFilter
=
(
direction
,
e
)
=>
{
this
.
setState
({
// deselect all
...
...
@@ -153,12 +159,18 @@ export default class Transfer extends React.Component {
});
}
handleLeftFilter
=
(
e
)
=>
this
.
handleFilter
(
'
left
'
,
e
)
handleRightFilter
=
(
e
)
=>
this
.
handleFilter
(
'
right
'
,
e
)
handleClear
=
(
direction
)
=>
{
this
.
setState
({
[
`
${
direction
}
Filter`
]:
''
,
});
}
handleLeftClear
=
()
=>
this
.
handleClear
(
'
left
'
)
handleRightClear
=
()
=>
this
.
handleClear
(
'
right
'
)
handleSelect
=
(
direction
,
selectedItem
,
checked
)
=>
{
const
{
leftCheckedKeys
,
rightCheckedKeys
}
=
this
.
state
;
const
holder
=
direction
===
'
left
'
?
leftCheckedKeys
:
rightCheckedKeys
;
...
...
@@ -179,6 +191,9 @@ export default class Transfer extends React.Component {
});
}
handleLeftSelect
=
(
selectedItem
,
checked
)
=>
this
.
handleSelect
(
'
left
'
,
selectedItem
,
checked
);
handleRightSelect
=
(
selectedItem
,
checked
)
=>
this
.
handleSelect
(
'
right
'
,
selectedItem
,
checked
);
render
()
{
const
{
prefixCls
,
titles
,
operations
,
showSearch
,
notFoundContent
,
...
...
@@ -206,10 +221,10 @@ export default class Transfer extends React.Component {
style
=
{
listStyle
}
checkedKeys
=
{
leftCheckedKeys
}
checkStatus
=
{
leftCheckStatus
}
handleFilter
=
{
this
.
handle
Filter
.
bind
(
this
,
'
left
'
)
}
handleClear
=
{
this
.
handle
Clear
.
bind
(
this
,
'
left
'
)
}
handleSelect
=
{
this
.
handle
Select
.
bind
(
this
,
'
left
'
)
}
handleSelectAll
=
{
this
.
handle
SelectAll
.
bind
(
this
,
'
left
'
)
}
handleFilter
=
{
this
.
handle
LeftFilter
}
handleClear
=
{
this
.
handle
LeftClear
}
handleSelect
=
{
this
.
handle
LeftSelect
}
handleSelectAll
=
{
this
.
handle
LeftSelectAll
}
position
=
"left"
render
=
{
this
.
props
.
render
}
showSearch
=
{
showSearch
}
...
...
@@ -220,10 +235,10 @@ export default class Transfer extends React.Component {
prefixCls
=
{
`
${
prefixCls
}
-list`
}
/>
<
Operation
rightActive
=
{
rightActive
}
rightArrowText
=
{
operations
[
0
]
}
moveToRight
=
{
this
.
moveTo
.
bind
(
this
,
'
right
'
)
}
moveToRight
=
{
this
.
moveTo
Right
}
leftActive
=
{
leftActive
}
leftArrowText
=
{
operations
[
1
]
}
moveToLeft
=
{
this
.
moveTo
.
bind
(
this
,
'
left
'
)
}
moveToLeft
=
{
this
.
moveTo
Left
}
className
=
{
`
${
prefixCls
}
-operation`
}
/>
<
List
titleText
=
{
titles
[
1
]
}
dataSource
=
{
rightDataSource
}
...
...
@@ -231,10 +246,10 @@ export default class Transfer extends React.Component {
style
=
{
listStyle
}
checkedKeys
=
{
rightCheckedKeys
}
checkStatus
=
{
rightCheckStatus
}
handleFilter
=
{
this
.
handle
Filter
.
bind
(
this
,
'
right
'
)
}
handleClear
=
{
this
.
handle
Clear
.
bind
(
this
,
'
right
'
)
}
handleSelect
=
{
this
.
handle
Select
.
bind
(
this
,
'
right
'
)
}
handleSelectAll
=
{
this
.
handle
SelectAll
.
bind
(
this
,
'
right
'
)
}
handleFilter
=
{
this
.
handle
RightFilter
}
handleClear
=
{
this
.
handle
RightClear
}
handleSelect
=
{
this
.
handle
RightSelect
}
handleSelectAll
=
{
this
.
handle
RightSelectAll
}
position
=
"right"
render
=
{
this
.
props
.
render
}
showSearch
=
{
showSearch
}
...
...
components/upload/uploadList.jsx
浏览文件 @
fd3406bd
...
...
@@ -95,9 +95,9 @@ export default class UploadList extends React.Component {
?
(
<
span
>
<
a
href
=
{
file
.
url
}
target
=
"_blank"
style
=
{
{
pointerEvents
:
file
.
url
?
''
:
'
none
'
}
}
><
Icon
type
=
"eye-o"
/></
a
>
<
Icon
type
=
"delete"
onClick
=
{
this
.
handleClose
.
bind
(
this
,
file
)
}
/>
<
Icon
type
=
"delete"
onClick
=
{
()
=>
this
.
handleClose
(
file
)
}
/>
</
span
>
)
:
<
Icon
type
=
"cross"
onClick
=
{
this
.
handleClose
.
bind
(
this
,
file
)
}
/>
)
:
<
Icon
type
=
"cross"
onClick
=
{
()
=>
this
.
handleClose
(
file
)
}
/>
}
</
div
>
{
progress
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录