From cae096e14d3ceca3973233127afcdc669ee6b7ef Mon Sep 17 00:00:00 2001 From: niko <644506165@qq.com> Date: Mon, 20 Nov 2017 09:40:03 +0800 Subject: [PATCH] feat: add extra footer to MonthCalendar (#318) * add extral footer to MonthCalendar https://github.com/ant-design/ant-design/issues/8184 * update docs --- README.md | 6 ++++++ assets/index.less | 4 ---- assets/index/MonthPanel.less | 7 +++++-- src/MonthCalendar.jsx | 33 +++++++++++++++++++++------------ 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 430b0f84..ea6f13c1 100644 --- a/README.md +++ b/README.md @@ -472,6 +472,12 @@ http://react-component.github.io/calendar/examples/index.html called when a date is changed inside calendar (next year/next month/keyboard) + + renderFooter + () => React.Node + + extra footer + diff --git a/assets/index.less b/assets/index.less index 91787674..89e11059 100644 --- a/assets/index.less +++ b/assets/index.less @@ -8,7 +8,3 @@ @import "index/DecadePanel"; @import "common/RangeCalendar"; @import "common/FullCalendar"; - -.@{prefixClass}-month-calendar { - height: 308px; -} \ No newline at end of file diff --git a/assets/index/MonthPanel.less b/assets/index/MonthPanel.less index 22b57ea5..6fd91d76 100644 --- a/assets/index/MonthPanel.less +++ b/assets/index/MonthPanel.less @@ -119,8 +119,6 @@ } } - - .@{prefixClass}-month-panel-selected-cell .@{prefixClass}-month-panel-month { background: #3fc7fa; color: #fff; @@ -130,3 +128,8 @@ color: #fff; } } + +.@{prefixClass}-month-header-wrap { + position: relative; + height: 308px; +} diff --git a/src/MonthCalendar.jsx b/src/MonthCalendar.jsx index 8e4e00aa..aa15220c 100644 --- a/src/MonthCalendar.jsx +++ b/src/MonthCalendar.jsx @@ -3,6 +3,7 @@ import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; import KeyCode from 'rc-util/lib/KeyCode'; import CalendarHeader from './calendar/CalendarHeader'; +import CalendarFooter from './calendar/CalendarFooter'; import CalendarMixin from './mixin/CalendarMixin'; import CommonMixin from './mixin/CommonMixin'; @@ -74,18 +75,26 @@ const MonthCalendar = createReactClass({ const { props, state } = this; const { mode, value } = state; const children = ( - +
+
+ +
+ +
); return this.renderRoot({ className: `${props.prefixCls}-month-calendar`,