Skip to content

Commit

Permalink
1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Long committed Jun 8, 2018
1 parent 5b247f3 commit 3c9c9c6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rcc-calendar",
"version": "1.0.4",
"version": "1.0.5",
"description": "react component calendar",
"main": "./dist/index.js",
"files": [
Expand Down
1 change: 1 addition & 0 deletions src/Props.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export type PickerProps = {
iconRender?: Function,
disabledDate?: Function,
showIcon: boolean,
title: string | Function,
}

export type InputProps = {
Expand Down
6 changes: 5 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
.rcc-calendar-range-select {
border-bottom: 1px solid #0d7b7b;
display: flex;
justify-content: flex-start;
justify-content: space-between;
align-items: center;
}
.rcc-calendar-range-select > .rcc-calendar-input-range {
Expand All @@ -195,6 +195,10 @@
background-color: transparent;
border: none;
}
.rcc-calendar-range-title {
display: inline-block;
margin-right: 10px;
}
.stickCenterV {
position: absolute;
top: 50%;
Expand Down
7 changes: 5 additions & 2 deletions src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
height: 280px;
position: relative;
}

&-range-left {
.rcc-calendar-panels {
margin-right: 15px;
Expand Down Expand Up @@ -191,7 +190,7 @@
&-select {
border-bottom: 1px solid #0d7b7b;
display: flex;
justify-content: flex-start;
justify-content: space-between;
align-items: center;
& > .rcc-calendar-input-range {
background-color: transparent;
Expand All @@ -202,6 +201,10 @@
}
}
}
&-title {
display: inline-block;
margin-right: 10px;
}
&-content {
&:extend(.flex-center);
}
Expand Down
14 changes: 14 additions & 0 deletions src/range/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ class Range extends React.PureComponent<RangeProps> {
};
};

renderTitle = () => {
const {title} = this.props;
if (!title) {
return '';
}
if (typeof title === 'function') {
return title();
}
return title;
};

renderSelect = () => {
const { selectValue } = this.state;
const { format, iconRender } = this.props;
Expand All @@ -101,6 +112,9 @@ class Range extends React.PureComponent<RangeProps> {
<div className={classNames(pf, className)}>
<div className={`${pf}-select`}>
{this.renderSelect()}
<div className={`${pf}-title`}>
{this.renderTitle()}
</div>
</div>
<div className={`${pf}-content`}>
<Calendar {...this.calendarProps('left', 'startDate', diff)} />
Expand Down

0 comments on commit 3c9c9c6

Please sign in to comment.