diff --git a/README-zh_CN.md b/README-zh_CN.md
index ce54a827a3e2176725e8ece8110a9c7acf620e0e..9aa2c06bef3d55472deaa99e2f2ce4bfddbe4327 100644
--- a/README-zh_CN.md
+++ b/README-zh_CN.md
@@ -26,15 +26,15 @@ npm install antd
- 使用全部组件
```jsx
- import { Datepicker } from 'antd';
- ReactDOM.render(, mountNode);
+ import { DatePicker } from 'antd';
+ ReactDOM.render(, mountNode);
```
- 按需使用
```jsx
- import Datepicker from 'antd/lib/datepicker';
- ReactDOM.render(, mountNode);
+ import DatePicker from 'antd/lib/date-picker';
+ ReactDOM.render(, mountNode);
```
引入样式:
diff --git a/README.md b/README.md
index 59f6d91022e3182f7850c77573687b1559bc5013..a6dade5c32c9959e696581d0d8ac5314bc631686 100644
--- a/README.md
+++ b/README.md
@@ -25,15 +25,15 @@ npm install antd
- Use all components
```jsx
- import { Datepicker } from 'antd';
- ReactDOM.render(, mountNode);
+ import { DatePicker } from 'antd';
+ ReactDOM.render(, mountNode);
```
- Use on demand
```jsx
- import Datepicker from 'antd/lib/datepicker';
- ReactDOM.render(, mountNode);
+ import DatePicker from 'antd/lib/date-picker';
+ ReactDOM.render(, mountNode);
```
Import style:
diff --git a/components/calendar/locale/en_US.js b/components/calendar/locale/en_US.js
index b2fd69dfec9a126fe1f28bc948fdded331ced564..1fde2c098a4245f7a5421a4efdb1a672a37a5a3f 100644
--- a/components/calendar/locale/en_US.js
+++ b/components/calendar/locale/en_US.js
@@ -1 +1 @@
-module.exports = require('../../datepicker/locale/en_US');
+module.exports = require('../../date-picker/locale/en_US');
diff --git a/components/calendar/locale/zh_CN.js b/components/calendar/locale/zh_CN.js
index e54d3d1024d510675c3b55da544520c7bedd5704..1880b1a9806eff178e302e8b8eed35d4686d3597 100644
--- a/components/calendar/locale/zh_CN.js
+++ b/components/calendar/locale/zh_CN.js
@@ -1 +1 @@
-module.exports = require('../../datepicker/locale/zh_CN');
+module.exports = require('../../date-picker/locale/zh_CN');
diff --git a/components/date-picker/demo/basic.md b/components/date-picker/demo/basic.md
new file mode 100644
index 0000000000000000000000000000000000000000..602e91965c4ad68655f74fe00be7b3c440c046e1
--- /dev/null
+++ b/components/date-picker/demo/basic.md
@@ -0,0 +1,15 @@
+# 基本
+
+- order: 0
+
+最简单的用法。
+
+---
+
+````jsx
+import { DatePicker } from 'antd';
+
+ReactDOM.render(
+
+, document.getElementById('components-date-picker-demo-basic'));
+````
diff --git a/components/date-picker/demo/disabled.md b/components/date-picker/demo/disabled.md
new file mode 100644
index 0000000000000000000000000000000000000000..5fe43250ead6c43b620f8bf0c4ba5d0dde7c2762
--- /dev/null
+++ b/components/date-picker/demo/disabled.md
@@ -0,0 +1,15 @@
+# 禁用
+
+- order: 5
+
+选择框的不可用状态。
+
+---
+
+````jsx
+import { DatePicker } from 'antd';
+
+ReactDOM.render(
+
+, document.getElementById('components-date-picker-demo-disabled'));
+````
diff --git a/components/date-picker/demo/formatter.md b/components/date-picker/demo/formatter.md
new file mode 100644
index 0000000000000000000000000000000000000000..1b9f81fa8968015f2086191656f29cf70321ff6b
--- /dev/null
+++ b/components/date-picker/demo/formatter.md
@@ -0,0 +1,15 @@
+# 日期格式
+
+- order: 1
+
+使用 `format` 属性,可以自定义你需要的日期显示格式,如 `yyyy/MM/dd`。
+
+---
+
+````jsx
+import { DatePicker } from 'antd';
+
+ReactDOM.render(
+
+, document.getElementById('components-date-picker-demo-formatter'));
+````
diff --git a/components/datepicker/demo/locale.md b/components/date-picker/demo/locale.md
similarity index 72%
rename from components/datepicker/demo/locale.md
rename to components/date-picker/demo/locale.md
index 6d18da5f110df11abe9f8166aea372aa7c64c5d5..7e6975b023b5c0f6604eafc792672ade39e435a5 100644
--- a/components/datepicker/demo/locale.md
+++ b/components/date-picker/demo/locale.md
@@ -7,8 +7,8 @@
---
````jsx
-import { Datepicker } from 'antd';
-import enUS from 'antd/lib/datepicker/locale/en_US';
+import { DatePicker } from 'antd';
+import enUS from 'antd/lib/date-picker/locale/en_US';
import assign from 'object-assign';
const App = React.createClass({
@@ -22,10 +22,10 @@ const App = React.createClass({
};
},
render() {
- return ;
+ return ;
}
});
-ReactDOM.render(, document.getElementById('components-datepicker-demo-locale'));
+ReactDOM.render(, document.getElementById('components-date-picker-demo-locale'));
````
diff --git a/components/date-picker/demo/month-picker.md b/components/date-picker/demo/month-picker.md
new file mode 100644
index 0000000000000000000000000000000000000000..97b765ffcc2205d821be2abbc8a4dd75beb8af74
--- /dev/null
+++ b/components/date-picker/demo/month-picker.md
@@ -0,0 +1,15 @@
+# 月选择器
+
+- order: 9
+
+使用 MonthPicker 实现月选择器.
+
+---
+
+````jsx
+import { DatePicker } from 'antd';
+const MonthPicker = DatePicker.MonthPicker;
+ReactDOM.render(
+
+, document.getElementById('components-date-picker-demo-month-picker'));
+````
diff --git a/components/datepicker/demo/range.md b/components/date-picker/demo/range.md
similarity index 69%
rename from components/datepicker/demo/range.md
rename to components/date-picker/demo/range.md
index 1ef0cefa0e6432819a559c22631386039ddb70dd..e02ada273253372c549aa49746fe17139e4ed1f6 100644
--- a/components/datepicker/demo/range.md
+++ b/components/date-picker/demo/range.md
@@ -9,7 +9,7 @@
---
````jsx
-import { Datepicker } from 'antd';
+import { DatePicker } from 'antd';
const disabledDate = function(current, value) {
// can not select days after today
@@ -17,6 +17,6 @@ const disabledDate = function(current, value) {
};
ReactDOM.render(
-
-, document.getElementById('components-datepicker-demo-range'));
+
+, document.getElementById('components-date-picker-demo-range'));
````
diff --git a/components/datepicker/demo/select.md b/components/date-picker/demo/select.md
similarity index 65%
rename from components/datepicker/demo/select.md
rename to components/date-picker/demo/select.md
index a7f49155f1814b88ac26cafd2fffdc71f8e9baa8..7dd2e7d4566f7fca9287c1d60220ff9bb5a4255a 100644
--- a/components/datepicker/demo/select.md
+++ b/components/date-picker/demo/select.md
@@ -7,18 +7,18 @@
---
````jsx
-import { Datepicker } from 'antd';
+import { DatePicker } from 'antd';
const Picker = React.createClass({
handleChange: function(value) {
console.log(new Date(value.getTime()));
},
render: function() {
- return ;
+ return ;
}
});
ReactDOM.render(
-, document.getElementById('components-datepicker-demo-select'));
+, document.getElementById('components-date-picker-demo-select'));
````
diff --git a/components/date-picker/demo/size.md b/components/date-picker/demo/size.md
new file mode 100644
index 0000000000000000000000000000000000000000..d27a3b88239c33166a2192f24efb5c4d733efb6f
--- /dev/null
+++ b/components/date-picker/demo/size.md
@@ -0,0 +1,19 @@
+# 三种大小
+
+- order: 1
+
+三种大小的输入框,大的用在表单中,中的为默认。
+
+---
+
+````jsx
+import { DatePicker } from 'antd';
+
+ReactDOM.render(
+
-
-
@@ -50,5 +50,5 @@ const DateRange = React.createClass({
ReactDOM.render(
-, document.getElementById('components-datepicker-demo-start-end'));
+, document.getElementById('components-date-picker-demo-start-end'));
````
diff --git a/components/datepicker/demo/time.md b/components/date-picker/demo/time.md
similarity index 81%
rename from components/datepicker/demo/time.md
rename to components/date-picker/demo/time.md
index b525f9614bd670995a880a214a63edc636f06ae7..6151eb88fdb931aa0b1951c6a7117e301624865a 100644
--- a/components/datepicker/demo/time.md
+++ b/components/date-picker/demo/time.md
@@ -7,7 +7,7 @@
---
````jsx
-import { Datepicker, Timepicker } from 'antd';
+import { DatePicker, TimePicker } from 'antd';
const DateTimePicker = React.createClass({
handleChange(from, value) {
@@ -37,8 +37,8 @@ const DateTimePicker = React.createClass({
},
render() {
return
-
-
+
+
;
}
});
@@ -48,5 +48,5 @@ function onSelect(value) {
}
ReactDOM.render(
-, document.getElementById('components-datepicker-demo-time'));
+, document.getElementById('components-date-picker-demo-time'));
````
diff --git a/components/datepicker/index.jsx b/components/date-picker/index.jsx
similarity index 98%
rename from components/datepicker/index.jsx
rename to components/date-picker/index.jsx
index d0ca23241ef9ec7f4a897798162a49ed0acb179d..040ae125cae5550a6afb7e10460a262f50dceaae 100644
--- a/components/datepicker/index.jsx
+++ b/components/date-picker/index.jsx
@@ -1,7 +1,7 @@
import React from 'react';
import Calendar from 'rc-calendar';
import MonthCalendar from 'rc-calendar/lib/MonthCalendar';
-import Datepicker from 'rc-calendar/lib/Picker';
+import DatePicker from 'rc-calendar/lib/Picker';
import GregorianCalendar from 'gregorian-calendar';
import defaultLocale from './locale/zh_CN';
import CalendarLocale from 'rc-calendar/lib/locale/zh_CN';
@@ -121,7 +121,7 @@ function createPicker(TheCalendar, defaultFormat) {
}
return
-
+
;
}
});
diff --git a/components/datepicker/index.md b/components/date-picker/index.md
similarity index 95%
rename from components/datepicker/index.md
rename to components/date-picker/index.md
index 2f12f7978e4b5175beb7027bd6537ba55e208692..878fb560d21d6d817a90da38b6f4460f7e5a9eb1 100644
--- a/components/datepicker/index.md
+++ b/components/date-picker/index.md
@@ -1,4 +1,4 @@
-# Datepicker
+# DatePicker
- category: Components
- chinese: 日期选择框
@@ -15,7 +15,7 @@
## API
```html
-
+
```
| 参数 | 说明 | 类型 | 默认值 |
diff --git a/components/datepicker/locale/en_US.js b/components/date-picker/locale/en_US.js
similarity index 100%
rename from components/datepicker/locale/en_US.js
rename to components/date-picker/locale/en_US.js
diff --git a/components/datepicker/locale/zh_CN.js b/components/date-picker/locale/zh_CN.js
similarity index 100%
rename from components/datepicker/locale/zh_CN.js
rename to components/date-picker/locale/zh_CN.js
diff --git a/components/datepicker/demo/basic.md b/components/datepicker/demo/basic.md
deleted file mode 100644
index 37382c4dc3ba240f3537dcf98da43e47cce8c8cf..0000000000000000000000000000000000000000
--- a/components/datepicker/demo/basic.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# 基本
-
-- order: 0
-
-最简单的用法。
-
----
-
-````jsx
-import { Datepicker } from 'antd';
-
-ReactDOM.render(
-
-, document.getElementById('components-datepicker-demo-basic'));
-````
diff --git a/components/datepicker/demo/disabled.md b/components/datepicker/demo/disabled.md
deleted file mode 100644
index e4828222441e32abe57285c82eb8536999115e72..0000000000000000000000000000000000000000
--- a/components/datepicker/demo/disabled.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# 禁用
-
-- order: 5
-
-选择框的不可用状态。
-
----
-
-````jsx
-import { Datepicker } from 'antd';
-
-ReactDOM.render(
-
-, document.getElementById('components-datepicker-demo-disabled'));
-````
diff --git a/components/datepicker/demo/formatter.md b/components/datepicker/demo/formatter.md
deleted file mode 100644
index ad0e8049fc2db78f00d94c20f2e1c41a99bcd5e2..0000000000000000000000000000000000000000
--- a/components/datepicker/demo/formatter.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# 日期格式
-
-- order: 1
-
-使用 `format` 属性,可以自定义你需要的日期显示格式,如 `yyyy/MM/dd`。
-
----
-
-````jsx
-import { Datepicker } from 'antd';
-
-ReactDOM.render(
-
-, document.getElementById('components-datepicker-demo-formatter'));
-````
diff --git a/components/datepicker/demo/month-picker.md b/components/datepicker/demo/month-picker.md
deleted file mode 100644
index 47e72827beae37d67830416aaf4474a315d528d7..0000000000000000000000000000000000000000
--- a/components/datepicker/demo/month-picker.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# 月选择器
-
-- order: 9
-
-使用 MonthPicker 实现月选择器.
-
----
-
-````jsx
-import { Datepicker } from 'antd';
-const MonthPicker = Datepicker.MonthPicker;
-ReactDOM.render(
-
-, document.getElementById('components-datepicker-demo-month-picker'));
-````
diff --git a/components/datepicker/demo/size.md b/components/datepicker/demo/size.md
deleted file mode 100644
index a9cdac10e8d2094cba566bd7d80388bf44540bfa..0000000000000000000000000000000000000000
--- a/components/datepicker/demo/size.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# 三种大小
-
-- order: 1
-
-三种大小的输入框,大的用在表单中,中的为默认。
-
----
-
-````jsx
-import { Datepicker } from 'antd';
-
-ReactDOM.render(
-
-
-
-
-
-, document.getElementById('components-datepicker-demo-size'));
-````
diff --git a/components/form/demo/mix.md b/components/form/demo/mix.md
index 9aa1d9853d42d1b9697e8e25d35f2f407206570e..5340ae240ee176d96c2234dbccb0b3c1896018dd 100644
--- a/components/form/demo/mix.md
+++ b/components/form/demo/mix.md
@@ -7,7 +7,7 @@
---
````jsx
-import { Form, Select, InputNumber, Datepicker, Switch, Slider, Button, message, Row, Col } from 'antd';
+import { Form, Select, InputNumber, DatePicker, Switch, Slider, Button, message, Row, Col } from 'antd';
const FormItem = Form.Item;
const Option = Select.Option;
@@ -92,17 +92,17 @@ const Demo = React.createClass({
-
+
-
-
+
diff --git a/components/form/demo/validate.md b/components/form/demo/validate.md
index 7e03f5632b7a62bf5f4806f53a380e3299509a34..7f387958ec4c239b493693c9010f0fc2d55f9b36 100644
--- a/components/form/demo/validate.md
+++ b/components/form/demo/validate.md
@@ -13,7 +13,7 @@ validateStatus: ['success', 'warning', 'error', 'validating']。
---
````jsx
-import { Form, Input, Datepicker, Col } from 'antd';
+import { Form, Input, DatePicker, Col } from 'antd';
const FormItem = Form.Item;
ReactDOM.render(
@@ -78,13 +78,13 @@ ReactDOM.render(
labelCol={{span: 5}}
validateStatus="error">
-
+
-
-
+
请输入正确选项
diff --git a/components/timepicker/demo/basic.md b/components/time-picker/demo/basic.md
similarity index 59%
rename from components/timepicker/demo/basic.md
rename to components/time-picker/demo/basic.md
index 247b3d892998c4cf96bf38a5ac694cb01e708e4e..6d4493d8f256a91eafa6fed29d8cc8d2edc8a593 100644
--- a/components/timepicker/demo/basic.md
+++ b/components/time-picker/demo/basic.md
@@ -7,7 +7,7 @@
---
````jsx
-import { Timepicker } from 'antd';
+import { TimePicker } from 'antd';
function onChange(time) {
if (time) {
@@ -16,6 +16,6 @@ function onChange(time) {
}
ReactDOM.render(
-
-, document.getElementById('components-timepicker-demo-basic'));
+
+, document.getElementById('components-time-picker-demo-basic'));
````
diff --git a/components/time-picker/demo/disabled.md b/components/time-picker/demo/disabled.md
new file mode 100644
index 0000000000000000000000000000000000000000..0ac3377c26c3bddee96ed7d4e7dfe393521737c7
--- /dev/null
+++ b/components/time-picker/demo/disabled.md
@@ -0,0 +1,15 @@
+# 禁用
+
+- order: 4
+
+禁用时间选择。
+
+---
+
+````jsx
+import { TimePicker } from 'antd';
+
+ReactDOM.render(
+
+, document.getElementById('components-time-picker-demo-disabled'));
+````
diff --git a/components/time-picker/demo/size.md b/components/time-picker/demo/size.md
new file mode 100644
index 0000000000000000000000000000000000000000..bd1db78974706e92d5802495038f7ec8ed9208e3
--- /dev/null
+++ b/components/time-picker/demo/size.md
@@ -0,0 +1,19 @@
+# 三种大小
+
+- order: 6
+
+三种大小的输入框,大的用在表单中,中的为默认。
+
+---
+
+````jsx
+import { TimePicker } from 'antd';
+
+ReactDOM.render(
+
+
+
+
+
+, document.getElementById('components-time-picker-demo-size'));
+````
diff --git a/components/timepicker/demo/special-minutes.md b/components/time-picker/demo/special-minutes.md
similarity index 54%
rename from components/timepicker/demo/special-minutes.md
rename to components/time-picker/demo/special-minutes.md
index 42b76c259960a78e7c171cc9300e24f25e0ff5b2..8a266ef0b892da0f973503ff3dca868d2bd9ba39 100644
--- a/components/timepicker/demo/special-minutes.md
+++ b/components/time-picker/demo/special-minutes.md
@@ -7,9 +7,9 @@
---
````jsx
-import { Timepicker } from 'antd';
+import { TimePicker } from 'antd';
ReactDOM.render(
-
-, document.getElementById('components-timepicker-demo-special-minutes'));
+
+, document.getElementById('components-time-picker-demo-special-minutes'));
````
diff --git a/components/timepicker/demo/value.md b/components/time-picker/demo/value.md
similarity index 78%
rename from components/timepicker/demo/value.md
rename to components/time-picker/demo/value.md
index 327990983bb8478ec0f4da6383ec5d6366ea58ba..bfdbe9bdde19edd6c1f63985122e17ceb88757df 100644
--- a/components/timepicker/demo/value.md
+++ b/components/time-picker/demo/value.md
@@ -7,7 +7,7 @@ value 和 onChange 需要配合使用。
---
````jsx
-import { Timepicker } from 'antd';
+import { TimePicker } from 'antd';
const Test = React.createClass({
getInitialState() {
@@ -23,9 +23,9 @@ const Test = React.createClass({
this.setState({ time });
},
render() {
- return ;
+ return ;
}
});
-ReactDOM.render(, document.getElementById('components-timepicker-demo-value'));
+ReactDOM.render(, document.getElementById('components-time-picker-demo-value'));
````
diff --git a/components/time-picker/demo/without-seconds.md b/components/time-picker/demo/without-seconds.md
new file mode 100644
index 0000000000000000000000000000000000000000..3d2e484c7561da4ee392a6e918c5c3c30184a5af
--- /dev/null
+++ b/components/time-picker/demo/without-seconds.md
@@ -0,0 +1,15 @@
+# 不展示秒
+
+- order: 2
+
+不展示秒,也不允许选择。
+
+---
+
+````jsx
+import { TimePicker } from 'antd';
+
+ReactDOM.render(
+
+, document.getElementById('components-time-picker-demo-without-seconds'));
+````
diff --git a/components/timepicker/index.jsx b/components/time-picker/index.jsx
similarity index 97%
rename from components/timepicker/index.jsx
rename to components/time-picker/index.jsx
index 3b12760970cf5264fd70e0883f0cd7f00a4a6aa7..a8b4eadb2889be1e47a0c4d45807b48ae4156fb8 100644
--- a/components/timepicker/index.jsx
+++ b/components/time-picker/index.jsx
@@ -5,7 +5,7 @@ import objectAssign from 'object-assign';
import defaultLocale from './locale/zh_CN';
import classNames from 'classnames';
-const AntTimepicker = React.createClass({
+const AntTimePicker = React.createClass({
getDefaultProps() {
return {
format: 'HH:mm:ss',
@@ -104,4 +104,4 @@ const AntTimepicker = React.createClass({
});
-export default AntTimepicker;
+export default AntTimePicker;
diff --git a/components/timepicker/index.md b/components/time-picker/index.md
similarity index 95%
rename from components/timepicker/index.md
rename to components/time-picker/index.md
index 16983f838b6e08de8253b2ace934be2267034685..0f1599ce8faf18dea120d45197291482c0e2cf40 100644
--- a/components/timepicker/index.md
+++ b/components/time-picker/index.md
@@ -1,4 +1,4 @@
-# Timepicker
+# TimePicker
- category: Components
- chinese: 时间选择框
@@ -17,7 +17,7 @@ API
---
```html
-
+
```
| 参数 | 说明 | 类型 | 默认值 |
diff --git a/components/timepicker/locale/en_US.js b/components/time-picker/locale/en_US.js
similarity index 100%
rename from components/timepicker/locale/en_US.js
rename to components/time-picker/locale/en_US.js
diff --git a/components/timepicker/locale/zh_CN.js b/components/time-picker/locale/zh_CN.js
similarity index 100%
rename from components/timepicker/locale/zh_CN.js
rename to components/time-picker/locale/zh_CN.js
diff --git a/components/timepicker/demo/disabled.md b/components/timepicker/demo/disabled.md
deleted file mode 100644
index dc348cb2bd30bc95880195ddba0b005069235901..0000000000000000000000000000000000000000
--- a/components/timepicker/demo/disabled.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# 禁用
-
-- order: 4
-
-禁用时间选择。
-
----
-
-````jsx
-import { Timepicker } from 'antd';
-
-ReactDOM.render(
-
-, document.getElementById('components-timepicker-demo-disabled'));
-````
diff --git a/components/timepicker/demo/size.md b/components/timepicker/demo/size.md
deleted file mode 100644
index 051ad5323720181040ff16c23c4d4aaa5b4451fa..0000000000000000000000000000000000000000
--- a/components/timepicker/demo/size.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# 三种大小
-
-- order: 6
-
-三种大小的输入框,大的用在表单中,中的为默认。
-
----
-
-````jsx
-import { Timepicker } from 'antd';
-
-ReactDOM.render(
-
-
-
-
-
-, document.getElementById('components-timepicker-demo-size'));
-````
diff --git a/components/timepicker/demo/without-seconds.md b/components/timepicker/demo/without-seconds.md
deleted file mode 100644
index 7767e651e9e0fd52e58fc68039160265c022025c..0000000000000000000000000000000000000000
--- a/components/timepicker/demo/without-seconds.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# 不展示秒
-
-- order: 2
-
-不展示秒,也不允许选择。
-
----
-
-````jsx
-import { Timepicker } from 'antd';
-
-ReactDOM.render(
-
-, document.getElementById('components-timepicker-demo-without-seconds'));
-````
diff --git a/components/validation/demo/other-items.md b/components/validation/demo/other-items.md
index 852c15b1cf62959b1e4a44b8aa8314ff932b9023..26afe4ab4137b9ac1103c811fbe8d448ddfde90f 100644
--- a/components/validation/demo/other-items.md
+++ b/components/validation/demo/other-items.md
@@ -4,12 +4,12 @@
提供以下组件表单域的校验。
-`Select` `Radio` `Datepicker` `InputNumber`。
+`Select` `Radio` `DatePicker` `InputNumber`。
---
````jsx
-import {Validation, Select, Radio, Button, Datepicker, InputNumber, Form} from 'antd';
+import {Validation, Select, Radio, Button, DatePicker, InputNumber, Form} from 'antd';
const Validator = Validation.Validator;
const Option = Select.Option;
const RadioGroup = Radio.Group;
@@ -172,7 +172,7 @@ const Demo = React.createClass({
type: 'date',
message: '你的生日是什么呢?'
}, {validator: this.checkBirthday}]}>
-
+
diff --git a/docs/getting-started.md b/docs/getting-started.md
index 54debb70a3b91ff041b0b69371d40afefbc3326b..4279e5e30505a7e80bb2e961c27f405b0664947f 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -47,7 +47,7 @@ $ npm install
```jsx
import React from 'react';
-import { Datepicker, message } from 'antd';
+import { DatePicker, message } from 'antd';
const App = React.createClass({
getInitialState() {
@@ -63,7 +63,7 @@ const App = React.createClass({
},
render() {
return
-
+
当前日期:{this.state.date.toString()}
;
}
diff --git a/docs/introduce.md b/docs/introduce.md
index c53132132fe1bceba0fe228c221979cdac666daa..14945ce75c8d7b65cff45465f86d3b727349c3e1 100644
--- a/docs/introduce.md
+++ b/docs/introduce.md
@@ -35,15 +35,15 @@
## 示例
```jsx
-import { Datepicker } from 'antd';
-ReactDOM.render(, mountNode);
+import { DatePicker } from 'antd';
+ReactDOM.render(, mountNode);
```
或者按需加载:
```jsx
-import Datepicker from 'antd/lib/datepicker';
-ReactDOM.render(, mountNode);
+import DatePicker from 'antd/lib/date-picker';
+ReactDOM.render(, mountNode);
```
引入样式:
diff --git a/index.js b/index.js
index d05db9d3082a039cbb95fb5fc12b602360f82b9c..a0233b7ce6e8b4998df6284247f97ed7ffa37ceb 100644
--- a/index.js
+++ b/index.js
@@ -2,7 +2,7 @@ import React from 'react';
const antd = {
Affix: require('./components/affix'),
- Datepicker: require('./components/datepicker'),
+ DatePicker: require('./components/date-picker'),
Tooltip: require('./components/tooltip'),
Carousel: require('./components/carousel'),
Tabs: require('./components/tabs'),
@@ -41,7 +41,7 @@ const antd = {
Form: require('./components/form'),
Input: require('./components/input'),
Calendar: require('./components/calendar'),
- Timepicker: require('./components/timepicker'),
+ TimePicker: require('./components/time-picker'),
};
antd.version = require('./package.json').version;
diff --git a/scripts/demo.js b/scripts/demo.js
index fc03b4101420e57ddbd420203c1e6fd213cdd63f..0a0d365a7164f357fbdc73acac58a4ae8551a5ce 100644
--- a/scripts/demo.js
+++ b/scripts/demo.js
@@ -1,5 +1,7 @@
-function capitalizeFirstLetter(string) {
- return string.charAt(0).toUpperCase() + string.slice(1);
+function camelize(str) {
+ return str.replace (/(?:^|[-_])(\w)/g, function (_, c) {
+ return c ? c.toUpperCase () : '';
+ });
}
window.require = function (path) {
@@ -7,7 +9,7 @@ window.require = function (path) {
var namespaces = path.split('/');
namespaces.forEach(function (key, i) {
if (i === 2) {
- key = capitalizeFirstLetter(key);
+ key = camelize(key);
}
if (key !== 'lib') {
if (result[key]) {
@@ -34,9 +36,9 @@ window['object-assign'] = require('object-assign');
window['classnames'] = require('classnames');
require('./importCss');
-antd.Datepicker.locale = {
- en_US: require('../components/datepicker/locale/en_US'),
- zh_CN: require('../components/datepicker/locale/zh_CN'),
+antd.DatePicker.locale = {
+ en_US: require('../components/date-picker/locale/en_US'),
+ zh_CN: require('../components/date-picker/locale/zh_CN'),
};
antd.Calendar.locale = {