Skip to content

Commit

Permalink
[changed] change date picker offset in MonthCalendar & YearCalendar
Browse files Browse the repository at this point in the history
  • Loading branch information
qili.taoqili committed Apr 23, 2019
1 parent 1de7210 commit 2b1b8ec
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 例子
Expand Down
1 change: 1 addition & 0 deletions src/MonthCalendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/YearCalendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 13 additions & 1 deletion src/style/common/Calendar.less
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,16 @@
height: 300 - @trigger-height-small;
}
}
}
}

.date-picker-dropdown-offset-small {
padding-top: 27px;
}

.date-picker-dropdown-offset-middle {
padding-top: 31px;
}

.date-picker-dropdown-offset-large {
padding-top: 35px;
}

0 comments on commit 2b1b8ec

Please sign in to comment.