Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
273e5272
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,发现更多精彩内容 >>
提交
273e5272
编写于
3月 29, 2016
作者:
B
Bruce Mitchener
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use static class members for propTypes and friends.
上级
1ffbc31a
变更
33
隐藏空白更改
内联
并排
Showing
33 changed file
with
486 addition
and
462 deletion
+486
-462
components/badge/ScrollNumber.jsx
components/badge/ScrollNumber.jsx
+18
-18
components/badge/index.jsx
components/badge/index.jsx
+16
-16
components/breadcrumb/index.jsx
components/breadcrumb/index.jsx
+31
-31
components/button/button-group.jsx
components/button/button-group.jsx
+4
-3
components/button/button.jsx
components/button/button.jsx
+16
-15
components/calendar/Header.jsx
components/calendar/Header.jsx
+24
-20
components/calendar/index.jsx
components/calendar/index.jsx
+29
-22
components/carousel/index.jsx
components/carousel/index.jsx
+5
-5
components/cascader/index.jsx
components/cascader/index.jsx
+22
-15
components/collapse/index.jsx
components/collapse/index.jsx
+6
-6
components/dropdown/dropdown-button.jsx
components/dropdown/dropdown-button.jsx
+13
-13
components/dropdown/dropdown.jsx
components/dropdown/dropdown.jsx
+7
-7
components/form/Form.jsx
components/form/Form.jsx
+20
-20
components/form/FormItem.jsx
components/form/FormItem.jsx
+22
-22
components/input-number/index.jsx
components/input-number/index.jsx
+5
-5
components/input/index.jsx
components/input/index.jsx
+29
-30
components/locale-provider/index.jsx
components/locale-provider/index.jsx
+12
-8
components/pagination/index.jsx
components/pagination/index.jsx
+12
-12
components/popover/index.jsx
components/popover/index.jsx
+9
-9
components/select/index.jsx
components/select/index.jsx
+11
-11
components/slider/index.jsx
components/slider/index.jsx
+5
-5
components/spin/index.jsx
components/spin/index.jsx
+10
-10
components/steps/index.jsx
components/steps/index.jsx
+9
-9
components/switch/index.jsx
components/switch/index.jsx
+4
-4
components/tabs/index.jsx
components/tabs/index.jsx
+13
-10
components/tag/index.jsx
components/tag/index.jsx
+7
-7
components/timeline/index.jsx
components/timeline/index.jsx
+13
-13
components/transfer/index.jsx
components/transfer/index.jsx
+34
-35
components/transfer/list.jsx
components/transfer/list.jsx
+31
-32
components/transfer/operation.jsx
components/transfer/operation.jsx
+15
-15
components/transfer/search.jsx
components/transfer/search.jsx
+13
-13
components/tree-select/index.jsx
components/tree-select/index.jsx
+12
-12
components/tree/index.jsx
components/tree/index.jsx
+9
-9
未找到文件。
components/badge/ScrollNumber.jsx
浏览文件 @
273e5272
...
...
@@ -7,6 +7,24 @@ function getNumberArray(num) {
}
export
default
class
ScrollNumber
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
:
'
ant-scroll-number
'
,
count
:
null
,
component
:
'
sup
'
,
onAnimated
()
{},
height
:
18
,
}
static
propTypes
=
{
count
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
string
,
React
.
PropTypes
.
number
]),
component
:
React
.
PropTypes
.
string
,
onAnimated
:
React
.
PropTypes
.
func
,
height
:
React
.
PropTypes
.
number
,
}
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
...
...
@@ -112,21 +130,3 @@ export default class ScrollNumber extends React.Component {
);
}
}
ScrollNumber
.
defaultProps
=
{
prefixCls
:
'
ant-scroll-number
'
,
count
:
null
,
component
:
'
sup
'
,
onAnimated
()
{},
height
:
18
,
};
ScrollNumber
.
propTypes
=
{
count
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
string
,
React
.
PropTypes
.
number
]),
component
:
React
.
PropTypes
.
string
,
onAnimated
:
React
.
PropTypes
.
func
,
height
:
React
.
PropTypes
.
number
,
};
components/badge/index.jsx
浏览文件 @
273e5272
...
...
@@ -4,6 +4,22 @@ import ScrollNumber from './ScrollNumber';
import
classNames
from
'
classnames
'
;
export
default
class
Badge
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
:
'
ant-badge
'
,
count
:
null
,
dot
:
false
,
overflowCount
:
99
,
}
static
propTypes
=
{
count
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
string
,
React
.
PropTypes
.
number
]),
dot
:
React
.
PropTypes
.
bool
,
overflowCount
:
React
.
PropTypes
.
number
,
}
render
()
{
let
{
count
,
prefixCls
,
overflowCount
,
className
,
style
,
children
}
=
this
.
props
;
const
dot
=
this
.
props
.
dot
;
...
...
@@ -41,19 +57,3 @@ export default class Badge extends React.Component {
);
}
}
Badge
.
defaultProps
=
{
prefixCls
:
'
ant-badge
'
,
count
:
null
,
dot
:
false
,
overflowCount
:
99
,
};
Badge
.
propTypes
=
{
count
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
string
,
React
.
PropTypes
.
number
]),
dot
:
React
.
PropTypes
.
bool
,
overflowCount
:
React
.
PropTypes
.
number
,
};
components/breadcrumb/index.jsx
浏览文件 @
273e5272
...
...
@@ -2,6 +2,20 @@ import React, { cloneElement } from 'react';
/* Exported as Breadcrumb.Item */
class
BreadcrumbItem
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
:
'
ant-breadcrumb
'
,
separator
:
'
/
'
,
}
static
propTypes
=
{
prefixCls
:
React
.
PropTypes
.
string
,
separator
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
string
,
React
.
PropTypes
.
element
,
]),
href
:
React
.
PropTypes
.
string
,
}
render
()
{
const
{
prefixCls
,
separator
,
children
}
=
this
.
props
;
let
link
=
<
a
className
=
{
`
${
prefixCls
}
-link`
}
{
...
this
.
props
}
>
{
children
}
</
a
>;
...
...
@@ -17,21 +31,25 @@ class BreadcrumbItem extends React.Component {
}
}
BreadcrumbItem
.
defaultProps
=
{
prefixCls
:
'
ant-breadcrumb
'
,
separator
:
'
/
'
,
};
export
default
class
Breadcrumb
extends
React
.
Component
{
static
Item
=
BreadcrumbItem
;
static
defaultProps
=
{
prefixCls
:
'
ant-breadcrumb
'
,
separator
:
'
/
'
,
linkRender
:
(
href
,
name
)
=>
<
a
href
=
{
`#
${
href
}
`
}
>
{
name
}
</
a
>,
}
BreadcrumbItem
.
propTypes
=
{
prefixCls
:
React
.
PropTypes
.
string
,
separator
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
string
,
React
.
PropTypes
.
element
,
]),
href
:
React
.
PropTypes
.
string
,
};
static
propTypes
=
{
prefixCls
:
React
.
PropTypes
.
string
,
separator
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
string
,
React
.
PropTypes
.
element
,
]),
routes
:
React
.
PropTypes
.
array
,
params
:
React
.
PropTypes
.
object
,
}
export
default
class
Breadcrumb
extends
React
.
Component
{
render
()
{
let
crumbs
;
const
{
separator
,
prefixCls
,
routes
,
params
,
children
,
linkRender
}
=
this
.
props
;
...
...
@@ -76,21 +94,3 @@ export default class Breadcrumb extends React.Component {
);
}
}
Breadcrumb
.
defaultProps
=
{
prefixCls
:
'
ant-breadcrumb
'
,
separator
:
'
/
'
,
linkRender
:
(
href
,
name
)
=>
<
a
href
=
{
`#
${
href
}
`
}
>
{
name
}
</
a
>,
};
Breadcrumb
.
propTypes
=
{
prefixCls
:
React
.
PropTypes
.
string
,
separator
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
string
,
React
.
PropTypes
.
element
,
]),
routes
:
React
.
PropTypes
.
array
,
params
:
React
.
PropTypes
.
object
,
};
Breadcrumb
.
Item
=
BreadcrumbItem
;
components/button/button-group.jsx
浏览文件 @
273e5272
...
...
@@ -4,6 +4,10 @@ import classNames from 'classnames';
const
prefix
=
'
ant-btn-group-
'
;
export
default
class
ButtonGroup
extends
React
.
Component
{
static
propTypes
=
{
size
:
React
.
PropTypes
.
oneOf
([
'
large
'
,
'
small
'
]),
}
render
()
{
const
{
size
,
className
,
...
others
}
=
this
.
props
;
...
...
@@ -23,6 +27,3 @@ export default class ButtonGroup extends React.Component {
return
<
div
{
...
others
}
className
=
{
classes
}
/>;
}
}
ButtonGroup
.
propTypes
=
{
size
:
React
.
PropTypes
.
oneOf
([
'
large
'
,
'
small
'
]),
};
components/button/button.jsx
浏览文件 @
273e5272
...
...
@@ -30,6 +30,21 @@ function clearButton(button) {
}
export
default
class
Button
extends
React
.
Component
{
static
defaultProps
=
{
onClick
()
{},
}
static
propTypes
=
{
type
:
React
.
PropTypes
.
oneOf
([
'
primary
'
,
'
ghost
'
,
'
dashed
'
]),
shape
:
React
.
PropTypes
.
oneOf
([
'
circle
'
,
'
circle-outline
'
]),
size
:
React
.
PropTypes
.
oneOf
([
'
large
'
,
'
small
'
]),
htmlType
:
React
.
PropTypes
.
oneOf
([
'
submit
'
,
'
button
'
,
'
reset
'
]),
onClick
:
React
.
PropTypes
.
func
,
loading
:
React
.
PropTypes
.
bool
,
className
:
React
.
PropTypes
.
string
,
icon
:
React
.
PropTypes
.
string
,
}
handleClick
=
(...
args
)
=>
{
// Add click effect
const
buttonNode
=
findDOMNode
(
this
);
...
...
@@ -40,6 +55,7 @@ export default class Button extends React.Component {
this
.
props
.
onClick
(...
args
);
}
render
()
{
const
props
=
this
.
props
;
const
{
type
,
shape
,
size
,
className
,
htmlType
,
children
,
icon
,
...
others
}
=
props
;
...
...
@@ -72,18 +88,3 @@ export default class Button extends React.Component {
);
}
}
Button
.
propTypes
=
{
type
:
React
.
PropTypes
.
oneOf
([
'
primary
'
,
'
ghost
'
,
'
dashed
'
]),
shape
:
React
.
PropTypes
.
oneOf
([
'
circle
'
,
'
circle-outline
'
]),
size
:
React
.
PropTypes
.
oneOf
([
'
large
'
,
'
small
'
]),
htmlType
:
React
.
PropTypes
.
oneOf
([
'
submit
'
,
'
button
'
,
'
reset
'
]),
onClick
:
React
.
PropTypes
.
func
,
loading
:
React
.
PropTypes
.
bool
,
className
:
React
.
PropTypes
.
string
,
icon
:
React
.
PropTypes
.
string
,
};
Button
.
defaultProps
=
{
onClick
()
{},
};
components/calendar/Header.jsx
浏览文件 @
273e5272
...
...
@@ -6,6 +6,26 @@ import { Group, Button } from '../radio';
function
noop
()
{}
export
default
class
Header
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
:
`
${
PREFIX_CLS
}
-header`
,
yearSelectOffset
:
10
,
yearSelectTotal
:
20
,
onValueChange
:
noop
,
onTypeChange
:
noop
,
}
static
propTypes
=
{
value
:
PropTypes
.
object
,
locale
:
PropTypes
.
object
,
yearSelectOffset
:
PropTypes
.
number
,
yearSelectTotal
:
PropTypes
.
number
,
onValueChange
:
PropTypes
.
func
,
onTypeChange
:
PropTypes
.
func
,
prefixCls
:
PropTypes
.
string
,
selectPrefixCls
:
PropTypes
.
string
,
type
:
PropTypes
.
string
,
}
getYearSelectElement
(
year
)
{
const
{
yearSelectOffset
,
yearSelectTotal
,
locale
,
prefixCls
,
fullscreen
}
=
this
.
props
;
const
start
=
year
-
yearSelectOffset
;
...
...
@@ -29,6 +49,7 @@ export default class Header extends React.Component {
</
Select
>
);
}
getMonthSelectElement
(
month
)
{
const
props
=
this
.
props
;
const
months
=
props
.
locale
.
format
.
months
;
...
...
@@ -52,6 +73,7 @@ export default class Header extends React.Component {
</
Select
>
);
}
onYearChange
=
(
year
)
=>
{
const
newValue
=
this
.
props
.
value
.
clone
();
newValue
.
setYear
(
parseInt
(
year
,
10
));
...
...
@@ -63,9 +85,11 @@ export default class Header extends React.Component {
newValue
.
setMonth
(
parseInt
(
month
,
10
));
this
.
props
.
onValueChange
(
newValue
);
}
onTypeChange
=
(
e
)
=>
{
this
.
props
.
onTypeChange
(
e
.
target
.
value
);
}
render
()
{
const
{
type
,
value
,
prefixCls
,
locale
}
=
this
.
props
;
const
yearSelect
=
this
.
getYearSelectElement
(
value
.
getYear
());
...
...
@@ -86,23 +110,3 @@ export default class Header extends React.Component {
);
}
}
Header
.
propTypes
=
{
value
:
PropTypes
.
object
,
locale
:
PropTypes
.
object
,
yearSelectOffset
:
PropTypes
.
number
,
yearSelectTotal
:
PropTypes
.
number
,
onValueChange
:
PropTypes
.
func
,
onTypeChange
:
PropTypes
.
func
,
prefixCls
:
PropTypes
.
string
,
selectPrefixCls
:
PropTypes
.
string
,
type
:
PropTypes
.
string
,
};
Header
.
defaultProps
=
{
prefixCls
:
`
${
PREFIX_CLS
}
-header`
,
yearSelectOffset
:
10
,
yearSelectTotal
:
20
,
onValueChange
:
noop
,
onTypeChange
:
noop
,
};
components/calendar/index.jsx
浏览文件 @
273e5272
...
...
@@ -13,6 +13,28 @@ function zerofixed(v) {
}
export
default
class
Calendar
extends
React
.
Component
{
static
defaultProps
=
{
monthCellRender
:
noop
,
dateCellRender
:
noop
,
locale
:
zhCN
,
fullscreen
:
true
,
prefixCls
:
PREFIX_CLS
,
onPanelChange
:
noop
,
mode
:
'
month
'
,
}
static
propTypes
=
{
monthCellRender
:
PropTypes
.
func
,
dateCellRender
:
PropTypes
.
func
,
fullscreen
:
PropTypes
.
bool
,
locale
:
PropTypes
.
object
,
prefixCls
:
PropTypes
.
string
,
className
:
PropTypes
.
string
,
style
:
PropTypes
.
object
,
onPanelChange
:
PropTypes
.
func
,
value
:
PropTypes
.
instanceOf
(
Date
),
}
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
...
...
@@ -20,11 +42,13 @@ export default class Calendar extends React.Component {
mode
:
props
.
mode
,
};
}
parseDateFromValue
(
value
)
{
const
date
=
new
GregorianCalendar
(
this
.
props
.
locale
);
date
.
setTime
(
+
value
);
return
date
;
}
componentWillReceiveProps
(
nextProps
)
{
if
(
'
value
'
in
nextProps
)
{
this
.
setState
({
...
...
@@ -32,6 +56,7 @@ export default class Calendar extends React.Component {
});
}
}
monthCellRender
=
(
value
,
locale
)
=>
{
const
prefixCls
=
this
.
props
.
prefixCls
;
const
month
=
value
.
getMonth
();
...
...
@@ -46,6 +71,7 @@ export default class Calendar extends React.Component {
</
div
>
);
}
dateCellRender
=
(
value
)
=>
{
const
prefixCls
=
this
.
props
.
prefixCls
;
return
(
...
...
@@ -59,12 +85,14 @@ export default class Calendar extends React.Component {
</
div
>
);
}
setValue
=
(
value
)
=>
{
if
(
!
(
'
value
'
in
this
.
props
)
&&
this
.
state
.
value
!==
value
)
{
this
.
setState
({
value
});
}
this
.
props
.
onPanelChange
(
value
,
this
.
state
.
mode
);
}
setType
=
(
type
)
=>
{
const
mode
=
(
type
===
'
date
'
)
?
'
month
'
:
'
year
'
;
if
(
this
.
state
.
mode
!==
mode
)
{
...
...
@@ -72,6 +100,7 @@ export default class Calendar extends React.Component {
this
.
props
.
onPanelChange
(
this
.
state
.
value
,
mode
);
}
}
render
()
{
const
props
=
this
.
props
;
const
{
value
,
mode
}
=
this
.
state
;
...
...
@@ -107,25 +136,3 @@ export default class Calendar extends React.Component {
);
}
}
Calendar
.
propTypes
=
{
monthCellRender
:
PropTypes
.
func
,
dateCellRender
:
PropTypes
.
func
,
fullscreen
:
PropTypes
.
bool
,
locale
:
PropTypes
.
object
,
prefixCls
:
PropTypes
.
string
,
className
:
PropTypes
.
string
,
style
:
PropTypes
.
object
,
onPanelChange
:
PropTypes
.
func
,
value
:
PropTypes
.
instanceOf
(
Date
),
};
Calendar
.
defaultProps
=
{
monthCellRender
:
noop
,
dateCellRender
:
noop
,
locale
:
zhCN
,
fullscreen
:
true
,
prefixCls
:
PREFIX_CLS
,
onPanelChange
:
noop
,
mode
:
'
month
'
,
};
components/carousel/index.jsx
浏览文件 @
273e5272
...
...
@@ -17,6 +17,11 @@ import SlickCarousel from 'react-slick';
import
React
from
'
react
'
;
export
default
class
Carousel
extends
React
.
Component
{
static
defaultProps
=
{
dots
:
true
,
arrows
:
false
,
}
render
()
{
let
props
=
{
...
this
.
props
};
...
...
@@ -37,8 +42,3 @@ export default class Carousel extends React.Component {
);
}
}
Carousel
.
defaultProps
=
{
dots
:
true
,
arrows
:
false
,
};
components/cascader/index.jsx
浏览文件 @
273e5272
...
...
@@ -6,6 +6,21 @@ import arrayTreeFilter from 'array-tree-filter';
import
classNames
from
'
classnames
'
;
export
default
class
Cascader
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
:
'
ant-cascader
'
,
placeholder
:
'
请选择
'
,
transitionName
:
'
slide-up
'
,
popupPlacement
:
'
bottomLeft
'
,
onChange
()
{},
options
:
[],
displayRender
(
label
)
{
return
label
.
join
(
'
/
'
);
},
disabled
:
false
,
allowClear
:
true
,
onPopupVisibleChange
()
{},
}
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
...
...
@@ -13,36 +28,43 @@ export default class Cascader extends React.Component {
popupVisible
:
false
,
};
}
componentWillReceiveProps
(
nextProps
)
{
if
(
'
value
'
in
nextProps
)
{
this
.
setState
({
value
:
nextProps
.
value
||
[]
});
}
}
handleChange
=
(
value
,
selectedOptions
)
=>
{
this
.
setValue
(
value
,
selectedOptions
);
}
handlePopupVisibleChange
=
(
popupVisible
)
=>
{
this
.
setState
({
popupVisible
});
this
.
props
.
onPopupVisibleChange
(
popupVisible
);
}
setValue
=
(
value
,
selectedOptions
=
[])
=>
{
if
(
!
(
'
value
'
in
this
.
props
))
{
this
.
setState
({
value
});
}
this
.
props
.
onChange
(
value
,
selectedOptions
);
}
getLabel
()
{
const
{
options
,
displayRender
}
=
this
.
props
;
const
label
=
arrayTreeFilter
(
options
,
(
o
,
level
)
=>
o
.
value
===
this
.
state
.
value
[
level
])
.
map
(
o
=>
o
.
label
);
return
displayRender
(
label
);
}
clearSelection
=
(
e
)
=>
{
e
.
preventDefault
();
e
.
stopPropagation
();
this
.
setValue
([]);
this
.
setState
({
popupVisible
:
false
});
}
render
()
{
const
{
prefixCls
,
children
,
placeholder
,
size
,
disabled
,
className
,
style
,
allowClear
,
...
otherProps
}
=
this
.
props
;
...
...
@@ -92,18 +114,3 @@ export default class Cascader extends React.Component {
);
}
}
Cascader
.
defaultProps
=
{
prefixCls
:
'
ant-cascader
'
,
placeholder
:
'
请选择
'
,
transitionName
:
'
slide-up
'
,
popupPlacement
:
'
bottomLeft
'
,
onChange
()
{},
options
:
[],
displayRender
(
label
)
{
return
label
.
join
(
'
/
'
);
},
disabled
:
false
,
allowClear
:
true
,
onPopupVisibleChange
()
{},
};
components/collapse/index.jsx
浏览文件 @
273e5272
...
...
@@ -2,13 +2,13 @@ import RcCollapse from 'rc-collapse';
import
React
from
'
react
'
;
export
default
class
Collapse
extends
React
.
Component
{
static
Panel
=
RcCollapse
.
Panel
;
static
defaultProps
=
{
prefixCls
:
'
ant-collapse
'
,
}
render
()
{
return
<
RcCollapse
{
...
this
.
props
}
/>;
}
}
Collapse
.
defaultProps
=
{
prefixCls
:
'
ant-collapse
'
,
};
Collapse
.
Panel
=
RcCollapse
.
Panel
;
components/dropdown/dropdown-button.jsx
浏览文件 @
273e5272
...
...
@@ -6,6 +6,19 @@ const ButtonGroup = Button.Group;
import
classNames
from
'
classnames
'
;
export
default
class
DropdownButton
extends
React
.
Component
{
static
defaultProps
=
{
align
:
{
points
:
[
'
tr
'
,
'
br
'
],
overlay
:
{
adjustX
:
1
,
adjustY
:
1
,
},
offset
:
[
0
,
4
],
targetOffset
:
[
0
,
0
],
},
type
:
'
default
'
,
}
render
()
{
const
{
type
,
overlay
,
trigger
,
align
,
children
,
className
,
...
restProps
}
=
this
.
props
;
const
cls
=
classNames
({
...
...
@@ -24,16 +37,3 @@ export default class DropdownButton extends React.Component {
);
}
}
DropdownButton
.
defaultProps
=
{
align
:
{
points
:
[
'
tr
'
,
'
br
'
],
overlay
:
{
adjustX
:
1
,
adjustY
:
1
,
},
offset
:
[
0
,
4
],
targetOffset
:
[
0
,
0
],
},
type
:
'
default
'
,
};
components/dropdown/dropdown.jsx
浏览文件 @
273e5272
...
...
@@ -2,6 +2,13 @@ import React from 'react';
import
RcDropdown
from
'
rc-dropdown
'
;
export
default
class
Dropdown
extends
React
.
Component
{
static
defaultProps
=
{
transitionName
:
'
slide-up
'
,
prefixCls
:
'
ant-dropdown
'
,
mouseEnterDelay
:
0.15
,
mouseLeaveDelay
:
0.1
,
}
render
()
{
const
{
overlay
,
...
otherProps
}
=
this
.
props
;
const
menu
=
React
.
cloneElement
(
overlay
,
{
...
...
@@ -12,10 +19,3 @@ export default class Dropdown extends React.Component {
);
}
}
Dropdown
.
defaultProps
=
{
transitionName
:
'
slide-up
'
,
prefixCls
:
'
ant-dropdown
'
,
mouseEnterDelay
:
0.15
,
mouseLeaveDelay
:
0.1
,
};
components/form/Form.jsx
浏览文件 @
273e5272
...
...
@@ -2,6 +2,26 @@ import React from 'react';
import
classNames
from
'
classnames
'
;
export
default
class
Form
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
:
'
ant-form
'
,
onSubmit
(
e
)
{
e
.
preventDefault
();
},
}
static
propTypes
=
{
prefixCls
:
React
.
PropTypes
.
string
,
horizontal
:
React
.
PropTypes
.
bool
,
inline
:
React
.
PropTypes
.
bool
,
form
:
React
.
PropTypes
.
object
,
children
:
React
.
PropTypes
.
any
,
onSubmit
:
React
.
PropTypes
.
func
,
}
static
childContextTypes
=
{
form
:
React
.
PropTypes
.
object
,
}
getChildContext
()
{
return
{
form
:
this
.
props
.
form
,
...
...
@@ -23,23 +43,3 @@ export default class Form extends React.Component {
);
}
}
Form
.
propTypes
=
{
prefixCls
:
React
.
PropTypes
.
string
,
horizontal
:
React
.
PropTypes
.
bool
,
inline
:
React
.
PropTypes
.
bool
,
form
:
React
.
PropTypes
.
object
,
children
:
React
.
PropTypes
.
any
,
onSubmit
:
React
.
PropTypes
.
func
,
};
Form
.
defaultProps
=
{
prefixCls
:
'
ant-form
'
,
onSubmit
(
e
)
{
e
.
preventDefault
();
},
};
Form
.
childContextTypes
=
{
form
:
React
.
PropTypes
.
object
,
};
components/form/FormItem.jsx
浏览文件 @
273e5272
...
...
@@ -8,6 +8,28 @@ function prefixClsFn(prefixCls, ...args) {
}
export
default
class
FormItem
extends
React
.
Component
{
static
defaultProps
=
{
hasFeedback
:
false
,
prefixCls
:
'
ant-form
'
,
}
static
propTypes
=
{
prefixCls
:
React
.
PropTypes
.
string
,
label
:
React
.
PropTypes
.
node
,
labelCol
:
React
.
PropTypes
.
object
,
help
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
node
,
React
.
PropTypes
.
bool
]),
validateStatus
:
React
.
PropTypes
.
oneOf
([
''
,
'
success
'
,
'
warning
'
,
'
error
'
,
'
validating
'
]),
hasFeedback
:
React
.
PropTypes
.
bool
,
wrapperCol
:
React
.
PropTypes
.
object
,
className
:
React
.
PropTypes
.
string
,
id
:
React
.
PropTypes
.
string
,
children
:
React
.
PropTypes
.
node
,
}
static
contextTypes
=
{
form
:
React
.
PropTypes
.
object
,
}
_getLayoutClass
(
colDef
)
{
if
(
!
colDef
)
{
return
''
;
...
...
@@ -183,25 +205,3 @@ export default class FormItem extends React.Component {
return
this
.
renderFormItem
(
children
);
}
}
FormItem
.
propTypes
=
{
prefixCls
:
React
.
PropTypes
.
string
,
label
:
React
.
PropTypes
.
node
,
labelCol
:
React
.
PropTypes
.
object
,
help
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
node
,
React
.
PropTypes
.
bool
]),
validateStatus
:
React
.
PropTypes
.
oneOf
([
''
,
'
success
'
,
'
warning
'
,
'
error
'
,
'
validating
'
]),
hasFeedback
:
React
.
PropTypes
.
bool
,
wrapperCol
:
React
.
PropTypes
.
object
,
className
:
React
.
PropTypes
.
string
,
id
:
React
.
PropTypes
.
string
,
children
:
React
.
PropTypes
.
node
,
};
FormItem
.
defaultProps
=
{
hasFeedback
:
false
,
prefixCls
:
'
ant-form
'
,
};
FormItem
.
contextTypes
=
{
form
:
React
.
PropTypes
.
object
,
};
components/input-number/index.jsx
浏览文件 @
273e5272
...
...
@@ -3,6 +3,11 @@ import classNames from 'classnames';
import
RcInputNumber
from
'
rc-input-number
'
;
export
default
class
InputNumber
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
:
'
ant-input-number
'
,
step
:
1
,
}
render
()
{
const
{
className
,
size
,
...
other
}
=
this
.
props
;
const
inputNumberClass
=
classNames
({
...
...
@@ -14,8 +19,3 @@ export default class InputNumber extends React.Component {
return
<
RcInputNumber
className
=
{
inputNumberClass
}
{
...
other
}
/>;
}
}
InputNumber
.
defaultProps
=
{
prefixCls
:
'
ant-input-number
'
,
step
:
1
,
};
components/input/index.jsx
浏览文件 @
273e5272
...
...
@@ -17,6 +17,10 @@ function fixControlledValue(value) {
}
class
Group
extends
React
.
Component
{
static
propTypes
=
{
children
:
React
.
PropTypes
.
any
,
}
render
()
{
const
className
=
classNames
({
'
ant-input-group
'
:
true
,
...
...
@@ -30,11 +34,32 @@ class Group extends React.Component {
}
}
Group
.
propTypes
=
{
children
:
React
.
PropTypes
.
any
,
};
export
default
class
Input
extends
React
.
Component
{
static
Group
=
Group
;
static
defaultProps
=
{
defaultValue
:
''
,
disabled
:
false
,
prefixCls
:
'
ant-input
'
,
type
:
'
text
'
,
}
static
propTypes
=
{
type
:
React
.
PropTypes
.
string
,
id
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
string
,
React
.
PropTypes
.
number
,
]),
size
:
React
.
PropTypes
.
oneOf
([
'
small
'
,
'
default
'
,
'
large
'
]),
disabled
:
React
.
PropTypes
.
bool
,
value
:
React
.
PropTypes
.
any
,
defaultValue
:
React
.
PropTypes
.
any
,
className
:
React
.
PropTypes
.
string
,
addonBefore
:
React
.
PropTypes
.
node
,
addonAfter
:
React
.
PropTypes
.
node
,
prefixCls
:
React
.
PropTypes
.
string
,
}
class
Input
extends
React
.
Component
{
renderLabledInput
(
children
)
{
const
props
=
this
.
props
;
const
wrapperClassName
=
`
${
props
.
prefixCls
}
-group`
;
...
...
@@ -98,29 +123,3 @@ class Input extends React.Component {
return
this
.
renderLabledInput
(
this
.
renderInput
());
}
}
Input
.
propTypes
=
{
type
:
React
.
PropTypes
.
string
,
id
:
React
.
PropTypes
.
oneOfType
([
React
.
PropTypes
.
string
,
React
.
PropTypes
.
number
,
]),
size
:
React
.
PropTypes
.
oneOf
([
'
small
'
,
'
default
'
,
'
large
'
]),
disabled
:
React
.
PropTypes
.
bool
,
value
:
React
.
PropTypes
.
any
,
defaultValue
:
React
.
PropTypes
.
any
,
className
:
React
.
PropTypes
.
string
,
addonBefore
:
React
.
PropTypes
.
node
,
addonAfter
:
React
.
PropTypes
.
node
,
prefixCls
:
React
.
PropTypes
.
string
,
};
Input
.
defaultProps
=
{
defaultValue
:
''
,
disabled
:
false
,
prefixCls
:
'
ant-input
'
,
type
:
'
text
'
,
};
Input
.
Group
=
Group
;
export
default
Input
;
components/locale-provider/index.jsx
浏览文件 @
273e5272
...
...
@@ -2,30 +2,34 @@ import React from 'react';
import
{
changeConfirmLocale
}
from
'
../modal/confirm
'
;
export
default
class
LocaleProvider
extends
React
.
Component
{
static
propTypes
=
{
locale
:
React
.
PropTypes
.
object
,
}
static
childContextTypes
=
{
antLocale
:
React
.
PropTypes
.
object
,
}
getChildContext
()
{
return
{
antLocale
:
this
.
props
.
locale
,
};
}
componentDidMount
()
{
this
.
componentDidUpdate
();
}
componentDidUpdate
()
{
const
{
locale
}
=
this
.
props
;
changeConfirmLocale
(
locale
&&
locale
.
Modal
);
}
componentWillUnMount
()
{
changeConfirmLocale
();
}
render
()
{
return
React
.
Children
.
only
(
this
.
props
.
children
);
}
}
LocaleProvider
.
childContextTypes
=
{
antLocale
:
React
.
PropTypes
.
object
,
};
LocaleProvider
.
propTypes
=
{
locale
:
React
.
PropTypes
.
object
,
};
components/pagination/index.jsx
浏览文件 @
273e5272
...
...
@@ -4,14 +4,24 @@ import Select from '../select';
import
zhCN
from
'
./locale/zh_CN
'
;
class
MiniSelect
extends
React
.
Component
{
static
Option
=
Select
.
Option
;
render
()
{
return
<
Select
size
=
"small"
{
...
this
.
props
}
/>;
}
}
MiniSelect
.
Option
=
Select
.
Option
;
export
default
class
Pagination
extends
React
.
Component
{
static
defaultProps
=
{
locale
:
zhCN
,
className
:
''
,
prefixCls
:
'
ant-pagination
'
,
}
static
contextTypes
=
{
antLocale
:
React
.
PropTypes
.
object
,
}
render
()
{
let
className
=
this
.
props
.
className
;
let
selectComponentClass
=
Select
;
...
...
@@ -37,13 +47,3 @@ export default class Pagination extends React.Component {
);
}
}
Pagination
.
defaultProps
=
{
locale
:
zhCN
,
className
:
''
,
prefixCls
:
'
ant-pagination
'
,
};
Pagination
.
contextTypes
=
{
antLocale
:
React
.
PropTypes
.
object
,
};
components/popover/index.jsx
浏览文件 @
273e5272
...
...
@@ -6,6 +6,15 @@ const placements = getPlacements();
const
prefixCls
=
'
ant-popover
'
;
export
default
class
Popover
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
,
placement
:
'
top
'
,
trigger
:
'
hover
'
,
mouseEnterDelay
:
0.1
,
mouseLeaveDelay
:
0.1
,
overlayStyle
:
{}
}
render
()
{
const
transitionName
=
({
top
:
'
zoom-down
'
,
...
...
@@ -48,12 +57,3 @@ export default class Popover extends React.Component {
);
}
}
Popover
.
defaultProps
=
{
prefixCls
,
placement
:
'
top
'
,
trigger
:
'
hover
'
,
mouseEnterDelay
:
0.1
,
mouseLeaveDelay
:
0.1
,
overlayStyle
:
{}
};
components/select/index.jsx
浏览文件 @
273e5272
...
...
@@ -3,6 +3,17 @@ import RcSelect, { Option, OptGroup } from 'rc-select';
import
classNames
from
'
classnames
'
;
export
default
class
Select
extends
React
.
Component
{
static
Option
=
Option
;
static
OptGroup
=
OptGroup
;
static
defaultProps
=
{
prefixCls
:
'
ant-select
'
,
transitionName
:
'
slide-up
'
,
optionLabelProp
:
'
children
'
,
choiceTransitionName
:
'
zoom
'
,
showSearch
:
false
,
}
render
()
{
let
{
size
,
className
,
combobox
,
notFoundContent
...
...
@@ -25,14 +36,3 @@ export default class Select extends React.Component {
);
}
}
Select
.
defaultProps
=
{
prefixCls
:
'
ant-select
'
,
transitionName
:
'
slide-up
'
,
optionLabelProp
:
'
children
'
,
choiceTransitionName
:
'
zoom
'
,
showSearch
:
false
,
};
Select
.
Option
=
Option
;
Select
.
OptGroup
=
OptGroup
;
components/slider/index.jsx
浏览文件 @
273e5272
...
...
@@ -2,6 +2,11 @@ import React from 'react';
import
RcSlider
from
'
rc-slider
'
;
export
default
class
Slider
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
:
'
ant-slider
'
,
tipTransitionName
:
'
zoom-down
'
}
render
()
{
const
{
isIncluded
,
marks
,
index
,
defaultIndex
,
...
rest
}
=
this
.
props
;
...
...
@@ -34,8 +39,3 @@ export default class Slider extends React.Component {
return
<
RcSlider
{
...
rest
}
/>;
}
}
Slider
.
defaultProps
=
{
prefixCls
:
'
ant-slider
'
,
tipTransitionName
:
'
zoom-down
'
};
components/spin/index.jsx
浏览文件 @
273e5272
...
...
@@ -3,6 +3,16 @@ import classNames from 'classnames';
import
{
isCssAnimationSupported
}
from
'
css-animation
'
;
export
default
class
Spin
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
:
'
ant-spin
'
,
spining
:
true
,
}
static
propTypes
=
{
className
:
React
.
PropTypes
.
string
,
size
:
React
.
PropTypes
.
oneOf
([
'
small
'
,
'
default
'
,
'
large
'
]),
}
isNestedPattern
()
{
return
!!
(
this
.
props
&&
this
.
props
.
children
);
}
...
...
@@ -45,13 +55,3 @@ export default class Spin extends React.Component {
return
spinElement
;
}
}
Spin
.
defaultProps
=
{
prefixCls
:
'
ant-spin
'
,
spining
:
true
,
};
Spin
.
propTypes
=
{
className
:
React
.
PropTypes
.
string
,
size
:
React
.
PropTypes
.
oneOf
([
'
small
'
,
'
default
'
,
'
large
'
]),
};
components/steps/index.jsx
浏览文件 @
273e5272
...
...
@@ -2,6 +2,15 @@ import React from 'react';
import
RcSteps
from
'
rc-steps
'
;
export
default
class
Steps
extends
React
.
Component
{
static
Step
=
RcSteps
.
Step
;
static
defaultProps
=
{
prefixCls
:
'
ant-steps
'
,
iconPrefix
:
'
ant
'
,
maxDescriptionWidth
:
100
,
current
:
0
}
render
()
{
let
maxDescriptionWidth
=
this
.
props
.
maxDescriptionWidth
;
if
(
this
.
props
.
direction
===
'
vertical
'
)
{
...
...
@@ -19,12 +28,3 @@ export default class Steps extends React.Component {
);
}
}
Steps
.
defaultProps
=
{
prefixCls
:
'
ant-steps
'
,
iconPrefix
:
'
ant
'
,
maxDescriptionWidth
:
100
,
current
:
0
};
Steps
.
Step
=
RcSteps
.
Step
;
components/switch/index.jsx
浏览文件 @
273e5272
...
...
@@ -3,6 +3,10 @@ import React from 'react';
import
classNames
from
'
classnames
'
;
export
default
class
Switch
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
:
'
ant-switch
'
,
}
render
()
{
const
{
prefixCls
,
size
,
className
}
=
this
.
props
;
const
cls
=
classNames
({
...
...
@@ -12,7 +16,3 @@ export default class Switch extends React.Component {
return
<
RcSwitch
className
=
{
cls
}
{
...
this
.
props
}
/>;
}
}
Switch
.
defaultProps
=
{
prefixCls
:
'
ant-switch
'
,
};
components/tabs/index.jsx
浏览文件 @
273e5272
...
...
@@ -4,9 +4,20 @@ import classNames from 'classnames';
import
Icon
from
'
../icon
'
;
export
default
class
Tabs
extends
React
.
Component
{
static
TabPane
=
RcTabs
.
TabPane
;
static
defaultProps
=
{
prefixCls
:
'
ant-tabs
'
,
animation
:
'
slide-horizontal
'
,
type
:
'
line
'
,
// or 'card' 'editable-card'
onChange
()
{},
onEdit
()
{},
}
createNewTab
=
(
targetKey
)
=>
{
this
.
props
.
onEdit
(
targetKey
,
'
add
'
);
}
removeTab
=
(
targetKey
,
e
)
=>
{
e
.
stopPropagation
();
if
(
!
targetKey
)
{
...
...
@@ -14,9 +25,11 @@ export default class Tabs extends React.Component {
}
this
.
props
.
onEdit
(
targetKey
,
'
remove
'
);
}
handleChange
=
(
activeKey
)
=>
{
this
.
props
.
onChange
(
activeKey
);
}
render
()
{
let
{
prefixCls
,
size
,
tabPosition
,
animation
,
type
,
children
,
tabBarExtraContent
}
=
this
.
props
;
...
...
@@ -65,13 +78,3 @@ export default class Tabs extends React.Component {
);
}
}
Tabs
.
defaultProps
=
{
prefixCls
:
'
ant-tabs
'
,
animation
:
'
slide-horizontal
'
,
type
:
'
line
'
,
// or 'card' 'editable-card'
onChange
()
{},
onEdit
()
{},
};
Tabs
.
TabPane
=
RcTabs
.
TabPane
;
components/tag/index.jsx
浏览文件 @
273e5272
...
...
@@ -5,6 +5,13 @@ import Icon from '../icon';
import
classNames
from
'
classnames
'
;
export
default
class
Tag
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
:
'
ant-tag
'
,
closable
:
false
,
onClose
()
{},
afterClose
()
{},
}
constructor
(
props
)
{
super
(
props
);
...
...
@@ -61,10 +68,3 @@ export default class Tag extends React.Component {
);
}
}
Tag
.
defaultProps
=
{
prefixCls
:
'
ant-tag
'
,
closable
:
false
,
onClose
()
{},
afterClose
()
{},
};
components/timeline/index.jsx
浏览文件 @
273e5272
...
...
@@ -3,6 +3,13 @@ import classNames from 'classnames';
/* Exported as Timeline.Item */
class
TimelineItem
extends
React
.
Component
{
static
defaultProps
=
{
prefixCls
:
'
ant-timeline
'
,
color
:
'
blue
'
,
last
:
false
,
pending
:
false
,
}
render
()
{
const
{
prefixCls
,
color
,
last
,
children
,
pending
}
=
this
.
props
;
const
itemClassName
=
classNames
({
...
...
@@ -20,14 +27,13 @@ class TimelineItem extends React.Component {
}
}
TimelineItem
.
defaultProps
=
{
prefixCls
:
'
ant-timeline
'
,
color
:
'
blue
'
,
last
:
false
,
pending
:
false
,
};
export
default
class
Timeline
extends
React
.
Component
{
static
Item
=
TimelineItem
;
static
defaultProps
=
{
prefixCls
:
'
ant-timeline
'
,
}
render
()
{
const
{
prefixCls
,
children
,
pending
}
=
this
.
props
;
const
pendingNode
=
typeof
pending
===
'
boolean
'
?
null
:
pending
;
...
...
@@ -51,9 +57,3 @@ export default class Timeline extends React.Component {
);
}
}
Timeline
.
defaultProps
=
{
prefixCls
:
'
ant-timeline
'
,
};
Timeline
.
Item
=
TimelineItem
;
components/transfer/index.jsx
浏览文件 @
273e5272
...
...
@@ -8,6 +8,40 @@ function noop() {
}
export
default
class
Transfer
extends
React
.
Component
{
static
List
=
List
;
static
Operation
=
Operation
;
static
Search
=
Search
;
static
defaultProps
=
{
prefixCls
:
'
ant-transfer
'
,
dataSource
:
[],
render
:
noop
,
targetKeys
:
[],
onChange
:
noop
,
titles
:
[
'
源列表
'
,
'
目的列表
'
],
operations
:
[],
showSearch
:
false
,
body
:
noop
,
footer
:
noop
,
}
static
propTypes
=
{
prefixCls
:
PropTypes
.
string
,
dataSource
:
PropTypes
.
array
,
render
:
PropTypes
.
func
,
targetKeys
:
PropTypes
.
array
,
onChange
:
PropTypes
.
func
,
height
:
PropTypes
.
number
,
listStyle
:
PropTypes
.
object
,
className
:
PropTypes
.
string
,
titles
:
PropTypes
.
array
,
operations
:
PropTypes
.
array
,
showSearch
:
PropTypes
.
bool
,
searchPlaceholder
:
PropTypes
.
string
,
notFoundContent
:
PropTypes
.
node
,
body
:
PropTypes
.
func
,
footer
:
PropTypes
.
func
,
}
constructor
(
props
)
{
super
(
props
);
...
...
@@ -213,38 +247,3 @@ export default class Transfer extends React.Component {
);
}
}
Transfer
.
defaultProps
=
{
prefixCls
:
'
ant-transfer
'
,
dataSource
:
[],
render
:
noop
,
targetKeys
:
[],
onChange
:
noop
,
titles
:
[
'
源列表
'
,
'
目的列表
'
],
operations
:
[],
showSearch
:
false
,
body
:
noop
,
footer
:
noop
,
};
Transfer
.
propTypes
=
{
prefixCls
:
PropTypes
.
string
,
dataSource
:
PropTypes
.
array
,
render
:
PropTypes
.
func
,
targetKeys
:
PropTypes
.
array
,
onChange
:
PropTypes
.
func
,
height
:
PropTypes
.
number
,
listStyle
:
PropTypes
.
object
,
className
:
PropTypes
.
string
,
titles
:
PropTypes
.
array
,
operations
:
PropTypes
.
array
,
showSearch
:
PropTypes
.
bool
,
searchPlaceholder
:
PropTypes
.
string
,
notFoundContent
:
PropTypes
.
node
,
body
:
PropTypes
.
func
,
footer
:
PropTypes
.
func
,
};
Transfer
.
List
=
List
;
Transfer
.
Operation
=
Operation
;
Transfer
.
Search
=
Search
;
components/transfer/list.jsx
浏览文件 @
273e5272
...
...
@@ -8,6 +8,37 @@ function noop() {
}
export
default
class
TransferList
extends
React
.
Component
{
static
defaultProps
=
{
dataSource
:
[],
titleText
:
''
,
showSearch
:
false
,
handleFilter
:
noop
,
handleSelect
:
noop
,
handleSelectAll
:
noop
,
render
:
noop
,
// advanced
body
:
noop
,
footer
:
noop
,
}
static
propTypes
=
{
prefixCls
:
PropTypes
.
string
,
dataSource
:
PropTypes
.
array
,
showSearch
:
PropTypes
.
bool
,
searchPlaceholder
:
PropTypes
.
string
,
titleText
:
PropTypes
.
string
,
style
:
PropTypes
.
object
,
handleFilter
:
PropTypes
.
func
,
handleSelect
:
PropTypes
.
func
,
handleSelectAll
:
PropTypes
.
func
,
render
:
PropTypes
.
func
,
body
:
PropTypes
.
func
,
footer
:
PropTypes
.
func
,
}
static
contextTypes
=
{
antLocale
:
React
.
PropTypes
.
object
,
}
constructor
(
props
)
{
super
(
props
);
...
...
@@ -151,35 +182,3 @@ export default class TransferList extends React.Component {
);
}
}
TransferList
.
defaultProps
=
{
dataSource
:
[],
titleText
:
''
,
showSearch
:
false
,
handleFilter
:
noop
,
handleSelect
:
noop
,
handleSelectAll
:
noop
,
render
:
noop
,
// advanced
body
:
noop
,
footer
:
noop
,
};
TransferList
.
propTypes
=
{
prefixCls
:
PropTypes
.
string
,
dataSource
:
PropTypes
.
array
,
showSearch
:
PropTypes
.
bool
,
searchPlaceholder
:
PropTypes
.
string
,
titleText
:
PropTypes
.
string
,
style
:
PropTypes
.
object
,
handleFilter
:
PropTypes
.
func
,
handleSelect
:
PropTypes
.
func
,
handleSelectAll
:
PropTypes
.
func
,
render
:
PropTypes
.
func
,
body
:
PropTypes
.
func
,
footer
:
PropTypes
.
func
,
};
TransferList
.
contextTypes
=
{
antLocale
:
React
.
PropTypes
.
object
,
};
components/transfer/operation.jsx
浏览文件 @
273e5272
...
...
@@ -6,6 +6,21 @@ function noop() {
}
export
default
class
TransferOperation
extends
React
.
Component
{
static
defaultProps
=
{
leftArrowText
:
''
,
rightArrowText
:
''
,
moveToLeft
:
noop
,
moveToRight
:
noop
,
}
static
propTypes
=
{
className
:
PropTypes
.
string
,
leftArrowText
:
PropTypes
.
string
,
rightArrowText
:
PropTypes
.
string
,
moveToLeft
:
PropTypes
.
func
,
moveToRight
:
PropTypes
.
func
,
}
render
()
{
const
{
moveToLeft
,
...
...
@@ -35,18 +50,3 @@ export default class TransferOperation extends React.Component {
);
}
}
TransferOperation
.
defaultProps
=
{
leftArrowText
:
''
,
rightArrowText
:
''
,
moveToLeft
:
noop
,
moveToRight
:
noop
,
};
TransferOperation
.
propTypes
=
{
className
:
PropTypes
.
string
,
leftArrowText
:
PropTypes
.
string
,
rightArrowText
:
PropTypes
.
string
,
moveToLeft
:
PropTypes
.
func
,
moveToRight
:
PropTypes
.
func
,
};
components/transfer/search.jsx
浏览文件 @
273e5272
...
...
@@ -4,6 +4,19 @@ function noop() {
}
export
default
class
Search
extends
React
.
Component
{
static
defaultProps
=
{
placeholder
:
''
,
onChange
:
noop
,
handleClear
:
noop
,
}
static
propTypes
=
{
prefixCls
:
PropTypes
.
string
,
placeholder
:
PropTypes
.
string
,
onChange
:
PropTypes
.
func
,
handleClear
:
PropTypes
.
func
,
}
handleChange
=
(
e
)
=>
{
this
.
props
.
onChange
(
e
);
}
...
...
@@ -29,16 +42,3 @@ export default class Search extends React.Component {
);
}
}
Search
.
defaultProps
=
{
placeholder
:
''
,
onChange
:
noop
,
handleClear
:
noop
,
};
Search
.
propTypes
=
{
prefixCls
:
PropTypes
.
string
,
placeholder
:
PropTypes
.
string
,
onChange
:
PropTypes
.
func
,
handleClear
:
PropTypes
.
func
,
};
components/tree-select/index.jsx
浏览文件 @
273e5272
...
...
@@ -3,6 +3,18 @@ import RcTreeSelect, { TreeNode, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from 'rc-tr
import
classNames
from
'
classnames
'
;
export
default
class
TreeSelect
extends
React
.
Component
{
static
TreeNode
=
TreeNode
;
static
SHOW_ALL
=
SHOW_ALL
;
static
SHOW_PARENT
=
SHOW_PARENT
;
static
SHOW_CHILD
=
SHOW_CHILD
;
static
defaultProps
=
{
prefixCls
:
'
ant-select
'
,
transitionName
:
'
slide-up
'
,
choiceTransitionName
:
'
zoom
'
,
showSearch
:
false
,
}
render
()
{
const
props
=
this
.
props
;
let
{
...
...
@@ -32,15 +44,3 @@ export default class TreeSelect extends React.Component {
);
}
}
TreeSelect
.
defaultProps
=
{
prefixCls
:
'
ant-select
'
,
transitionName
:
'
slide-up
'
,
choiceTransitionName
:
'
zoom
'
,
showSearch
:
false
,
};
TreeSelect
.
TreeNode
=
TreeNode
;
TreeSelect
.
SHOW_ALL
=
SHOW_ALL
;
TreeSelect
.
SHOW_PARENT
=
SHOW_PARENT
;
TreeSelect
.
SHOW_CHILD
=
SHOW_CHILD
;
components/tree/index.jsx
浏览文件 @
273e5272
...
...
@@ -3,6 +3,15 @@ import RcTree from 'rc-tree';
import
animation
from
'
../common/openAnimation
'
;
export
default
class
Tree
extends
React
.
Component
{
static
TreeNode
=
RcTree
.
TreeNode
;
static
defaultProps
=
{
prefixCls
:
'
ant-tree
'
,
checkable
:
false
,
showIcon
:
false
,
openAnimation
:
animation
,
}
render
()
{
const
props
=
this
.
props
;
let
checkable
=
props
.
checkable
;
...
...
@@ -16,12 +25,3 @@ export default class Tree extends React.Component {
);
}
}
Tree
.
defaultProps
=
{
prefixCls
:
'
ant-tree
'
,
checkable
:
false
,
showIcon
:
false
,
openAnimation
:
animation
,
};
Tree
.
TreeNode
=
RcTree
.
TreeNode
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录