Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
2482140d
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,发现更多精彩内容 >>
提交
2482140d
编写于
3月 05, 2016
作者:
A
afc163
提交者:
Benjy Cui
3月 10, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change context locale name
上级
193eb144
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
26 addition
and
25 deletion
+26
-25
components/date-picker/PickerMixin.jsx
components/date-picker/PickerMixin.jsx
+3
-3
components/locale-provider/demo/all.md
components/locale-provider/demo/all.md
+3
-2
components/locale-provider/index.jsx
components/locale-provider/index.jsx
+3
-3
components/modal/Modal.jsx
components/modal/Modal.jsx
+4
-4
components/pagination/index.jsx
components/pagination/index.jsx
+3
-3
components/popconfirm/index.jsx
components/popconfirm/index.jsx
+4
-4
components/table/index.jsx
components/table/index.jsx
+3
-3
components/time-picker/index.jsx
components/time-picker/index.jsx
+3
-3
未找到文件。
components/date-picker/PickerMixin.jsx
浏览文件 @
2482140d
...
...
@@ -6,13 +6,13 @@ import GregorianCalendar from 'gregorian-calendar';
export
default
{
contextTypes
:
{
l
ocale
:
React
.
PropTypes
.
object
,
antL
ocale
:
React
.
PropTypes
.
object
,
},
getLocale
()
{
let
locale
=
defaultLocale
;
if
(
this
.
context
.
locale
&&
this
.
context
.
l
ocale
.
DatePicker
)
{
locale
=
this
.
context
.
l
ocale
.
DatePicker
;
if
(
this
.
context
.
antLocale
&&
this
.
context
.
antL
ocale
.
DatePicker
)
{
locale
=
this
.
context
.
antL
ocale
.
DatePicker
;
}
// 统一合并为完整的 Locale
const
result
=
objectAssign
({},
locale
,
this
.
props
.
locale
);
...
...
components/locale-provider/demo/all.md
浏览文件 @
2482140d
...
...
@@ -7,7 +7,8 @@
---
````
jsx
import
{
LocaleProvider
,
Pagination
,
DatePicker
,
TimePicker
,
Popconfirm
,
Table
,
Modal
,
Button
,
Select
}
from
'
antd
'
;
import
{
LocaleProvider
,
Pagination
,
DatePicker
,
TimePicker
,
Popconfirm
,
Table
,
Modal
,
Button
,
Select
}
from
'
antd
'
;
import
enUS
from
'
antd/lib/locale-provider/en_US
'
;
const
Option
=
Select
.
Option
;
...
...
@@ -68,7 +69,7 @@ const App = React.createClass({
<
div
>
<
LocaleProvider
locale
=
{
this
.
state
.
locale
}
><
Page
/></
LocaleProvider
>
<
div
>
<
Select
defaultValue
=
{
enUS
}
onChange
=
{
this
.
changeLocale
}
>
<
Select
defaultValue
=
{
enUS
}
onChange
=
{
this
.
changeLocale
}
dropdownMatchSelectWidth
=
{
false
}
>
<
Option
value
=
{
enUS
}
>
English
</
Option
>
<
Option
value
=
{
null
}
>
中文
</
Option
>
</
Select
>
...
...
components/locale-provider/index.jsx
浏览文件 @
2482140d
...
...
@@ -3,16 +3,16 @@ import React from 'react';
export
default
class
LocaleProvider
extends
React
.
Component
{
getChildContext
()
{
return
{
l
ocale
:
this
.
props
.
locale
,
antL
ocale
:
this
.
props
.
locale
,
};
}
render
()
{
return
React
.
cloneElement
(
this
.
props
.
children
);
return
React
.
Children
.
only
(
this
.
props
.
children
);
}
}
LocaleProvider
.
childContextTypes
=
{
l
ocale
:
React
.
PropTypes
.
object
,
antL
ocale
:
React
.
PropTypes
.
object
,
};
LocaleProvider
.
propTypes
=
{
...
...
components/modal/Modal.jsx
浏览文件 @
2482140d
...
...
@@ -23,7 +23,7 @@ let AntModal = React.createClass({
},
contextTypes
:
{
l
ocale
:
React
.
PropTypes
.
object
,
antL
ocale
:
React
.
PropTypes
.
object
,
},
handleCancel
(
e
)
{
...
...
@@ -56,9 +56,9 @@ let AntModal = React.createClass({
let
props
=
this
.
props
;
let
{
okText
,
cancelText
}
=
props
;
if
(
this
.
context
.
locale
&&
this
.
context
.
l
ocale
.
Modal
)
{
okText
=
okText
||
this
.
context
.
l
ocale
.
Modal
.
okText
;
cancelText
=
cancelText
||
this
.
context
.
l
ocale
.
Modal
.
cancelText
;
if
(
this
.
context
.
antLocale
&&
this
.
context
.
antL
ocale
.
Modal
)
{
okText
=
okText
||
this
.
context
.
antL
ocale
.
Modal
.
okText
;
cancelText
=
cancelText
||
this
.
context
.
antL
ocale
.
Modal
.
cancelText
;
}
let
defaultFooter
=
[
...
...
components/pagination/index.jsx
浏览文件 @
2482140d
...
...
@@ -17,8 +17,8 @@ class AntPagination extends React.Component {
let
selectComponentClass
=
Select
;
let
locale
;
if
(
this
.
context
.
locale
&&
this
.
context
.
l
ocale
.
Pagination
)
{
locale
=
this
.
context
.
l
ocale
.
Pagination
;
if
(
this
.
context
.
antLocale
&&
this
.
context
.
antL
ocale
.
Pagination
)
{
locale
=
this
.
context
.
antL
ocale
.
Pagination
;
}
else
{
locale
=
this
.
props
.
locale
;
}
...
...
@@ -45,7 +45,7 @@ AntPagination.defaultProps = {
};
AntPagination
.
contextTypes
=
{
l
ocale
:
React
.
PropTypes
.
object
,
antL
ocale
:
React
.
PropTypes
.
object
,
};
export
default
AntPagination
;
components/popconfirm/index.jsx
浏览文件 @
2482140d
...
...
@@ -38,7 +38,7 @@ export default React.createClass({
};
},
contextTypes
:
{
l
ocale
:
React
.
PropTypes
.
object
,
antL
ocale
:
React
.
PropTypes
.
object
,
},
componentWillReceiveProps
(
nextProps
)
{
if
(
'
visible
'
in
nextProps
)
{
...
...
@@ -65,9 +65,9 @@ export default React.createClass({
render
()
{
const
{
title
,
placement
,
overlayStyle
,
trigger
,
...
restProps
}
=
this
.
props
;
let
{
okText
,
cancelText
}
=
this
.
props
;
if
(
this
.
context
.
locale
&&
this
.
context
.
l
ocale
.
Popconfirm
)
{
okText
=
okText
||
this
.
context
.
l
ocale
.
Popconfirm
.
okText
;
cancelText
=
cancelText
||
this
.
context
.
l
ocale
.
Popconfirm
.
cancelText
;
if
(
this
.
context
.
antLocale
&&
this
.
context
.
antL
ocale
.
Popconfirm
)
{
okText
=
okText
||
this
.
context
.
antL
ocale
.
Popconfirm
.
okText
;
cancelText
=
cancelText
||
this
.
context
.
antL
ocale
.
Popconfirm
.
cancelText
;
}
const
overlay
=
(
<
div
>
...
...
components/table/index.jsx
浏览文件 @
2482140d
...
...
@@ -75,7 +75,7 @@ let AntTable = React.createClass({
},
contextTypes
:
{
l
ocale
:
React
.
PropTypes
.
object
,
antL
ocale
:
React
.
PropTypes
.
object
,
},
getDefaultSelection
()
{
...
...
@@ -89,8 +89,8 @@ let AntTable = React.createClass({
getLocale
()
{
let
locale
=
{};
if
(
this
.
context
.
locale
&&
this
.
context
.
l
ocale
.
Table
)
{
locale
=
this
.
context
.
l
ocale
.
Table
;
if
(
this
.
context
.
antLocale
&&
this
.
context
.
antL
ocale
.
Table
)
{
locale
=
this
.
context
.
antL
ocale
.
Table
;
}
return
objectAssign
({},
defaultLocale
,
locale
,
this
.
props
.
locale
);
},
...
...
components/time-picker/index.jsx
浏览文件 @
2482140d
...
...
@@ -28,7 +28,7 @@ const AntTimePicker = React.createClass({
},
contextTypes
:
{
l
ocale
:
React
.
PropTypes
.
object
,
antL
ocale
:
React
.
PropTypes
.
object
,
},
getFormatter
()
{
...
...
@@ -73,8 +73,8 @@ const AntTimePicker = React.createClass({
getLocale
()
{
let
locale
=
defaultLocale
;
if
(
this
.
context
.
locale
&&
this
.
context
.
l
ocale
.
TimePicker
)
{
locale
=
this
.
context
.
l
ocale
.
TimePicker
;
if
(
this
.
context
.
antLocale
&&
this
.
context
.
antL
ocale
.
TimePicker
)
{
locale
=
this
.
context
.
antL
ocale
.
TimePicker
;
}
// 统一合并为完整的 Locale
return
objectAssign
({},
locale
,
this
.
props
.
locale
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录