From 2b1b8ec2590c85df34c7286663a8575518762551 Mon Sep 17 00:00:00 2001 From: "qili.taoqili" Date: Tue, 23 Apr 2019 18:18:32 +0800 Subject: [PATCH] [changed] change date picker offset in MonthCalendar & YearCalendar --- README.md | 2 -- src/MonthCalendar.jsx | 1 + src/YearCalendar.jsx | 1 + src/style/common/Calendar.less | 14 +++++++++++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 20367562..57ffa458 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,6 @@ http://uxco.re/components/calendar/ |allowClear| 是否支持清空 | boolean | true | |onOpenChange | 在下拉面板展开、收起时调用 | function(open) | noop | |defaultOpenValue| 在值为空的情况下,日历面板默认展示的值 | boolean | | -|firstDayOfWeek | 星期起始天设置(1对应周一 / 2对应周二 / ... / 7对应周日) | number | 7 | ### props @@ -96,7 +95,6 @@ http://uxco.re/components/calendar/ |yearSelectTotal| 年选择器中年份的总数,如最早可选为 1947 年,总数为 100,则可选年份范围为 1947 - 2047 | number | 100 | |renderSidebar|sidebar|React Element|() => React.Node |renderFooter|extra foot|React Element|() => React.Node -|firstDayOfWeek|星期起始日,可选值(1-7)|Number|7| #### disabledTime 例子 diff --git a/src/MonthCalendar.jsx b/src/MonthCalendar.jsx index 27d4c3ec..9db59745 100644 --- a/src/MonthCalendar.jsx +++ b/src/MonthCalendar.jsx @@ -144,6 +144,7 @@ class MonthCalendar extends React.Component { calendar={calendar} onChange={me.handleChange} {...pickerOptions} + dropdownClassName={`date-picker-dropdown-offset-${p.size}`} > {({ value }) => { const showClear = p.allowClear ? (value && !p.disabled) : false; diff --git a/src/YearCalendar.jsx b/src/YearCalendar.jsx index 501108ca..c35eab8f 100644 --- a/src/YearCalendar.jsx +++ b/src/YearCalendar.jsx @@ -122,6 +122,7 @@ class YearCalendar extends React.Component { calendar={calendar} onChange={me.handleChange} {...pickerOptions} + dropdownClassName={`date-picker-dropdown-offset-${p.size}`} > {({ value }) => { const showClear = p.allowClear ? (value && !p.disabled) : false; diff --git a/src/style/common/Calendar.less b/src/style/common/Calendar.less index 7489c8ac..f3473056 100644 --- a/src/style/common/Calendar.less +++ b/src/style/common/Calendar.less @@ -293,4 +293,16 @@ height: 300 - @trigger-height-small; } } -} \ No newline at end of file +} + +.date-picker-dropdown-offset-small { + padding-top: 27px; +} + +.date-picker-dropdown-offset-middle { + padding-top: 31px; +} + +.date-picker-dropdown-offset-large { + padding-top: 35px; +}